Commit ed20178d authored by Arnd Bergmann's avatar Arnd Bergmann

Merge branch 'drivers/macb-gem-cleanup' into at91/gpio

parents d28bdfc5 c220f8cd
...@@ -136,7 +136,7 @@ static struct clk pwm_clk = { ...@@ -136,7 +136,7 @@ static struct clk pwm_clk = {
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
static struct clk macb_clk = { static struct clk macb_clk = {
.name = "macb_clk", .name = "pclk",
.pmc_mask = 1 << AT91CAP9_ID_EMAC, .pmc_mask = 1 << AT91CAP9_ID_EMAC,
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
...@@ -209,6 +209,8 @@ static struct clk *periph_clocks[] __initdata = { ...@@ -209,6 +209,8 @@ static struct clk *periph_clocks[] __initdata = {
}; };
static struct clk_lookup periph_clocks_lookups[] = { static struct clk_lookup periph_clocks_lookups[] = {
/* One additional fake clock for macb_hclk */
CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
......
...@@ -200,7 +200,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {} ...@@ -200,7 +200,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
static u64 eth_dmamask = DMA_BIT_MASK(32); static u64 eth_dmamask = DMA_BIT_MASK(32);
static struct at91_eth_data eth_data; static struct macb_platform_data eth_data;
static struct resource eth_resources[] = { static struct resource eth_resources[] = {
[0] = { [0] = {
...@@ -227,7 +227,7 @@ static struct platform_device at91cap9_eth_device = { ...@@ -227,7 +227,7 @@ static struct platform_device at91cap9_eth_device = {
.num_resources = ARRAY_SIZE(eth_resources), .num_resources = ARRAY_SIZE(eth_resources),
}; };
void __init at91_add_device_eth(struct at91_eth_data *data) void __init at91_add_device_eth(struct macb_platform_data *data)
{ {
if (!data) if (!data)
return; return;
...@@ -264,7 +264,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) ...@@ -264,7 +264,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91cap9_eth_device); platform_device_register(&at91cap9_eth_device);
} }
#else #else
void __init at91_add_device_eth(struct at91_eth_data *data) {} void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif #endif
......
...@@ -135,7 +135,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} ...@@ -135,7 +135,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE) #if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
static u64 eth_dmamask = DMA_BIT_MASK(32); static u64 eth_dmamask = DMA_BIT_MASK(32);
static struct at91_eth_data eth_data; static struct macb_platform_data eth_data;
static struct resource eth_resources[] = { static struct resource eth_resources[] = {
[0] = { [0] = {
...@@ -162,7 +162,7 @@ static struct platform_device at91rm9200_eth_device = { ...@@ -162,7 +162,7 @@ static struct platform_device at91rm9200_eth_device = {
.num_resources = ARRAY_SIZE(eth_resources), .num_resources = ARRAY_SIZE(eth_resources),
}; };
void __init at91_add_device_eth(struct at91_eth_data *data) void __init at91_add_device_eth(struct macb_platform_data *data)
{ {
if (!data) if (!data)
return; return;
...@@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) ...@@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91rm9200_eth_device); platform_device_register(&at91rm9200_eth_device);
} }
#else #else
void __init at91_add_device_eth(struct at91_eth_data *data) {} void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif #endif
......
...@@ -119,7 +119,7 @@ static struct clk ohci_clk = { ...@@ -119,7 +119,7 @@ static struct clk ohci_clk = {
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
static struct clk macb_clk = { static struct clk macb_clk = {
.name = "macb_clk", .name = "pclk",
.pmc_mask = 1 << AT91SAM9260_ID_EMAC, .pmc_mask = 1 << AT91SAM9260_ID_EMAC,
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
...@@ -189,6 +189,8 @@ static struct clk *periph_clocks[] __initdata = { ...@@ -189,6 +189,8 @@ static struct clk *periph_clocks[] __initdata = {
}; };
static struct clk_lookup periph_clocks_lookups[] = { static struct clk_lookup periph_clocks_lookups[] = {
/* One additional fake clock for macb_hclk */
CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
......
...@@ -136,7 +136,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} ...@@ -136,7 +136,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
static u64 eth_dmamask = DMA_BIT_MASK(32); static u64 eth_dmamask = DMA_BIT_MASK(32);
static struct at91_eth_data eth_data; static struct macb_platform_data eth_data;
static struct resource eth_resources[] = { static struct resource eth_resources[] = {
[0] = { [0] = {
...@@ -163,7 +163,7 @@ static struct platform_device at91sam9260_eth_device = { ...@@ -163,7 +163,7 @@ static struct platform_device at91sam9260_eth_device = {
.num_resources = ARRAY_SIZE(eth_resources), .num_resources = ARRAY_SIZE(eth_resources),
}; };
void __init at91_add_device_eth(struct at91_eth_data *data) void __init at91_add_device_eth(struct macb_platform_data *data)
{ {
if (!data) if (!data)
return; return;
...@@ -200,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) ...@@ -200,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91sam9260_eth_device); platform_device_register(&at91sam9260_eth_device);
} }
#else #else
void __init at91_add_device_eth(struct at91_eth_data *data) {} void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif #endif
......
...@@ -117,7 +117,7 @@ static struct clk pwm_clk = { ...@@ -117,7 +117,7 @@ static struct clk pwm_clk = {
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
static struct clk macb_clk = { static struct clk macb_clk = {
.name = "macb_clk", .name = "pclk",
.pmc_mask = 1 << AT91SAM9263_ID_EMAC, .pmc_mask = 1 << AT91SAM9263_ID_EMAC,
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
...@@ -181,6 +181,8 @@ static struct clk *periph_clocks[] __initdata = { ...@@ -181,6 +181,8 @@ static struct clk *periph_clocks[] __initdata = {
}; };
static struct clk_lookup periph_clocks_lookups[] = { static struct clk_lookup periph_clocks_lookups[] = {
/* One additional fake clock for macb_hclk */
CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
......
...@@ -144,7 +144,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} ...@@ -144,7 +144,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
static u64 eth_dmamask = DMA_BIT_MASK(32); static u64 eth_dmamask = DMA_BIT_MASK(32);
static struct at91_eth_data eth_data; static struct macb_platform_data eth_data;
static struct resource eth_resources[] = { static struct resource eth_resources[] = {
[0] = { [0] = {
...@@ -171,7 +171,7 @@ static struct platform_device at91sam9263_eth_device = { ...@@ -171,7 +171,7 @@ static struct platform_device at91sam9263_eth_device = {
.num_resources = ARRAY_SIZE(eth_resources), .num_resources = ARRAY_SIZE(eth_resources),
}; };
void __init at91_add_device_eth(struct at91_eth_data *data) void __init at91_add_device_eth(struct macb_platform_data *data)
{ {
if (!data) if (!data)
return; return;
...@@ -208,7 +208,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) ...@@ -208,7 +208,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91sam9263_eth_device); platform_device_register(&at91sam9263_eth_device);
} }
#else #else
void __init at91_add_device_eth(struct at91_eth_data *data) {} void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif #endif
......
...@@ -149,7 +149,7 @@ static struct clk ac97_clk = { ...@@ -149,7 +149,7 @@ static struct clk ac97_clk = {
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
static struct clk macb_clk = { static struct clk macb_clk = {
.name = "macb_clk", .name = "pclk",
.pmc_mask = 1 << AT91SAM9G45_ID_EMAC, .pmc_mask = 1 << AT91SAM9G45_ID_EMAC,
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
...@@ -208,6 +208,8 @@ static struct clk *periph_clocks[] __initdata = { ...@@ -208,6 +208,8 @@ static struct clk *periph_clocks[] __initdata = {
}; };
static struct clk_lookup periph_clocks_lookups[] = { static struct clk_lookup periph_clocks_lookups[] = {
/* One additional fake clock for macb_hclk */
CLKDEV_CON_ID("hclk", &macb_clk),
/* One additional fake clock for ohci */ /* One additional fake clock for ohci */
CLKDEV_CON_ID("ohci_clk", &uhphs_clk), CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk), CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
......
...@@ -284,7 +284,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {} ...@@ -284,7 +284,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
static u64 eth_dmamask = DMA_BIT_MASK(32); static u64 eth_dmamask = DMA_BIT_MASK(32);
static struct at91_eth_data eth_data; static struct macb_platform_data eth_data;
static struct resource eth_resources[] = { static struct resource eth_resources[] = {
[0] = { [0] = {
...@@ -311,7 +311,7 @@ static struct platform_device at91sam9g45_eth_device = { ...@@ -311,7 +311,7 @@ static struct platform_device at91sam9g45_eth_device = {
.num_resources = ARRAY_SIZE(eth_resources), .num_resources = ARRAY_SIZE(eth_resources),
}; };
void __init at91_add_device_eth(struct at91_eth_data *data) void __init at91_add_device_eth(struct macb_platform_data *data)
{ {
if (!data) if (!data)
return; return;
...@@ -348,7 +348,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) ...@@ -348,7 +348,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91sam9g45_eth_device); platform_device_register(&at91sam9g45_eth_device);
} }
#else #else
void __init at91_add_device_eth(struct at91_eth_data *data) {} void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif #endif
......
...@@ -63,7 +63,7 @@ static void __init onearm_init_early(void) ...@@ -63,7 +63,7 @@ static void __init onearm_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata onearm_eth_data = { static struct macb_platform_data __initdata onearm_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -103,7 +103,7 @@ static struct spi_board_info afeb9260_spi_devices[] = { ...@@ -103,7 +103,7 @@ static struct spi_board_info afeb9260_spi_devices[] = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata afeb9260_macb_data = { static struct macb_platform_data __initdata afeb9260_macb_data = {
.phy_irq_pin = AT91_PIN_PA9, .phy_irq_pin = AT91_PIN_PA9,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -115,7 +115,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = { ...@@ -115,7 +115,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct __initdata at91_eth_data cam60_macb_data = { static struct __initdata macb_platform_data cam60_macb_data = {
.phy_irq_pin = AT91_PIN_PB5, .phy_irq_pin = AT91_PIN_PB5,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -153,7 +153,7 @@ static struct at91_mmc_data __initdata cap9adk_mmc_data = { ...@@ -153,7 +153,7 @@ static struct at91_mmc_data __initdata cap9adk_mmc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata cap9adk_macb_data = { static struct macb_platform_data __initdata cap9adk_macb_data = {
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -57,7 +57,7 @@ static void __init carmeva_init_early(void) ...@@ -57,7 +57,7 @@ static void __init carmeva_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata carmeva_eth_data = { static struct macb_platform_data __initdata carmeva_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -99,7 +99,7 @@ static struct at91_udc_data __initdata cpu9krea_udc_data = { ...@@ -99,7 +99,7 @@ static struct at91_udc_data __initdata cpu9krea_udc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata cpu9krea_macb_data = { static struct macb_platform_data __initdata cpu9krea_macb_data = {
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -82,7 +82,7 @@ static void __init cpuat91_init_early(void) ...@@ -82,7 +82,7 @@ static void __init cpuat91_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata cpuat91_eth_data = { static struct macb_platform_data __initdata cpuat91_eth_data = {
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -58,7 +58,7 @@ static void __init csb337_init_early(void) ...@@ -58,7 +58,7 @@ static void __init csb337_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata csb337_eth_data = { static struct macb_platform_data __initdata csb337_eth_data = {
.phy_irq_pin = AT91_PIN_PC2, .phy_irq_pin = AT91_PIN_PC2,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -52,7 +52,7 @@ static void __init csb637_init_early(void) ...@@ -52,7 +52,7 @@ static void __init csb637_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata csb637_eth_data = { static struct macb_platform_data __initdata csb637_eth_data = {
.phy_irq_pin = AT91_PIN_PC0, .phy_irq_pin = AT91_PIN_PC0,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -60,7 +60,7 @@ static void __init eb9200_init_early(void) ...@@ -60,7 +60,7 @@ static void __init eb9200_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata eb9200_eth_data = { static struct macb_platform_data __initdata eb9200_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -64,7 +64,7 @@ static void __init ecb_at91init_early(void) ...@@ -64,7 +64,7 @@ static void __init ecb_at91init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata ecb_at91eth_data = { static struct macb_platform_data __initdata ecb_at91eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -47,7 +47,7 @@ static void __init eco920_init_early(void) ...@@ -47,7 +47,7 @@ static void __init eco920_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata eco920_eth_data = { static struct macb_platform_data __initdata eco920_eth_data = {
.phy_irq_pin = AT91_PIN_PC2, .phy_irq_pin = AT91_PIN_PC2,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -135,7 +135,7 @@ static struct spi_board_info foxg20_spi_devices[] = { ...@@ -135,7 +135,7 @@ static struct spi_board_info foxg20_spi_devices[] = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata foxg20_macb_data = { static struct macb_platform_data __initdata foxg20_macb_data = {
.phy_irq_pin = AT91_PIN_PA7, .phy_irq_pin = AT91_PIN_PA7,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -93,7 +93,7 @@ static struct at91_udc_data __initdata udc_data = { ...@@ -93,7 +93,7 @@ static struct at91_udc_data __initdata udc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata macb_data = { static struct macb_platform_data __initdata macb_data = {
.phy_irq_pin = AT91_PIN_PA28, .phy_irq_pin = AT91_PIN_PA28,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -61,7 +61,7 @@ static void __init kafa_init_early(void) ...@@ -61,7 +61,7 @@ static void __init kafa_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata kafa_eth_data = { static struct macb_platform_data __initdata kafa_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -69,7 +69,7 @@ static void __init kb9202_init_early(void) ...@@ -69,7 +69,7 @@ static void __init kb9202_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata kb9202_eth_data = { static struct macb_platform_data __initdata kb9202_eth_data = {
.phy_irq_pin = AT91_PIN_PB29, .phy_irq_pin = AT91_PIN_PB29,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -155,7 +155,7 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = { ...@@ -155,7 +155,7 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata neocore926_macb_data = { static struct macb_platform_data __initdata neocore926_macb_data = {
.phy_irq_pin = AT91_PIN_PE31, .phy_irq_pin = AT91_PIN_PE31,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -122,7 +122,7 @@ static struct at91_udc_data __initdata pcontrol_g20_udc_data = { ...@@ -122,7 +122,7 @@ static struct at91_udc_data __initdata pcontrol_g20_udc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata macb_data = { static struct macb_platform_data __initdata macb_data = {
.phy_irq_pin = AT91_PIN_PA28, .phy_irq_pin = AT91_PIN_PA28,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -60,7 +60,7 @@ static void __init picotux200_init_early(void) ...@@ -60,7 +60,7 @@ static void __init picotux200_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata picotux200_eth_data = { static struct macb_platform_data __initdata picotux200_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -104,7 +104,7 @@ static struct spi_board_info ek_spi_devices[] = { ...@@ -104,7 +104,7 @@ static struct spi_board_info ek_spi_devices[] = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PA31, .phy_irq_pin = AT91_PIN_PA31,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -65,7 +65,7 @@ static void __init dk_init_early(void) ...@@ -65,7 +65,7 @@ static void __init dk_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata dk_eth_data = { static struct macb_platform_data __initdata dk_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -65,7 +65,7 @@ static void __init ek_init_early(void) ...@@ -65,7 +65,7 @@ static void __init ek_init_early(void)
at91_set_serial_console(0); at91_set_serial_console(0);
} }
static struct at91_eth_data __initdata ek_eth_data = { static struct macb_platform_data __initdata ek_eth_data = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -60,7 +60,7 @@ static void __init rsi_ews_init_early(void) ...@@ -60,7 +60,7 @@ static void __init rsi_ews_init_early(void)
/* /*
* Ethernet * Ethernet
*/ */
static struct at91_eth_data rsi_ews_eth_data __initdata = { static struct macb_platform_data rsi_ews_eth_data __initdata = {
.phy_irq_pin = AT91_PIN_PC4, .phy_irq_pin = AT91_PIN_PC4,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -109,7 +109,7 @@ static struct spi_board_info ek_spi_devices[] = { ...@@ -109,7 +109,7 @@ static struct spi_board_info ek_spi_devices[] = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PA7, .phy_irq_pin = AT91_PIN_PA7,
.is_rmii = 0, .is_rmii = 0,
}; };
......
...@@ -151,7 +151,7 @@ static struct spi_board_info ek_spi_devices[] = { ...@@ -151,7 +151,7 @@ static struct spi_board_info ek_spi_devices[] = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PA7, .phy_irq_pin = AT91_PIN_PA7,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -158,7 +158,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = { ...@@ -158,7 +158,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PE31, .phy_irq_pin = AT91_PIN_PE31,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -123,7 +123,7 @@ static struct spi_board_info ek_spi_devices[] = { ...@@ -123,7 +123,7 @@ static struct spi_board_info ek_spi_devices[] = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PA7, .phy_irq_pin = AT91_PIN_PA7,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -115,7 +115,7 @@ static struct mci_platform_data __initdata mci1_data = { ...@@ -115,7 +115,7 @@ static struct mci_platform_data __initdata mci1_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PD5, .phy_irq_pin = AT91_PIN_PD5,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -65,7 +65,7 @@ static struct at91_udc_data __initdata snapper9260_udc_data = { ...@@ -65,7 +65,7 @@ static struct at91_udc_data __initdata snapper9260_udc_data = {
.vbus_polled = 1, .vbus_polled = 1,
}; };
static struct at91_eth_data snapper9260_macb_data = { static struct macb_platform_data snapper9260_macb_data = {
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -157,7 +157,7 @@ static struct at91_udc_data __initdata stamp9g20evb_udc_data = { ...@@ -157,7 +157,7 @@ static struct at91_udc_data __initdata stamp9g20evb_udc_data = {
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata macb_data = { static struct macb_platform_data __initdata macb_data = {
.phy_irq_pin = AT91_PIN_PA28, .phy_irq_pin = AT91_PIN_PA28,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -146,7 +146,7 @@ static void __init ek_add_device_spi(void) ...@@ -146,7 +146,7 @@ static void __init ek_add_device_spi(void)
/* /*
* MACB Ethernet device * MACB Ethernet device
*/ */
static struct at91_eth_data __initdata ek_macb_data = { static struct macb_platform_data __initdata ek_macb_data = {
.phy_irq_pin = AT91_PIN_PE31, .phy_irq_pin = AT91_PIN_PE31,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -110,7 +110,7 @@ static struct gpio_led yl9200_leds[] = { ...@@ -110,7 +110,7 @@ static struct gpio_led yl9200_leds[] = {
/* /*
* Ethernet * Ethernet
*/ */
static struct at91_eth_data __initdata yl9200_eth_data = { static struct macb_platform_data __initdata yl9200_eth_data = {
.phy_irq_pin = AT91_PIN_PB28, .phy_irq_pin = AT91_PIN_PB28,
.is_rmii = 1, .is_rmii = 1,
}; };
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/atmel-mci.h> #include <linux/atmel-mci.h>
#include <sound/atmel-ac97c.h> #include <sound/atmel-ac97c.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/platform_data/macb.h>
/* USB Device */ /* USB Device */
struct at91_udc_data { struct at91_udc_data {
...@@ -81,18 +82,7 @@ extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) ...@@ -81,18 +82,7 @@ extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
/* atmel-mci platform config */ /* atmel-mci platform config */
extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data); extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data);
/* Ethernet (EMAC & MACB) */ extern void __init at91_add_device_eth(struct macb_platform_data *data);
struct at91_eth_data {
u32 phy_mask;
u8 phy_irq_pin; /* PHY IRQ */
u8 is_rmii; /* using RMII interface? */
};
extern void __init at91_add_device_eth(struct at91_eth_data *data);
#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \
|| defined(CONFIG_ARCH_AT91SAM9G45)
#define eth_platform_data at91_eth_data
#endif
/* USB Host */ /* USB Host */
struct at91_usbh_data { struct at91_usbh_data {
......
...@@ -109,7 +109,7 @@ struct eth_addr { ...@@ -109,7 +109,7 @@ struct eth_addr {
u8 addr[6]; u8 addr[6];
}; };
static struct eth_addr __initdata hw_addr[2]; static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2]; static struct macb_platform_data __initdata eth_data[2];
static struct spi_board_info spi0_board_info[] __initdata = { static struct spi_board_info spi0_board_info[] __initdata = {
{ {
......
...@@ -105,7 +105,7 @@ struct eth_addr { ...@@ -105,7 +105,7 @@ struct eth_addr {
}; };
static struct eth_addr __initdata hw_addr[2]; static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2] = { static struct macb_platform_data __initdata eth_data[2] = {
{ {
/* /*
* The MDIO pullups on STK1000 are a bit too weak for * The MDIO pullups on STK1000 are a bit too weak for
......
...@@ -50,7 +50,7 @@ struct eth_addr { ...@@ -50,7 +50,7 @@ struct eth_addr {
u8 addr[6]; u8 addr[6];
}; };
static struct eth_addr __initdata hw_addr[1]; static struct eth_addr __initdata hw_addr[1];
static struct eth_platform_data __initdata eth_data[1] = { static struct macb_platform_data __initdata eth_data[1] = {
{ {
.phy_mask = ~(1U << 1), .phy_mask = ~(1U << 1),
}, },
......
...@@ -102,7 +102,7 @@ struct eth_addr { ...@@ -102,7 +102,7 @@ struct eth_addr {
}; };
static struct eth_addr __initdata hw_addr[1]; static struct eth_addr __initdata hw_addr[1];
static struct eth_platform_data __initdata eth_data[1]; static struct macb_platform_data __initdata eth_data[1];
/* /*
* The next two functions should go away as the boot loader is * The next two functions should go away as the boot loader is
......
...@@ -52,7 +52,7 @@ struct eth_addr { ...@@ -52,7 +52,7 @@ struct eth_addr {
}; };
static struct eth_addr __initdata hw_addr[2]; static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2]; static struct macb_platform_data __initdata eth_data[2];
static int ads7846_get_pendown_state_PB26(void) static int ads7846_get_pendown_state_PB26(void)
{ {
......
...@@ -86,7 +86,7 @@ struct eth_addr { ...@@ -86,7 +86,7 @@ struct eth_addr {
u8 addr[6]; u8 addr[6];
}; };
static struct eth_addr __initdata hw_addr[2]; static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2]; static struct macb_platform_data __initdata eth_data[2];
static struct spi_eeprom eeprom_25lc010 = { static struct spi_eeprom eeprom_25lc010 = {
.name = "25lc010", .name = "25lc010",
......
...@@ -1067,7 +1067,7 @@ void __init at32_setup_serial_console(unsigned int usart_id) ...@@ -1067,7 +1067,7 @@ void __init at32_setup_serial_console(unsigned int usart_id)
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#ifdef CONFIG_CPU_AT32AP7000 #ifdef CONFIG_CPU_AT32AP7000
static struct eth_platform_data macb0_data; static struct macb_platform_data macb0_data;
static struct resource macb0_resource[] = { static struct resource macb0_resource[] = {
PBMEM(0xfff01800), PBMEM(0xfff01800),
IRQ(25), IRQ(25),
...@@ -1076,7 +1076,7 @@ DEFINE_DEV_DATA(macb, 0); ...@@ -1076,7 +1076,7 @@ DEFINE_DEV_DATA(macb, 0);
DEV_CLK(hclk, macb0, hsb, 8); DEV_CLK(hclk, macb0, hsb, 8);
DEV_CLK(pclk, macb0, pbb, 6); DEV_CLK(pclk, macb0, pbb, 6);
static struct eth_platform_data macb1_data; static struct macb_platform_data macb1_data;
static struct resource macb1_resource[] = { static struct resource macb1_resource[] = {
PBMEM(0xfff01c00), PBMEM(0xfff01c00),
IRQ(26), IRQ(26),
...@@ -1086,7 +1086,7 @@ DEV_CLK(hclk, macb1, hsb, 9); ...@@ -1086,7 +1086,7 @@ DEV_CLK(hclk, macb1, hsb, 9);
DEV_CLK(pclk, macb1, pbb, 7); DEV_CLK(pclk, macb1, pbb, 7);
struct platform_device *__init struct platform_device *__init
at32_add_device_eth(unsigned int id, struct eth_platform_data *data) at32_add_device_eth(unsigned int id, struct macb_platform_data *data)
{ {
struct platform_device *pdev; struct platform_device *pdev;
u32 pin_mask; u32 pin_mask;
...@@ -1163,7 +1163,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data) ...@@ -1163,7 +1163,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
return NULL; return NULL;
} }
memcpy(pdev->dev.platform_data, data, sizeof(struct eth_platform_data)); memcpy(pdev->dev.platform_data, data, sizeof(struct macb_platform_data));
platform_device_register(pdev); platform_device_register(pdev);
return pdev; return pdev;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/platform_data/macb.h>
#define GPIO_PIN_NONE (-1) #define GPIO_PIN_NONE (-1)
...@@ -42,12 +43,8 @@ struct atmel_uart_data { ...@@ -42,12 +43,8 @@ struct atmel_uart_data {
void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
struct platform_device *at32_add_device_usart(unsigned int id); struct platform_device *at32_add_device_usart(unsigned int id);
struct eth_platform_data {
u32 phy_mask;
u8 is_rmii;
};
struct platform_device * struct platform_device *
at32_add_device_eth(unsigned int id, struct eth_platform_data *data); at32_add_device_eth(unsigned int id, struct macb_platform_data *data);
struct spi_board_info; struct spi_board_info;
struct platform_device * struct platform_device *
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/platform_data/macb.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/gfp.h> #include <linux/gfp.h>
...@@ -984,7 +985,7 @@ static const struct net_device_ops at91ether_netdev_ops = { ...@@ -984,7 +985,7 @@ static const struct net_device_ops at91ether_netdev_ops = {
static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address, static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address,
struct platform_device *pdev, struct clk *ether_clk) struct platform_device *pdev, struct clk *ether_clk)
{ {
struct at91_eth_data *board_data = pdev->dev.platform_data; struct macb_platform_data *board_data = pdev->dev.platform_data;
struct net_device *dev; struct net_device *dev;
struct at91_private *lp; struct at91_private *lp;
unsigned int val; unsigned int val;
......
...@@ -85,7 +85,9 @@ struct recv_desc_bufs ...@@ -85,7 +85,9 @@ struct recv_desc_bufs
struct at91_private struct at91_private
{ {
struct mii_if_info mii; /* ethtool support */ struct mii_if_info mii; /* ethtool support */
struct at91_eth_data board_data; /* board-specific configuration */ struct macb_platform_data board_data; /* board-specific
* configuration (shared with
* macb for common data */
struct clk *ether_clk; /* clock */ struct clk *ether_clk; /* clock */
/* PHY */ /* PHY */
......
This diff is collapsed.
/*
* Copyright (C) 2004-2006 Atmel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __MACB_PDATA_H__
#define __MACB_PDATA_H__
struct macb_platform_data {
u32 phy_mask;
u8 phy_irq_pin; /* PHY IRQ */
u8 is_rmii; /* using RMII interface? */
};
#endif /* __MACB_PDATA_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment