diff options
Diffstat (limited to 'arch/arm/plat-omap/devices.c')
-rw-r--r-- | arch/arm/plat-omap/devices.c | 144 |
1 files changed, 91 insertions, 53 deletions
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index a64b692a1bfe..95677d17cd1c 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -14,20 +14,22 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/slab.h> | ||
17 | 18 | ||
18 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
19 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
20 | #include <asm/mach/map.h> | 21 | #include <asm/mach/map.h> |
21 | 22 | ||
22 | #include <mach/tc.h> | 23 | #include <plat/tc.h> |
23 | #include <mach/control.h> | 24 | #include <plat/control.h> |
24 | #include <mach/board.h> | 25 | #include <plat/board.h> |
25 | #include <mach/mmc.h> | 26 | #include <plat/mmc.h> |
26 | #include <mach/mux.h> | 27 | #include <plat/mux.h> |
27 | #include <mach/gpio.h> | 28 | #include <mach/gpio.h> |
28 | #include <mach/menelaus.h> | 29 | #include <plat/menelaus.h> |
29 | #include <mach/mcbsp.h> | 30 | #include <plat/mcbsp.h> |
30 | #include <mach/dsp_common.h> | 31 | #include <plat/dsp_common.h> |
32 | #include <plat/omap44xx.h> | ||
31 | 33 | ||
32 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) | 34 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) |
33 | 35 | ||
@@ -113,17 +115,17 @@ static void omap_init_kp(void) | |||
113 | omap_cfg_reg(E19_1610_KBR4); | 115 | omap_cfg_reg(E19_1610_KBR4); |
114 | omap_cfg_reg(N19_1610_KBR5); | 116 | omap_cfg_reg(N19_1610_KBR5); |
115 | } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { | 117 | } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { |
116 | omap_cfg_reg(E2_730_KBR0); | 118 | omap_cfg_reg(E2_7XX_KBR0); |
117 | omap_cfg_reg(J7_730_KBR1); | 119 | omap_cfg_reg(J7_7XX_KBR1); |
118 | omap_cfg_reg(E1_730_KBR2); | 120 | omap_cfg_reg(E1_7XX_KBR2); |
119 | omap_cfg_reg(F3_730_KBR3); | 121 | omap_cfg_reg(F3_7XX_KBR3); |
120 | omap_cfg_reg(D2_730_KBR4); | 122 | omap_cfg_reg(D2_7XX_KBR4); |
121 | 123 | ||
122 | omap_cfg_reg(C2_730_KBC0); | 124 | omap_cfg_reg(C2_7XX_KBC0); |
123 | omap_cfg_reg(D3_730_KBC1); | 125 | omap_cfg_reg(D3_7XX_KBC1); |
124 | omap_cfg_reg(E4_730_KBC2); | 126 | omap_cfg_reg(E4_7XX_KBC2); |
125 | omap_cfg_reg(F4_730_KBC3); | 127 | omap_cfg_reg(F4_7XX_KBC3); |
126 | omap_cfg_reg(E3_730_KBC4); | 128 | omap_cfg_reg(E3_7XX_KBC4); |
127 | } else if (machine_is_omap_h4()) { | 129 | } else if (machine_is_omap_h4()) { |
128 | omap_cfg_reg(T19_24XX_KBR0); | 130 | omap_cfg_reg(T19_24XX_KBR0); |
129 | omap_cfg_reg(R19_24XX_KBR1); | 131 | omap_cfg_reg(R19_24XX_KBR1); |
@@ -192,6 +194,41 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | |||
192 | 194 | ||
193 | /*-------------------------------------------------------------------------*/ | 195 | /*-------------------------------------------------------------------------*/ |
194 | 196 | ||
197 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ | ||
198 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) | ||
199 | |||
200 | static struct resource mcpdm_resources[] = { | ||
201 | { | ||
202 | .name = "mcpdm_mem", | ||
203 | .start = OMAP44XX_MCPDM_BASE, | ||
204 | .end = OMAP44XX_MCPDM_BASE + SZ_4K, | ||
205 | .flags = IORESOURCE_MEM, | ||
206 | }, | ||
207 | { | ||
208 | .name = "mcpdm_irq", | ||
209 | .start = OMAP44XX_IRQ_MCPDM, | ||
210 | .end = OMAP44XX_IRQ_MCPDM, | ||
211 | .flags = IORESOURCE_IRQ, | ||
212 | }, | ||
213 | }; | ||
214 | |||
215 | static struct platform_device omap_mcpdm_device = { | ||
216 | .name = "omap-mcpdm", | ||
217 | .id = -1, | ||
218 | .num_resources = ARRAY_SIZE(mcpdm_resources), | ||
219 | .resource = mcpdm_resources, | ||
220 | }; | ||
221 | |||
222 | static void omap_init_mcpdm(void) | ||
223 | { | ||
224 | (void) platform_device_register(&omap_mcpdm_device); | ||
225 | } | ||
226 | #else | ||
227 | static inline void omap_init_mcpdm(void) {} | ||
228 | #endif | ||
229 | |||
230 | /*-------------------------------------------------------------------------*/ | ||
231 | |||
195 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ | 232 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ |
196 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | 233 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) |
197 | 234 | ||
@@ -242,6 +279,39 @@ fail: | |||
242 | 279 | ||
243 | /*-------------------------------------------------------------------------*/ | 280 | /*-------------------------------------------------------------------------*/ |
244 | 281 | ||
282 | #if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE) | ||
283 | |||
284 | #ifdef CONFIG_ARCH_OMAP2 | ||
285 | #define OMAP_RNG_BASE 0x480A0000 | ||
286 | #else | ||
287 | #define OMAP_RNG_BASE 0xfffe5000 | ||
288 | #endif | ||
289 | |||
290 | static struct resource rng_resources[] = { | ||
291 | { | ||
292 | .start = OMAP_RNG_BASE, | ||
293 | .end = OMAP_RNG_BASE + 0x4f, | ||
294 | .flags = IORESOURCE_MEM, | ||
295 | }, | ||
296 | }; | ||
297 | |||
298 | static struct platform_device omap_rng_device = { | ||
299 | .name = "omap_rng", | ||
300 | .id = -1, | ||
301 | .num_resources = ARRAY_SIZE(rng_resources), | ||
302 | .resource = rng_resources, | ||
303 | }; | ||
304 | |||
305 | static void omap_init_rng(void) | ||
306 | { | ||
307 | (void) platform_device_register(&omap_rng_device); | ||
308 | } | ||
309 | #else | ||
310 | static inline void omap_init_rng(void) {} | ||
311 | #endif | ||
312 | |||
313 | /*-------------------------------------------------------------------------*/ | ||
314 | |||
245 | /* Numbering for the SPI-capable controllers when used for SPI: | 315 | /* Numbering for the SPI-capable controllers when used for SPI: |
246 | * spi = 1 | 316 | * spi = 1 |
247 | * uwire = 2 | 317 | * uwire = 2 |
@@ -324,39 +394,6 @@ static void omap_init_wdt(void) | |||
324 | static inline void omap_init_wdt(void) {} | 394 | static inline void omap_init_wdt(void) {} |
325 | #endif | 395 | #endif |
326 | 396 | ||
327 | /*-------------------------------------------------------------------------*/ | ||
328 | |||
329 | #if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE) | ||
330 | |||
331 | #ifdef CONFIG_ARCH_OMAP24XX | ||
332 | #define OMAP_RNG_BASE 0x480A0000 | ||
333 | #else | ||
334 | #define OMAP_RNG_BASE 0xfffe5000 | ||
335 | #endif | ||
336 | |||
337 | static struct resource rng_resources[] = { | ||
338 | { | ||
339 | .start = OMAP_RNG_BASE, | ||
340 | .end = OMAP_RNG_BASE + 0x4f, | ||
341 | .flags = IORESOURCE_MEM, | ||
342 | }, | ||
343 | }; | ||
344 | |||
345 | static struct platform_device omap_rng_device = { | ||
346 | .name = "omap_rng", | ||
347 | .id = -1, | ||
348 | .num_resources = ARRAY_SIZE(rng_resources), | ||
349 | .resource = rng_resources, | ||
350 | }; | ||
351 | |||
352 | static void omap_init_rng(void) | ||
353 | { | ||
354 | (void) platform_device_register(&omap_rng_device); | ||
355 | } | ||
356 | #else | ||
357 | static inline void omap_init_rng(void) {} | ||
358 | #endif | ||
359 | |||
360 | /* | 397 | /* |
361 | * This gets called after board-specific INIT_MACHINE, and initializes most | 398 | * This gets called after board-specific INIT_MACHINE, and initializes most |
362 | * on-chip peripherals accessible on this board (except for few like USB): | 399 | * on-chip peripherals accessible on this board (except for few like USB): |
@@ -384,9 +421,10 @@ static int __init omap_init_devices(void) | |||
384 | */ | 421 | */ |
385 | omap_init_dsp(); | 422 | omap_init_dsp(); |
386 | omap_init_kp(); | 423 | omap_init_kp(); |
424 | omap_init_rng(); | ||
425 | omap_init_mcpdm(); | ||
387 | omap_init_uwire(); | 426 | omap_init_uwire(); |
388 | omap_init_wdt(); | 427 | omap_init_wdt(); |
389 | omap_init_rng(); | ||
390 | return 0; | 428 | return 0; |
391 | } | 429 | } |
392 | arch_initcall(omap_init_devices); | 430 | arch_initcall(omap_init_devices); |