diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-overo.c')
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index b3f6e9d81807..b1f23bea863f 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -57,6 +57,9 @@ | |||
57 | #define GPMC_CS0_BASE 0x60 | 57 | #define GPMC_CS0_BASE 0x60 |
58 | #define GPMC_CS_SIZE 0x30 | 58 | #define GPMC_CS_SIZE 0x30 |
59 | 59 | ||
60 | #define OVERO_SMSC911X_CS 5 | ||
61 | #define OVERO_SMSC911X_GPIO 176 | ||
62 | |||
60 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | 63 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
61 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 64 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
62 | 65 | ||
@@ -116,6 +119,67 @@ static void __init overo_ads7846_init(void) | |||
116 | static inline void __init overo_ads7846_init(void) { return; } | 119 | static inline void __init overo_ads7846_init(void) { return; } |
117 | #endif | 120 | #endif |
118 | 121 | ||
122 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | ||
123 | |||
124 | #include <linux/smsc911x.h> | ||
125 | |||
126 | static struct resource overo_smsc911x_resources[] = { | ||
127 | { | ||
128 | .name = "smsc911x-memory", | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | }, | ||
131 | { | ||
132 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
133 | }, | ||
134 | }; | ||
135 | |||
136 | static struct smsc911x_platform_config overo_smsc911x_config = { | ||
137 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
138 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
139 | .flags = SMSC911X_USE_32BIT , | ||
140 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
141 | }; | ||
142 | |||
143 | static struct platform_device overo_smsc911x_device = { | ||
144 | .name = "smsc911x", | ||
145 | .id = -1, | ||
146 | .num_resources = ARRAY_SIZE(overo_smsc911x_resources), | ||
147 | .resource = &overo_smsc911x_resources, | ||
148 | .dev = { | ||
149 | .platform_data = &overo_smsc911x_config, | ||
150 | }, | ||
151 | }; | ||
152 | |||
153 | static inline void __init overo_init_smsc911x(void) | ||
154 | { | ||
155 | unsigned long cs_mem_base; | ||
156 | |||
157 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { | ||
158 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); | ||
159 | return; | ||
160 | } | ||
161 | |||
162 | overo_smsc911x_resources[0].start = cs_mem_base + 0x0; | ||
163 | overo_smsc911x_resources[0].end = cs_mem_base + 0xff; | ||
164 | |||
165 | if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) && | ||
166 | (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) { | ||
167 | gpio_export(OVERO_SMSC911X_GPIO, 0); | ||
168 | } else { | ||
169 | printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n"); | ||
170 | return; | ||
171 | } | ||
172 | |||
173 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); | ||
174 | overo_smsc911x_resources[1].end = 0; | ||
175 | |||
176 | platform_device_register(&overo_smsc911x_device); | ||
177 | } | ||
178 | |||
179 | #else | ||
180 | static inline void __init overo_init_smsc911x(void) { return; } | ||
181 | #endif | ||
182 | |||
119 | static struct mtd_partition overo_nand_partitions[] = { | 183 | static struct mtd_partition overo_nand_partitions[] = { |
120 | { | 184 | { |
121 | .name = "xloader", | 185 | .name = "xloader", |
@@ -290,6 +354,7 @@ static void __init overo_init(void) | |||
290 | overo_flash_init(); | 354 | overo_flash_init(); |
291 | usb_musb_init(); | 355 | usb_musb_init(); |
292 | overo_ads7846_init(); | 356 | overo_ads7846_init(); |
357 | overo_init_smsc911x(); | ||
293 | 358 | ||
294 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, | 359 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, |
295 | "OVERO_GPIO_W2W_NRESET") == 0) && | 360 | "OVERO_GPIO_W2W_NRESET") == 0) && |