提交 c40a763b 编写于 作者: J Jean-Christophe PLAGNIOL-VILLARD 提交者: Nicolas Ferre

ARM: at91: uncompress Store UART address in a variable

This will allow a future change to auto-detect which UART to use.
Signed-off-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
上级 1234f4ba
......@@ -43,6 +43,14 @@
#define UART_OFFSET AT91_USART5
#endif
void __iomem *at91_uart;
static inline void arch_decomp_setup(void)
{
#ifdef UART_OFFSET
at91_uart = (void __iomem *) UART_OFFSET; /* physical address */
#endif
}
/*
* The following code assumes the serial port has already been
* initialized by the bootloader. If you didn't setup a port in
......@@ -53,27 +61,21 @@
static void putc(int c)
{
#ifdef UART_OFFSET
void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY))
while (!(__raw_readl(at91_uart + ATMEL_US_CSR) & ATMEL_US_TXRDY))
barrier();
__raw_writel(c, sys + ATMEL_US_THR);
__raw_writel(c, at91_uart + ATMEL_US_THR);
#endif
}
static inline void flush(void)
{
#ifdef UART_OFFSET
void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
/* wait for transmission to complete */
while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
while (!(__raw_readl(at91_uart + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
barrier();
#endif
}
#define arch_decomp_setup()
#define arch_decomp_wdog()
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册