summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Bießmann <andreas.devel@googlemail.com>2014-09-18 23:46:49 +0200
committerAndreas Bießmann <andreas.devel@googlemail.com>2014-10-10 21:51:17 +0200
commitb719a08863dc865fbdd049f50eefeca52fc2cdcc (patch)
treec1ba9fc8b73940a14cf215e51c9ea0c4da021a96
parent476095772f3aa58ee581943e4e993d9b8a61239c (diff)
downloadu-boot-imx-b719a08863dc865fbdd049f50eefeca52fc2cdcc.zip
u-boot-imx-b719a08863dc865fbdd049f50eefeca52fc2cdcc.tar.gz
u-boot-imx-b719a08863dc865fbdd049f50eefeca52fc2cdcc.tar.bz2
sama5d3xek: run PHY's config
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Bo Shen <voice.shen@atmel.com>
-rw-r--r--board/atmel/sama5d3xek/sama5d3xek.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c
index f53754b..ca4f79d 100644
--- a/board/atmel/sama5d3xek/sama5d3xek.c
+++ b/board/atmel/sama5d3xek/sama5d3xek.c
@@ -17,6 +17,7 @@
#include <lcd.h>
#include <atmel_lcdc.h>
#include <atmel_mci.h>
+#include <phy.h>
#include <micrel.h>
#include <net.h>
#include <netdev.h>
@@ -273,15 +274,25 @@ int dram_init(void)
int board_phy_config(struct phy_device *phydev)
{
- /* rx data delay */
- ksz9021_phy_extended_write(phydev,
- MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW, 0x2222);
- /* tx data delay */
- ksz9021_phy_extended_write(phydev,
- MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW, 0x2222);
- /* rx/tx clock delay */
- ksz9021_phy_extended_write(phydev,
- MII_KSZ9021_EXT_RGMII_CLOCK_SKEW, 0xf2f4);
+ /* board specific timings for GMAC */
+ if (has_gmac()) {
+ /* rx data delay */
+ ksz9021_phy_extended_write(phydev,
+ MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW,
+ 0x2222);
+ /* tx data delay */
+ ksz9021_phy_extended_write(phydev,
+ MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW,
+ 0x2222);
+ /* rx/tx clock delay */
+ ksz9021_phy_extended_write(phydev,
+ MII_KSZ9021_EXT_RGMII_CLOCK_SKEW,
+ 0xf2f4);
+ }
+
+ /* always run the PHY's config routine */
+ if (phydev->drv->config)
+ return phydev->drv->config(phydev);
return 0;
}