aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-10-19 14:27:58 -0400
committerStephen Warren <swarren@nvidia.com>2012-11-16 14:22:17 -0500
commit7a28106509463529d7b0408d3f5a0ab99f6810ee (patch)
tree8d81641bb678c2a0055049abf14b48dcd28f72a4
parent1a6d3da8bc45502940efb19604d4c94c470ef6be (diff)
ARM: tegra: don't include iomap.h from debug-macro.S
In order to move Tegra's debug-macro.S to a common location for single zImage, it must not rely on any machine-specific header files such as <mach/iomap.h>. Duplicate the few physical address definitions that debug-macro.S relies upon directly into the file. To avoid tegra_io_desc[] requiring shared knowledge of the UART mapping's virtual address, use a virtual address outside the ranges in tegra_io_desc[]. Call debug_ll_io_init() to propagate the mapping beyond the early pages tables. Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/include/mach/debug-macro.S24
-rw-r--r--arch/arm/mach-tegra/io.c1
2 files changed, 20 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index d4c23d60d448..f67fd6df0e2f 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -26,10 +26,18 @@
26 26
27#include <linux/serial_reg.h> 27#include <linux/serial_reg.h>
28 28
29#include "../../iomap.h"
30
31#define UART_SHIFT 2 29#define UART_SHIFT 2
32 30
31/* Physical addresses */
32#define TEGRA_CLK_RESET_BASE 0x60006000
33#define TEGRA_APB_MISC_BASE 0x70000000
34#define TEGRA_UARTA_BASE 0x70006000
35#define TEGRA_UARTB_BASE 0x70006040
36#define TEGRA_UARTC_BASE 0x70006200
37#define TEGRA_UARTD_BASE 0x70006300
38#define TEGRA_UARTE_BASE 0x70006400
39#define TEGRA_PMC_BASE 0x7000e400
40
33#define TEGRA_CLK_RST_DEVICES_L (TEGRA_CLK_RESET_BASE + 0x04) 41#define TEGRA_CLK_RST_DEVICES_L (TEGRA_CLK_RESET_BASE + 0x04)
34#define TEGRA_CLK_RST_DEVICES_H (TEGRA_CLK_RESET_BASE + 0x08) 42#define TEGRA_CLK_RST_DEVICES_H (TEGRA_CLK_RESET_BASE + 0x08)
35#define TEGRA_CLK_RST_DEVICES_U (TEGRA_CLK_RESET_BASE + 0x0c) 43#define TEGRA_CLK_RST_DEVICES_U (TEGRA_CLK_RESET_BASE + 0x0c)
@@ -39,6 +47,12 @@
39#define TEGRA_PMC_SCRATCH20 (TEGRA_PMC_BASE + 0xa0) 47#define TEGRA_PMC_SCRATCH20 (TEGRA_PMC_BASE + 0xa0)
40#define TEGRA_APB_MISC_GP_HIDREV (TEGRA_APB_MISC_BASE + 0x804) 48#define TEGRA_APB_MISC_GP_HIDREV (TEGRA_APB_MISC_BASE + 0x804)
41 49
50/*
51 * Must be 1MB-aligned since a 1MB mapping is used early on.
52 * Must not overlap with regions in mach-tegra/io.c:tegra_io_desc[].
53 */
54#define UART_VIRTUAL_BASE 0xfe100000
55
42#define checkuart(rp, rv, lhu, bit, uart) \ 56#define checkuart(rp, rv, lhu, bit, uart) \
43 /* Load address of CLK_RST register */ \ 57 /* Load address of CLK_RST register */ \
44 movw rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \ 58 movw rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \
@@ -139,10 +153,10 @@
13991: str \rp, [\tmp, #4] @ Store in tegra_uart_phys 15391: str \rp, [\tmp, #4] @ Store in tegra_uart_phys
140 cmp \rp, #0 @ Valid UART address? 154 cmp \rp, #0 @ Valid UART address?
141 bne 92f @ Yes, go process it 155 bne 92f @ Yes, go process it
142 str \rp, [\tmp, #8] @ Store 0 in tegra_uart_phys 156 str \rp, [\tmp, #8] @ Store 0 in tegra_uart_virt
143 b 100f @ Done 157 b 100f @ Done
14492: sub \rv, \rp, #IO_APB_PHYS @ Calculate virt address 15892: and \rv, \rp, #0xffffff @ offset within 1MB section
145 add \rv, \rv, #IO_APB_VIRT 159 add \rv, \rv, #UART_VIRTUAL_BASE
146 str \rv, [\tmp, #8] @ Store in tegra_uart_virt 160 str \rv, [\tmp, #8] @ Store in tegra_uart_virt
147 movw \rv, #TEGRA_APB_MISC_GP_HIDREV & 0xffff 161 movw \rv, #TEGRA_APB_MISC_GP_HIDREV & 0xffff
148 movt \rv, #TEGRA_APB_MISC_GP_HIDREV >> 16 162 movt \rv, #TEGRA_APB_MISC_GP_HIDREV >> 16
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c
index 7d09f301b3a1..bb9c9c29d181 100644
--- a/arch/arm/mach-tegra/io.c
+++ b/arch/arm/mach-tegra/io.c
@@ -59,5 +59,6 @@ static struct map_desc tegra_io_desc[] __initdata = {
59 59
60void __init tegra_map_common_io(void) 60void __init tegra_map_common_io(void)
61{ 61{
62 debug_ll_io_init();
62 iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc)); 63 iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));
63} 64}