[ARM] tegra: Centralize macros to define debug uart base
authorColin Cross <ccross@google.com>
Fri, 6 Aug 2010 21:29:14 +0000 (14:29 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:26:17 +0000 (16:26 -0700)
Signed-off-by: Colin Cross <ccross@google.com>
arch/arm/mach-tegra/include/mach/debug-macro.S
arch/arm/mach-tegra/include/mach/iomap.h
arch/arm/mach-tegra/include/mach/uncompress.h

index 55a39564b43c476e2002b806a8bdff6f6e7c6f44..34b1804a274365b8d3138a4f2c3d12f44c2e6d1c 100644 (file)
  */
 
 #include <mach/io.h>
+#include <mach/iomap.h>
 
        .macro  addruart,rx, tmp
         mrc     p15, 0, \rx, c1, c0
         tst     \rx, #1                 @ MMU enabled?
         ldreq   \rx, =IO_APB_PHYS       @ physical
         ldrne   \rx, =IO_APB_VIRT        @ virtual
-#if defined(CONFIG_TEGRA_DEBUG_UART_NONE)
-#error "A debug UART must be selected in the kernel config to use DEBUG_LL"
-#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
-        orr     \rx, \rx, #0x6000
-#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
-       ldr     \tmp, =0x6040
+       ldr     \tmp, =(TEGRA_DEBUG_UART_BASE & 0xFFFF)
         orr     \rx, \rx, \tmp
-#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
-        orr     \rx, \rx, #0x6200
-#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
-        orr     \rx, \rx, #0x6300
-#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
-        orr     \rx, \rx, #0x6400
-#endif
        .endm
 
 #define UART_SHIFT     2
index 44a4f4bcf91f0e47bbbdddb7a667366e0588a607..325eca37348fab1ef76a8adb8453a10b1c7de42a 100644 (file)
 #define TEGRA_SDMMC4_BASE              0xC8000600
 #define TEGRA_SDMMC4_SIZE              SZ_512
 
+#if defined(CONFIG_TEGRA_DEBUG_UART_NONE)
+# define TEGRA_DEBUG_UART_BASE 0
+#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
+# define TEGRA_DEBUG_UART_BASE TEGRA_UARTA_BASE
+#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
+# define TEGRA_DEBUG_UART_BASE TEGRA_UARTB_BASE
+#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
+# define TEGRA_DEBUG_UART_BASE TEGRA_UARTC_BASE
+#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
+# define TEGRA_DEBUG_UART_BASE TEGRA_UARTD_BASE
+#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
+# define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE
+#endif
+
 #endif
index 6c4dd815abd7670e0df8d2980a8d28342ba9bd54..4e8323770c79770b21f24f9dc1228a0186973a3c 100644 (file)
 
 #include <mach/iomap.h>
 
-#if defined(CONFIG_TEGRA_DEBUG_UARTA)
-#define DEBUG_UART_BASE TEGRA_UARTA_BASE
-#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
-#define DEBUG_UART_BASE TEGRA_UARTB_BASE
-#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
-#define DEBUG_UART_BASE TEGRA_UARTC_BASE
-#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
-#define DEBUG_UART_BASE TEGRA_UARTD_BASE
-#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
-#define DEBUG_UART_BASE TEGRA_UARTE_BASE
-#else
-#define DEBUG_UART_BASE NULL
-#endif
-
 static void putc(int c)
 {
-       volatile u8 *uart = (volatile u8 *)DEBUG_UART_BASE;
+       volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
        int shift = 2;
 
        if (uart == NULL)
@@ -59,7 +45,7 @@ static inline void flush(void)
 
 static inline void arch_decomp_setup(void)
 {
-       volatile u8 *uart = (volatile u8 *)DEBUG_UART_BASE;
+       volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
        int shift = 2;
 
        if (uart == NULL)