From patchwork Mon Apr 2 14:37:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 10319927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1F4060375 for ; Mon, 2 Apr 2018 14:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EE8128AA7 for ; Mon, 2 Apr 2018 14:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8164928ADE; Mon, 2 Apr 2018 14:54:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1611028AA7 for ; Mon, 2 Apr 2018 14:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8KmW+oEsE3gCUvuwsjt8pvbYuLG8gEag1y+CJpur96o=; b=BI2g6NZh0OD4MK iRhH5+flVCgnv2mt89k2y7lncmdsHbKPHUHVLCaeVo2Qn1hhYvgvBi6wBCoqA9cGTrzWy8O1wHgkA WtgNDAyjg8O+o1v0fHwU5N/wSqq+kKQwKejpdqTv9v/fcSAwBrcMA9CV1rt8laTir7HRN0hUwWmI4 cgm5Aw9wFRSq+F99JAaFORbzhk7MKiNQjN/KhlvXRp+Zub1B3Wr+ukwkqiBN4JtzR/oH8Vn9mDxK7 Kyzxh/2YMqrrveTWA1wD2zdgdVUMH4t3ec1vx5FX2/ZIJwIsu4fsSEYhLD5niWOfpyMuQxxf8iw6U ZZtQ2O8SDH7Qw55axrcg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f30qg-00019R-Fx; Mon, 02 Apr 2018 14:54:18 +0000 Received: from fllnx210.ext.ti.com ([198.47.19.17]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f30Yh-00045D-Sf for linux-arm-kernel@lists.infradead.org; Mon, 02 Apr 2018 14:35:50 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w32EZNtq027343; Mon, 2 Apr 2018 09:35:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1522679723; bh=H0zZcrV8n8pw59PbRE+j5XciC37ro8j2N1qHMuR70rc=; h=From:To:Subject:Date:In-Reply-To:References; b=dbt/OQuhzv8uWKihtbuLr1L4wYRfDS1m4PmMOsXXltg73jVIePvETVxm6IcsrEviC gI3THCiM52KUCSo1DV2FubBXGkOUKQ7nL2QLb1M+Wo1za1GLLL/dXwihj58o1ez+ui 0B6kcPy6hfI2pBoZuGmd23SaF42+J3ma9rU4JK04= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w32EZNgB024825; Mon, 2 Apr 2018 09:35:23 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 2 Apr 2018 09:35:23 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 2 Apr 2018 09:35:23 -0500 Received: from ula0868495.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w32EZKc1025486; Mon, 2 Apr 2018 09:35:22 -0500 From: Murali Karicheri To: , , , , , , , , , Subject: [net-next PATCH v3 04/11] net: netcp: ethss: make call to gbe_sgmii_config() conditional Date: Mon, 2 Apr 2018 10:37:54 -0400 Message-ID: <1522679881-25643-5-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1522679881-25643-1-git-send-email-m-karicheri2@ti.com> References: <1522679881-25643-1-git-send-email-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180402_073544_059455_14011568 X-CRM114-Status: GOOD ( 17.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As a preparatory patch to add support for 2u cpsw hardware found on K2G SoC, make call to gbe_sgmii_config() conditional. This is required since 2u uses RGMII interface instead of SGMII and to allow for driver re-use. Signed-off-by: Murali Karicheri --- drivers/net/ethernet/ti/netcp_ethss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c index 1b79fe5..1628fbe 100644 --- a/drivers/net/ethernet/ti/netcp_ethss.c +++ b/drivers/net/ethernet/ti/netcp_ethss.c @@ -2274,7 +2274,8 @@ static int gbe_slave_open(struct gbe_intf *gbe_intf) void (*hndlr)(struct net_device *) = gbe_adjust_link; - gbe_sgmii_config(priv, slave); + if (IS_SS_ID_VER_14(priv) || IS_SS_ID_NU(priv)) + gbe_sgmii_config(priv, slave); gbe_port_reset(slave); gbe_sgmii_rtreset(priv, slave, false); gbe_port_config(priv, slave, priv->rx_packet_max); @@ -3042,7 +3043,8 @@ static void init_secondary_ports(struct gbe_priv *gbe_dev, continue; } - gbe_sgmii_config(gbe_dev, slave); + if (IS_SS_ID_VER_14(gbe_dev) || IS_SS_ID_NU(gbe_dev)) + gbe_sgmii_config(gbe_dev, slave); gbe_port_reset(slave); gbe_port_config(gbe_dev, slave, gbe_dev->rx_packet_max); list_add_tail(&slave->slave_list, &gbe_dev->secondary_slaves);