2 * linux/arch/arm/mach-omap2/devices.c
4 * OMAP2 platform device setup/initialization
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
17 #include <linux/clk.h>
19 #include <mach/hardware.h>
20 #include <mach/irqs.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/map.h>
25 #include <plat/control.h>
27 #include <plat/board.h>
28 #include <plat/mcbsp.h>
29 #include <mach/gpio.h>
35 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
37 static struct resource cam_resources[] = {
39 .start = OMAP24XX_CAMERA_BASE,
40 .end = OMAP24XX_CAMERA_BASE + 0xfff,
41 .flags = IORESOURCE_MEM,
44 .start = INT_24XX_CAM_IRQ,
45 .flags = IORESOURCE_IRQ,
49 static struct platform_device omap_cam_device = {
50 .name = "omap24xxcam",
52 .num_resources = ARRAY_SIZE(cam_resources),
53 .resource = cam_resources,
56 static inline void omap_init_camera(void)
58 platform_device_register(&omap_cam_device);
61 #elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
63 static struct resource omap3isp_resources[] = {
65 .start = OMAP3430_ISP_BASE,
66 .end = OMAP3430_ISP_END,
67 .flags = IORESOURCE_MEM,
70 .start = OMAP3430_ISP_CBUFF_BASE,
71 .end = OMAP3430_ISP_CBUFF_END,
72 .flags = IORESOURCE_MEM,
75 .start = OMAP3430_ISP_CCP2_BASE,
76 .end = OMAP3430_ISP_CCP2_END,
77 .flags = IORESOURCE_MEM,
80 .start = OMAP3430_ISP_CCDC_BASE,
81 .end = OMAP3430_ISP_CCDC_END,
82 .flags = IORESOURCE_MEM,
85 .start = OMAP3430_ISP_HIST_BASE,
86 .end = OMAP3430_ISP_HIST_END,
87 .flags = IORESOURCE_MEM,
90 .start = OMAP3430_ISP_H3A_BASE,
91 .end = OMAP3430_ISP_H3A_END,
92 .flags = IORESOURCE_MEM,
95 .start = OMAP3430_ISP_PREV_BASE,
96 .end = OMAP3430_ISP_PREV_END,
97 .flags = IORESOURCE_MEM,
100 .start = OMAP3430_ISP_RESZ_BASE,
101 .end = OMAP3430_ISP_RESZ_END,
102 .flags = IORESOURCE_MEM,
105 .start = OMAP3430_ISP_SBL_BASE,
106 .end = OMAP3430_ISP_SBL_END,
107 .flags = IORESOURCE_MEM,
110 .start = OMAP3430_ISP_CSI2A_BASE,
111 .end = OMAP3430_ISP_CSI2A_END,
112 .flags = IORESOURCE_MEM,
115 .start = OMAP3430_ISP_CSI2PHY_BASE,
116 .end = OMAP3430_ISP_CSI2PHY_END,
117 .flags = IORESOURCE_MEM,
120 .start = INT_34XX_CAM_IRQ,
121 .flags = IORESOURCE_IRQ,
125 static struct platform_device omap3isp_device = {
128 .num_resources = ARRAY_SIZE(omap3isp_resources),
129 .resource = omap3isp_resources,
132 static inline void omap_init_camera(void)
134 platform_device_register(&omap3isp_device);
137 static inline void omap_init_camera(void)
142 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
144 #define MBOX_REG_SIZE 0x120
146 #ifdef CONFIG_ARCH_OMAP2
147 static struct resource omap2_mbox_resources[] = {
149 .start = OMAP24XX_MAILBOX_BASE,
150 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
151 .flags = IORESOURCE_MEM,
154 .start = INT_24XX_MAIL_U0_MPU,
155 .flags = IORESOURCE_IRQ,
159 .start = INT_24XX_MAIL_U3_MPU,
160 .flags = IORESOURCE_IRQ,
164 static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
166 #define omap2_mbox_resources NULL
167 #define omap2_mbox_resources_sz 0
170 #ifdef CONFIG_ARCH_OMAP3
171 static struct resource omap3_mbox_resources[] = {
173 .start = OMAP34XX_MAILBOX_BASE,
174 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
175 .flags = IORESOURCE_MEM,
178 .start = INT_24XX_MAIL_U0_MPU,
179 .flags = IORESOURCE_IRQ,
183 static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
185 #define omap3_mbox_resources NULL
186 #define omap3_mbox_resources_sz 0
189 #ifdef CONFIG_ARCH_OMAP4
191 #define OMAP4_MBOX_REG_SIZE 0x130
192 static struct resource omap4_mbox_resources[] = {
194 .start = OMAP44XX_MAILBOX_BASE,
195 .end = OMAP44XX_MAILBOX_BASE +
196 OMAP4_MBOX_REG_SIZE - 1,
197 .flags = IORESOURCE_MEM,
200 .start = OMAP44XX_IRQ_MAIL_U0,
201 .flags = IORESOURCE_IRQ,
205 static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
207 #define omap4_mbox_resources NULL
208 #define omap4_mbox_resources_sz 0
211 static struct platform_device mbox_device = {
212 .name = "omap-mailbox",
216 static inline void omap_init_mbox(void)
218 if (cpu_is_omap24xx()) {
219 mbox_device.resource = omap2_mbox_resources;
220 mbox_device.num_resources = omap2_mbox_resources_sz;
221 } else if (cpu_is_omap34xx()) {
222 mbox_device.resource = omap3_mbox_resources;
223 mbox_device.num_resources = omap3_mbox_resources_sz;
224 } else if (cpu_is_omap44xx()) {
225 mbox_device.resource = omap4_mbox_resources;
226 mbox_device.num_resources = omap4_mbox_resources_sz;
228 pr_err("%s: platform not supported\n", __func__);
231 platform_device_register(&mbox_device);
234 static inline void omap_init_mbox(void) { }
235 #endif /* CONFIG_OMAP_MBOX_FWK */
237 static inline void omap_init_sti(void) {}
239 #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
241 static struct platform_device omap_pcm = {
242 .name = "omap-pcm-audio",
247 * OMAP2420 has 2 McBSP ports
248 * OMAP2430 has 5 McBSP ports
249 * OMAP3 has 5 McBSP ports
250 * OMAP4 has 4 McBSP ports
252 OMAP_MCBSP_PLATFORM_DEVICE(1);
253 OMAP_MCBSP_PLATFORM_DEVICE(2);
254 OMAP_MCBSP_PLATFORM_DEVICE(3);
255 OMAP_MCBSP_PLATFORM_DEVICE(4);
256 OMAP_MCBSP_PLATFORM_DEVICE(5);
258 static void omap_init_audio(void)
260 platform_device_register(&omap_mcbsp1);
261 platform_device_register(&omap_mcbsp2);
262 if (cpu_is_omap243x() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
263 platform_device_register(&omap_mcbsp3);
264 platform_device_register(&omap_mcbsp4);
266 if (cpu_is_omap243x() || cpu_is_omap34xx())
267 platform_device_register(&omap_mcbsp5);
269 platform_device_register(&omap_pcm);
273 static inline void omap_init_audio(void) {}
276 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
278 #include <plat/mcspi.h>
280 #define OMAP2_MCSPI1_BASE 0x48098000
281 #define OMAP2_MCSPI2_BASE 0x4809a000
282 #define OMAP2_MCSPI3_BASE 0x480b8000
283 #define OMAP2_MCSPI4_BASE 0x480ba000
285 #define OMAP4_MCSPI1_BASE 0x48098100
286 #define OMAP4_MCSPI2_BASE 0x4809a100
287 #define OMAP4_MCSPI3_BASE 0x480b8100
288 #define OMAP4_MCSPI4_BASE 0x480ba100
290 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
294 static struct resource omap2_mcspi1_resources[] = {
296 .start = OMAP2_MCSPI1_BASE,
297 .end = OMAP2_MCSPI1_BASE + 0xff,
298 .flags = IORESOURCE_MEM,
302 static struct platform_device omap2_mcspi1 = {
303 .name = "omap2_mcspi",
305 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
306 .resource = omap2_mcspi1_resources,
308 .platform_data = &omap2_mcspi1_config,
312 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
316 static struct resource omap2_mcspi2_resources[] = {
318 .start = OMAP2_MCSPI2_BASE,
319 .end = OMAP2_MCSPI2_BASE + 0xff,
320 .flags = IORESOURCE_MEM,
324 static struct platform_device omap2_mcspi2 = {
325 .name = "omap2_mcspi",
327 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
328 .resource = omap2_mcspi2_resources,
330 .platform_data = &omap2_mcspi2_config,
334 #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
335 defined(CONFIG_ARCH_OMAP4)
336 static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
340 static struct resource omap2_mcspi3_resources[] = {
342 .start = OMAP2_MCSPI3_BASE,
343 .end = OMAP2_MCSPI3_BASE + 0xff,
344 .flags = IORESOURCE_MEM,
348 static struct platform_device omap2_mcspi3 = {
349 .name = "omap2_mcspi",
351 .num_resources = ARRAY_SIZE(omap2_mcspi3_resources),
352 .resource = omap2_mcspi3_resources,
354 .platform_data = &omap2_mcspi3_config,
359 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
360 static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
364 static struct resource omap2_mcspi4_resources[] = {
366 .start = OMAP2_MCSPI4_BASE,
367 .end = OMAP2_MCSPI4_BASE + 0xff,
368 .flags = IORESOURCE_MEM,
372 static struct platform_device omap2_mcspi4 = {
373 .name = "omap2_mcspi",
375 .num_resources = ARRAY_SIZE(omap2_mcspi4_resources),
376 .resource = omap2_mcspi4_resources,
378 .platform_data = &omap2_mcspi4_config,
383 #ifdef CONFIG_ARCH_OMAP4
384 static inline void omap4_mcspi_fixup(void)
386 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE;
387 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff;
388 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE;
389 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff;
390 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE;
391 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff;
392 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE;
393 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff;
396 static inline void omap4_mcspi_fixup(void)
401 #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
402 defined(CONFIG_ARCH_OMAP4)
403 static inline void omap2_mcspi3_init(void)
405 platform_device_register(&omap2_mcspi3);
408 static inline void omap2_mcspi3_init(void)
413 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
414 static inline void omap2_mcspi4_init(void)
416 platform_device_register(&omap2_mcspi4);
419 static inline void omap2_mcspi4_init(void)
424 static void omap_init_mcspi(void)
426 if (cpu_is_omap44xx())
429 platform_device_register(&omap2_mcspi1);
430 platform_device_register(&omap2_mcspi2);
432 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
435 if (cpu_is_omap343x() || cpu_is_omap44xx())
440 static inline void omap_init_mcspi(void) {}
443 static struct resource omap2_pmu_resource = {
446 .flags = IORESOURCE_IRQ,
449 static struct resource omap3_pmu_resource = {
450 .start = INT_34XX_BENCH_MPU_EMUL,
451 .end = INT_34XX_BENCH_MPU_EMUL,
452 .flags = IORESOURCE_IRQ,
455 static struct platform_device omap_pmu_device = {
457 .id = ARM_PMU_DEVICE_CPU,
461 static void omap_init_pmu(void)
463 if (cpu_is_omap24xx())
464 omap_pmu_device.resource = &omap2_pmu_resource;
465 else if (cpu_is_omap34xx())
466 omap_pmu_device.resource = &omap3_pmu_resource;
470 platform_device_register(&omap_pmu_device);
474 #if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
476 #ifdef CONFIG_ARCH_OMAP2
477 static struct resource omap2_sham_resources[] = {
479 .start = OMAP24XX_SEC_SHA1MD5_BASE,
480 .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64,
481 .flags = IORESOURCE_MEM,
484 .start = INT_24XX_SHA1MD5,
485 .flags = IORESOURCE_IRQ,
488 static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources);
490 #define omap2_sham_resources NULL
491 #define omap2_sham_resources_sz 0
494 #ifdef CONFIG_ARCH_OMAP3
495 static struct resource omap3_sham_resources[] = {
497 .start = OMAP34XX_SEC_SHA1MD5_BASE,
498 .end = OMAP34XX_SEC_SHA1MD5_BASE + 0x64,
499 .flags = IORESOURCE_MEM,
502 .start = INT_34XX_SHA1MD52_IRQ,
503 .flags = IORESOURCE_IRQ,
506 .start = OMAP34XX_DMA_SHA1MD5_RX,
507 .flags = IORESOURCE_DMA,
510 static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources);
512 #define omap3_sham_resources NULL
513 #define omap3_sham_resources_sz 0
516 static struct platform_device sham_device = {
521 static void omap_init_sham(void)
523 if (cpu_is_omap24xx()) {
524 sham_device.resource = omap2_sham_resources;
525 sham_device.num_resources = omap2_sham_resources_sz;
526 } else if (cpu_is_omap34xx()) {
527 sham_device.resource = omap3_sham_resources;
528 sham_device.num_resources = omap3_sham_resources_sz;
530 pr_err("%s: platform not supported\n", __func__);
533 platform_device_register(&sham_device);
536 static inline void omap_init_sham(void) { }
539 #if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)
541 #ifdef CONFIG_ARCH_OMAP24XX
542 static struct resource omap2_aes_resources[] = {
544 .start = OMAP24XX_SEC_AES_BASE,
545 .end = OMAP24XX_SEC_AES_BASE + 0x4C,
546 .flags = IORESOURCE_MEM,
549 .start = OMAP24XX_DMA_AES_TX,
550 .flags = IORESOURCE_DMA,
553 .start = OMAP24XX_DMA_AES_RX,
554 .flags = IORESOURCE_DMA,
557 static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
559 #define omap2_aes_resources NULL
560 #define omap2_aes_resources_sz 0
563 #ifdef CONFIG_ARCH_OMAP34XX
564 static struct resource omap3_aes_resources[] = {
566 .start = OMAP34XX_SEC_AES_BASE,
567 .end = OMAP34XX_SEC_AES_BASE + 0x4C,
568 .flags = IORESOURCE_MEM,
571 .start = OMAP34XX_DMA_AES2_TX,
572 .flags = IORESOURCE_DMA,
575 .start = OMAP34XX_DMA_AES2_RX,
576 .flags = IORESOURCE_DMA,
579 static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources);
581 #define omap3_aes_resources NULL
582 #define omap3_aes_resources_sz 0
585 static struct platform_device aes_device = {
590 static void omap_init_aes(void)
592 if (cpu_is_omap24xx()) {
593 aes_device.resource = omap2_aes_resources;
594 aes_device.num_resources = omap2_aes_resources_sz;
595 } else if (cpu_is_omap34xx()) {
596 aes_device.resource = omap3_aes_resources;
597 aes_device.num_resources = omap3_aes_resources_sz;
599 pr_err("%s: platform not supported\n", __func__);
602 platform_device_register(&aes_device);
606 static inline void omap_init_aes(void) { }
609 /*-------------------------------------------------------------------------*/
611 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
613 #define MMCHS_SYSCONFIG 0x0010
614 #define MMCHS_SYSCONFIG_SWRESET (1 << 1)
615 #define MMCHS_SYSSTATUS 0x0014
616 #define MMCHS_SYSSTATUS_RESETDONE (1 << 0)
618 static struct platform_device dummy_pdev = {
620 .bus = &platform_bus_type,
625 * omap_hsmmc_reset() - Full reset of each HS-MMC controller
627 * Ensure that each MMC controller is fully reset. Controllers
628 * left in an unknown state (by bootloader) may prevent retention
629 * or OFF-mode. This is especially important in cases where the
630 * MMC driver is not enabled, _or_ built as a module.
632 * In order for reset to work, interface, functional and debounce
633 * clocks must be enabled. The debounce clock comes from func_32k_clk
634 * and is not under SW control, so we only enable i- and f-clocks.
636 static void __init omap_hsmmc_reset(void)
638 u32 i, nr_controllers;
640 if (cpu_is_omap242x())
643 nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
644 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
646 for (i = 0; i < nr_controllers; i++) {
648 struct clk *iclk, *fclk;
649 struct device *dev = &dummy_pdev.dev;
653 base = OMAP2_MMC1_BASE;
656 base = OMAP2_MMC2_BASE;
659 base = OMAP3_MMC3_BASE;
662 if (!cpu_is_omap44xx())
664 base = OMAP4_MMC4_BASE;
667 if (!cpu_is_omap44xx())
669 base = OMAP4_MMC5_BASE;
673 if (cpu_is_omap44xx())
674 base += OMAP4_MMC_REG_OFFSET;
677 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
678 iclk = clk_get(dev, "ick");
679 if (iclk && clk_enable(iclk))
682 fclk = clk_get(dev, "fck");
683 if (fclk && clk_enable(fclk))
686 if (!iclk || !fclk) {
688 "%s: Unable to enable clocks for MMC%d, "
689 "cannot reset.\n", __func__, i);
693 omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG);
694 v = omap_readl(base + MMCHS_SYSSTATUS);
695 while (!(omap_readl(base + MMCHS_SYSSTATUS) &
696 MMCHS_SYSSTATUS_RESETDONE))
710 static inline void omap_hsmmc_reset(void) {}
713 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
714 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
716 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
719 if ((mmc_controller->slots[0].switch_pin > 0) && \
720 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
721 omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
722 OMAP_PIN_INPUT_PULLUP);
723 if ((mmc_controller->slots[0].gpio_wp > 0) && \
724 (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
725 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
726 OMAP_PIN_INPUT_PULLUP);
728 if (cpu_is_omap2420() && controller_nr == 0) {
729 omap_mux_init_signal("sdmmc_cmd", 0);
730 omap_mux_init_signal("sdmmc_clki", 0);
731 omap_mux_init_signal("sdmmc_clko", 0);
732 omap_mux_init_signal("sdmmc_dat0", 0);
733 omap_mux_init_signal("sdmmc_dat_dir0", 0);
734 omap_mux_init_signal("sdmmc_cmd_dir", 0);
735 if (mmc_controller->slots[0].wires == 4) {
736 omap_mux_init_signal("sdmmc_dat1", 0);
737 omap_mux_init_signal("sdmmc_dat2", 0);
738 omap_mux_init_signal("sdmmc_dat3", 0);
739 omap_mux_init_signal("sdmmc_dat_dir1", 0);
740 omap_mux_init_signal("sdmmc_dat_dir2", 0);
741 omap_mux_init_signal("sdmmc_dat_dir3", 0);
745 * Use internal loop-back in MMC/SDIO Module Input Clock
748 if (mmc_controller->slots[0].internal_clock) {
749 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
751 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
755 if (cpu_is_omap34xx()) {
756 if (controller_nr == 0) {
757 omap_mux_init_signal("sdmmc1_clk",
758 OMAP_PIN_INPUT_PULLUP);
759 omap_mux_init_signal("sdmmc1_cmd",
760 OMAP_PIN_INPUT_PULLUP);
761 omap_mux_init_signal("sdmmc1_dat0",
762 OMAP_PIN_INPUT_PULLUP);
763 if (mmc_controller->slots[0].wires == 4 ||
764 mmc_controller->slots[0].wires == 8) {
765 omap_mux_init_signal("sdmmc1_dat1",
766 OMAP_PIN_INPUT_PULLUP);
767 omap_mux_init_signal("sdmmc1_dat2",
768 OMAP_PIN_INPUT_PULLUP);
769 omap_mux_init_signal("sdmmc1_dat3",
770 OMAP_PIN_INPUT_PULLUP);
772 if (mmc_controller->slots[0].wires == 8) {
773 omap_mux_init_signal("sdmmc1_dat4",
774 OMAP_PIN_INPUT_PULLUP);
775 omap_mux_init_signal("sdmmc1_dat5",
776 OMAP_PIN_INPUT_PULLUP);
777 omap_mux_init_signal("sdmmc1_dat6",
778 OMAP_PIN_INPUT_PULLUP);
779 omap_mux_init_signal("sdmmc1_dat7",
780 OMAP_PIN_INPUT_PULLUP);
783 if (controller_nr == 1) {
785 omap_mux_init_signal("sdmmc2_clk",
786 OMAP_PIN_INPUT_PULLUP);
787 omap_mux_init_signal("sdmmc2_cmd",
788 OMAP_PIN_INPUT_PULLUP);
789 omap_mux_init_signal("sdmmc2_dat0",
790 OMAP_PIN_INPUT_PULLUP);
793 * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed
794 * in the board-*.c files
796 if (mmc_controller->slots[0].wires == 4 ||
797 mmc_controller->slots[0].wires == 8) {
798 omap_mux_init_signal("sdmmc2_dat1",
799 OMAP_PIN_INPUT_PULLUP);
800 omap_mux_init_signal("sdmmc2_dat2",
801 OMAP_PIN_INPUT_PULLUP);
802 omap_mux_init_signal("sdmmc2_dat3",
803 OMAP_PIN_INPUT_PULLUP);
805 if (mmc_controller->slots[0].wires == 8) {
806 omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
807 OMAP_PIN_INPUT_PULLUP);
808 omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
809 OMAP_PIN_INPUT_PULLUP);
810 omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6",
811 OMAP_PIN_INPUT_PULLUP);
812 omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7",
813 OMAP_PIN_INPUT_PULLUP);
818 * For MMC3 the pins need to be muxed in the board-*.c files
823 void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
829 for (i = 0; i < nr_controllers; i++) {
830 unsigned long base, size;
831 unsigned int irq = 0;
836 omap2_mmc_mux(mmc_data[i], i);
840 base = OMAP2_MMC1_BASE;
841 irq = INT_24XX_MMC_IRQ;
844 base = OMAP2_MMC2_BASE;
845 irq = INT_24XX_MMC2_IRQ;
848 if (!cpu_is_omap44xx() && !cpu_is_omap34xx())
850 base = OMAP3_MMC3_BASE;
851 irq = INT_34XX_MMC3_IRQ;
854 if (!cpu_is_omap44xx())
856 base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET;
857 irq = OMAP44XX_IRQ_MMC4;
860 if (!cpu_is_omap44xx())
862 base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET;
863 irq = OMAP44XX_IRQ_MMC5;
869 if (cpu_is_omap2420()) {
870 size = OMAP2420_MMC_SIZE;
872 } else if (cpu_is_omap44xx()) {
874 base += OMAP4_MMC_REG_OFFSET;
875 irq += OMAP44XX_IRQ_GIC_START;
877 size = OMAP4_HSMMC_SIZE;
878 name = "mmci-omap-hs";
880 size = OMAP3_HSMMC_SIZE;
881 name = "mmci-omap-hs";
883 omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
889 /*-------------------------------------------------------------------------*/
891 #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
892 #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
893 #define OMAP_HDQ_BASE 0x480B2000
895 static struct resource omap_hdq_resources[] = {
897 .start = OMAP_HDQ_BASE,
898 .end = OMAP_HDQ_BASE + 0x1C,
899 .flags = IORESOURCE_MEM,
902 .start = INT_24XX_HDQ_IRQ,
903 .flags = IORESOURCE_IRQ,
906 static struct platform_device omap_hdq_dev = {
910 .platform_data = NULL,
912 .num_resources = ARRAY_SIZE(omap_hdq_resources),
913 .resource = omap_hdq_resources,
915 static inline void omap_hdq_init(void)
917 (void) platform_device_register(&omap_hdq_dev);
920 static inline void omap_hdq_init(void) {}
923 /*---------------------------------------------------------------------------*/
925 #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
926 defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
927 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
928 static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
931 static struct resource omap_vout_resource[2] = {
935 static struct platform_device omap_vout_device = {
937 .num_resources = ARRAY_SIZE(omap_vout_resource),
938 .resource = &omap_vout_resource[0],
941 static void omap_init_vout(void)
943 if (platform_device_register(&omap_vout_device) < 0)
944 printk(KERN_ERR "Unable to register OMAP-VOUT device\n");
947 static inline void omap_init_vout(void) {}
950 /*-------------------------------------------------------------------------*/
952 static int __init omap2_init_devices(void)
954 /* please keep these calls, and their implementations above,
955 * in alphabetical order so they're easier to sort through.
971 arch_initcall(omap2_init_devices);