aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorSteve Glendinning <steve.glendinning@smsc.com>2009-01-23 12:09:13 -0500
committerSteve Glendinning <steve.glendinning@smsc.com>2009-04-02 13:26:17 -0400
commit1c0e147eb6d7037957b5c53a96b82c40b75787c2 (patch)
tree34cccbb29eef50b37ea9a9af2146c3320803c230 /arch/arm/mach-omap2
parentc5142e84f3a39c6396ce2ddde01b1e420a67464a (diff)
arm: convert omap ldp platform to use smsc911x
from 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x, will replace it. so convert omap_ldp to use smsc911x driver. Signed-off-by: Stanley.Miao <stanley.miao@windriver.com> Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-ldp.c47
1 files changed, 29 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
49static struct resource ldp_smc911x_resources[] = { 50static 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
62static struct platform_device ldp_smc911x_device = { 63static 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
70static 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
69static struct platform_device *ldp_devices[] __initdata = { 80static struct platform_device *ldp_devices[] __initdata = {
70 &ldp_smc911x_device, 81 &ldp_smsc911x_device,
71}; 82};
72 83
73static inline void __init ldp_init_smc911x(void) 84static 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
110static struct omap_uart_config ldp_uart_config __initdata = { 121static struct omap_uart_config ldp_uart_config __initdata = {