diff options
author | Steve Sakoman <sakoman@gmail.com> | 2010-08-02 07:21:39 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-08-02 07:21:39 -0400 |
commit | a5ba7ae2a1b9d4ce0b2ad1cd902af88ac6f7ef33 (patch) | |
tree | 021e4da3176cf5b1dfe2f326c2493b429906b7af /arch/arm/mach-omap2/board-overo.c | |
parent | 25d6f63093ef5fa596318d7790e6d5029a711a75 (diff) |
omap: Overo: Fix support for second ethernet port
The original patch got truncated when applied from patchwork.kernel.org
as discussed at:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28953.html
This patch supplies the missing chunks.
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
[tony@atomide.com: added more info to the patch description]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-overo.c')
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 79ac41400c21..4ceeb56c414c 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -166,9 +166,26 @@ static struct platform_device overo_smsc911x_device = { | |||
166 | }, | 166 | }, |
167 | }; | 167 | }; |
168 | 168 | ||
169 | static struct platform_device overo_smsc911x2_device = { | ||
170 | .name = "smsc911x", | ||
171 | .id = 1, | ||
172 | .num_resources = ARRAY_SIZE(overo_smsc911x2_resources), | ||
173 | .resource = overo_smsc911x2_resources, | ||
174 | .dev = { | ||
175 | .platform_data = &overo_smsc911x_config, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct platform_device *smsc911x_devices[] = { | ||
180 | &overo_smsc911x_device, | ||
181 | &overo_smsc911x2_device, | ||
182 | }; | ||
183 | |||
169 | static inline void __init overo_init_smsc911x(void) | 184 | static inline void __init overo_init_smsc911x(void) |
170 | { | 185 | { |
171 | unsigned long cs_mem_base; | 186 | unsigned long cs_mem_base, cs_mem_base2; |
187 | |||
188 | /* set up first smsc911x chip */ | ||
172 | 189 | ||
173 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { | 190 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { |
174 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); | 191 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); |
@@ -189,7 +206,28 @@ static inline void __init overo_init_smsc911x(void) | |||
189 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); | 206 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); |
190 | overo_smsc911x_resources[1].end = 0; | 207 | overo_smsc911x_resources[1].end = 0; |
191 | 208 | ||
192 | platform_device_register(&overo_smsc911x_device); | 209 | /* set up second smsc911x chip */ |
210 | |||
211 | if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) { | ||
212 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n"); | ||
213 | return; | ||
214 | } | ||
215 | |||
216 | overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0; | ||
217 | overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff; | ||
218 | |||
219 | if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) && | ||
220 | (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) { | ||
221 | gpio_export(OVERO_SMSC911X2_GPIO, 0); | ||
222 | } else { | ||
223 | printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n"); | ||
224 | return; | ||
225 | } | ||
226 | |||
227 | overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO); | ||
228 | overo_smsc911x2_resources[1].end = 0; | ||
229 | |||
230 | platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices)); | ||
193 | } | 231 | } |
194 | 232 | ||
195 | #else | 233 | #else |