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>
28 #include <mach/omapfb.h>
29 #include <mach/sram.h>
35 #include <mach/powerdomain.h>
37 #include "powerdomains.h"
39 #include <mach/clockdomain.h>
40 #include "clockdomains.h"
43 * The machine specific code may provide the extra mapping besides the
44 * default mapping provided here.
47 #ifdef CONFIG_ARCH_OMAP24XX
48 static struct map_desc omap24xx_io_desc
[] __initdata
= {
50 .virtual = L3_24XX_VIRT
,
51 .pfn
= __phys_to_pfn(L3_24XX_PHYS
),
52 .length
= L3_24XX_SIZE
,
56 .virtual = L4_24XX_VIRT
,
57 .pfn
= __phys_to_pfn(L4_24XX_PHYS
),
58 .length
= L4_24XX_SIZE
,
63 #ifdef CONFIG_ARCH_OMAP2420
64 static struct map_desc omap242x_io_desc
[] __initdata
= {
66 .virtual = DSP_MEM_24XX_VIRT
,
67 .pfn
= __phys_to_pfn(DSP_MEM_24XX_PHYS
),
68 .length
= DSP_MEM_24XX_SIZE
,
72 .virtual = DSP_IPI_24XX_VIRT
,
73 .pfn
= __phys_to_pfn(DSP_IPI_24XX_PHYS
),
74 .length
= DSP_IPI_24XX_SIZE
,
78 .virtual = DSP_MMU_24XX_VIRT
,
79 .pfn
= __phys_to_pfn(DSP_MMU_24XX_PHYS
),
80 .length
= DSP_MMU_24XX_SIZE
,
87 #ifdef CONFIG_ARCH_OMAP2430
88 static struct map_desc omap243x_io_desc
[] __initdata
= {
90 .virtual = L4_WK_243X_VIRT
,
91 .pfn
= __phys_to_pfn(L4_WK_243X_PHYS
),
92 .length
= L4_WK_243X_SIZE
,
96 .virtual = OMAP243X_GPMC_VIRT
,
97 .pfn
= __phys_to_pfn(OMAP243X_GPMC_PHYS
),
98 .length
= OMAP243X_GPMC_SIZE
,
102 .virtual = OMAP243X_SDRC_VIRT
,
103 .pfn
= __phys_to_pfn(OMAP243X_SDRC_PHYS
),
104 .length
= OMAP243X_SDRC_SIZE
,
108 .virtual = OMAP243X_SMS_VIRT
,
109 .pfn
= __phys_to_pfn(OMAP243X_SMS_PHYS
),
110 .length
= OMAP243X_SMS_SIZE
,
117 #ifdef CONFIG_ARCH_OMAP34XX
118 static struct map_desc omap34xx_io_desc
[] __initdata
= {
120 .virtual = L3_34XX_VIRT
,
121 .pfn
= __phys_to_pfn(L3_34XX_PHYS
),
122 .length
= L3_34XX_SIZE
,
126 .virtual = L4_34XX_VIRT
,
127 .pfn
= __phys_to_pfn(L4_34XX_PHYS
),
128 .length
= L4_34XX_SIZE
,
132 .virtual = L4_WK_34XX_VIRT
,
133 .pfn
= __phys_to_pfn(L4_WK_34XX_PHYS
),
134 .length
= L4_WK_34XX_SIZE
,
138 .virtual = OMAP34XX_GPMC_VIRT
,
139 .pfn
= __phys_to_pfn(OMAP34XX_GPMC_PHYS
),
140 .length
= OMAP34XX_GPMC_SIZE
,
144 .virtual = OMAP343X_SMS_VIRT
,
145 .pfn
= __phys_to_pfn(OMAP343X_SMS_PHYS
),
146 .length
= OMAP343X_SMS_SIZE
,
150 .virtual = OMAP343X_SDRC_VIRT
,
151 .pfn
= __phys_to_pfn(OMAP343X_SDRC_PHYS
),
152 .length
= OMAP343X_SDRC_SIZE
,
156 .virtual = L4_PER_34XX_VIRT
,
157 .pfn
= __phys_to_pfn(L4_PER_34XX_PHYS
),
158 .length
= L4_PER_34XX_SIZE
,
162 .virtual = L4_EMU_34XX_VIRT
,
163 .pfn
= __phys_to_pfn(L4_EMU_34XX_PHYS
),
164 .length
= L4_EMU_34XX_SIZE
,
170 void __init
omap2_map_common_io(void)
172 #if defined(CONFIG_ARCH_OMAP2420)
173 iotable_init(omap24xx_io_desc
, ARRAY_SIZE(omap24xx_io_desc
));
174 iotable_init(omap242x_io_desc
, ARRAY_SIZE(omap242x_io_desc
));
177 #if 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
));
182 #if defined(CONFIG_ARCH_OMAP34XX)
183 iotable_init(omap34xx_io_desc
, ARRAY_SIZE(omap34xx_io_desc
));
186 /* Normally devicemaps_init() would flush caches and tlb after
187 * mdesc->map_io(), but we must also do it here because of the CPU
188 * revision check below.
190 local_flush_tlb_all();
193 omap2_check_revision();
195 omapfb_reserve_sdram();
198 void __init
omap2_init_common_hw(void)
201 pwrdm_init(powerdomains_omap
);
202 clkdm_init(clockdomains_omap
, clkdm_pwrdm_autodeps
);