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 <asm/hardware.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/map.h>
22 #include <asm/arch/tc.h>
23 #include <asm/arch/board.h>
24 #include <asm/arch/mux.h>
25 #include <asm/arch/gpio.h>
26 #include <asm/arch/eac.h>
28 #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
30 #define OMAP2_I2C_BASE2 0x48072000
31 #define OMAP2_I2C_INT2 57
33 static struct resource i2c_resources2[] = {
35 .start = OMAP2_I2C_BASE2,
36 .end = OMAP2_I2C_BASE2 + 0x3f,
37 .flags = IORESOURCE_MEM,
40 .start = OMAP2_I2C_INT2,
41 .flags = IORESOURCE_IRQ,
45 static struct platform_device omap_i2c_device2 = {
48 .num_resources = ARRAY_SIZE(i2c_resources2),
49 .resource = i2c_resources2,
52 /* See also arch/arm/plat-omap/devices.c for first I2C on 24xx */
53 static void omap_init_i2c(void)
55 /* REVISIT: Second I2C not in use on H4? */
56 if (machine_is_omap_h4())
59 if (!cpu_is_omap2430()) {
60 omap_cfg_reg(J15_24XX_I2C2_SCL);
61 omap_cfg_reg(H19_24XX_I2C2_SDA);
63 (void) platform_device_register(&omap_i2c_device2);
68 static void omap_init_i2c(void) {}
72 #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
73 #define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
75 static struct resource mbox_resources[] = {
77 .start = OMAP2_MBOX_BASE,
78 .end = OMAP2_MBOX_BASE + 0x11f,
79 .flags = IORESOURCE_MEM,
82 .start = INT_24XX_MAIL_U0_MPU,
83 .flags = IORESOURCE_IRQ,
86 .start = INT_24XX_MAIL_U3_MPU,
87 .flags = IORESOURCE_IRQ,
91 static struct platform_device mbox_device = {
94 .num_resources = ARRAY_SIZE(mbox_resources),
95 .resource = mbox_resources,
98 static inline void omap_init_mbox(void)
100 platform_device_register(&mbox_device);
103 static inline void omap_init_mbox(void) { }
106 #if defined(CONFIG_OMAP_STI)
108 #define OMAP2_STI_BASE IO_ADDRESS(0x48068000)
109 #define OMAP2_STI_CHANNEL_BASE 0x54000000
110 #define OMAP2_STI_IRQ 4
112 static struct resource sti_resources[] = {
114 .start = OMAP2_STI_BASE,
115 .end = OMAP2_STI_BASE + 0x7ff,
116 .flags = IORESOURCE_MEM,
119 .start = OMAP2_STI_CHANNEL_BASE,
120 .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1,
121 .flags = IORESOURCE_MEM,
124 .start = OMAP2_STI_IRQ,
125 .flags = IORESOURCE_IRQ,
129 static struct platform_device sti_device = {
132 .num_resources = ARRAY_SIZE(sti_resources),
133 .resource = sti_resources,
136 static inline void omap_init_sti(void)
138 platform_device_register(&sti_device);
141 static inline void omap_init_sti(void) {}
144 #if defined(CONFIG_SPI_OMAP24XX)
146 #include <asm/arch/mcspi.h>
148 #define OMAP2_MCSPI1_BASE 0x48098000
149 #define OMAP2_MCSPI2_BASE 0x4809a000
151 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
155 static struct resource omap2_mcspi1_resources[] = {
157 .start = OMAP2_MCSPI1_BASE,
158 .end = OMAP2_MCSPI1_BASE + 0xff,
159 .flags = IORESOURCE_MEM,
163 struct platform_device omap2_mcspi1 = {
164 .name = "omap2_mcspi",
166 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
167 .resource = omap2_mcspi1_resources,
169 .platform_data = &omap2_mcspi1_config,
173 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
177 static struct resource omap2_mcspi2_resources[] = {
179 .start = OMAP2_MCSPI2_BASE,
180 .end = OMAP2_MCSPI2_BASE + 0xff,
181 .flags = IORESOURCE_MEM,
185 struct platform_device omap2_mcspi2 = {
186 .name = "omap2_mcspi",
188 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
189 .resource = omap2_mcspi2_resources,
191 .platform_data = &omap2_mcspi2_config,
195 static void omap_init_mcspi(void)
197 platform_device_register(&omap2_mcspi1);
198 platform_device_register(&omap2_mcspi2);
202 static inline void omap_init_mcspi(void) {}
205 #ifdef CONFIG_SND_OMAP24XX_EAC
207 #define OMAP2_EAC_BASE 0x48090000
209 static struct resource omap2_eac_resources[] = {
211 .start = OMAP2_EAC_BASE,
212 .end = OMAP2_EAC_BASE + 0x109,
213 .flags = IORESOURCE_MEM,
217 static struct platform_device omap2_eac_device = {
218 .name = "omap24xx-eac",
220 .num_resources = ARRAY_SIZE(omap2_eac_resources),
221 .resource = omap2_eac_resources,
223 .platform_data = NULL,
227 void omap_init_eac(struct eac_platform_data *pdata)
229 omap2_eac_device.dev.platform_data = pdata;
230 platform_device_register(&omap2_eac_device);
234 void omap_init_eac(struct eac_platform_data *pdata) {}
237 /*-------------------------------------------------------------------------*/
239 static int __init omap2_init_devices(void)
241 /* please keep these calls, and their implementations above,
242 * in alphabetical order so they're easier to sort through.
251 arch_initcall(omap2_init_devices);