diff options
author | Sriram <srk@ti.com> | 2009-11-22 13:11:30 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-11-22 13:24:33 -0500 |
commit | 562138a4487191b5bcc0bea591368db7b3d3900a (patch) | |
tree | 7c2231dc7f4b8ef84ed94ce7ec1ca2bc089170c3 /arch/arm/mach-omap2/board-omap3evm.c | |
parent | 1a7ec135d8b263ee0c3ce692e9372a6e4e85e58f (diff) |
omap3evm: MIgrate to smsc911x ethernet driver
Migrate to smsc911x ethernet driver instead of smc911x driver.
The smsc911x ethernet driver supports NAPI and performs better
under heavy traffic. With the smc911x driver we were witnessing
very high iowait time for high IO load over NFS.
Signed-off-by: Sriramakrishnan <srk@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3evm.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index c0336b0cb702..5efc2e9068db 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -22,11 +22,13 @@ | |||
22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
23 | #include <linux/input/matrix_keypad.h> | 23 | #include <linux/input/matrix_keypad.h> |
24 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
25 | #include <linux/interrupt.h> | ||
25 | 26 | ||
26 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
27 | #include <linux/spi/ads7846.h> | 28 | #include <linux/spi/ads7846.h> |
28 | #include <linux/i2c/twl4030.h> | 29 | #include <linux/i2c/twl4030.h> |
29 | #include <linux/usb/otg.h> | 30 | #include <linux/usb/otg.h> |
31 | #include <linux/smsc911x.h> | ||
30 | 32 | ||
31 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
32 | 34 | ||
@@ -52,7 +54,7 @@ | |||
52 | #define OMAP3EVM_ETHR_SIZE 1024 | 54 | #define OMAP3EVM_ETHR_SIZE 1024 |
53 | #define OMAP3EVM_ETHR_ID_REV 0x50 | 55 | #define OMAP3EVM_ETHR_ID_REV 0x50 |
54 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 | 56 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 |
55 | #define OMAP3EVM_SMC911X_CS 5 | 57 | #define OMAP3EVM_SMSC911X_CS 5 |
56 | 58 | ||
57 | static u8 omap3_evm_version; | 59 | static u8 omap3_evm_version; |
58 | 60 | ||
@@ -86,7 +88,8 @@ static void __init omap3_evm_get_revision(void) | |||
86 | } | 88 | } |
87 | } | 89 | } |
88 | 90 | ||
89 | static struct resource omap3evm_smc911x_resources[] = { | 91 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
92 | static struct resource omap3evm_smsc911x_resources[] = { | ||
90 | [0] = { | 93 | [0] = { |
91 | .start = OMAP3EVM_ETHR_START, | 94 | .start = OMAP3EVM_ETHR_START, |
92 | .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1), | 95 | .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1), |
@@ -95,24 +98,34 @@ static struct resource omap3evm_smc911x_resources[] = { | |||
95 | [1] = { | 98 | [1] = { |
96 | .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), | 99 | .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), |
97 | .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), | 100 | .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), |
98 | .flags = IORESOURCE_IRQ, | 101 | .flags = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW), |
99 | }, | 102 | }, |
100 | }; | 103 | }; |
101 | 104 | ||
102 | static struct platform_device omap3evm_smc911x_device = { | 105 | static struct smsc911x_platform_config smsc911x_config = { |
103 | .name = "smc911x", | 106 | .phy_interface = PHY_INTERFACE_MODE_MII, |
107 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
108 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
109 | .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS), | ||
110 | }; | ||
111 | |||
112 | static struct platform_device omap3evm_smsc911x_device = { | ||
113 | .name = "smsc911x", | ||
104 | .id = -1, | 114 | .id = -1, |
105 | .num_resources = ARRAY_SIZE(omap3evm_smc911x_resources), | 115 | .num_resources = ARRAY_SIZE(omap3evm_smsc911x_resources), |
106 | .resource = &omap3evm_smc911x_resources[0], | 116 | .resource = &omap3evm_smsc911x_resources[0], |
117 | .dev = { | ||
118 | .platform_data = &smsc911x_config, | ||
119 | }, | ||
107 | }; | 120 | }; |
108 | 121 | ||
109 | static inline void __init omap3evm_init_smc911x(void) | 122 | static inline void __init omap3evm_init_smsc911x(void) |
110 | { | 123 | { |
111 | int eth_cs; | 124 | int eth_cs; |
112 | struct clk *l3ck; | 125 | struct clk *l3ck; |
113 | unsigned int rate; | 126 | unsigned int rate; |
114 | 127 | ||
115 | eth_cs = OMAP3EVM_SMC911X_CS; | 128 | eth_cs = OMAP3EVM_SMSC911X_CS; |
116 | 129 | ||
117 | l3ck = clk_get(NULL, "l3_ck"); | 130 | l3ck = clk_get(NULL, "l3_ck"); |
118 | if (IS_ERR(l3ck)) | 131 | if (IS_ERR(l3ck)) |
@@ -120,15 +133,20 @@ static inline void __init omap3evm_init_smc911x(void) | |||
120 | else | 133 | else |
121 | rate = clk_get_rate(l3ck); | 134 | rate = clk_get_rate(l3ck); |
122 | 135 | ||
123 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMC911x irq") < 0) { | 136 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { |
124 | printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", | 137 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
125 | OMAP3EVM_ETHR_GPIO_IRQ); | 138 | OMAP3EVM_ETHR_GPIO_IRQ); |
126 | return; | 139 | return; |
127 | } | 140 | } |
128 | 141 | ||
129 | gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ); | 142 | gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ); |
143 | platform_device_register(&omap3evm_smsc911x_device); | ||
130 | } | 144 | } |
131 | 145 | ||
146 | #else | ||
147 | static inline void __init omap3evm_init_smsc911x(void) { return; } | ||
148 | #endif | ||
149 | |||
132 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | 150 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { |
133 | .supply = "vmmc", | 151 | .supply = "vmmc", |
134 | }; | 152 | }; |
@@ -385,12 +403,10 @@ static void __init omap3_evm_init_irq(void) | |||
385 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); | 403 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); |
386 | omap_init_irq(); | 404 | omap_init_irq(); |
387 | omap_gpio_init(); | 405 | omap_gpio_init(); |
388 | omap3evm_init_smc911x(); | ||
389 | } | 406 | } |
390 | 407 | ||
391 | static struct platform_device *omap3_evm_devices[] __initdata = { | 408 | static struct platform_device *omap3_evm_devices[] __initdata = { |
392 | &omap3_evm_lcd_device, | 409 | &omap3_evm_lcd_device, |
393 | &omap3evm_smc911x_device, | ||
394 | }; | 410 | }; |
395 | 411 | ||
396 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 412 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
@@ -447,6 +463,7 @@ static void __init omap3_evm_init(void) | |||
447 | usb_musb_init(); | 463 | usb_musb_init(); |
448 | usb_ehci_init(&ehci_pdata); | 464 | usb_ehci_init(&ehci_pdata); |
449 | ads7846_dev_init(); | 465 | ads7846_dev_init(); |
466 | omap3evm_init_smsc911x(); | ||
450 | } | 467 | } |
451 | 468 | ||
452 | static void __init omap3_evm_map_io(void) | 469 | static void __init omap3_evm_map_io(void) |