From patchwork Thu Aug 11 14:34:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mugunthan V N X-Patchwork-Id: 658379 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3s9MvH151mz9s9W for ; Fri, 12 Aug 2016 08:22:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 60988A751E; Fri, 12 Aug 2016 00:22:01 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IO_NJ2injUa5; Fri, 12 Aug 2016 00:22:01 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7FCE74BA35; Fri, 12 Aug 2016 00:21:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94F404B801 for ; Thu, 11 Aug 2016 16:35:58 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id syjlzK0uYciB for ; Thu, 11 Aug 2016 16:35:06 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from bear.ext.ti.com (bear.ext.ti.com [198.47.19.11]) by theia.denx.de (Postfix) with ESMTPS id C202D4B71E for ; Thu, 11 Aug 2016 16:34:16 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u7BEY8tm012350; Thu, 11 Aug 2016 09:34:09 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u7BEY8PP013396; Thu, 11 Aug 2016 09:34:08 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Thu, 11 Aug 2016 09:34:08 -0500 Received: from a0131834lt.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u7BEY4DI014934; Thu, 11 Aug 2016 09:34:05 -0500 From: Mugunthan V N To: Date: Thu, 11 Aug 2016 20:04:03 +0530 Message-ID: <20160811143403.26695-1-mugunthanvnm@ti.com> X-Mailer: git-send-email 2.9.2.664.ga0a1831 MIME-Version: 1.0 Cc: Tom Rini , WingMan Kwok , Joe Hershberger Subject: [U-Boot] [PATCH] drivers: net: keystone_net: add rgmii link type support when parsing dt X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reported-by: Sekhar Nori Tested-by: Sekhar Nori Acked-by: Joe Hershberger --- 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;