Skip to content

Commit

Permalink
macb: unify at91 and avr32 platform data
Browse files Browse the repository at this point in the history
Both at91 and avr32 defines its own platform data structure for
the macb driver and both share common structures though at91
includes a currently unused phy_irq_pin.  Create a common
macb_platform_data for macb that both at91 and avr32 can use.  In
future we can use this to support other architectures that use the
same IP block with the macb driver.

v2: rename eth_platform_data to macb_platform_data and allow at91_ether
to share the platform data with macb.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  • Loading branch information
Jamie Iles committed Nov 22, 2011
1 parent 461845d commit 84e0cdb
Show file tree
Hide file tree
Showing 50 changed files with 87 additions and 82 deletions.
6 changes: 3 additions & 3 deletions arch/arm/mach-at91/at91cap9_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}

#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
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[] = {
[0] = {
Expand All @@ -227,7 +227,7 @@ static struct platform_device at91cap9_eth_device = {
.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)
return;
Expand Down Expand Up @@ -264,7 +264,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91cap9_eth_device);
}
#else
void __init at91_add_device_eth(struct at91_eth_data *data) {}
void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif


Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-at91/at91rm9200_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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[] = {
[0] = {
Expand All @@ -162,7 +162,7 @@ static struct platform_device at91rm9200_eth_device = {
.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)
return;
Expand Down Expand Up @@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91rm9200_eth_device);
}
#else
void __init at91_add_device_eth(struct at91_eth_data *data) {}
void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif


Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-at91/at91sam9260_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}

#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
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[] = {
[0] = {
Expand All @@ -163,7 +163,7 @@ static struct platform_device at91sam9260_eth_device = {
.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)
return;
Expand Down Expand Up @@ -200,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91sam9260_eth_device);
}
#else
void __init at91_add_device_eth(struct at91_eth_data *data) {}
void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif


Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-at91/at91sam9263_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}

#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
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[] = {
[0] = {
Expand All @@ -171,7 +171,7 @@ static struct platform_device at91sam9263_eth_device = {
.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)
return;
Expand Down Expand Up @@ -208,7 +208,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91sam9263_eth_device);
}
#else
void __init at91_add_device_eth(struct at91_eth_data *data) {}
void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif


Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-at91/at91sam9g45_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}

#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
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[] = {
[0] = {
Expand All @@ -311,7 +311,7 @@ static struct platform_device at91sam9g45_eth_device = {
.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)
return;
Expand Down Expand Up @@ -348,7 +348,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
platform_device_register(&at91sam9g45_eth_device);
}
#else
void __init at91_add_device_eth(struct at91_eth_data *data) {}
void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif


Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-1arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void __init onearm_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-afeb-9260v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static struct spi_board_info afeb9260_spi_devices[] = {
/*
* 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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cam60.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = {
/*
* 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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cap9adk.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static struct at91_mmc_data __initdata cap9adk_mmc_data = {
/*
* MACB Ethernet device
*/
static struct at91_eth_data __initdata cap9adk_macb_data = {
static struct macb_platform_data __initdata cap9adk_macb_data = {
.is_rmii = 1,
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-carmeva.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void __init carmeva_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cpu9krea.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static struct at91_udc_data __initdata cpu9krea_udc_data = {
/*
* MACB Ethernet device
*/
static struct at91_eth_data __initdata cpu9krea_macb_data = {
static struct macb_platform_data __initdata cpu9krea_macb_data = {
.is_rmii = 1,
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cpuat91.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void __init cpuat91_init_early(void)
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,
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-csb337.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void __init csb337_init_early(void)
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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-csb637.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void __init csb637_init_early(void)
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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-eb9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void __init eb9200_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-ecbat91.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void __init ecb_at91init_early(void)
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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-eco920.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void __init eco920_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-foxg20.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static struct spi_board_info foxg20_spi_devices[] = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-gsia18s.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static struct at91_udc_data __initdata udc_data = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-kafa.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void __init kafa_init_early(void)
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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-kb9202.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void __init kb9202_init_early(void)
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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-neocore926.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-pcontrol-g20.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static struct at91_udc_data __initdata pcontrol_g20_udc_data = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-picotux200.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void __init picotux200_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-qil-a9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static struct spi_board_info ek_spi_devices[] = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rm9200dk.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void __init dk_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rm9200ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void __init ek_init_early(void)
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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rsi-ews.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void __init rsi_ews_init_early(void)
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9-l9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static struct spi_board_info ek_spi_devices[] = {
/*
* 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,
.is_rmii = 0,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9260ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static struct spi_board_info ek_spi_devices[] = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9263ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9g20ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static struct spi_board_info ek_spi_devices[] = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9m10g45ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static struct mci_platform_data __initdata mci1_data = {
/*
* 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,
.is_rmii = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-snapper9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static struct at91_udc_data __initdata snapper9260_udc_data = {
.vbus_polled = 1,
};

static struct at91_eth_data snapper9260_macb_data = {
static struct macb_platform_data snapper9260_macb_data = {
.is_rmii = 1,
};

Expand Down
Loading

0 comments on commit 84e0cdb

Please sign in to comment.