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 <mach/omapfb.h>
28 #include <mach/sram.h>
29 #include <mach/sdrc.h>
30 #include <mach/gpmc.h>
34 #include <mach/powerdomain.h>
36 #include "powerdomains.h"
38 #include <mach/clockdomain.h>
39 #include "clockdomains.h"
42 * The machine specific code may provide the extra mapping besides the
43 * default mapping provided here.
46 #ifdef CONFIG_ARCH_OMAP24XX
47 static struct map_desc omap24xx_io_desc[] __initdata = {
49 .virtual = L3_24XX_VIRT,
50 .pfn = __phys_to_pfn(L3_24XX_PHYS),
51 .length = L3_24XX_SIZE,
55 .virtual = L4_24XX_VIRT,
56 .pfn = __phys_to_pfn(L4_24XX_PHYS),
57 .length = L4_24XX_SIZE,
62 #ifdef CONFIG_ARCH_OMAP2420
63 static struct map_desc omap242x_io_desc[] __initdata = {
65 .virtual = DSP_MEM_24XX_VIRT,
66 .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
67 .length = DSP_MEM_24XX_SIZE,
71 .virtual = DSP_IPI_24XX_VIRT,
72 .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS),
73 .length = DSP_IPI_24XX_SIZE,
77 .virtual = DSP_MMU_24XX_VIRT,
78 .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
79 .length = DSP_MMU_24XX_SIZE,
86 #ifdef CONFIG_ARCH_OMAP2430
87 static struct map_desc omap243x_io_desc[] __initdata = {
89 .virtual = L4_WK_243X_VIRT,
90 .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
91 .length = L4_WK_243X_SIZE,
95 .virtual = OMAP243X_GPMC_VIRT,
96 .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
97 .length = OMAP243X_GPMC_SIZE,
101 .virtual = OMAP243X_SDRC_VIRT,
102 .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
103 .length = OMAP243X_SDRC_SIZE,
107 .virtual = OMAP243X_SMS_VIRT,
108 .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
109 .length = OMAP243X_SMS_SIZE,
116 #ifdef CONFIG_ARCH_OMAP34XX
117 static struct map_desc omap34xx_io_desc[] __initdata = {
119 .virtual = L3_34XX_VIRT,
120 .pfn = __phys_to_pfn(L3_34XX_PHYS),
121 .length = L3_34XX_SIZE,
125 .virtual = L4_34XX_VIRT,
126 .pfn = __phys_to_pfn(L4_34XX_PHYS),
127 .length = L4_34XX_SIZE,
131 .virtual = L4_WK_34XX_VIRT,
132 .pfn = __phys_to_pfn(L4_WK_34XX_PHYS),
133 .length = L4_WK_34XX_SIZE,
137 .virtual = OMAP34XX_GPMC_VIRT,
138 .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
139 .length = OMAP34XX_GPMC_SIZE,
143 .virtual = OMAP343X_SMS_VIRT,
144 .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
145 .length = OMAP343X_SMS_SIZE,
149 .virtual = OMAP343X_SDRC_VIRT,
150 .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
151 .length = OMAP343X_SDRC_SIZE,
155 .virtual = L4_PER_34XX_VIRT,
156 .pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
157 .length = L4_PER_34XX_SIZE,
161 .virtual = L4_EMU_34XX_VIRT,
162 .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
163 .length = L4_EMU_34XX_SIZE,
169 void __init omap2_map_common_io(void)
171 #if defined(CONFIG_ARCH_OMAP2420)
172 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
173 iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
176 #if defined(CONFIG_ARCH_OMAP2430)
177 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
178 iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
181 #if defined(CONFIG_ARCH_OMAP34XX)
182 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
185 /* Normally devicemaps_init() would flush caches and tlb after
186 * mdesc->map_io(), but we must also do it here because of the CPU
187 * revision check below.
189 local_flush_tlb_all();
192 omap2_check_revision();
194 omapfb_reserve_sdram();
197 void __init omap2_init_common_hw(struct omap_sdrc_params *sp)
200 pwrdm_init(powerdomains_omap);
201 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);