diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-07-12 21:31:45 (GMT) |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2017-07-13 13:05:49 (GMT) |
commit | 3f0a1042bb4eae00eae1e9bb9aa4dca4f3b987f8 (patch) | |
tree | 1cabef65737d62f8385e94ee4f0daec08c7faba6 | |
parent | bc104a706601b576f01c1029e2adbb188a9acf43 (diff) | |
download | u-boot-3f0a1042bb4eae00eae1e9bb9aa4dca4f3b987f8.tar.xz |
mx6sabreauto: Make Ethernet functional again
Since commit ce412b79e7255770 ("drivers: net: phy: atheros: add separate
config for AR8031") Ethernet does not work on mx6sabreauto.
This commit correctly assigns ar8031_config() as the configuration
function for AR8031 in the same way as done in the Linux kernel.
However, on mx6sabreauto design we need some additional configurations,
such as enabling the 125 MHz AR8031 output and setting the TX clock
delay that need to be done in the board file.
This is the equivalent fix from commit 4b6035da482c ("mx6sabresd: Make
Ethernet functional again").
Reported-by: Miquel RAYNAL <miquel.raynal@free-electrons.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
-rw-r--r-- | board/freescale/mx6sabreauto/mx6sabreauto.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c b/board/freescale/mx6sabreauto/mx6sabreauto.c index a8fe251..a5703a3 100644 --- a/board/freescale/mx6sabreauto/mx6sabreauto.c +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c @@ -433,6 +433,39 @@ u32 get_board_rev(void) return (get_cpu_rev() & ~(0xF << 8)) | rev; } +static int ar8031_phy_fixup(struct phy_device *phydev) +{ + unsigned short val; + + /* To enable AR8031 ouput a 125MHz clk from CLK_25M */ + phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7); + phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016); + phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007); + + val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe); + val &= 0xffe3; + val |= 0x18; + phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val); + + /* introduce tx clock delay */ + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x5); + val = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e); + val |= 0x0100; + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, val); + + return 0; +} + +int board_phy_config(struct phy_device *phydev) +{ + ar8031_phy_fixup(phydev); + + if (phydev->drv->config) + phydev->drv->config(phydev); + + return 0; +} + #if defined(CONFIG_VIDEO_IPUV3) static void disable_lvds(struct display_info_t const *dev) { |