From: Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] AT91SAM9 series - cleanup USART definitions
Date: Tue, 29 Jun 2010 20:32:34 +0200 [thread overview]
Message-ID: <4C2A3C42.7050602@emk-elektronik.de> (raw)
Hi,
AT91SAM9 based boards have something like this in their include/configs
file:
#define CONFIG_ATMEL_USART 1
#undef CONFIG_USART0
#undef CONFIG_USART1
#undef CONFIG_USART2
#define CONFIG_USART3 1 /* USART 3 is DBGU */
these defines are used in drivers/serial/atmel_usart.c:
#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
USARTx_BASE is defined in arch/arm/include/asm/arch-at91/memory_map.h:
#define USART0_BASE AT91_USART0
#define USART1_BASE AT91_USART1
#define USART2_BASE AT91_USART2
#define USART3_BASE (AT91_BASE_SYS + AT91_DBGU)
#define SPI0_BASE AT91_BASE_SPI
(note that nothing else is defined in that file!)
AT91_USARTx finally comes from arch/arm/include/asm/arch-at91/at91sam*.h:
#define AT91_USART0 AT91SAM9260_BASE_US0
#define AT91_USART1 AT91SAM9260_BASE_US1
#define AT91_USART2 AT91SAM9260_BASE_US2
#define AT91_USART3 AT91SAM9260_BASE_US3
#define AT91_USART4 AT91SAM9260_BASE_US4
#define AT91_USART5 AT91SAM9260_BASE_US5
1. memory_map.h is misleading, it just defines a few USARTs and one SPI
2. equalling CONFIG_USART3 with the debug UART is plain wrong, the 9260
for example has 6 'regular' USARTs (0..5) plus the debug UART
I propose to make the following changes:
1. get rid of memory_map.h and the references to it, move the USART
definitions to the respective at91sam*.h files
2. use DBU_BASE for the debug UART, leaving USART[0-5]_BASE to adress
the 'regular' USARTs
3. use CONFIG_UARTDEBUG to indicate use of the debug UART for console output
Note for those that don't want to dig the datasheets: the debug UART is
software compatible to the 'regular' USARTs as long as only asynchronous
features are used (true for the atmel_usart.c driver)
Reinhard
next reply other threads:[~2010-06-29 18:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-29 18:32 Reinhard Meyer [this message]
2010-06-29 19:17 ` [U-Boot] [RFC] AT91SAM9 series - cleanup USART definitions Wolfgang Denk
2010-06-29 20:46 ` Reinhard Meyer
2010-06-29 21:03 ` Reinhard Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C2A3C42.7050602@emk-elektronik.de \
--to=reinhard.meyer@emk-elektronik.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.