diff options
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/board-ldp.c | 47 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 65 |
2 files changed, 94 insertions, 18 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index e096f776f996..da57b0fcda14 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/spi/ads7846.h> | 23 | #include <linux/spi/ads7846.h> |
24 | #include <linux/i2c/twl4030.h> | 24 | #include <linux/i2c/twl4030.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/smsc911x.h> | ||
26 | 27 | ||
27 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
@@ -41,12 +42,12 @@ | |||
41 | 42 | ||
42 | #include "mmc-twl4030.h" | 43 | #include "mmc-twl4030.h" |
43 | 44 | ||
44 | #define LDP_SMC911X_CS 1 | 45 | #define LDP_SMSC911X_CS 1 |
45 | #define LDP_SMC911X_GPIO 152 | 46 | #define LDP_SMSC911X_GPIO 152 |
46 | #define DEBUG_BASE 0x08000000 | 47 | #define DEBUG_BASE 0x08000000 |
47 | #define LDP_ETHR_START DEBUG_BASE | 48 | #define LDP_ETHR_START DEBUG_BASE |
48 | 49 | ||
49 | static struct resource ldp_smc911x_resources[] = { | 50 | static struct resource ldp_smsc911x_resources[] = { |
50 | [0] = { | 51 | [0] = { |
51 | .start = LDP_ETHR_START, | 52 | .start = LDP_ETHR_START, |
52 | .end = LDP_ETHR_START + SZ_4K, | 53 | .end = LDP_ETHR_START + SZ_4K, |
@@ -59,40 +60,50 @@ static struct resource ldp_smc911x_resources[] = { | |||
59 | }, | 60 | }, |
60 | }; | 61 | }; |
61 | 62 | ||
62 | static struct platform_device ldp_smc911x_device = { | 63 | static struct smsc911x_platform_config ldp_smsc911x_config = { |
63 | .name = "smc911x", | 64 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
65 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
66 | .flags = SMSC911X_USE_32BIT, | ||
67 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
68 | }; | ||
69 | |||
70 | static struct platform_device ldp_smsc911x_device = { | ||
71 | .name = "smsc911x", | ||
64 | .id = -1, | 72 | .id = -1, |
65 | .num_resources = ARRAY_SIZE(ldp_smc911x_resources), | 73 | .num_resources = ARRAY_SIZE(ldp_smsc911x_resources), |
66 | .resource = ldp_smc911x_resources, | 74 | .resource = ldp_smsc911x_resources, |
75 | .dev = { | ||
76 | .platform_data = &ldp_smsc911x_config, | ||
77 | }, | ||
67 | }; | 78 | }; |
68 | 79 | ||
69 | static struct platform_device *ldp_devices[] __initdata = { | 80 | static struct platform_device *ldp_devices[] __initdata = { |
70 | &ldp_smc911x_device, | 81 | &ldp_smsc911x_device, |
71 | }; | 82 | }; |
72 | 83 | ||
73 | static inline void __init ldp_init_smc911x(void) | 84 | static inline void __init ldp_init_smsc911x(void) |
74 | { | 85 | { |
75 | int eth_cs; | 86 | int eth_cs; |
76 | unsigned long cs_mem_base; | 87 | unsigned long cs_mem_base; |
77 | int eth_gpio = 0; | 88 | int eth_gpio = 0; |
78 | 89 | ||
79 | eth_cs = LDP_SMC911X_CS; | 90 | eth_cs = LDP_SMSC911X_CS; |
80 | 91 | ||
81 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { | 92 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { |
82 | printk(KERN_ERR "Failed to request GPMC mem for smc911x\n"); | 93 | printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n"); |
83 | return; | 94 | return; |
84 | } | 95 | } |
85 | 96 | ||
86 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; | 97 | ldp_smsc911x_resources[0].start = cs_mem_base + 0x0; |
87 | ldp_smc911x_resources[0].end = cs_mem_base + 0xff; | 98 | ldp_smsc911x_resources[0].end = cs_mem_base + 0xff; |
88 | udelay(100); | 99 | udelay(100); |
89 | 100 | ||
90 | eth_gpio = LDP_SMC911X_GPIO; | 101 | eth_gpio = LDP_SMSC911X_GPIO; |
91 | 102 | ||
92 | ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); | 103 | ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); |
93 | 104 | ||
94 | if (gpio_request(eth_gpio, "smc911x irq") < 0) { | 105 | if (gpio_request(eth_gpio, "smsc911x irq") < 0) { |
95 | printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", | 106 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
96 | eth_gpio); | 107 | eth_gpio); |
97 | return; | 108 | return; |
98 | } | 109 | } |
@@ -104,7 +115,7 @@ static void __init omap_ldp_init_irq(void) | |||
104 | omap2_init_common_hw(NULL); | 115 | omap2_init_common_hw(NULL); |
105 | omap_init_irq(); | 116 | omap_init_irq(); |
106 | omap_gpio_init(); | 117 | omap_gpio_init(); |
107 | ldp_init_smc911x(); | 118 | ldp_init_smsc911x(); |
108 | } | 119 | } |
109 | 120 | ||
110 | static struct omap_uart_config ldp_uart_config __initdata = { | 121 | static struct omap_uart_config ldp_uart_config __initdata = { |
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) && |