On Wed, Jul 12, 2017 at 4:52 PM, Fabio Estevam <feste...@gmail.com> wrote:

> I don't have my mx6sabreauto handy to investigate this problem.
>
> Does the change below make Ethernet to work again?
> https://pastebin.com/VnEdBCa6

And here is a patch against u-boot-imx tree (
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=summary)

No need to change anything in defconfig. Only do:

make mx6sabreauto_defconfig
make

and Ethernet should work with the patch applied.

Please let me know how your test goes.
From 90a39a79f2b53459630f71194a4122d169886983 Mon Sep 17 00:00:00 2001
From: Fabio Estevam <fabio.este...@nxp.com>
Date: Wed, 12 Jul 2017 17:08:32 -0300
Subject: [PATCH] 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 configuration,
such as enabling the 125 MHz AR8031 output that needs to be done
in the board file.

This is the same fix as done in commit 4b6035da482c ("mx6sabresd: Make
Ethernet functional again").

Reported-by: Miquel RAYNAL <miquel.ray...@free-electrons.com>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 33 +++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

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)
 {
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to