Xilinx: LL TEMAC: removed __res for powerpc arch
Subsystems (2)
PATCH 1/1 Xilinx: LL TEMAC: removed __res for powerpc arch
The copy of the mac address from the board data to the platform data was moved from the LL TEMAC driver to a virtex_device_fixup function so the driver works for powerpc arch also.
Signed-off-by John Linn <[email protected]>
--- arch/ppc/platforms/4xx/Kconfig | 22 +++++++++++---- arch/ppc/platforms/4xx/Makefile | 2 + arch/ppc/platforms/4xx/xilinx_generic_mlxxx.c | 37 +++++++++++++++++++++++++ drivers/net/xilinx_lltemac/xlltemac_main.c | 6 +--- 4 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 arch/ppc/platforms/4xx/xilinx_generic_mlxxx.c
arch/ppc/platforms/4xx/Kconfig +16 -6
@@ -58,6 +58,7 @@ config XILINX_ML300 select XILINX_VIRTEX_II_PRO select EMBEDDEDBOOT select XILINX_EMBED_CONFIG + select XILINX_MLxxx help This option enables support for the Xilinx ML300 evaluation board.
@@ -74,22 +75,25 @@ config XILINX_ML403 select XILINX_VIRTEX_4_FX select EMBEDDEDBOOT select XILINX_EMBED_CONFIG + select XILINX_MLxxx help This option enables support for the Xilinx ML403 evaluation board. config XILINX_ML405 - bool "Xilinx-ML405" - select XILINX_VIRTEX_4_FX - select EMBEDDEDBOOT - select XILINX_EMBED_CONFIG - help - This option enables support for the Xilinx ML405 evaluation board. + bool "Xilinx-ML405" + select XILINX_VIRTEX_4_FX + select EMBEDDEDBOOT + select XILINX_EMBED_CONFIG + select XILINX_MLxxx + help + This option enables support for the Xilinx ML405 evaluation board. config XILINX_ML41x bool "Xilinx-ML41x" select XILINX_VIRTEX_4_FX select EMBEDDEDBOOT select XILINX_EMBED_CONFIG + select XILINX_MLxxx help This option enables support for the Xilinx ML410/411 evaluation boards.
@@ -245,6 +249,12 @@ config 405GPR depends on SYCAMORE default y +config XILINX_MLxxx + bool + help + Include platform support for many Xilinx development boards + with configuration data stored in IIC eeprom. + config XILINX_VIRTEX_II_PRO bool select XILINX_VIRTEX
arch/ppc/platforms/4xx/Makefile +2 -0
@@ -19,6 +19,8 @@ obj-$(CONFIG_XILINX_XUPV2P) += xilinx_generic_ppc.o xilinx_xupv2p.o obj-$(CONFIG_XILINX_ML403) += xilinx_generic_ppc.o obj-$(CONFIG_XILINX_ML405) += xilinx_generic_ppc.o obj-$(CONFIG_XILINX_ML41x) += xilinx_generic_ppc.o +obj-$(CONFIG_XILINX_MLxxx) += xilinx_generic_mlxxx.o +obj-$(CONFIG_XILINX_ML507) += xilinx_generic_mlxxx.o obj-$(CONFIG_405GP) += ibm405gp.o obj-$(CONFIG_REDWOOD_5) += ibmstb4.o
arch/ppc/platforms/4xx/xilinx_generic_mlxxx.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Xilinx MLxxx board initialization +* +* 2007 (c) Xilinx, Inc. This file is licensed under the +* terms of the GNU General Public License version 2. This program is licensed +* "as is" without any warranty of any kind, whether express or implied. +*/ + +#include <linux/io.h> +#include <linux/xilinx_devices.h> +#include <linux/platform_device.h> + +extern bd_t __res; + +int virtex_device_fixup (struct platform_device *dev) +{ +static int temac_count =0 ; +struct xlltemac_platform_data *pdata = dev->dev.platform_data; + +#if defined(CONFIG_XILINX_MLxxx) + +if (strcmp (dev->name,"xilinx_lltemac" ) ==0 ) { + +/* only copy the mac address into the 1st lltemac if +there are multiple */ + +if (temac_count++ ==0 ) { +printk (KERN_INFO "Fixup MAC address for %s:%d\n" , + dev->name, dev->id); +/* Set the MAC address from the iic eeprom info in the board data */ +memcpy (pdata->mac_addr, ((bd_t *) &__res)->bi_enetaddr,6 ); + } + } +#endif + +return 0 ; +}
drivers/net/xilinx_lltemac/xlltemac_main.c +2 -4
@@ -2980,7 +2980,6 @@ static int detect_phy(struct net_local *lp, char *dev_name)printk (KERN_WARNING "XTemac: No PHY detected. Assuming a PHY at address 0\n" );return 0 ;/* default to zero */ } -extern bd_t __res;/** Shared device initialization code */ static int xtenet_setup(
@@ -3048,9 +3047,8 @@ static int xtenet_setup( goto error; } -/* Set the MAC address from the iic eeprom info in the board data */ -memcpy (ndev->dev_addr, ((bd_t *) &__res)->bi_enetaddr,6 ); -memcpy (pdata->mac_addr, ((bd_t *) &__res)->bi_enetaddr,6 ); +/* Set the MAC address from platform data */ +memcpy (ndev->dev_addr, pdata->mac_addr,6 );if (_XLlTemac_SetMacAddress (&lp->Emac, ndev->dev_addr) !=XST_SUCCESS ) {/* should not fail right after an initialize */
Signature · 1 line
1.5.2.1