diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-ldp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-ldp.c | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index f6a13451d1fd..da57b0fcda14 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -22,31 +22,35 @@ | |||
22 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
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> | ||
26 | #include <linux/smsc911x.h> | ||
25 | 27 | ||
26 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
27 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
28 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
29 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
30 | 32 | ||
31 | #include <mach/board-ldp.h> | ||
32 | #include <mach/mcspi.h> | 33 | #include <mach/mcspi.h> |
33 | #include <mach/gpio.h> | 34 | #include <mach/gpio.h> |
34 | #include <mach/board.h> | 35 | #include <mach/board.h> |
35 | #include <mach/common.h> | 36 | #include <mach/common.h> |
36 | #include <mach/gpmc.h> | 37 | #include <mach/gpmc.h> |
37 | 38 | ||
38 | #include <asm/io.h> | ||
39 | #include <asm/delay.h> | 39 | #include <asm/delay.h> |
40 | #include <mach/control.h> | 40 | #include <mach/control.h> |
41 | #include <mach/usb.h> | ||
41 | 42 | ||
42 | #include "mmc-twl4030.h" | 43 | #include "mmc-twl4030.h" |
43 | 44 | ||
44 | #define SDP3430_SMC91X_CS 3 | 45 | #define LDP_SMSC911X_CS 1 |
46 | #define LDP_SMSC911X_GPIO 152 | ||
47 | #define DEBUG_BASE 0x08000000 | ||
48 | #define LDP_ETHR_START DEBUG_BASE | ||
45 | 49 | ||
46 | static struct resource ldp_smc911x_resources[] = { | 50 | static struct resource ldp_smsc911x_resources[] = { |
47 | [0] = { | 51 | [0] = { |
48 | .start = OMAP34XX_ETHR_START, | 52 | .start = LDP_ETHR_START, |
49 | .end = OMAP34XX_ETHR_START + SZ_4K, | 53 | .end = LDP_ETHR_START + SZ_4K, |
50 | .flags = IORESOURCE_MEM, | 54 | .flags = IORESOURCE_MEM, |
51 | }, | 55 | }, |
52 | [1] = { | 56 | [1] = { |
@@ -56,40 +60,50 @@ static struct resource ldp_smc911x_resources[] = { | |||
56 | }, | 60 | }, |
57 | }; | 61 | }; |
58 | 62 | ||
59 | static struct platform_device ldp_smc911x_device = { | 63 | static struct smsc911x_platform_config ldp_smsc911x_config = { |
60 | .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", | ||
61 | .id = -1, | 72 | .id = -1, |
62 | .num_resources = ARRAY_SIZE(ldp_smc911x_resources), | 73 | .num_resources = ARRAY_SIZE(ldp_smsc911x_resources), |
63 | .resource = ldp_smc911x_resources, | 74 | .resource = ldp_smsc911x_resources, |
75 | .dev = { | ||
76 | .platform_data = &ldp_smsc911x_config, | ||
77 | }, | ||
64 | }; | 78 | }; |
65 | 79 | ||
66 | static struct platform_device *ldp_devices[] __initdata = { | 80 | static struct platform_device *ldp_devices[] __initdata = { |
67 | &ldp_smc911x_device, | 81 | &ldp_smsc911x_device, |
68 | }; | 82 | }; |
69 | 83 | ||
70 | static inline void __init ldp_init_smc911x(void) | 84 | static inline void __init ldp_init_smsc911x(void) |
71 | { | 85 | { |
72 | int eth_cs; | 86 | int eth_cs; |
73 | unsigned long cs_mem_base; | 87 | unsigned long cs_mem_base; |
74 | int eth_gpio = 0; | 88 | int eth_gpio = 0; |
75 | 89 | ||
76 | eth_cs = LDP_SMC911X_CS; | 90 | eth_cs = LDP_SMSC911X_CS; |
77 | 91 | ||
78 | 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) { |
79 | printk(KERN_ERR "Failed to request GPMC mem for smc911x\n"); | 93 | printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n"); |
80 | return; | 94 | return; |
81 | } | 95 | } |
82 | 96 | ||
83 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; | 97 | ldp_smsc911x_resources[0].start = cs_mem_base + 0x0; |
84 | ldp_smc911x_resources[0].end = cs_mem_base + 0xf; | 98 | ldp_smsc911x_resources[0].end = cs_mem_base + 0xff; |
85 | udelay(100); | 99 | udelay(100); |
86 | 100 | ||
87 | eth_gpio = LDP_SMC911X_GPIO; | 101 | eth_gpio = LDP_SMSC911X_GPIO; |
88 | 102 | ||
89 | ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); | 103 | ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); |
90 | 104 | ||
91 | if (gpio_request(eth_gpio, "smc911x irq") < 0) { | 105 | if (gpio_request(eth_gpio, "smsc911x irq") < 0) { |
92 | 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", |
93 | eth_gpio); | 107 | eth_gpio); |
94 | return; | 108 | return; |
95 | } | 109 | } |
@@ -98,10 +112,10 @@ static inline void __init ldp_init_smc911x(void) | |||
98 | 112 | ||
99 | static void __init omap_ldp_init_irq(void) | 113 | static void __init omap_ldp_init_irq(void) |
100 | { | 114 | { |
101 | omap2_init_common_hw(); | 115 | omap2_init_common_hw(NULL); |
102 | omap_init_irq(); | 116 | omap_init_irq(); |
103 | omap_gpio_init(); | 117 | omap_gpio_init(); |
104 | ldp_init_smc911x(); | 118 | ldp_init_smsc911x(); |
105 | } | 119 | } |
106 | 120 | ||
107 | static struct omap_uart_config ldp_uart_config __initdata = { | 121 | static struct omap_uart_config ldp_uart_config __initdata = { |
@@ -162,6 +176,7 @@ static void __init omap_ldp_init(void) | |||
162 | omap_board_config_size = ARRAY_SIZE(ldp_config); | 176 | omap_board_config_size = ARRAY_SIZE(ldp_config); |
163 | omap_serial_init(); | 177 | omap_serial_init(); |
164 | twl4030_mmc_init(mmc); | 178 | twl4030_mmc_init(mmc); |
179 | usb_musb_init(); | ||
165 | } | 180 | } |
166 | 181 | ||
167 | static void __init omap_ldp_map_io(void) | 182 | static void __init omap_ldp_map_io(void) |