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 #include <asm/arch/powerdomain.h>
32 #include "powerdomains.h"
34 #include <asm/arch/clockdomain.h>
35 #include "clockdomains.h"
37 extern void omap_sram_init(void);
38 extern int omap2_clk_init(void);
39 extern void omap2_check_revision(void);
40 extern void omap2_init_memory(void);
41 extern void gpmc_init(void);
42 extern void omapfb_reserve_sdram(void);
45 * The machine specific code may provide the extra mapping besides the
46 * default mapping provided here.
49 #ifdef CONFIG_ARCH_OMAP24XX
50 static struct map_desc omap24xx_io_desc[] __initdata = {
52 .virtual = L3_24XX_VIRT,
53 .pfn = __phys_to_pfn(L3_24XX_PHYS),
54 .length = L3_24XX_SIZE,
58 .virtual = L4_24XX_VIRT,
59 .pfn = __phys_to_pfn(L4_24XX_PHYS),
60 .length = L4_24XX_SIZE,
65 #ifdef CONFIG_ARCH_OMAP2420
66 static struct map_desc omap242x_io_desc[] __initdata = {
68 .virtual = DSP_MEM_24XX_VIRT,
69 .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
70 .length = DSP_MEM_24XX_SIZE,
74 .virtual = DSP_IPI_24XX_VIRT,
75 .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS),
76 .length = DSP_IPI_24XX_SIZE,
80 .virtual = DSP_MMU_24XX_VIRT,
81 .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
82 .length = DSP_MMU_24XX_SIZE,
89 #ifdef CONFIG_ARCH_OMAP2430
90 static struct map_desc omap243x_io_desc[] __initdata = {
92 .virtual = L4_WK_243X_VIRT,
93 .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
94 .length = L4_WK_243X_SIZE,
98 .virtual = OMAP243X_GPMC_VIRT,
99 .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
100 .length = OMAP243X_GPMC_SIZE,
104 .virtual = OMAP243X_SDRC_VIRT,
105 .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
106 .length = OMAP243X_SDRC_SIZE,
110 .virtual = OMAP243X_SMS_VIRT,
111 .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
112 .length = OMAP243X_SMS_SIZE,
119 #ifdef CONFIG_ARCH_OMAP34XX
120 static struct map_desc omap34xx_io_desc[] __initdata = {
122 .virtual = L3_34XX_VIRT,
123 .pfn = __phys_to_pfn(L3_34XX_PHYS),
124 .length = L3_34XX_SIZE,
128 .virtual = L4_34XX_VIRT,
129 .pfn = __phys_to_pfn(L4_34XX_PHYS),
130 .length = L4_34XX_SIZE,
134 .virtual = L4_WK_34XX_VIRT,
135 .pfn = __phys_to_pfn(L4_WK_34XX_PHYS),
136 .length = L4_WK_34XX_SIZE,
140 .virtual = OMAP34XX_GPMC_VIRT,
141 .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
142 .length = OMAP34XX_GPMC_SIZE,
146 .virtual = OMAP343X_SMS_VIRT,
147 .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
148 .length = OMAP343X_SMS_SIZE,
152 .virtual = OMAP343X_SDRC_VIRT,
153 .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
154 .length = OMAP343X_SDRC_SIZE,
158 .virtual = L4_PER_34XX_VIRT,
159 .pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
160 .length = L4_PER_34XX_SIZE,
164 .virtual = L4_EMU_34XX_VIRT,
165 .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
166 .length = L4_EMU_34XX_SIZE,
172 void __init omap2_map_common_io(void)
174 #if defined(CONFIG_ARCH_OMAP2420)
175 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
176 iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
177 #elif defined(CONFIG_ARCH_OMAP2430)
178 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
179 iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
180 #elif defined(CONFIG_ARCH_OMAP34XX)
181 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
183 /* Normally devicemaps_init() would flush caches and tlb after
184 * mdesc->map_io(), but we must also do it here because of the CPU
185 * revision check below.
187 local_flush_tlb_all();
190 omap2_check_revision();
192 omapfb_reserve_sdram();
195 void __init omap2_init_common_hw(void)
198 pwrdm_init(powerdomains_omap);
199 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);