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/config.h>
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
18 #include <asm/hardware.h>
20 #include <asm/mach-types.h>
21 #include <asm/mach/map.h>
23 #include <asm/arch/tc.h>
24 #include <asm/arch/board.h>
25 #include <asm/arch/mux.h>
26 #include <asm/arch/gpio.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 omap_cfg_reg(J15_24XX_I2C2_SCL);
60 omap_cfg_reg(H19_24XX_I2C2_SDA);
61 (void) platform_device_register(&omap_i2c_device2);
66 static void omap_init_i2c(void) {}
70 #if defined(CONFIG_OMAP_STI)
72 #define OMAP2_STI_BASE IO_ADDRESS(0x48068000)
73 #define OMAP2_STI_CHANNEL_BASE 0x54000000
74 #define OMAP2_STI_IRQ 4
76 static struct resource sti_resources[] = {
78 .start = OMAP2_STI_BASE,
79 .end = OMAP2_STI_BASE + 0x7ff,
80 .flags = IORESOURCE_MEM,
83 .start = OMAP2_STI_CHANNEL_BASE,
84 .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1,
85 .flags = IORESOURCE_MEM,
88 .start = OMAP2_STI_IRQ,
89 .flags = IORESOURCE_IRQ,
93 static struct platform_device sti_device = {
96 .num_resources = ARRAY_SIZE(sti_resources),
97 .resource = sti_resources,
100 static inline void omap_init_sti(void)
102 platform_device_register(&sti_device);
105 static inline void omap_init_sti(void) {}
108 #if defined(CONFIG_SPI_OMAP24XX)
110 #include <asm/arch/mcspi.h>
112 #define OMAP2_MCSPI1_BASE 0x48098000
113 #define OMAP2_MCSPI2_BASE 0x4809a000
115 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
119 static struct resource omap2_mcspi1_resources[] = {
121 .start = OMAP2_MCSPI1_BASE,
122 .end = OMAP2_MCSPI1_BASE + 0xff,
123 .flags = IORESOURCE_MEM,
127 struct platform_device omap2_mcspi1 = {
128 .name = "omap2_mcspi",
130 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
131 .resource = omap2_mcspi1_resources,
133 .platform_data = &omap2_mcspi1_config,
137 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
141 static struct resource omap2_mcspi2_resources[] = {
143 .start = OMAP2_MCSPI2_BASE,
144 .end = OMAP2_MCSPI2_BASE + 0xff,
145 .flags = IORESOURCE_MEM,
149 struct platform_device omap2_mcspi2 = {
150 .name = "omap2_mcspi",
152 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
153 .resource = omap2_mcspi2_resources,
155 .platform_data = &omap2_mcspi2_config,
159 static void omap_init_mcspi(void)
161 platform_device_register(&omap2_mcspi1);
162 platform_device_register(&omap2_mcspi2);
166 static inline void omap_init_mcspi(void) {}
169 /*-------------------------------------------------------------------------*/
171 static int __init omap2_init_devices(void)
173 /* please keep these calls, and their implementations above,
174 * in alphabetical order so they're easier to sort through.
182 arch_initcall(omap2_init_devices);