]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: gem: Pass phy address to init
authorDavid Andrey <david.andrey@netmodule.com>
Thu, 4 Apr 2013 17:13:07 +0000 (19:13 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 25 Apr 2013 14:55:46 +0000 (16:55 +0200)
Pass the PHY address to the driver init to
allow parallel use of both interfaces

Signed-off-by: David Andrey <david.andrey@netmodule.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynq/board.c
drivers/net/zynq_gem.c
include/configs/petalogix-arm-auto.h
include/configs/zynq.h
include/configs/zynq_zc70x.h
include/configs/zynq_zc770.h
include/configs/zynq_zed.h
include/netdev.h

index 6abc2e329c9714bd58be97bec5ebbbb329ab8e02..4859bfa211d120f8264bffef2bd0a99e727a7f81 100644 (file)
@@ -144,10 +144,12 @@ int board_eth_init(bd_t *bis)
 
 #if defined(CONFIG_ZYNQ_GEM)
 # if defined(CONFIG_ZYNQ_GEM0)
-       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR0);
+       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR0,
+                                               CONFIG_ZYNQ_GEM_PHY_ADDR0);
 # endif
 # if defined(CONFIG_ZYNQ_GEM1)
-       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR1);
+       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR1,
+                                               CONFIG_ZYNQ_GEM_PHY_ADDR1);
 # endif
 #endif
 
index bd1c8c095c4f529bade415fe4eee17fd47e90149..5b3c8203ea9000a86e2e10e3b2b8946d6ecf9e64 100644 (file)
@@ -538,7 +538,7 @@ static int zynq_gem_miiphy_write(const char *devname, uchar addr,
        return phywrite(dev, addr, reg, val);
 }
 
-int zynq_gem_initialize(bd_t *bis, int base_addr)
+int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr)
 {
        struct eth_device *dev;
        struct zynq_gem_priv *priv;
@@ -554,11 +554,7 @@ int zynq_gem_initialize(bd_t *bis, int base_addr)
        }
        priv = dev->priv;
 
-#ifdef CONFIG_PHY_ADDR
-       priv->phyaddr = CONFIG_PHY_ADDR;
-#else
-       priv->phyaddr = -1;
-#endif
+       priv->phyaddr = phy_addr;
 
        sprintf(dev->name, "Gem.%x", base_addr);
 
index 7a66566a3c1a22cc06aa75ba814687ae4c8060a9..f4fa18caddb5c405354a0bc7b957851025983bb3 100644 (file)
 #if defined(XILINX_PS7_GEM_BASEADDR)
 # if (XILINX_PS7_GEM_BASEADDR == ZYNQ_GEM_BASEADDR0)
 #  define CONFIG_ZYNQ_GEM0
+#  define CONFIG_ZYNQ_GEM_PHY_ADDR     -1
 # else
 #  define CONFIG_ZYNQ_GEM1
+#  define CONFIG_ZYNQ_GEM_PHY_ADDR1    -1
 # endif
 #endif
 
index ebe1b1bc05adfd9af1189bfa87340c280ef1191d..3b23354bc8a3f2c411b77286641df067a6c07685 100644 (file)
@@ -54,6 +54,7 @@
 #define CONFIG_NET_MULTI
 #define CONFIG_ZYNQ_GEM
 #define CONFIG_ZYNQ_GEM0
+#define CONFIG_ZYNQ_GEM_PHY_ADDR0      7
 
 #if defined(CONFIG_ZYNQ_DCC)
 # define CONFIG_ARM_DCC
index 53c58396bdcf6e12d21b282d029ddc8cea73d0a4..8fe3af23d84f1340e29e18f19bfcad8c28dc4c6c 100644 (file)
@@ -22,7 +22,7 @@
 
 #define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
-#define CONFIG_PHY_ADDR        7
+#define CONFIG_ZYNQ_GEM_PHY_ADDR0      7
 
 #define CONFIG_SYS_NO_FLASH
 
index 1eab709233577fdc30ae3395e47c923707a9900b..0e27a438fe1426c8f037260aa4de9db430af14c3 100644 (file)
@@ -25,7 +25,7 @@
 #if defined(CONFIG_ZC770_XM010)
 # define CONFIG_ZYNQ_SERIAL_UART1
 # define CONFIG_ZYNQ_GEM0
-# define CONFIG_PHY_ADDR       7
+# define CONFIG_ZYNQ_GEM_PHY_ADDR0     7
 # define CONFIG_ZYNQ_SDHCI0
 # define CONFIG_ZYNQ_SPI
 
@@ -40,7 +40,7 @@
 #elif defined(CONFIG_ZC770_XM013)
 # define CONFIG_ZYNQ_SERIAL_UART0
 # define CONFIG_ZYNQ_GEM1
-# define CONFIG_PHY_ADDR       7
+# define CONFIG_ZYNQ_GEM_PHY_ADDR1     7
 # define CONFIG_ZYNQ_SPI
 
 #else
index fe93abf611c53d193680da9a2458980c17a53dbf..506b0ab0250d76f95cda9434bc34ecbc0d5addbb 100644 (file)
@@ -22,7 +22,7 @@
 
 #define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
-#define CONFIG_PHY_ADDR        0
+#define CONFIG_ZYNQ_GEM_PHY_ADDR0      0
 
 #define CONFIG_SYS_NO_FLASH
 
index 5926a1064c23106a53f649d43120cb73d6cd2aff..e9b9ec39024fd751cd5f2d57b7ef1177a17ddce5 100644 (file)
@@ -104,7 +104,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
                                                        int txpp, int rxpp);
 int xilinx_ll_temac_initialize(bd_t *bis, unsigned long base_addr,
                                                int mode, unsigned long ctrl);
-int zynq_gem_initialize(bd_t *bis, int base_addr);
+int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr);
 /*
  * As long as the Xilinx xps_ll_temac ethernet driver has not its own interface
  * exported by a public hader file, we need a global definition at this point.