[U-Boot] [PATCH] drivers: net: keystone_net: add rgmii link type support when parsing dt

Add support to detect RGMII link interface from link-interface device tree entry. Also rename the existing link type enums so that it provides meaningful interface like SGMII.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com ---
Tested this patch on Keystone K2G evm, logs [1]
[1] - http://pastebin.ubuntu.com/23026361/
--- drivers/net/keystone_net.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c index e41b7d1..0da3325 100644 --- a/drivers/net/keystone_net.c +++ b/drivers/net/keystone_net.c @@ -56,13 +56,16 @@ struct rx_buff_desc net_rx_buffs = { #ifdef CONFIG_DM_ETH
enum link_type { - LINK_TYPE_MAC_TO_MAC_AUTO = 0, - LINK_TYPE_MAC_TO_PHY_MODE = 1, - LINK_TYPE_MAC_TO_MAC_FORCED_MODE = 2, - LINK_TYPE_MAC_TO_FIBRE_MODE = 3, - LINK_TYPE_MAC_TO_PHY_NO_MDIO_MODE = 4, - LINK_TYPE_10G_MAC_TO_PHY_MODE = 10, - LINK_TYPE_10G_MAC_TO_MAC_FORCED_MODE = 11, + LINK_TYPE_SGMII_MAC_TO_MAC_AUTO = 0, + LINK_TYPE_SGMII_MAC_TO_PHY_MODE = 1, + LINK_TYPE_SGMII_MAC_TO_MAC_FORCED_MODE = 2, + LINK_TYPE_SGMII_MAC_TO_FIBRE_MODE = 3, + LINK_TYPE_SGMII_MAC_TO_PHY_NO_MDIO_MODE = 4, + LINK_TYPE_RGMII_LINK_MAC_PHY = 5, + LINK_TYPE_RGMII_LINK_MAC_MAC_FORCED = 6, + LINK_TYPE_RGMII_LINK_MAC_PHY_NO_MDIO = 7, + LINK_TYPE_10G_MAC_TO_PHY_MODE = 10, + LINK_TYPE_10G_MAC_TO_MAC_FORCED_MODE = 11, };
#define mac_hi(mac) (((mac)[0] << 0) | ((mac)[1] << 8) | \ @@ -1077,11 +1080,15 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave, priv->mdio_base = (void *)fdtdec_get_addr(fdt, mdio, "reg"); }
- if (priv->link_type == LINK_TYPE_MAC_TO_PHY_MODE) { + if (priv->link_type == LINK_TYPE_SGMII_MAC_TO_PHY_MODE) { priv->phy_if = PHY_INTERFACE_MODE_SGMII; pdata->phy_interface = priv->phy_if; priv->sgmii_link_type = SGMII_LINK_MAC_PHY; priv->has_mdio = true; + } else if (priv->link_type == LINK_TYPE_RGMII_LINK_MAC_PHY) { + priv->phy_if = PHY_INTERFACE_MODE_RGMII; + pdata->phy_interface = priv->phy_if; + priv->has_mdio = true; }
return 0;

On Thursday 11 August 2016 08:04 PM, Mugunthan V N wrote:
Add support to detect RGMII link interface from link-interface device tree entry. Also rename the existing link type enums so that it provides meaningful interface like SGMII.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Reported-by: Sekhar Nori nsekhar@ti.com Tested-by: Sekhar Nori nsekhar@ti.com
Fixes crash on K2G on network access with mainline master.
Regards, Sekhar

On Thu, Aug 11, 2016 at 9:34 AM, Mugunthan V N mugunthanvnm@ti.com wrote:
Add support to detect RGMII link interface from link-interface device tree entry. Also rename the existing link type enums so that it provides meaningful interface like SGMII.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Acked-by: Joe Hershberger joe.hershberger@ni.com

On Thu, Aug 11, 2016 at 08:04:03PM +0530, Mugunthan V N wrote:
Add support to detect RGMII link interface from link-interface device tree entry. Also rename the existing link type enums so that it provides meaningful interface like SGMII.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com Reported-by: Sekhar Nori nsekhar@ti.com Tested-by: Sekhar Nori nsekhar@ti.com Acked-by: Joe Hershberger joe.hershberger@ni.com
Applied to u-boot/master, thanks!
participants (4)
-
Joe Hershberger
-
Mugunthan V N
-
Sekhar Nori
-
Tom Rini