aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/include/mach
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-08-06 17:29:14 -0400
committerColin Cross <ccross@android.com>2011-02-10 00:56:59 -0500
commitd377eb0d95e4a7333afeb5ca4ba8554160480263 (patch)
tree9e6d8999a3e1da827da3186af4eabca4c008ea48 /arch/arm/mach-tegra/include/mach
parent100b33c8bd8a3235fd0b7948338d6cbb3db3c63d (diff)
ARM: tegra: Centralize macros to define debug uart base
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/include/mach')
-rw-r--r--arch/arm/mach-tegra/include/mach/debug-macro.S25
-rw-r--r--arch/arm/mach-tegra/include/mach/iomap.h14
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h18
3 files changed, 21 insertions, 36 deletions
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index a0e7c12868bd..e0ebe65c1657 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -19,30 +19,15 @@
19 */ 19 */
20 20
21#include <mach/io.h> 21#include <mach/io.h>
22#include <mach/iomap.h>
22 23
23 .macro addruart, rp, rv 24 .macro addruart, rp, rv
24 ldr \rp, =IO_APB_PHYS @ physical 25 ldr \rp, =IO_APB_PHYS @ physical
25 ldr \rv, =IO_APB_VIRT @ virtual 26 ldr \rv, =IO_APB_VIRT @ virtual
26#if defined(CONFIG_TEGRA_DEBUG_UART_NONE) 27 orr \rp, \rp, #(TEGRA_DEBUG_UART_BASE & 0xFF)
27#error "A debug UART must be selected in the kernel config to use DEBUG_LL" 28 orr \rp, \rp, #(TEGRA_DEBUG_UART_BASE & 0xFF00)
28#elif defined(CONFIG_TEGRA_DEBUG_UARTA) 29 orr \rv, \rv, #(TEGRA_DEBUG_UART_BASE & 0xFF)
29 orr \rp, \rp, #0x6000 30 orr \rv, \rv, #(TEGRA_DEBUG_UART_BASE & 0xFF00)
30 orr \rv, \rv, #0x6000
31#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
32 orr \rp, \rp, #0x6000
33 orr \rp, \rp, #0x40
34 orr \rv, \rv, #0x6000
35 orr \rv, \rv, #0x40
36#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
37 orr \rp, \rp, #0x6200
38 orr \rv, \rv, #0x6200
39#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
40 orr \rp, \rp, #0x6300
41 orr \rv, \rv, #0x6300
42#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
43 orr \rp, \rp, #0x6400
44 orr \rv, \rv, #0x6400
45#endif
46 .endm 31 .endm
47 32
48#define UART_SHIFT 2 33#define UART_SHIFT 2
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 44a4f4bcf91f..325eca37348f 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -221,4 +221,18 @@
221#define TEGRA_SDMMC4_BASE 0xC8000600 221#define TEGRA_SDMMC4_BASE 0xC8000600
222#define TEGRA_SDMMC4_SIZE SZ_512 222#define TEGRA_SDMMC4_SIZE SZ_512
223 223
224#if defined(CONFIG_TEGRA_DEBUG_UART_NONE)
225# define TEGRA_DEBUG_UART_BASE 0
226#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
227# define TEGRA_DEBUG_UART_BASE TEGRA_UARTA_BASE
228#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
229# define TEGRA_DEBUG_UART_BASE TEGRA_UARTB_BASE
230#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
231# define TEGRA_DEBUG_UART_BASE TEGRA_UARTC_BASE
232#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
233# define TEGRA_DEBUG_UART_BASE TEGRA_UARTD_BASE
234#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
235# define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE
236#endif
237
224#endif 238#endif
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 6c4dd815abd7..4e8323770c79 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -26,23 +26,9 @@
26 26
27#include <mach/iomap.h> 27#include <mach/iomap.h>
28 28
29#if defined(CONFIG_TEGRA_DEBUG_UARTA)
30#define DEBUG_UART_BASE TEGRA_UARTA_BASE
31#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
32#define DEBUG_UART_BASE TEGRA_UARTB_BASE
33#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
34#define DEBUG_UART_BASE TEGRA_UARTC_BASE
35#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
36#define DEBUG_UART_BASE TEGRA_UARTD_BASE
37#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
38#define DEBUG_UART_BASE TEGRA_UARTE_BASE
39#else
40#define DEBUG_UART_BASE NULL
41#endif
42
43static void putc(int c) 29static void putc(int c)
44{ 30{
45 volatile u8 *uart = (volatile u8 *)DEBUG_UART_BASE; 31 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
46 int shift = 2; 32 int shift = 2;
47 33
48 if (uart == NULL) 34 if (uart == NULL)
@@ -59,7 +45,7 @@ static inline void flush(void)
59 45
60static inline void arch_decomp_setup(void) 46static inline void arch_decomp_setup(void)
61{ 47{
62 volatile u8 *uart = (volatile u8 *)DEBUG_UART_BASE; 48 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
63 int shift = 2; 49 int shift = 2;
64 50
65 if (uart == NULL) 51 if (uart == NULL)