]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
davinci: support different UART bases for zImage uncompress
authorMark A. Greer <mgreer@mvista.com>
Wed, 18 Feb 2009 21:00:36 +0000 (14:00 -0700)
committerKevin Hilman <khilman@deeprootsystems.com>
Tue, 26 May 2009 14:18:14 +0000 (07:18 -0700)
The davinci pre-kernel boot code assumes that all platforms use the
same UART base address for the console.  That assumption is not longer
valid with some newer SoCs so determine the console UART base address
from the machine number passed in from bootloader.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-davinci/include/mach/uncompress.h

index 8c165def37b6d853f958db165de5b315ef48526d..1e27475f9a2322f1a4f61e25fd1a1e5858e29fc2 100644 (file)
 #include <linux/serial_reg.h>
 #include <mach/serial.h>
 
+#include <asm/mach-types.h>
+
+extern unsigned int __machine_arch_type;
+
+static u32 *uart;
+
+static u32 *get_uart_base(void)
+{
+       /* Add logic here for new platforms, using __macine_arch_type */
+       return (u32 *)DAVINCI_UART0_BASE;
+}
+
 /* PORT_16C550A, in polled non-fifo mode */
 
 static void putc(char c)
 {
-       volatile u32 *uart = (volatile void *) DAVINCI_UART0_BASE;
+       if (!uart)
+               uart = get_uart_base();
 
        while (!(uart[UART_LSR] & UART_LSR_THRE))
                barrier();
@@ -26,7 +39,9 @@ static void putc(char c)
 
 static inline void flush(void)
 {
-       volatile u32 *uart = (volatile void *) DAVINCI_UART0_BASE;
+       if (!uart)
+               uart = get_uart_base();
+
        while (!(uart[UART_LSR] & UART_LSR_THRE))
                barrier();
 }