aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-02-10 22:22:00 -0500
committerRob Herring <rob.herring@calxeda.com>2012-03-06 22:34:41 -0500
commit6c38e25b6b9c64c8b2fc02c70095e70d97a3ace6 (patch)
treeb2224c9d9eceb6a9f709571d3d954767326988fb /arch/arm/mach-tegra
parent8a52dd4f94abe147bbd4080664817a389c8b6818 (diff)
ARM: tegra: clean-up mach/io.h
Move tegra specific mach/io.h parts into iomap.h. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com> Cc: Colin Cross <ccross@android.com> Cc: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/include/mach/debug-macro.S1
-rw-r--r--arch/arm/mach-tegra/include/mach/io.h48
-rw-r--r--arch/arm/mach-tegra/include/mach/iomap.h48
-rw-r--r--arch/arm/mach-tegra/io.c1
4 files changed, 49 insertions, 49 deletions
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index 619abc63aee8..e28ce1675146 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -18,7 +18,6 @@
18 * 18 *
19 */ 19 */
20 20
21#include <mach/io.h>
22#include <mach/iomap.h> 21#include <mach/iomap.h>
23 22
24 .macro addruart, rp, rv, tmp 23 .macro addruart, rp, rv, tmp
diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h
index f15defffb5d2..47b4b6119116 100644
--- a/arch/arm/mach-tegra/include/mach/io.h
+++ b/arch/arm/mach-tegra/include/mach/io.h
@@ -23,56 +23,8 @@
23 23
24#define IO_SPACE_LIMIT 0xffff 24#define IO_SPACE_LIMIT 0xffff
25 25
26/* On TEGRA, many peripherals are very closely packed in
27 * two 256MB io windows (that actually only use about 64KB
28 * at the start of each).
29 *
30 * We will just map the first 1MB of each window (to minimize
31 * pt entries needed) and provide a macro to transform physical
32 * io addresses to an appropriate void __iomem *.
33 *
34 */
35
36#ifdef __ASSEMBLY__
37#define IOMEM(x) (x)
38#else
39#define IOMEM(x) ((void __force __iomem *)(x))
40#endif
41
42#define IO_IRAM_PHYS 0x40000000
43#define IO_IRAM_VIRT IOMEM(0xFE400000)
44#define IO_IRAM_SIZE SZ_256K
45
46#define IO_CPU_PHYS 0x50040000
47#define IO_CPU_VIRT IOMEM(0xFE000000)
48#define IO_CPU_SIZE SZ_16K
49
50#define IO_PPSB_PHYS 0x60000000
51#define IO_PPSB_VIRT IOMEM(0xFE200000)
52#define IO_PPSB_SIZE SZ_1M
53
54#define IO_APB_PHYS 0x70000000
55#define IO_APB_VIRT IOMEM(0xFE300000)
56#define IO_APB_SIZE SZ_1M
57
58#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
59#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst)))
60
61#define IO_TO_VIRT(n) ( \
62 IO_TO_VIRT_BETWEEN((n), IO_PPSB_PHYS, IO_PPSB_SIZE) ? \
63 IO_TO_VIRT_XLATE((n), IO_PPSB_PHYS, IO_PPSB_VIRT) : \
64 IO_TO_VIRT_BETWEEN((n), IO_APB_PHYS, IO_APB_SIZE) ? \
65 IO_TO_VIRT_XLATE((n), IO_APB_PHYS, IO_APB_VIRT) : \
66 IO_TO_VIRT_BETWEEN((n), IO_CPU_PHYS, IO_CPU_SIZE) ? \
67 IO_TO_VIRT_XLATE((n), IO_CPU_PHYS, IO_CPU_VIRT) : \
68 IO_TO_VIRT_BETWEEN((n), IO_IRAM_PHYS, IO_IRAM_SIZE) ? \
69 IO_TO_VIRT_XLATE((n), IO_IRAM_PHYS, IO_IRAM_VIRT) : \
70 NULL)
71
72#ifndef __ASSEMBLER__ 26#ifndef __ASSEMBLER__
73 27
74#define IO_ADDRESS(n) (IO_TO_VIRT(n))
75
76#ifdef CONFIG_TEGRA_PCI 28#ifdef CONFIG_TEGRA_PCI
77extern void __iomem *tegra_pcie_io_base; 29extern void __iomem *tegra_pcie_io_base;
78 30
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 19dec3ac0854..082b4d167801 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -271,4 +271,52 @@
271# define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE 271# define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE
272#endif 272#endif
273 273
274/* On TEGRA, many peripherals are very closely packed in
275 * two 256MB io windows (that actually only use about 64KB
276 * at the start of each).
277 *
278 * We will just map the first 1MB of each window (to minimize
279 * pt entries needed) and provide a macro to transform physical
280 * io addresses to an appropriate void __iomem *.
281 *
282 */
283
284#ifdef __ASSEMBLY__
285#define IOMEM(x) (x)
286#else
287#define IOMEM(x) ((void __force __iomem *)(x))
288#endif
289
290#define IO_IRAM_PHYS 0x40000000
291#define IO_IRAM_VIRT IOMEM(0xFE400000)
292#define IO_IRAM_SIZE SZ_256K
293
294#define IO_CPU_PHYS 0x50040000
295#define IO_CPU_VIRT IOMEM(0xFE000000)
296#define IO_CPU_SIZE SZ_16K
297
298#define IO_PPSB_PHYS 0x60000000
299#define IO_PPSB_VIRT IOMEM(0xFE200000)
300#define IO_PPSB_SIZE SZ_1M
301
302#define IO_APB_PHYS 0x70000000
303#define IO_APB_VIRT IOMEM(0xFE300000)
304#define IO_APB_SIZE SZ_1M
305
306#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
307#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst)))
308
309#define IO_TO_VIRT(n) ( \
310 IO_TO_VIRT_BETWEEN((n), IO_PPSB_PHYS, IO_PPSB_SIZE) ? \
311 IO_TO_VIRT_XLATE((n), IO_PPSB_PHYS, IO_PPSB_VIRT) : \
312 IO_TO_VIRT_BETWEEN((n), IO_APB_PHYS, IO_APB_SIZE) ? \
313 IO_TO_VIRT_XLATE((n), IO_APB_PHYS, IO_APB_VIRT) : \
314 IO_TO_VIRT_BETWEEN((n), IO_CPU_PHYS, IO_CPU_SIZE) ? \
315 IO_TO_VIRT_XLATE((n), IO_CPU_PHYS, IO_CPU_VIRT) : \
316 IO_TO_VIRT_BETWEEN((n), IO_IRAM_PHYS, IO_IRAM_SIZE) ? \
317 IO_TO_VIRT_XLATE((n), IO_IRAM_PHYS, IO_IRAM_VIRT) : \
318 NULL)
319
320#define IO_ADDRESS(n) (IO_TO_VIRT(n))
321
274#endif 322#endif
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c
index d23ee2db2827..58b4baf9c483 100644
--- a/arch/arm/mach-tegra/io.c
+++ b/arch/arm/mach-tegra/io.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <mach/iomap.h>
29 30
30#include "board.h" 31#include "board.h"
31 32