linux-omap-psp 2.6.32: update to latest PSP git
[openembedded.git] / recipes / linux / linux-omap-psp-2.6.32 / 0016-ARM-OMAP-Overo-Add-support-for-second-ethernet-port.patch
bloba2d0c6a7f943a939ca108fb1e1f78d1906eb284d
1 From e98c43b693a4893bbe52ed1874e31961d36a4116 Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <sakoman@gmail.com>
3 Date: Tue, 15 Dec 2009 14:59:42 -0800
4 Subject: [PATCH 16/30] ARM: OMAP: Overo: Add support for second ethernet port
6 Signed-off-by: Steve Sakoman <sakoman@gmail.com>
7 ---
8 arch/arm/mach-omap2/board-overo.c | 56 +++++++++++++++++++++++++++++++++++--
9 1 files changed, 53 insertions(+), 3 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
12 index e0aebc3..6204b8c 100644
13 --- a/arch/arm/mach-omap2/board-overo.c
14 +++ b/arch/arm/mach-omap2/board-overo.c
15 @@ -63,6 +63,8 @@
17 #define OVERO_SMSC911X_CS 5
18 #define OVERO_SMSC911X_GPIO 176
19 +#define OVERO_SMSC911X2_CS 4
20 +#define OVERO_SMSC911X2_GPIO 65
22 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
23 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
24 @@ -137,6 +139,16 @@ static struct resource overo_smsc911x_resources[] = {
28 +static struct resource overo_smsc911x2_resources[] = {
29 + {
30 + .name = "smsc911x2-memory",
31 + .flags = IORESOURCE_MEM,
32 + },
33 + {
34 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
35 + },
36 +};
38 static struct smsc911x_platform_config overo_smsc911x_config = {
39 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
40 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
41 @@ -146,7 +158,7 @@ static struct smsc911x_platform_config overo_smsc911x_config = {
43 static struct platform_device overo_smsc911x_device = {
44 .name = "smsc911x",
45 - .id = -1,
46 + .id = 0,
47 .num_resources = ARRAY_SIZE(overo_smsc911x_resources),
48 .resource = overo_smsc911x_resources,
49 .dev = {
50 @@ -154,9 +166,26 @@ static struct platform_device overo_smsc911x_device = {
54 +static struct platform_device overo_smsc911x2_device = {
55 + .name = "smsc911x",
56 + .id = 1,
57 + .num_resources = ARRAY_SIZE(overo_smsc911x2_resources),
58 + .resource = overo_smsc911x2_resources,
59 + .dev = {
60 + .platform_data = &overo_smsc911x_config,
61 + },
62 +};
64 +static struct platform_device *smsc911x_devices[] = {
65 + &overo_smsc911x_device,
66 + &overo_smsc911x2_device,
67 +};
69 static inline void __init overo_init_smsc911x(void)
71 - unsigned long cs_mem_base;
72 + unsigned long cs_mem_base, cs_mem_base2;
74 + /* set up first smsc911x chip */
76 if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
77 printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
78 @@ -177,7 +206,28 @@ static inline void __init overo_init_smsc911x(void)
79 overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
80 overo_smsc911x_resources[1].end = 0;
82 - platform_device_register(&overo_smsc911x_device);
83 + /* set up second smsc911x chip */
85 + if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) {
86 + printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n");
87 + return;
88 + }
90 + overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0;
91 + overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff;
93 + if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) &&
94 + (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) {
95 + gpio_export(OVERO_SMSC911X2_GPIO, 0);
96 + } else {
97 + printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n");
98 + return;
99 + }
101 + overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO);
102 + overo_smsc911x2_resources[1].end = 0;
104 + platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices));
107 #else
109 1.6.6.1