aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-11-29 10:44:55 -0500
committerArnd Bergmann <arnd@arndb.de>2011-11-29 10:44:55 -0500
commited20178d6266e0b9c9370e6862ac1eadadb8b321 (patch)
tree91cd87e854b53e43c6ec288d1e4dfc261fbbb677
parentd28bdfc5c80fb64bf50824920bf9b554732dec74 (diff)
parentc220f8cd01198552a616c4216f2a8e719fdb5fd9 (diff)
Merge branch 'drivers/macb-gem-cleanup' into at91/gpio
-rw-r--r--arch/arm/mach-at91/at91cap9.c4
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c6
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9260.c4
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9263.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c4
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c6
-rw-r--r--arch/arm/mach-at91/board-1arm.c2
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c2
-rw-r--r--arch/arm/mach-at91/board-cam60.c2
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c2
-rw-r--r--arch/arm/mach-at91/board-carmeva.c2
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c2
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c2
-rw-r--r--arch/arm/mach-at91/board-csb337.c2
-rw-r--r--arch/arm/mach-at91/board-csb637.c2
-rw-r--r--arch/arm/mach-at91/board-eb9200.c2
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c2
-rw-r--r--arch/arm/mach-at91/board-eco920.c2
-rw-r--r--arch/arm/mach-at91/board-foxg20.c2
-rw-r--r--arch/arm/mach-at91/board-gsia18s.c2
-rw-r--r--arch/arm/mach-at91/board-kafa.c2
-rw-r--r--arch/arm/mach-at91/board-kb9202.c2
-rw-r--r--arch/arm/mach-at91/board-neocore926.c2
-rw-r--r--arch/arm/mach-at91/board-pcontrol-g20.c2
-rw-r--r--arch/arm/mach-at91/board-picotux200.c2
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c2
-rw-r--r--arch/arm/mach-at91/board-rsi-ews.c2
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c2
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c2
-rw-r--r--arch/arm/mach-at91/board-snapper9260.c2
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c2
-rw-r--r--arch/arm/mach-at91/board-usb-a926x.c2
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c2
-rw-r--r--arch/arm/mach-at91/include/mach/board.h14
-rw-r--r--arch/avr32/boards/atngw100/setup.c2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c2
-rw-r--r--arch/avr32/boards/favr-32/setup.c2
-rw-r--r--arch/avr32/boards/hammerhead/setup.c2
-rw-r--r--arch/avr32/boards/merisc/setup.c2
-rw-r--r--arch/avr32/boards/mimc200/setup.c2
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c8
-rw-r--r--arch/avr32/mach-at32ap/include/mach/board.h7
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.c3
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.h4
-rw-r--r--drivers/net/ethernet/cadence/macb.c153
-rw-r--r--include/linux/platform_data/macb.h17
54 files changed, 157 insertions, 171 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 652dbe1c9cef..dcfa8af845ab 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -136,7 +136,7 @@ static struct clk pwm_clk = {
136 .type = CLK_TYPE_PERIPHERAL, 136 .type = CLK_TYPE_PERIPHERAL,
137}; 137};
138static struct clk macb_clk = { 138static struct clk macb_clk = {
139 .name = "macb_clk", 139 .name = "pclk",
140 .pmc_mask = 1 << AT91CAP9_ID_EMAC, 140 .pmc_mask = 1 << AT91CAP9_ID_EMAC,
141 .type = CLK_TYPE_PERIPHERAL, 141 .type = CLK_TYPE_PERIPHERAL,
142}; 142};
@@ -209,6 +209,8 @@ static struct clk *periph_clocks[] __initdata = {
209}; 209};
210 210
211static struct clk_lookup periph_clocks_lookups[] = { 211static struct clk_lookup periph_clocks_lookups[] = {
212 /* One additional fake clock for macb_hclk */
213 CLKDEV_CON_ID("hclk", &macb_clk),
212 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), 214 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
213 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), 215 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
214 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), 216 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index 19975cfb00cd..3f54eca3fca6 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -200,7 +200,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
200 200
201#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 201#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
202static u64 eth_dmamask = DMA_BIT_MASK(32); 202static u64 eth_dmamask = DMA_BIT_MASK(32);
203static struct at91_eth_data eth_data; 203static struct macb_platform_data eth_data;
204 204
205static struct resource eth_resources[] = { 205static struct resource eth_resources[] = {
206 [0] = { 206 [0] = {
@@ -227,7 +227,7 @@ static struct platform_device at91cap9_eth_device = {
227 .num_resources = ARRAY_SIZE(eth_resources), 227 .num_resources = ARRAY_SIZE(eth_resources),
228}; 228};
229 229
230void __init at91_add_device_eth(struct at91_eth_data *data) 230void __init at91_add_device_eth(struct macb_platform_data *data)
231{ 231{
232 if (!data) 232 if (!data)
233 return; 233 return;
@@ -264,7 +264,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
264 platform_device_register(&at91cap9_eth_device); 264 platform_device_register(&at91cap9_eth_device);
265} 265}
266#else 266#else
267void __init at91_add_device_eth(struct at91_eth_data *data) {} 267void __init at91_add_device_eth(struct macb_platform_data *data) {}
268#endif 268#endif
269 269
270 270
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index ba4fefe60f62..cb2244086113 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -135,7 +135,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
135 135
136#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE) 136#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
137static u64 eth_dmamask = DMA_BIT_MASK(32); 137static u64 eth_dmamask = DMA_BIT_MASK(32);
138static struct at91_eth_data eth_data; 138static struct macb_platform_data eth_data;
139 139
140static struct resource eth_resources[] = { 140static struct resource eth_resources[] = {
141 [0] = { 141 [0] = {
@@ -162,7 +162,7 @@ static struct platform_device at91rm9200_eth_device = {
162 .num_resources = ARRAY_SIZE(eth_resources), 162 .num_resources = ARRAY_SIZE(eth_resources),
163}; 163};
164 164
165void __init at91_add_device_eth(struct at91_eth_data *data) 165void __init at91_add_device_eth(struct macb_platform_data *data)
166{ 166{
167 if (!data) 167 if (!data)
168 return; 168 return;
@@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
199 platform_device_register(&at91rm9200_eth_device); 199 platform_device_register(&at91rm9200_eth_device);
200} 200}
201#else 201#else
202void __init at91_add_device_eth(struct at91_eth_data *data) {} 202void __init at91_add_device_eth(struct macb_platform_data *data) {}
203#endif 203#endif
204 204
205 205
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 5a17a23724c2..e94cc2268461 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -119,7 +119,7 @@ static struct clk ohci_clk = {
119 .type = CLK_TYPE_PERIPHERAL, 119 .type = CLK_TYPE_PERIPHERAL,
120}; 120};
121static struct clk macb_clk = { 121static struct clk macb_clk = {
122 .name = "macb_clk", 122 .name = "pclk",
123 .pmc_mask = 1 << AT91SAM9260_ID_EMAC, 123 .pmc_mask = 1 << AT91SAM9260_ID_EMAC,
124 .type = CLK_TYPE_PERIPHERAL, 124 .type = CLK_TYPE_PERIPHERAL,
125}; 125};
@@ -189,6 +189,8 @@ static struct clk *periph_clocks[] __initdata = {
189}; 189};
190 190
191static struct clk_lookup periph_clocks_lookups[] = { 191static struct clk_lookup periph_clocks_lookups[] = {
192 /* One additional fake clock for macb_hclk */
193 CLKDEV_CON_ID("hclk", &macb_clk),
192 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), 194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 195 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
194 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), 196 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 5b424fcc9c8c..f6d8ccf42a8d 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -136,7 +136,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
136 136
137#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 137#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
138static u64 eth_dmamask = DMA_BIT_MASK(32); 138static u64 eth_dmamask = DMA_BIT_MASK(32);
139static struct at91_eth_data eth_data; 139static struct macb_platform_data eth_data;
140 140
141static struct resource eth_resources[] = { 141static struct resource eth_resources[] = {
142 [0] = { 142 [0] = {
@@ -163,7 +163,7 @@ static struct platform_device at91sam9260_eth_device = {
163 .num_resources = ARRAY_SIZE(eth_resources), 163 .num_resources = ARRAY_SIZE(eth_resources),
164}; 164};
165 165
166void __init at91_add_device_eth(struct at91_eth_data *data) 166void __init at91_add_device_eth(struct macb_platform_data *data)
167{ 167{
168 if (!data) 168 if (!data)
169 return; 169 return;
@@ -200,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
200 platform_device_register(&at91sam9260_eth_device); 200 platform_device_register(&at91sam9260_eth_device);
201} 201}
202#else 202#else
203void __init at91_add_device_eth(struct at91_eth_data *data) {} 203void __init at91_add_device_eth(struct macb_platform_data *data) {}
204#endif 204#endif
205 205
206 206
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 2a42b99d99d1..5c14b22928a8 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -117,7 +117,7 @@ static struct clk pwm_clk = {
117 .type = CLK_TYPE_PERIPHERAL, 117 .type = CLK_TYPE_PERIPHERAL,
118}; 118};
119static struct clk macb_clk = { 119static struct clk macb_clk = {
120 .name = "macb_clk", 120 .name = "pclk",
121 .pmc_mask = 1 << AT91SAM9263_ID_EMAC, 121 .pmc_mask = 1 << AT91SAM9263_ID_EMAC,
122 .type = CLK_TYPE_PERIPHERAL, 122 .type = CLK_TYPE_PERIPHERAL,
123}; 123};
@@ -181,6 +181,8 @@ static struct clk *periph_clocks[] __initdata = {
181}; 181};
182 182
183static struct clk_lookup periph_clocks_lookups[] = { 183static struct clk_lookup periph_clocks_lookups[] = {
184 /* One additional fake clock for macb_hclk */
185 CLKDEV_CON_ID("hclk", &macb_clk),
184 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 186 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
185 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 187 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
186 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), 188 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 20e681c6b404..b344ec8a9af2 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -144,7 +144,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
144 144
145#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 145#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
146static u64 eth_dmamask = DMA_BIT_MASK(32); 146static u64 eth_dmamask = DMA_BIT_MASK(32);
147static struct at91_eth_data eth_data; 147static struct macb_platform_data eth_data;
148 148
149static struct resource eth_resources[] = { 149static struct resource eth_resources[] = {
150 [0] = { 150 [0] = {
@@ -171,7 +171,7 @@ static struct platform_device at91sam9263_eth_device = {
171 .num_resources = ARRAY_SIZE(eth_resources), 171 .num_resources = ARRAY_SIZE(eth_resources),
172}; 172};
173 173
174void __init at91_add_device_eth(struct at91_eth_data *data) 174void __init at91_add_device_eth(struct macb_platform_data *data)
175{ 175{
176 if (!data) 176 if (!data)
177 return; 177 return;
@@ -208,7 +208,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
208 platform_device_register(&at91sam9263_eth_device); 208 platform_device_register(&at91sam9263_eth_device);
209} 209}
210#else 210#else
211void __init at91_add_device_eth(struct at91_eth_data *data) {} 211void __init at91_add_device_eth(struct macb_platform_data *data) {}
212#endif 212#endif
213 213
214 214
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 7fdf964f6c3a..c0c9fa7b73f0 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -149,7 +149,7 @@ static struct clk ac97_clk = {
149 .type = CLK_TYPE_PERIPHERAL, 149 .type = CLK_TYPE_PERIPHERAL,
150}; 150};
151static struct clk macb_clk = { 151static struct clk macb_clk = {
152 .name = "macb_clk", 152 .name = "pclk",
153 .pmc_mask = 1 << AT91SAM9G45_ID_EMAC, 153 .pmc_mask = 1 << AT91SAM9G45_ID_EMAC,
154 .type = CLK_TYPE_PERIPHERAL, 154 .type = CLK_TYPE_PERIPHERAL,
155}; 155};
@@ -208,6 +208,8 @@ static struct clk *periph_clocks[] __initdata = {
208}; 208};
209 209
210static struct clk_lookup periph_clocks_lookups[] = { 210static struct clk_lookup periph_clocks_lookups[] = {
211 /* One additional fake clock for macb_hclk */
212 CLKDEV_CON_ID("hclk", &macb_clk),
211 /* One additional fake clock for ohci */ 213 /* One additional fake clock for ohci */
212 CLKDEV_CON_ID("ohci_clk", &uhphs_clk), 214 CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
213 CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk), 215 CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 2c64e01bbd13..fc3eb4d9c5c9 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -284,7 +284,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
284 284
285#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 285#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
286static u64 eth_dmamask = DMA_BIT_MASK(32); 286static u64 eth_dmamask = DMA_BIT_MASK(32);
287static struct at91_eth_data eth_data; 287static struct macb_platform_data eth_data;
288 288
289static struct resource eth_resources[] = { 289static struct resource eth_resources[] = {
290 [0] = { 290 [0] = {
@@ -311,7 +311,7 @@ static struct platform_device at91sam9g45_eth_device = {
311 .num_resources = ARRAY_SIZE(eth_resources), 311 .num_resources = ARRAY_SIZE(eth_resources),
312}; 312};
313 313
314void __init at91_add_device_eth(struct at91_eth_data *data) 314void __init at91_add_device_eth(struct macb_platform_data *data)
315{ 315{
316 if (!data) 316 if (!data)
317 return; 317 return;
@@ -348,7 +348,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
348 platform_device_register(&at91sam9g45_eth_device); 348 platform_device_register(&at91sam9g45_eth_device);
349} 349}
350#else 350#else
351void __init at91_add_device_eth(struct at91_eth_data *data) {} 351void __init at91_add_device_eth(struct macb_platform_data *data) {}
352#endif 352#endif
353 353
354 354
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index 367d5cd5e362..a60d98d7c3e2 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -63,7 +63,7 @@ static void __init onearm_init_early(void)
63 at91_set_serial_console(0); 63 at91_set_serial_console(0);
64} 64}
65 65
66static struct at91_eth_data __initdata onearm_eth_data = { 66static struct macb_platform_data __initdata onearm_eth_data = {
67 .phy_irq_pin = AT91_PIN_PC4, 67 .phy_irq_pin = AT91_PIN_PC4,
68 .is_rmii = 1, 68 .is_rmii = 1,
69}; 69};
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index 4282d96dffa8..17fc77925707 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -103,7 +103,7 @@ static struct spi_board_info afeb9260_spi_devices[] = {
103/* 103/*
104 * MACB Ethernet device 104 * MACB Ethernet device
105 */ 105 */
106static struct at91_eth_data __initdata afeb9260_macb_data = { 106static struct macb_platform_data __initdata afeb9260_macb_data = {
107 .phy_irq_pin = AT91_PIN_PA9, 107 .phy_irq_pin = AT91_PIN_PA9,
108 .is_rmii = 0, 108 .is_rmii = 0,
109}; 109};
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 02ded92de5b7..18c90c454079 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -115,7 +115,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = {
115/* 115/*
116 * MACB Ethernet device 116 * MACB Ethernet device
117 */ 117 */
118static struct __initdata at91_eth_data cam60_macb_data = { 118static struct __initdata macb_platform_data cam60_macb_data = {
119 .phy_irq_pin = AT91_PIN_PB5, 119 .phy_irq_pin = AT91_PIN_PB5,
120 .is_rmii = 0, 120 .is_rmii = 0,
121}; 121};
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index da2616f20e10..14d1d0556638 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -153,7 +153,7 @@ static struct at91_mmc_data __initdata cap9adk_mmc_data = {
153/* 153/*
154 * MACB Ethernet device 154 * MACB Ethernet device
155 */ 155 */
156static struct at91_eth_data __initdata cap9adk_macb_data = { 156static struct macb_platform_data __initdata cap9adk_macb_data = {
157 .is_rmii = 1, 157 .is_rmii = 1,
158}; 158};
159 159
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index 774c87fcbd5b..529b356cdb7d 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -57,7 +57,7 @@ static void __init carmeva_init_early(void)
57 at91_set_serial_console(0); 57 at91_set_serial_console(0);
58} 58}
59 59
60static struct at91_eth_data __initdata carmeva_eth_data = { 60static struct macb_platform_data __initdata carmeva_eth_data = {
61 .phy_irq_pin = AT91_PIN_PC4, 61 .phy_irq_pin = AT91_PIN_PC4,
62 .is_rmii = 1, 62 .is_rmii = 1,
63}; 63};
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index 7dd752e32e2a..5b55525e2966 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -99,7 +99,7 @@ static struct at91_udc_data __initdata cpu9krea_udc_data = {
99/* 99/*
100 * MACB Ethernet device 100 * MACB Ethernet device
101 */ 101 */
102static struct at91_eth_data __initdata cpu9krea_macb_data = { 102static struct macb_platform_data __initdata cpu9krea_macb_data = {
103 .is_rmii = 1, 103 .is_rmii = 1,
104}; 104};
105 105
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index d35e65b08ccd..7a4c82e8da51 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -82,7 +82,7 @@ static void __init cpuat91_init_early(void)
82 at91_set_serial_console(0); 82 at91_set_serial_console(0);
83} 83}
84 84
85static struct at91_eth_data __initdata cpuat91_eth_data = { 85static struct macb_platform_data __initdata cpuat91_eth_data = {
86 .is_rmii = 1, 86 .is_rmii = 1,
87}; 87};
88 88
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index c3936665e645..b004b20b8e42 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -58,7 +58,7 @@ static void __init csb337_init_early(void)
58 at91_set_serial_console(0); 58 at91_set_serial_console(0);
59} 59}
60 60
61static struct at91_eth_data __initdata csb337_eth_data = { 61static struct macb_platform_data __initdata csb337_eth_data = {
62 .phy_irq_pin = AT91_PIN_PC2, 62 .phy_irq_pin = AT91_PIN_PC2,
63 .is_rmii = 0, 63 .is_rmii = 0,
64}; 64};
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index 586100e2acbb..e966de5219c7 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -52,7 +52,7 @@ static void __init csb637_init_early(void)
52 at91_set_serial_console(0); 52 at91_set_serial_console(0);
53} 53}
54 54
55static struct at91_eth_data __initdata csb637_eth_data = { 55static struct macb_platform_data __initdata csb637_eth_data = {
56 .phy_irq_pin = AT91_PIN_PC0, 56 .phy_irq_pin = AT91_PIN_PC0,
57 .is_rmii = 0, 57 .is_rmii = 0,
58}; 58};
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index 45db7a3dbef0..3788fa527121 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -60,7 +60,7 @@ static void __init eb9200_init_early(void)
60 at91_set_serial_console(0); 60 at91_set_serial_console(0);
61} 61}
62 62
63static struct at91_eth_data __initdata eb9200_eth_data = { 63static struct macb_platform_data __initdata eb9200_eth_data = {
64 .phy_irq_pin = AT91_PIN_PC4, 64 .phy_irq_pin = AT91_PIN_PC4,
65 .is_rmii = 1, 65 .is_rmii = 1,
66}; 66};
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index 2f9c16d29212..af7622eae1a9 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -64,7 +64,7 @@ static void __init ecb_at91init_early(void)
64 at91_set_serial_console(0); 64 at91_set_serial_console(0);
65} 65}
66 66
67static struct at91_eth_data __initdata ecb_at91eth_data = { 67static struct macb_platform_data __initdata ecb_at91eth_data = {
68 .phy_irq_pin = AT91_PIN_PC4, 68 .phy_irq_pin = AT91_PIN_PC4,
69 .is_rmii = 0, 69 .is_rmii = 0,
70}; 70};
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 8252c722607b..8e75867d1d18 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -47,7 +47,7 @@ static void __init eco920_init_early(void)
47 at91_set_serial_console(0); 47 at91_set_serial_console(0);
48} 48}
49 49
50static struct at91_eth_data __initdata eco920_eth_data = { 50static struct macb_platform_data __initdata eco920_eth_data = {
51 .phy_irq_pin = AT91_PIN_PC2, 51 .phy_irq_pin = AT91_PIN_PC2,
52 .is_rmii = 1, 52 .is_rmii = 1,
53}; 53};
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index f27d1a780cfa..de8e09642f4e 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -135,7 +135,7 @@ static struct spi_board_info foxg20_spi_devices[] = {
135/* 135/*
136 * MACB Ethernet device 136 * MACB Ethernet device
137 */ 137 */
138static struct at91_eth_data __initdata foxg20_macb_data = { 138static struct macb_platform_data __initdata foxg20_macb_data = {
139 .phy_irq_pin = AT91_PIN_PA7, 139 .phy_irq_pin = AT91_PIN_PA7,
140 .is_rmii = 1, 140 .is_rmii = 1,
141}; 141};
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index 2e95949737e6..51c82f151119 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -93,7 +93,7 @@ static struct at91_udc_data __initdata udc_data = {
93/* 93/*
94 * MACB Ethernet device 94 * MACB Ethernet device
95 */ 95 */
96static struct at91_eth_data __initdata macb_data = { 96static struct macb_platform_data __initdata macb_data = {
97 .phy_irq_pin = AT91_PIN_PA28, 97 .phy_irq_pin = AT91_PIN_PA28,
98 .is_rmii = 1, 98 .is_rmii = 1,
99}; 99};
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index 3bae73e63633..9628a3defcf4 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -61,7 +61,7 @@ static void __init kafa_init_early(void)
61 at91_set_serial_console(0); 61 at91_set_serial_console(0);
62} 62}
63 63
64static struct at91_eth_data __initdata kafa_eth_data = { 64static struct macb_platform_data __initdata kafa_eth_data = {
65 .phy_irq_pin = AT91_PIN_PC4, 65 .phy_irq_pin = AT91_PIN_PC4,
66 .is_rmii = 0, 66 .is_rmii = 0,
67}; 67};
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index e61351ffad50..5ba5244cb632 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -69,7 +69,7 @@ static void __init kb9202_init_early(void)
69 at91_set_serial_console(0); 69 at91_set_serial_console(0);
70} 70}
71 71
72static struct at91_eth_data __initdata kb9202_eth_data = { 72static struct macb_platform_data __initdata kb9202_eth_data = {
73 .phy_irq_pin = AT91_PIN_PB29, 73 .phy_irq_pin = AT91_PIN_PB29,
74 .is_rmii = 0, 74 .is_rmii = 0,
75}; 75};
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index a9b9adc78c1d..7d24d84f5d50 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -155,7 +155,7 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = {
155/* 155/*
156 * MACB Ethernet device 156 * MACB Ethernet device
157 */ 157 */
158static struct at91_eth_data __initdata neocore926_macb_data = { 158static struct macb_platform_data __initdata neocore926_macb_data = {
159 .phy_irq_pin = AT91_PIN_PE31, 159 .phy_irq_pin = AT91_PIN_PE31,
160 .is_rmii = 1, 160 .is_rmii = 1,
161}; 161};
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 0e3c632d30eb..9a6e02163950 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -122,7 +122,7 @@ static struct at91_udc_data __initdata pcontrol_g20_udc_data = {
122/* 122/*
123 * MACB Ethernet device 123 * MACB Ethernet device
124 */ 124 */
125static struct at91_eth_data __initdata macb_data = { 125static struct macb_platform_data __initdata macb_data = {
126 .phy_irq_pin = AT91_PIN_PA28, 126 .phy_irq_pin = AT91_PIN_PA28,
127 .is_rmii = 1, 127 .is_rmii = 1,
128}; 128};
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 0a8fe6a1b7c8..dc18759a24b4 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -60,7 +60,7 @@ static void __init picotux200_init_early(void)
60 at91_set_serial_console(0); 60 at91_set_serial_console(0);
61} 61}
62 62
63static struct at91_eth_data __initdata picotux200_eth_data = { 63static struct macb_platform_data __initdata picotux200_eth_data = {
64 .phy_irq_pin = AT91_PIN_PC4, 64 .phy_irq_pin = AT91_PIN_PC4,
65 .is_rmii = 1, 65 .is_rmii = 1,
66}; 66};
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index 6eb0c9359866..04be42798128 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -104,7 +104,7 @@ static struct spi_board_info ek_spi_devices[] = {
104/* 104/*
105 * MACB Ethernet device 105 * MACB Ethernet device
106 */ 106 */
107static struct at91_eth_data __initdata ek_macb_data = { 107static struct macb_platform_data __initdata ek_macb_data = {
108 .phy_irq_pin = AT91_PIN_PA31, 108 .phy_irq_pin = AT91_PIN_PA31,
109 .is_rmii = 1, 109 .is_rmii = 1,
110}; 110};
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index 80a8c9c6e922..022d0cebda9d 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -65,7 +65,7 @@ static void __init dk_init_early(void)
65 at91_set_serial_console(0); 65 at91_set_serial_console(0);
66} 66}
67 67
68static struct at91_eth_data __initdata dk_eth_data = { 68static struct macb_platform_data __initdata dk_eth_data = {
69 .phy_irq_pin = AT91_PIN_PC4, 69 .phy_irq_pin = AT91_PIN_PC4,
70 .is_rmii = 1, 70 .is_rmii = 1,
71}; 71};
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 99fd7f8aee0e..ed275861adef 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -65,7 +65,7 @@ static void __init ek_init_early(void)
65 at91_set_serial_console(0); 65 at91_set_serial_console(0);
66} 66}
67 67
68static struct at91_eth_data __initdata ek_eth_data = { 68static struct macb_platform_data __initdata ek_eth_data = {
69 .phy_irq_pin = AT91_PIN_PC4, 69 .phy_irq_pin = AT91_PIN_PC4,
70 .is_rmii = 1, 70 .is_rmii = 1,
71}; 71};
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c
index e927df0175df..ed3b21f77674 100644
--- a/arch/arm/mach-at91/board-rsi-ews.c
+++ b/arch/arm/mach-at91/board-rsi-ews.c
@@ -60,7 +60,7 @@ static void __init rsi_ews_init_early(void)
60/* 60/*
61 * Ethernet 61 * Ethernet
62 */ 62 */
63static struct at91_eth_data rsi_ews_eth_data __initdata = { 63static struct macb_platform_data rsi_ews_eth_data __initdata = {
64 .phy_irq_pin = AT91_PIN_PC4, 64 .phy_irq_pin = AT91_PIN_PC4,
65 .is_rmii = 1, 65 .is_rmii = 1,
66}; 66};
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index e0283c57f467..1e1834b2b4c3 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -109,7 +109,7 @@ static struct spi_board_info ek_spi_devices[] = {
109/* 109/*
110 * MACB Ethernet device 110 * MACB Ethernet device
111 */ 111 */
112static struct at91_eth_data __initdata ek_macb_data = { 112static struct macb_platform_data __initdata ek_macb_data = {
113 .phy_irq_pin = AT91_PIN_PA7, 113 .phy_irq_pin = AT91_PIN_PA7,
114 .is_rmii = 0, 114 .is_rmii = 0,
115}; 115};
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 00db0f8e34b6..e1b250ed0ca8 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -151,7 +151,7 @@ static struct spi_board_info ek_spi_devices[] = {
151/* 151/*
152 * MACB Ethernet device 152 * MACB Ethernet device
153 */ 153 */
154static struct at91_eth_data __initdata ek_macb_data = { 154static struct macb_platform_data __initdata ek_macb_data = {
155 .phy_irq_pin = AT91_PIN_PA7, 155 .phy_irq_pin = AT91_PIN_PA7,
156 .is_rmii = 1, 156 .is_rmii = 1,
157}; 157};
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 7b25ca10d9d5..3ce0b17bd9ed 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -158,7 +158,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
158/* 158/*
159 * MACB Ethernet device 159 * MACB Ethernet device
160 */ 160 */
161static struct at91_eth_data __initdata ek_macb_data = { 161static struct macb_platform_data __initdata ek_macb_data = {
162 .phy_irq_pin = AT91_PIN_PE31, 162 .phy_irq_pin = AT91_PIN_PE31,
163 .is_rmii = 1, 163 .is_rmii = 1,
164}; 164};
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 0579f069d97b..a67b269a2fce 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -123,7 +123,7 @@ static struct spi_board_info ek_spi_devices[] = {
123/* 123/*
124 * MACB Ethernet device 124 * MACB Ethernet device
125 */ 125 */
126static struct at91_eth_data __initdata ek_macb_data = { 126static struct macb_platform_data __initdata ek_macb_data = {
127 .phy_irq_pin = AT91_PIN_PA7, 127 .phy_irq_pin = AT91_PIN_PA7,
128 .is_rmii = 1, 128 .is_rmii = 1,
129}; 129};
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 3e0d5a91f782..061465daa1f8 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -115,7 +115,7 @@ static struct mci_platform_data __initdata mci1_data = {
115/* 115/*
116 * MACB Ethernet device 116 * MACB Ethernet device
117 */ 117 */
118static struct at91_eth_data __initdata ek_macb_data = { 118static struct macb_platform_data __initdata ek_macb_data = {
119 .phy_irq_pin = AT91_PIN_PD5, 119 .phy_irq_pin = AT91_PIN_PD5,
120 .is_rmii = 1, 120 .is_rmii = 1,
121}; 121};
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index 645d8336468e..73ed8c746085 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -65,7 +65,7 @@ static struct at91_udc_data __initdata snapper9260_udc_data = {
65 .vbus_polled = 1, 65 .vbus_polled = 1,
66}; 66};
67 67
68static struct at91_eth_data snapper9260_macb_data = { 68static struct macb_platform_data snapper9260_macb_data = {
69 .is_rmii = 1, 69 .is_rmii = 1,
70}; 70};
71 71
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index f94ac865da53..f4b9b6f2b594 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -157,7 +157,7 @@ static struct at91_udc_data __initdata stamp9g20evb_udc_data = {
157/* 157/*
158 * MACB Ethernet device 158 * MACB Ethernet device
159 */ 159 */
160static struct at91_eth_data __initdata macb_data = { 160static struct macb_platform_data __initdata macb_data = {
161 .phy_irq_pin = AT91_PIN_PA28, 161 .phy_irq_pin = AT91_PIN_PA28,
162 .is_rmii = 1, 162 .is_rmii = 1,
163}; 163};
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c
index dbc2609fa7fe..2ffb2c84c7ce 100644
--- a/arch/arm/mach-at91/board-usb-a926x.c
+++ b/arch/arm/mach-at91/board-usb-a926x.c
@@ -146,7 +146,7 @@ static void __init ek_add_device_spi(void)
146/* 146/*
147 * MACB Ethernet device 147 * MACB Ethernet device
148 */ 148 */
149static struct at91_eth_data __initdata ek_macb_data = { 149static struct macb_platform_data __initdata ek_macb_data = {
150 .phy_irq_pin = AT91_PIN_PE31, 150 .phy_irq_pin = AT91_PIN_PE31,
151 .is_rmii = 1, 151 .is_rmii = 1,
152}; 152};
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 12a3f955162b..2c40a21b2794 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -110,7 +110,7 @@ static struct gpio_led yl9200_leds[] = {
110/* 110/*
111 * Ethernet 111 * Ethernet
112 */ 112 */
113static struct at91_eth_data __initdata yl9200_eth_data = { 113static struct macb_platform_data __initdata yl9200_eth_data = {
114 .phy_irq_pin = AT91_PIN_PB28, 114 .phy_irq_pin = AT91_PIN_PB28,
115 .is_rmii = 1, 115 .is_rmii = 1,
116}; 116};
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index eac92e995bb5..e209a2992245 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -40,6 +40,7 @@
40#include <linux/atmel-mci.h> 40#include <linux/atmel-mci.h>
41#include <sound/atmel-ac97c.h> 41#include <sound/atmel-ac97c.h>
42#include <linux/serial.h> 42#include <linux/serial.h>
43#include <linux/platform_data/macb.h>
43 44
44 /* USB Device */ 45 /* USB Device */
45struct at91_udc_data { 46struct at91_udc_data {
@@ -81,18 +82,7 @@ extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
81 /* atmel-mci platform config */ 82 /* atmel-mci platform config */
82extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data); 83extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data);
83 84
84 /* Ethernet (EMAC & MACB) */ 85extern void __init at91_add_device_eth(struct macb_platform_data *data);
85struct at91_eth_data {
86 u32 phy_mask;
87 u8 phy_irq_pin; /* PHY IRQ */
88 u8 is_rmii; /* using RMII interface? */
89};
90extern void __init at91_add_device_eth(struct at91_eth_data *data);
91
92#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \
93 || defined(CONFIG_ARCH_AT91SAM9G45)
94#define eth_platform_data at91_eth_data
95#endif
96 86
97 /* USB Host */ 87 /* USB Host */
98struct at91_usbh_data { 88struct at91_usbh_data {
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 1f17bde52cd4..7c756fb189f7 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -109,7 +109,7 @@ struct eth_addr {
109 u8 addr[6]; 109 u8 addr[6];
110}; 110};
111static struct eth_addr __initdata hw_addr[2]; 111static struct eth_addr __initdata hw_addr[2];
112static struct eth_platform_data __initdata eth_data[2]; 112static struct macb_platform_data __initdata eth_data[2];
113 113
114static struct spi_board_info spi0_board_info[] __initdata = { 114static struct spi_board_info spi0_board_info[] __initdata = {
115 { 115 {
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 4643ff5107c9..c56ddac85d61 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -105,7 +105,7 @@ struct eth_addr {
105}; 105};
106 106
107static struct eth_addr __initdata hw_addr[2]; 107static struct eth_addr __initdata hw_addr[2];
108static struct eth_platform_data __initdata eth_data[2] = { 108static struct macb_platform_data __initdata eth_data[2] = {
109 { 109 {
110 /* 110 /*
111 * The MDIO pullups on STK1000 are a bit too weak for 111 * The MDIO pullups on STK1000 are a bit too weak for
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c
index 86fab77a5a00..27bd6fbe21cb 100644
--- a/arch/avr32/boards/favr-32/setup.c
+++ b/arch/avr32/boards/favr-32/setup.c
@@ -50,7 +50,7 @@ struct eth_addr {
50 u8 addr[6]; 50 u8 addr[6];
51}; 51};
52static struct eth_addr __initdata hw_addr[1]; 52static struct eth_addr __initdata hw_addr[1];
53static struct eth_platform_data __initdata eth_data[1] = { 53static struct macb_platform_data __initdata eth_data[1] = {
54 { 54 {
55 .phy_mask = ~(1U << 1), 55 .phy_mask = ~(1U << 1),
56 }, 56 },
diff --git a/arch/avr32/boards/hammerhead/setup.c b/arch/avr32/boards/hammerhead/setup.c
index da14fbdd4e8e..9d1efd1cd425 100644
--- a/arch/avr32/boards/hammerhead/setup.c
+++ b/arch/avr32/boards/hammerhead/setup.c
@@ -102,7 +102,7 @@ struct eth_addr {
102}; 102};
103 103
104static struct eth_addr __initdata hw_addr[1]; 104static struct eth_addr __initdata hw_addr[1];
105static struct eth_platform_data __initdata eth_data[1]; 105static struct macb_platform_data __initdata eth_data[1];
106 106
107/* 107/*
108 * The next two functions should go away as the boot loader is 108 * The next two functions should go away as the boot loader is
diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
index e61bc948f959..ed137e335796 100644
--- a/arch/avr32/boards/merisc/setup.c
+++ b/arch/avr32/boards/merisc/setup.c
@@ -52,7 +52,7 @@ struct eth_addr {
52}; 52};
53 53
54static struct eth_addr __initdata hw_addr[2]; 54static struct eth_addr __initdata hw_addr[2];
55static struct eth_platform_data __initdata eth_data[2]; 55static struct macb_platform_data __initdata eth_data[2];
56 56
57static int ads7846_get_pendown_state_PB26(void) 57static int ads7846_get_pendown_state_PB26(void)
58{ 58{
diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c
index c4da5cba2dbf..05358aa5ef7d 100644
--- a/arch/avr32/boards/mimc200/setup.c
+++ b/arch/avr32/boards/mimc200/setup.c
@@ -86,7 +86,7 @@ struct eth_addr {
86 u8 addr[6]; 86 u8 addr[6];
87}; 87};
88static struct eth_addr __initdata hw_addr[2]; 88static struct eth_addr __initdata hw_addr[2];
89static struct eth_platform_data __initdata eth_data[2]; 89static struct macb_platform_data __initdata eth_data[2];
90 90
91static struct spi_eeprom eeprom_25lc010 = { 91static struct spi_eeprom eeprom_25lc010 = {
92 .name = "25lc010", 92 .name = "25lc010",
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 7fbf0dcb9afe..402a7bb72669 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1067,7 +1067,7 @@ void __init at32_setup_serial_console(unsigned int usart_id)
1067 * -------------------------------------------------------------------- */ 1067 * -------------------------------------------------------------------- */
1068 1068
1069#ifdef CONFIG_CPU_AT32AP7000 1069#ifdef CONFIG_CPU_AT32AP7000
1070static struct eth_platform_data macb0_data; 1070static struct macb_platform_data macb0_data;
1071static struct resource macb0_resource[] = { 1071static struct resource macb0_resource[] = {
1072 PBMEM(0xfff01800), 1072 PBMEM(0xfff01800),
1073 IRQ(25), 1073 IRQ(25),
@@ -1076,7 +1076,7 @@ DEFINE_DEV_DATA(macb, 0);
1076DEV_CLK(hclk, macb0, hsb, 8); 1076DEV_CLK(hclk, macb0, hsb, 8);
1077DEV_CLK(pclk, macb0, pbb, 6); 1077DEV_CLK(pclk, macb0, pbb, 6);
1078 1078
1079static struct eth_platform_data macb1_data; 1079static struct macb_platform_data macb1_data;
1080static struct resource macb1_resource[] = { 1080static struct resource macb1_resource[] = {
1081 PBMEM(0xfff01c00), 1081 PBMEM(0xfff01c00),
1082 IRQ(26), 1082 IRQ(26),
@@ -1086,7 +1086,7 @@ DEV_CLK(hclk, macb1, hsb, 9);
1086DEV_CLK(pclk, macb1, pbb, 7); 1086DEV_CLK(pclk, macb1, pbb, 7);
1087 1087
1088struct platform_device *__init 1088struct platform_device *__init
1089at32_add_device_eth(unsigned int id, struct eth_platform_data *data) 1089at32_add_device_eth(unsigned int id, struct macb_platform_data *data)
1090{ 1090{
1091 struct platform_device *pdev; 1091 struct platform_device *pdev;
1092 u32 pin_mask; 1092 u32 pin_mask;
@@ -1163,7 +1163,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
1163 return NULL; 1163 return NULL;
1164 } 1164 }
1165 1165
1166 memcpy(pdev->dev.platform_data, data, sizeof(struct eth_platform_data)); 1166 memcpy(pdev->dev.platform_data, data, sizeof(struct macb_platform_data));
1167 platform_device_register(pdev); 1167 platform_device_register(pdev);
1168 1168
1169 return pdev; 1169 return pdev;
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index 5d7ffca7d69f..67b111ce332d 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/serial.h> 8#include <linux/serial.h>
9#include <linux/platform_data/macb.h>
9 10
10#define GPIO_PIN_NONE (-1) 11#define GPIO_PIN_NONE (-1)
11 12
@@ -42,12 +43,8 @@ struct atmel_uart_data {
42void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); 43void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
43struct platform_device *at32_add_device_usart(unsigned int id); 44struct platform_device *at32_add_device_usart(unsigned int id);
44 45
45struct eth_platform_data {
46 u32 phy_mask;
47 u8 is_rmii;
48};
49struct platform_device * 46struct platform_device *
50at32_add_device_eth(unsigned int id, struct eth_platform_data *data); 47at32_add_device_eth(unsigned int id, struct macb_platform_data *data);
51 48
52struct spi_board_info; 49struct spi_board_info;
53struct platform_device * 50struct platform_device *
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 56624d303487..dfeb46cb3f74 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -26,6 +26,7 @@
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/ethtool.h> 28#include <linux/ethtool.h>
29#include <linux/platform_data/macb.h>
29#include <linux/platform_device.h> 30#include <linux/platform_device.h>
30#include <linux/clk.h> 31#include <linux/clk.h>
31#include <linux/gfp.h> 32#include <linux/gfp.h>
@@ -984,7 +985,7 @@ static const struct net_device_ops at91ether_netdev_ops = {
984static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address, 985static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address,
985 struct platform_device *pdev, struct clk *ether_clk) 986 struct platform_device *pdev, struct clk *ether_clk)
986{ 987{
987 struct at91_eth_data *board_data = pdev->dev.platform_data; 988 struct macb_platform_data *board_data = pdev->dev.platform_data;
988 struct net_device *dev; 989 struct net_device *dev;
989 struct at91_private *lp; 990 struct at91_private *lp;
990 unsigned int val; 991 unsigned int val;
diff --git a/drivers/net/ethernet/cadence/at91_ether.h b/drivers/net/ethernet/cadence/at91_ether.h
index 353f4dab62be..3725fbb0defe 100644
--- a/drivers/net/ethernet/cadence/at91_ether.h
+++ b/drivers/net/ethernet/cadence/at91_ether.h
@@ -85,7 +85,9 @@ struct recv_desc_bufs
85struct at91_private 85struct at91_private
86{ 86{
87 struct mii_if_info mii; /* ethtool support */ 87 struct mii_if_info mii; /* ethtool support */
88 struct at91_eth_data board_data; /* board-specific configuration */ 88 struct macb_platform_data board_data; /* board-specific
89 * configuration (shared with
90 * macb for common data */
89 struct clk *ether_clk; /* clock */ 91 struct clk *ether_clk; /* clock */
90 92
91 /* PHY */ 93 /* PHY */
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index a437b46e5490..aa1d597091a8 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11#include <linux/clk.h> 12#include <linux/clk.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
@@ -19,12 +20,10 @@
19#include <linux/netdevice.h> 20#include <linux/netdevice.h>
20#include <linux/etherdevice.h> 21#include <linux/etherdevice.h>
21#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/platform_data/macb.h>
22#include <linux/platform_device.h> 24#include <linux/platform_device.h>
23#include <linux/phy.h> 25#include <linux/phy.h>
24 26
25#include <mach/board.h>
26#include <mach/cpu.h>
27
28#include "macb.h" 27#include "macb.h"
29 28
30#define RX_BUFFER_SIZE 128 29#define RX_BUFFER_SIZE 128
@@ -84,7 +83,7 @@ static void __init macb_get_hwaddr(struct macb *bp)
84 if (is_valid_ether_addr(addr)) { 83 if (is_valid_ether_addr(addr)) {
85 memcpy(bp->dev->dev_addr, addr, sizeof(addr)); 84 memcpy(bp->dev->dev_addr, addr, sizeof(addr));
86 } else { 85 } else {
87 dev_info(&bp->pdev->dev, "invalid hw address, using random\n"); 86 netdev_info(bp->dev, "invalid hw address, using random\n");
88 random_ether_addr(bp->dev->dev_addr); 87 random_ether_addr(bp->dev->dev_addr);
89 } 88 }
90} 89}
@@ -178,11 +177,12 @@ static void macb_handle_link_change(struct net_device *dev)
178 177
179 if (status_change) { 178 if (status_change) {
180 if (phydev->link) 179 if (phydev->link)
181 printk(KERN_INFO "%s: link up (%d/%s)\n", 180 netdev_info(dev, "link up (%d/%s)\n",
182 dev->name, phydev->speed, 181 phydev->speed,
183 DUPLEX_FULL == phydev->duplex ? "Full":"Half"); 182 phydev->duplex == DUPLEX_FULL ?
183 "Full" : "Half");
184 else 184 else
185 printk(KERN_INFO "%s: link down\n", dev->name); 185 netdev_info(dev, "link down\n");
186 } 186 }
187} 187}
188 188
@@ -191,12 +191,12 @@ static int macb_mii_probe(struct net_device *dev)
191{ 191{
192 struct macb *bp = netdev_priv(dev); 192 struct macb *bp = netdev_priv(dev);
193 struct phy_device *phydev; 193 struct phy_device *phydev;
194 struct eth_platform_data *pdata; 194 struct macb_platform_data *pdata;
195 int ret; 195 int ret;
196 196
197 phydev = phy_find_first(bp->mii_bus); 197 phydev = phy_find_first(bp->mii_bus);
198 if (!phydev) { 198 if (!phydev) {
199 printk (KERN_ERR "%s: no PHY found\n", dev->name); 199 netdev_err(dev, "no PHY found\n");
200 return -1; 200 return -1;
201 } 201 }
202 202
@@ -209,7 +209,7 @@ static int macb_mii_probe(struct net_device *dev)
209 PHY_INTERFACE_MODE_RMII : 209 PHY_INTERFACE_MODE_RMII :
210 PHY_INTERFACE_MODE_MII); 210 PHY_INTERFACE_MODE_MII);
211 if (ret) { 211 if (ret) {
212 printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 212 netdev_err(dev, "Could not attach to PHY\n");
213 return ret; 213 return ret;
214 } 214 }
215 215
@@ -228,7 +228,7 @@ static int macb_mii_probe(struct net_device *dev)
228 228
229static int macb_mii_init(struct macb *bp) 229static int macb_mii_init(struct macb *bp)
230{ 230{
231 struct eth_platform_data *pdata; 231 struct macb_platform_data *pdata;
232 int err = -ENXIO, i; 232 int err = -ENXIO, i;
233 233
234 /* Enable management port */ 234 /* Enable management port */
@@ -303,14 +303,13 @@ static void macb_tx(struct macb *bp)
303 status = macb_readl(bp, TSR); 303 status = macb_readl(bp, TSR);
304 macb_writel(bp, TSR, status); 304 macb_writel(bp, TSR, status);
305 305
306 dev_dbg(&bp->pdev->dev, "macb_tx status = %02lx\n", 306 netdev_dbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status);
307 (unsigned long)status);
308 307
309 if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { 308 if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) {
310 int i; 309 int i;
311 printk(KERN_ERR "%s: TX %s, resetting buffers\n", 310 netdev_err(bp->dev, "TX %s, resetting buffers\n",
312 bp->dev->name, status & MACB_BIT(UND) ? 311 status & MACB_BIT(UND) ?
313 "underrun" : "retry limit exceeded"); 312 "underrun" : "retry limit exceeded");
314 313
315 /* Transfer ongoing, disable transmitter, to avoid confusion */ 314 /* Transfer ongoing, disable transmitter, to avoid confusion */
316 if (status & MACB_BIT(TGO)) 315 if (status & MACB_BIT(TGO))
@@ -369,8 +368,8 @@ static void macb_tx(struct macb *bp)
369 if (!(bufstat & MACB_BIT(TX_USED))) 368 if (!(bufstat & MACB_BIT(TX_USED)))
370 break; 369 break;
371 370
372 dev_dbg(&bp->pdev->dev, "skb %u (data %p) TX complete\n", 371 netdev_dbg(bp->dev, "skb %u (data %p) TX complete\n",
373 tail, skb->data); 372 tail, skb->data);
374 dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len, 373 dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len,
375 DMA_TO_DEVICE); 374 DMA_TO_DEVICE);
376 bp->stats.tx_packets++; 375 bp->stats.tx_packets++;
@@ -395,8 +394,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
395 394
396 len = MACB_BFEXT(RX_FRMLEN, bp->rx_ring[last_frag].ctrl); 395 len = MACB_BFEXT(RX_FRMLEN, bp->rx_ring[last_frag].ctrl);
397 396
398 dev_dbg(&bp->pdev->dev, "macb_rx_frame frags %u - %u (len %u)\n", 397 netdev_dbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n",
399 first_frag, last_frag, len); 398 first_frag, last_frag, len);
400 399
401 skb = dev_alloc_skb(len + RX_OFFSET); 400 skb = dev_alloc_skb(len + RX_OFFSET);
402 if (!skb) { 401 if (!skb) {
@@ -437,8 +436,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
437 436
438 bp->stats.rx_packets++; 437 bp->stats.rx_packets++;
439 bp->stats.rx_bytes += len; 438 bp->stats.rx_bytes += len;
440 dev_dbg(&bp->pdev->dev, "received skb of length %u, csum: %08x\n", 439 netdev_dbg(bp->dev, "received skb of length %u, csum: %08x\n",
441 skb->len, skb->csum); 440 skb->len, skb->csum);
442 netif_receive_skb(skb); 441 netif_receive_skb(skb);
443 442
444 return 0; 443 return 0;
@@ -515,8 +514,8 @@ static int macb_poll(struct napi_struct *napi, int budget)
515 514
516 work_done = 0; 515 work_done = 0;
517 516
518 dev_dbg(&bp->pdev->dev, "poll: status = %08lx, budget = %d\n", 517 netdev_dbg(bp->dev, "poll: status = %08lx, budget = %d\n",
519 (unsigned long)status, budget); 518 (unsigned long)status, budget);
520 519
521 work_done = macb_rx(bp, budget); 520 work_done = macb_rx(bp, budget);
522 if (work_done < budget) { 521 if (work_done < budget) {
@@ -565,8 +564,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
565 macb_writel(bp, IDR, MACB_RX_INT_FLAGS); 564 macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
566 565
567 if (napi_schedule_prep(&bp->napi)) { 566 if (napi_schedule_prep(&bp->napi)) {
568 dev_dbg(&bp->pdev->dev, 567 netdev_dbg(bp->dev, "scheduling RX softirq\n");
569 "scheduling RX softirq\n");
570 __napi_schedule(&bp->napi); 568 __napi_schedule(&bp->napi);
571 } 569 }
572 } 570 }
@@ -587,11 +585,11 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
587 585
588 if (status & MACB_BIT(HRESP)) { 586 if (status & MACB_BIT(HRESP)) {
589 /* 587 /*
590 * TODO: Reset the hardware, and maybe move the printk 588 * TODO: Reset the hardware, and maybe move the
591 * to a lower-priority context as well (work queue?) 589 * netdev_err to a lower-priority context as well
590 * (work queue?)
592 */ 591 */
593 printk(KERN_ERR "%s: DMA bus error: HRESP not OK\n", 592 netdev_err(dev, "DMA bus error: HRESP not OK\n");
594 dev->name);
595 } 593 }
596 594
597 status = macb_readl(bp, ISR); 595 status = macb_readl(bp, ISR);
@@ -626,16 +624,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
626 unsigned long flags; 624 unsigned long flags;
627 625
628#ifdef DEBUG 626#ifdef DEBUG
629 int i; 627 netdev_dbg(bp->dev,
630 dev_dbg(&bp->pdev->dev, 628 "start_xmit: len %u head %p data %p tail %p end %p\n",
631 "start_xmit: len %u head %p data %p tail %p end %p\n", 629 skb->len, skb->head, skb->data,
632 skb->len, skb->head, skb->data, 630 skb_tail_pointer(skb), skb_end_pointer(skb));
633 skb_tail_pointer(skb), skb_end_pointer(skb)); 631 print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1,
634 dev_dbg(&bp->pdev->dev, 632 skb->data, 16, true);
635 "data:");
636 for (i = 0; i < 16; i++)
637 printk(" %02x", (unsigned int)skb->data[i]);
638 printk("\n");
639#endif 633#endif
640 634
641 len = skb->len; 635 len = skb->len;
@@ -645,21 +639,20 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
645 if (TX_BUFFS_AVAIL(bp) < 1) { 639 if (TX_BUFFS_AVAIL(bp) < 1) {
646 netif_stop_queue(dev); 640 netif_stop_queue(dev);
647 spin_unlock_irqrestore(&bp->lock, flags); 641 spin_unlock_irqrestore(&bp->lock, flags);
648 dev_err(&bp->pdev->dev, 642 netdev_err(bp->dev, "BUG! Tx Ring full when queue awake!\n");
649 "BUG! Tx Ring full when queue awake!\n"); 643 netdev_dbg(bp->dev, "tx_head = %u, tx_tail = %u\n",
650 dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", 644 bp->tx_head, bp->tx_tail);
651 bp->tx_head, bp->tx_tail);
652 return NETDEV_TX_BUSY; 645 return NETDEV_TX_BUSY;
653 } 646 }
654 647
655 entry = bp->tx_head; 648 entry = bp->tx_head;
656 dev_dbg(&bp->pdev->dev, "Allocated ring entry %u\n", entry); 649 netdev_dbg(bp->dev, "Allocated ring entry %u\n", entry);
657 mapping = dma_map_single(&bp->pdev->dev, skb->data, 650 mapping = dma_map_single(&bp->pdev->dev, skb->data,
658 len, DMA_TO_DEVICE); 651 len, DMA_TO_DEVICE);
659 bp->tx_skb[entry].skb = skb; 652 bp->tx_skb[entry].skb = skb;
660 bp->tx_skb[entry].mapping = mapping; 653 bp->tx_skb[entry].mapping = mapping;
661 dev_dbg(&bp->pdev->dev, "Mapped skb data %p to DMA addr %08lx\n", 654 netdev_dbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n",
662 skb->data, (unsigned long)mapping); 655 skb->data, (unsigned long)mapping);
663 656
664 ctrl = MACB_BF(TX_FRMLEN, len); 657 ctrl = MACB_BF(TX_FRMLEN, len);
665 ctrl |= MACB_BIT(TX_LAST); 658 ctrl |= MACB_BIT(TX_LAST);
@@ -723,27 +716,27 @@ static int macb_alloc_consistent(struct macb *bp)
723 &bp->rx_ring_dma, GFP_KERNEL); 716 &bp->rx_ring_dma, GFP_KERNEL);
724 if (!bp->rx_ring) 717 if (!bp->rx_ring)
725 goto out_err; 718 goto out_err;
726 dev_dbg(&bp->pdev->dev, 719 netdev_dbg(bp->dev,
727 "Allocated RX ring of %d bytes at %08lx (mapped %p)\n", 720 "Allocated RX ring of %d bytes at %08lx (mapped %p)\n",
728 size, (unsigned long)bp->rx_ring_dma, bp->rx_ring); 721 size, (unsigned long)bp->rx_ring_dma, bp->rx_ring);
729 722
730 size = TX_RING_BYTES; 723 size = TX_RING_BYTES;
731 bp->tx_ring = dma_alloc_coherent(&bp->pdev->dev, size, 724 bp->tx_ring = dma_alloc_coherent(&bp->pdev->dev, size,
732 &bp->tx_ring_dma, GFP_KERNEL); 725 &bp->tx_ring_dma, GFP_KERNEL);
733 if (!bp->tx_ring) 726 if (!bp->tx_ring)
734 goto out_err; 727 goto out_err;
735 dev_dbg(&bp->pdev->dev, 728 netdev_dbg(bp->dev,
736 "Allocated TX ring of %d bytes at %08lx (mapped %p)\n", 729 "Allocated TX ring of %d bytes at %08lx (mapped %p)\n",
737 size, (unsigned long)bp->tx_ring_dma, bp->tx_ring); 730 size, (unsigned long)bp->tx_ring_dma, bp->tx_ring);
738 731
739 size = RX_RING_SIZE * RX_BUFFER_SIZE; 732 size = RX_RING_SIZE * RX_BUFFER_SIZE;
740 bp->rx_buffers = dma_alloc_coherent(&bp->pdev->dev, size, 733 bp->rx_buffers = dma_alloc_coherent(&bp->pdev->dev, size,
741 &bp->rx_buffers_dma, GFP_KERNEL); 734 &bp->rx_buffers_dma, GFP_KERNEL);
742 if (!bp->rx_buffers) 735 if (!bp->rx_buffers)
743 goto out_err; 736 goto out_err;
744 dev_dbg(&bp->pdev->dev, 737 netdev_dbg(bp->dev,
745 "Allocated RX buffers of %d bytes at %08lx (mapped %p)\n", 738 "Allocated RX buffers of %d bytes at %08lx (mapped %p)\n",
746 size, (unsigned long)bp->rx_buffers_dma, bp->rx_buffers); 739 size, (unsigned long)bp->rx_buffers_dma, bp->rx_buffers);
747 740
748 return 0; 741 return 0;
749 742
@@ -954,7 +947,7 @@ static int macb_open(struct net_device *dev)
954 struct macb *bp = netdev_priv(dev); 947 struct macb *bp = netdev_priv(dev);
955 int err; 948 int err;
956 949
957 dev_dbg(&bp->pdev->dev, "open\n"); 950 netdev_dbg(bp->dev, "open\n");
958 951
959 /* if the phy is not yet register, retry later*/ 952 /* if the phy is not yet register, retry later*/
960 if (!bp->phy_dev) 953 if (!bp->phy_dev)
@@ -965,9 +958,8 @@ static int macb_open(struct net_device *dev)
965 958
966 err = macb_alloc_consistent(bp); 959 err = macb_alloc_consistent(bp);
967 if (err) { 960 if (err) {
968 printk(KERN_ERR 961 netdev_err(dev, "Unable to allocate DMA memory (error %d)\n",
969 "%s: Unable to allocate DMA memory (error %d)\n", 962 err);
970 dev->name, err);
971 return err; 963 return err;
972 } 964 }
973 965
@@ -1119,7 +1111,7 @@ static const struct net_device_ops macb_netdev_ops = {
1119 1111
1120static int __init macb_probe(struct platform_device *pdev) 1112static int __init macb_probe(struct platform_device *pdev)
1121{ 1113{
1122 struct eth_platform_data *pdata; 1114 struct macb_platform_data *pdata;
1123 struct resource *regs; 1115 struct resource *regs;
1124 struct net_device *dev; 1116 struct net_device *dev;
1125 struct macb *bp; 1117 struct macb *bp;
@@ -1152,28 +1144,19 @@ static int __init macb_probe(struct platform_device *pdev)
1152 1144
1153 spin_lock_init(&bp->lock); 1145 spin_lock_init(&bp->lock);
1154 1146
1155#if defined(CONFIG_ARCH_AT91) 1147 bp->pclk = clk_get(&pdev->dev, "pclk");
1156 bp->pclk = clk_get(&pdev->dev, "macb_clk");
1157 if (IS_ERR(bp->pclk)) { 1148 if (IS_ERR(bp->pclk)) {
1158 dev_err(&pdev->dev, "failed to get macb_clk\n"); 1149 dev_err(&pdev->dev, "failed to get macb_clk\n");
1159 goto err_out_free_dev; 1150 goto err_out_free_dev;
1160 } 1151 }
1161 clk_enable(bp->pclk); 1152 clk_enable(bp->pclk);
1162#else 1153
1163 bp->pclk = clk_get(&pdev->dev, "pclk");
1164 if (IS_ERR(bp->pclk)) {
1165 dev_err(&pdev->dev, "failed to get pclk\n");
1166 goto err_out_free_dev;
1167 }
1168 bp->hclk = clk_get(&pdev->dev, "hclk"); 1154 bp->hclk = clk_get(&pdev->dev, "hclk");
1169 if (IS_ERR(bp->hclk)) { 1155 if (IS_ERR(bp->hclk)) {
1170 dev_err(&pdev->dev, "failed to get hclk\n"); 1156 dev_err(&pdev->dev, "failed to get hclk\n");
1171 goto err_out_put_pclk; 1157 goto err_out_put_pclk;
1172 } 1158 }
1173
1174 clk_enable(bp->pclk);
1175 clk_enable(bp->hclk); 1159 clk_enable(bp->hclk);
1176#endif
1177 1160
1178 bp->regs = ioremap(regs->start, resource_size(regs)); 1161 bp->regs = ioremap(regs->start, resource_size(regs));
1179 if (!bp->regs) { 1162 if (!bp->regs) {
@@ -1185,9 +1168,8 @@ static int __init macb_probe(struct platform_device *pdev)
1185 dev->irq = platform_get_irq(pdev, 0); 1168 dev->irq = platform_get_irq(pdev, 0);
1186 err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev); 1169 err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev);
1187 if (err) { 1170 if (err) {
1188 printk(KERN_ERR 1171 dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n",
1189 "%s: Unable to request IRQ %d (error %d)\n", 1172 dev->irq, err);
1190 dev->name, dev->irq, err);
1191 goto err_out_iounmap; 1173 goto err_out_iounmap;
1192 } 1174 }
1193 1175
@@ -1239,13 +1221,12 @@ static int __init macb_probe(struct platform_device *pdev)
1239 1221
1240 platform_set_drvdata(pdev, dev); 1222 platform_set_drvdata(pdev, dev);
1241 1223
1242 printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d (%pM)\n", 1224 netdev_info(dev, "Atmel MACB at 0x%08lx irq %d (%pM)\n",
1243 dev->name, dev->base_addr, dev->irq, dev->dev_addr); 1225 dev->base_addr, dev->irq, dev->dev_addr);
1244 1226
1245 phydev = bp->phy_dev; 1227 phydev = bp->phy_dev;
1246 printk(KERN_INFO "%s: attached PHY driver [%s] " 1228 netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
1247 "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name, 1229 phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
1248 phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
1249 1230
1250 return 0; 1231 return 0;
1251 1232
@@ -1256,14 +1237,10 @@ err_out_free_irq:
1256err_out_iounmap: 1237err_out_iounmap:
1257 iounmap(bp->regs); 1238 iounmap(bp->regs);
1258err_out_disable_clocks: 1239err_out_disable_clocks:
1259#ifndef CONFIG_ARCH_AT91
1260 clk_disable(bp->hclk); 1240 clk_disable(bp->hclk);
1261 clk_put(bp->hclk); 1241 clk_put(bp->hclk);
1262#endif
1263 clk_disable(bp->pclk); 1242 clk_disable(bp->pclk);
1264#ifndef CONFIG_ARCH_AT91
1265err_out_put_pclk: 1243err_out_put_pclk:
1266#endif
1267 clk_put(bp->pclk); 1244 clk_put(bp->pclk);
1268err_out_free_dev: 1245err_out_free_dev:
1269 free_netdev(dev); 1246 free_netdev(dev);
@@ -1289,10 +1266,8 @@ static int __exit macb_remove(struct platform_device *pdev)
1289 unregister_netdev(dev); 1266 unregister_netdev(dev);
1290 free_irq(dev->irq, dev); 1267 free_irq(dev->irq, dev);
1291 iounmap(bp->regs); 1268 iounmap(bp->regs);
1292#ifndef CONFIG_ARCH_AT91
1293 clk_disable(bp->hclk); 1269 clk_disable(bp->hclk);
1294 clk_put(bp->hclk); 1270 clk_put(bp->hclk);
1295#endif
1296 clk_disable(bp->pclk); 1271 clk_disable(bp->pclk);
1297 clk_put(bp->pclk); 1272 clk_put(bp->pclk);
1298 free_netdev(dev); 1273 free_netdev(dev);
@@ -1310,9 +1285,7 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state)
1310 1285
1311 netif_device_detach(netdev); 1286 netif_device_detach(netdev);
1312 1287
1313#ifndef CONFIG_ARCH_AT91
1314 clk_disable(bp->hclk); 1288 clk_disable(bp->hclk);
1315#endif
1316 clk_disable(bp->pclk); 1289 clk_disable(bp->pclk);
1317 1290
1318 return 0; 1291 return 0;
@@ -1324,9 +1297,7 @@ static int macb_resume(struct platform_device *pdev)
1324 struct macb *bp = netdev_priv(netdev); 1297 struct macb *bp = netdev_priv(netdev);
1325 1298
1326 clk_enable(bp->pclk); 1299 clk_enable(bp->pclk);
1327#ifndef CONFIG_ARCH_AT91
1328 clk_enable(bp->hclk); 1300 clk_enable(bp->hclk);
1329#endif
1330 1301
1331 netif_device_attach(netdev); 1302 netif_device_attach(netdev);
1332 1303
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h
new file mode 100644
index 000000000000..e7c748fb6053
--- /dev/null
+++ b/include/linux/platform_data/macb.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __MACB_PDATA_H__
9#define __MACB_PDATA_H__
10
11struct macb_platform_data {
12 u32 phy_mask;
13 u8 phy_irq_pin; /* PHY IRQ */
14 u8 is_rmii; /* using RMII interface? */
15};
16
17#endif /* __MACB_PDATA_H__ */