diff options
Diffstat (limited to 'arch/arm/mach-omap2/io.c')
-rw-r--r-- | arch/arm/mach-omap2/io.c | 152 |
1 files changed, 123 insertions, 29 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 7c3d6289c05f..5ea64f926ed5 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -4,8 +4,11 @@ | |||
4 | * OMAP2 I/O mapping code | 4 | * OMAP2 I/O mapping code |
5 | * | 5 | * |
6 | * Copyright (C) 2005 Nokia Corporation | 6 | * Copyright (C) 2005 Nokia Corporation |
7 | * Author: Juha Yrjölä <juha.yrjola@nokia.com> | 7 | * Copyright (C) 2007 Texas Instruments |
8 | * Updated map desc to add 2430 support : <x0khasim@ti.com> | 8 | * |
9 | * Author: | ||
10 | * Juha Yrjola <juha.yrjola@nokia.com> | ||
11 | * Syed Khasim <x0khasim@ti.com> | ||
9 | * | 12 | * |
10 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License version 2 as | 14 | * it under the terms of the GNU General Public License version 2 as |
@@ -23,19 +26,26 @@ | |||
23 | 26 | ||
24 | #include <mach/mux.h> | 27 | #include <mach/mux.h> |
25 | #include <mach/omapfb.h> | 28 | #include <mach/omapfb.h> |
29 | #include <mach/sram.h> | ||
30 | |||
31 | #include "memory.h" | ||
32 | |||
33 | #include "clock.h" | ||
34 | |||
35 | #include <mach/powerdomain.h> | ||
36 | |||
37 | #include "powerdomains.h" | ||
26 | 38 | ||
27 | extern void omap_sram_init(void); | 39 | #include <mach/clockdomain.h> |
28 | extern int omap2_clk_init(void); | 40 | #include "clockdomains.h" |
29 | extern void omap2_check_revision(void); | ||
30 | extern void omap2_init_memory(void); | ||
31 | extern void gpmc_init(void); | ||
32 | extern void omapfb_reserve_sdram(void); | ||
33 | 41 | ||
34 | /* | 42 | /* |
35 | * The machine specific code may provide the extra mapping besides the | 43 | * The machine specific code may provide the extra mapping besides the |
36 | * default mapping provided here. | 44 | * default mapping provided here. |
37 | */ | 45 | */ |
38 | static struct map_desc omap2_io_desc[] __initdata = { | 46 | |
47 | #ifdef CONFIG_ARCH_OMAP24XX | ||
48 | static struct map_desc omap24xx_io_desc[] __initdata = { | ||
39 | { | 49 | { |
40 | .virtual = L3_24XX_VIRT, | 50 | .virtual = L3_24XX_VIRT, |
41 | .pfn = __phys_to_pfn(L3_24XX_PHYS), | 51 | .pfn = __phys_to_pfn(L3_24XX_PHYS), |
@@ -43,12 +53,39 @@ static struct map_desc omap2_io_desc[] __initdata = { | |||
43 | .type = MT_DEVICE | 53 | .type = MT_DEVICE |
44 | }, | 54 | }, |
45 | { | 55 | { |
46 | .virtual = L4_24XX_VIRT, | 56 | .virtual = L4_24XX_VIRT, |
47 | .pfn = __phys_to_pfn(L4_24XX_PHYS), | 57 | .pfn = __phys_to_pfn(L4_24XX_PHYS), |
48 | .length = L4_24XX_SIZE, | 58 | .length = L4_24XX_SIZE, |
49 | .type = MT_DEVICE | 59 | .type = MT_DEVICE |
50 | }, | 60 | }, |
61 | }; | ||
62 | |||
63 | #ifdef CONFIG_ARCH_OMAP2420 | ||
64 | static struct map_desc omap242x_io_desc[] __initdata = { | ||
65 | { | ||
66 | .virtual = DSP_MEM_24XX_VIRT, | ||
67 | .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), | ||
68 | .length = DSP_MEM_24XX_SIZE, | ||
69 | .type = MT_DEVICE | ||
70 | }, | ||
71 | { | ||
72 | .virtual = DSP_IPI_24XX_VIRT, | ||
73 | .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), | ||
74 | .length = DSP_IPI_24XX_SIZE, | ||
75 | .type = MT_DEVICE | ||
76 | }, | ||
77 | { | ||
78 | .virtual = DSP_MMU_24XX_VIRT, | ||
79 | .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), | ||
80 | .length = DSP_MMU_24XX_SIZE, | ||
81 | .type = MT_DEVICE | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | #endif | ||
86 | |||
51 | #ifdef CONFIG_ARCH_OMAP2430 | 87 | #ifdef CONFIG_ARCH_OMAP2430 |
88 | static struct map_desc omap243x_io_desc[] __initdata = { | ||
52 | { | 89 | { |
53 | .virtual = L4_WK_243X_VIRT, | 90 | .virtual = L4_WK_243X_VIRT, |
54 | .pfn = __phys_to_pfn(L4_WK_243X_PHYS), | 91 | .pfn = __phys_to_pfn(L4_WK_243X_PHYS), |
@@ -61,30 +98,90 @@ static struct map_desc omap2_io_desc[] __initdata = { | |||
61 | .length = OMAP243X_GPMC_SIZE, | 98 | .length = OMAP243X_GPMC_SIZE, |
62 | .type = MT_DEVICE | 99 | .type = MT_DEVICE |
63 | }, | 100 | }, |
101 | { | ||
102 | .virtual = OMAP243X_SDRC_VIRT, | ||
103 | .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS), | ||
104 | .length = OMAP243X_SDRC_SIZE, | ||
105 | .type = MT_DEVICE | ||
106 | }, | ||
107 | { | ||
108 | .virtual = OMAP243X_SMS_VIRT, | ||
109 | .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS), | ||
110 | .length = OMAP243X_SMS_SIZE, | ||
111 | .type = MT_DEVICE | ||
112 | }, | ||
113 | }; | ||
114 | #endif | ||
64 | #endif | 115 | #endif |
116 | |||
117 | #ifdef CONFIG_ARCH_OMAP34XX | ||
118 | static struct map_desc omap34xx_io_desc[] __initdata = { | ||
65 | { | 119 | { |
66 | .virtual = DSP_MEM_24XX_VIRT, | 120 | .virtual = L3_34XX_VIRT, |
67 | .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), | 121 | .pfn = __phys_to_pfn(L3_34XX_PHYS), |
68 | .length = DSP_MEM_24XX_SIZE, | 122 | .length = L3_34XX_SIZE, |
69 | .type = MT_DEVICE | 123 | .type = MT_DEVICE |
70 | }, | 124 | }, |
71 | { | 125 | { |
72 | .virtual = DSP_IPI_24XX_VIRT, | 126 | .virtual = L4_34XX_VIRT, |
73 | .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), | 127 | .pfn = __phys_to_pfn(L4_34XX_PHYS), |
74 | .length = DSP_IPI_24XX_SIZE, | 128 | .length = L4_34XX_SIZE, |
75 | .type = MT_DEVICE | 129 | .type = MT_DEVICE |
76 | }, | 130 | }, |
77 | { | 131 | { |
78 | .virtual = DSP_MMU_24XX_VIRT, | 132 | .virtual = L4_WK_34XX_VIRT, |
79 | .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), | 133 | .pfn = __phys_to_pfn(L4_WK_34XX_PHYS), |
80 | .length = DSP_MMU_24XX_SIZE, | 134 | .length = L4_WK_34XX_SIZE, |
135 | .type = MT_DEVICE | ||
136 | }, | ||
137 | { | ||
138 | .virtual = OMAP34XX_GPMC_VIRT, | ||
139 | .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS), | ||
140 | .length = OMAP34XX_GPMC_SIZE, | ||
81 | .type = MT_DEVICE | 141 | .type = MT_DEVICE |
82 | } | 142 | }, |
143 | { | ||
144 | .virtual = OMAP343X_SMS_VIRT, | ||
145 | .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS), | ||
146 | .length = OMAP343X_SMS_SIZE, | ||
147 | .type = MT_DEVICE | ||
148 | }, | ||
149 | { | ||
150 | .virtual = OMAP343X_SDRC_VIRT, | ||
151 | .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS), | ||
152 | .length = OMAP343X_SDRC_SIZE, | ||
153 | .type = MT_DEVICE | ||
154 | }, | ||
155 | { | ||
156 | .virtual = L4_PER_34XX_VIRT, | ||
157 | .pfn = __phys_to_pfn(L4_PER_34XX_PHYS), | ||
158 | .length = L4_PER_34XX_SIZE, | ||
159 | .type = MT_DEVICE | ||
160 | }, | ||
161 | { | ||
162 | .virtual = L4_EMU_34XX_VIRT, | ||
163 | .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS), | ||
164 | .length = L4_EMU_34XX_SIZE, | ||
165 | .type = MT_DEVICE | ||
166 | }, | ||
83 | }; | 167 | }; |
168 | #endif | ||
84 | 169 | ||
85 | void __init omap2_map_common_io(void) | 170 | void __init omap2_map_common_io(void) |
86 | { | 171 | { |
87 | iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc)); | 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)); | ||
175 | #endif | ||
176 | |||
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)); | ||
180 | #endif | ||
181 | |||
182 | #if defined(CONFIG_ARCH_OMAP34XX) | ||
183 | iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); | ||
184 | #endif | ||
88 | 185 | ||
89 | /* Normally devicemaps_init() would flush caches and tlb after | 186 | /* Normally devicemaps_init() would flush caches and tlb after |
90 | * mdesc->map_io(), but we must also do it here because of the CPU | 187 | * mdesc->map_io(), but we must also do it here because of the CPU |
@@ -101,12 +198,9 @@ void __init omap2_map_common_io(void) | |||
101 | void __init omap2_init_common_hw(void) | 198 | void __init omap2_init_common_hw(void) |
102 | { | 199 | { |
103 | omap2_mux_init(); | 200 | omap2_mux_init(); |
201 | pwrdm_init(powerdomains_omap); | ||
202 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); | ||
104 | omap2_clk_init(); | 203 | omap2_clk_init(); |
105 | /* | ||
106 | * Need to Fix this for 2430 | ||
107 | */ | ||
108 | #ifndef CONFIG_ARCH_OMAP2430 | ||
109 | omap2_init_memory(); | 204 | omap2_init_memory(); |
110 | #endif | ||
111 | gpmc_init(); | 205 | gpmc_init(); |
112 | } | 206 | } |