[U-Boot] [RFC] AT91SAM9 series - cleanup USART definitions

Reinhard Meyer reinhard.meyer at emk-elektronik.de
Tue Jun 29 23:03:59 CEST 2010


Reinhard Meyer wrote:
> Hello Wolfgang,
>
> I just became aware that this patch will involve changes to ALL 
> include/configs/*.h files for AT91 AND AVR32 boards using 
> atmel_usart.c. If thats OK I will do that.
>
Reason:

#if defined(CONFIG_USART0)
# define USART_ID    0
# define USART_BASE    USART0_BASE
#elif defined(CONFIG_USART1)
# define USART_ID    1
# define USART_BASE    USART1_BASE
#elif defined(CONFIG_USART2)
# define USART_ID    2
# define USART_BASE    USART2_BASE
#elif defined(CONFIG_USART3)
# define USART_ID    3
# define USART_BASE    USART3_BASE
#endif

in atmel_usart.c would have to be blown up for each "new" USART 
incarnation Atmel invents on new SoCs.
USART_ID is effectively not used
and USART_BASE might as well defined directly in the 
include/configs/<board>.h file either by:

#define CONFIG_ATMEL_USART    1
#define CONFIG_ATMEL_USART_BASE AT91_UARTDEB /* USART used is DBGU */

OR directly by:

#define CONFIG_ATMEL_USART AT91_UARTDEB /* USART used is DBGU */

or is the 2nd solution bad because Makefiles might choke on it?

Greetings, Reinhard


More information about the U-Boot mailing list