2 * linux/arch/arm/mach-omap2/io.c
4 * OMAP2 I/O mapping code
6 * Copyright (C) 2005 Nokia Corporation
7 * Copyright (C) 2007 Texas Instruments
10 * Juha Yrjola <juha.yrjola@nokia.com>
11 * Syed Khasim <x0khasim@ti.com>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
18 #include <linux/module.h>
19 #include <linux/kernel.h>
20 #include <linux/init.h>
25 #include <asm/mach/map.h>
27 #include <asm/arch/mux.h>
28 #include <asm/arch/omapfb.h>
30 extern void omap_sram_init(void);
31 extern int omap2_clk_init(void);
32 extern void omap2_check_revision(void);
33 extern void omap2_init_memory(void);
34 extern void gpmc_init(void);
35 extern void omapfb_reserve_sdram(void);
38 * The machine specific code may provide the extra mapping besides the
39 * default mapping provided here.
42 #ifdef CONFIG_ARCH_OMAP24XX
43 static struct map_desc omap24xx_io_desc[] __initdata = {
45 .virtual = L3_24XX_VIRT,
46 .pfn = __phys_to_pfn(L3_24XX_PHYS),
47 .length = L3_24XX_SIZE,
51 .virtual = L4_24XX_VIRT,
52 .pfn = __phys_to_pfn(L4_24XX_PHYS),
53 .length = L4_24XX_SIZE,
58 #ifdef CONFIG_ARCH_OMAP2420
59 static struct map_desc omap242x_io_desc[] __initdata = {
61 .virtual = DSP_MEM_24XX_VIRT,
62 .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
63 .length = DSP_MEM_24XX_SIZE,
67 .virtual = DSP_IPI_24XX_VIRT,
68 .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS),
69 .length = DSP_IPI_24XX_SIZE,
73 .virtual = DSP_MMU_24XX_VIRT,
74 .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
75 .length = DSP_MMU_24XX_SIZE,
82 #ifdef CONFIG_ARCH_OMAP2430
83 static struct map_desc omap243x_io_desc[] __initdata = {
85 .virtual = L4_WK_243X_VIRT,
86 .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
87 .length = L4_WK_243X_SIZE,
91 .virtual = OMAP243X_GPMC_VIRT,
92 .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
93 .length = OMAP243X_GPMC_SIZE,
97 .virtual = OMAP243X_SDRC_VIRT,
98 .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
99 .length = OMAP243X_SDRC_SIZE,
103 .virtual = OMAP243X_SMS_VIRT,
104 .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
105 .length = OMAP243X_SMS_SIZE,
112 #ifdef CONFIG_ARCH_OMAP34XX
113 static struct map_desc omap34xx_io_desc[] __initdata = {
115 .virtual = L3_34XX_VIRT,
116 .pfn = __phys_to_pfn(L3_34XX_PHYS),
117 .length = L3_34XX_SIZE,
121 .virtual = L4_34XX_VIRT,
122 .pfn = __phys_to_pfn(L4_34XX_PHYS),
123 .length = L4_34XX_SIZE,
127 .virtual = L4_WK_34XX_VIRT,
128 .pfn = __phys_to_pfn(L4_WK_34XX_PHYS),
129 .length = L4_WK_34XX_SIZE,
133 .virtual = OMAP34XX_GPMC_VIRT,
134 .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
135 .length = OMAP34XX_GPMC_SIZE,
139 .virtual = OMAP343X_SMS_VIRT,
140 .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
141 .length = OMAP343X_SMS_SIZE,
145 .virtual = OMAP343X_SDRC_VIRT,
146 .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
147 .length = OMAP343X_SDRC_SIZE,
151 .virtual = L4_PER_34XX_VIRT,
152 .pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
153 .length = L4_PER_34XX_SIZE,
157 .virtual = L4_EMU_34XX_VIRT,
158 .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
159 .length = L4_EMU_34XX_SIZE,
165 void __init omap2_map_common_io(void)
167 #if defined(CONFIG_ARCH_OMAP2420)
168 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
169 iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
170 #elif defined(CONFIG_ARCH_OMAP2430)
171 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
172 iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
173 #elif defined(CONFIG_ARCH_OMAP34XX)
174 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
176 /* Normally devicemaps_init() would flush caches and tlb after
177 * mdesc->map_io(), but we must also do it here because of the CPU
178 * revision check below.
180 local_flush_tlb_all();
183 omap2_check_revision();
185 omapfb_reserve_sdram();
188 void __init omap2_init_common_hw(void)