aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-zoom-debugboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-zoom-debugboard.c')
-rw-r--r--arch/arm/mach-omap2/board-zoom-debugboard.c67
1 files changed, 11 insertions, 56 deletions
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index 1d7f827b0408..6402e781c458 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -15,6 +15,9 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16 16
17#include <plat/gpmc.h> 17#include <plat/gpmc.h>
18#include <plat/gpmc-smsc911x.h>
19
20#include <mach/board-zoom.h>
18 21
19#define ZOOM_SMSC911X_CS 7 22#define ZOOM_SMSC911X_CS 7
20#define ZOOM_SMSC911X_GPIO 158 23#define ZOOM_SMSC911X_GPIO 158
@@ -24,60 +27,16 @@
24#define DEBUG_BASE 0x08000000 27#define DEBUG_BASE 0x08000000
25#define ZOOM_ETHR_START DEBUG_BASE 28#define ZOOM_ETHR_START DEBUG_BASE
26 29
27static struct resource zoom_smsc911x_resources[] = { 30static struct omap_smsc911x_platform_data zoom_smsc911x_cfg = {
28 [0] = { 31 .cs = ZOOM_SMSC911X_CS,
29 .start = ZOOM_ETHR_START, 32 .gpio_irq = ZOOM_SMSC911X_GPIO,
30 .end = ZOOM_ETHR_START + SZ_4K, 33 .gpio_reset = -EINVAL,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
35 },
36};
37
38static struct smsc911x_platform_config zoom_smsc911x_config = {
39 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
40 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
41 .flags = SMSC911X_USE_32BIT, 34 .flags = SMSC911X_USE_32BIT,
42 .phy_interface = PHY_INTERFACE_MODE_MII,
43};
44
45static struct platform_device zoom_smsc911x_device = {
46 .name = "smsc911x",
47 .id = -1,
48 .num_resources = ARRAY_SIZE(zoom_smsc911x_resources),
49 .resource = zoom_smsc911x_resources,
50 .dev = {
51 .platform_data = &zoom_smsc911x_config,
52 },
53}; 35};
54 36
55static inline void __init zoom_init_smsc911x(void) 37static inline void __init zoom_init_smsc911x(void)
56{ 38{
57 int eth_cs; 39 gpmc_smsc911x_init(&zoom_smsc911x_cfg);
58 unsigned long cs_mem_base;
59 int eth_gpio = 0;
60
61 eth_cs = ZOOM_SMSC911X_CS;
62
63 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
64 printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
65 return;
66 }
67
68 zoom_smsc911x_resources[0].start = cs_mem_base + 0x0;
69 zoom_smsc911x_resources[0].end = cs_mem_base + 0xff;
70
71 eth_gpio = ZOOM_SMSC911X_GPIO;
72
73 zoom_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
74
75 if (gpio_request(eth_gpio, "smsc911x irq") < 0) {
76 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
77 eth_gpio);
78 return;
79 }
80 gpio_direction_input(eth_gpio);
81} 40}
82 41
83static struct plat_serial8250_port serial_platform_data[] = { 42static struct plat_serial8250_port serial_platform_data[] = {
@@ -118,12 +77,9 @@ static inline void __init zoom_init_quaduart(void)
118 77
119 quart_gpio = ZOOM_QUADUART_GPIO; 78 quart_gpio = ZOOM_QUADUART_GPIO;
120 79
121 if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) { 80 if (gpio_request_one(quart_gpio, GPIOF_IN, "TL16CP754C GPIO") < 0)
122 printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n", 81 printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n",
123 quart_gpio); 82 quart_gpio);
124 return;
125 }
126 gpio_direction_input(quart_gpio);
127} 83}
128 84
129static inline int omap_zoom_debugboard_detect(void) 85static inline int omap_zoom_debugboard_detect(void)
@@ -133,12 +89,12 @@ static inline int omap_zoom_debugboard_detect(void)
133 89
134 debug_board_detect = ZOOM_SMSC911X_GPIO; 90 debug_board_detect = ZOOM_SMSC911X_GPIO;
135 91
136 if (gpio_request(debug_board_detect, "Zoom debug board detect") < 0) { 92 if (gpio_request_one(debug_board_detect, GPIOF_IN,
93 "Zoom debug board detect") < 0) {
137 printk(KERN_ERR "Failed to request GPIO%d for Zoom debug" 94 printk(KERN_ERR "Failed to request GPIO%d for Zoom debug"
138 "board detect\n", debug_board_detect); 95 "board detect\n", debug_board_detect);
139 return 0; 96 return 0;
140 } 97 }
141 gpio_direction_input(debug_board_detect);
142 98
143 if (!gpio_get_value(debug_board_detect)) { 99 if (!gpio_get_value(debug_board_detect)) {
144 ret = 0; 100 ret = 0;
@@ -148,7 +104,6 @@ static inline int omap_zoom_debugboard_detect(void)
148} 104}
149 105
150static struct platform_device *zoom_devices[] __initdata = { 106static struct platform_device *zoom_devices[] __initdata = {
151 &zoom_smsc911x_device,
152 &zoom_debugboard_serial_device, 107 &zoom_debugboard_serial_device,
153}; 108};
154 109