aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/include
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-02-15 05:35:40 -0500
committerNicolas Ferre <nicolas.ferre@atmel.com>2012-04-17 04:58:03 -0400
commitc40a763be603867c226505dbe0845ea16a4ee538 (patch)
treef36a647f470ecc601947fe5c4d1107f7dd8dd1f0 /arch/arm/mach-at91/include
parent1234f4bada54cfcd4dfeeebccf0295d49174da40 (diff)
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: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/include')
-rw-r--r--arch/arm/mach-at91/include/mach/uncompress.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 4218647c1fcd..d985af7c94bd 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -43,6 +43,14 @@
43#define UART_OFFSET AT91_USART5 43#define UART_OFFSET AT91_USART5
44#endif 44#endif
45 45
46void __iomem *at91_uart;
47
48static inline void arch_decomp_setup(void)
49{
50#ifdef UART_OFFSET
51 at91_uart = (void __iomem *) UART_OFFSET; /* physical address */
52#endif
53}
46/* 54/*
47 * The following code assumes the serial port has already been 55 * The following code assumes the serial port has already been
48 * initialized by the bootloader. If you didn't setup a port in 56 * initialized by the bootloader. If you didn't setup a port in
@@ -53,27 +61,21 @@
53static void putc(int c) 61static void putc(int c)
54{ 62{
55#ifdef UART_OFFSET 63#ifdef UART_OFFSET
56 void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */ 64 while (!(__raw_readl(at91_uart + ATMEL_US_CSR) & ATMEL_US_TXRDY))
57
58 while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY))
59 barrier(); 65 barrier();
60 __raw_writel(c, sys + ATMEL_US_THR); 66 __raw_writel(c, at91_uart + ATMEL_US_THR);
61#endif 67#endif
62} 68}
63 69
64static inline void flush(void) 70static inline void flush(void)
65{ 71{
66#ifdef UART_OFFSET 72#ifdef UART_OFFSET
67 void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
68
69 /* wait for transmission to complete */ 73 /* wait for transmission to complete */
70 while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY)) 74 while (!(__raw_readl(at91_uart + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
71 barrier(); 75 barrier();
72#endif 76#endif
73} 77}
74 78
75#define arch_decomp_setup()
76
77#define arch_decomp_wdog() 79#define arch_decomp_wdog()
78 80
79#endif 81#endif