From patchwork Thu Mar 9 06:22:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13166812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CA0BC64EC4 for ; Thu, 9 Mar 2023 06:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VswTI7Igmrg4h+i/via+LQyk41ww/R8NHH98f2CbK1s=; b=z/p9MkyjBfy/qp dPtrPZQKO5JJaESx8qUWvwGTO1Nh9rZfM9junSVCaCYLPWT7dZfWWIDhrrBKAz1nBnm3uPLcZn9Sl yUUwnAYOizlQISFA2ihbiKyKeivlEQOL5F7r0w5oS5M91dzOIso4i5uRhawR1G4a3bNNGk1EArINq Vtl6w5bVD/v1LUDcFRbwUmrgib0dcWx/dr5s7+rhRO3usddZdznWAVMm92IXw7mks15Gnk6ZFp3qf bIetTfmi2KJO9AYFeJSe9AmTsY8BiJGQKPpUrGFj/tPUL2OQ3oHgQgS0XvVS9R/vp+OA9jF19QJUu xGYJ3c4gaFg+UrOL/7gQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa9g7-0083zN-9B; Thu, 09 Mar 2023 06:23:03 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa9fx-0083ug-Do; Thu, 09 Mar 2023 06:22:54 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3296MiWD130014; Thu, 9 Mar 2023 00:22:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678342964; bh=AKWxc2g8zn/BO+bAx6NLTSzuFHfkrm4HUaOji3JbZvw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Bdi9oVd2Mj5OW2JvmWNLkJ5tNQAW3x9ew63fmUIz9eofFTcAM49Whqoka9VDrg1Er DXKfFX/ZnexFf+WYLdUeHJpQJa0+gAm1JJCwPQmM7pwW6h9OkKQQeZZ0nd1LIuyQ41 01epJwmYhvBG/z7jSS4FHuQ8K5YeccDfIQadsULg= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3296Mibv004282 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 Mar 2023 00:22:44 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 9 Mar 2023 00:22:43 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 9 Mar 2023 00:22:44 -0600 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3296Mca2088683; Thu, 9 Mar 2023 00:22:41 -0600 From: Siddharth Vadapalli To: , , CC: , , , , Subject: [PATCH 1/3] phy: ti: phy-gmii-sel: Add support for SGMII mode Date: Thu, 9 Mar 2023 11:52:35 +0530 Message-ID: <20230309062237.389444-2-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309062237.389444-1-s-vadapalli@ti.com> References: <20230309062237.389444-1-s-vadapalli@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-20230308_222253_529127_B87D876A X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support to configure the CPSW MAC's PHY in SGMII mode if the SoC supports it. The extra_modes member of the phy_gmii_sel_soc_data struct corresponding to the SoC is used to determine whether or not the SoC supports SGMII mode. Signed-off-by: Siddharth Vadapalli --- drivers/phy/ti/phy-gmii-sel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c index 8c667819c39a..351173aeb0a6 100644 --- a/drivers/phy/ti/phy-gmii-sel.c +++ b/drivers/phy/ti/phy-gmii-sel.c @@ -23,6 +23,7 @@ #define AM33XX_GMII_SEL_MODE_RGMII 2 /* J72xx SoC specific definitions for the CONTROL port */ +#define J72XX_GMII_SEL_MODE_SGMII 3 #define J72XX_GMII_SEL_MODE_QSGMII 4 #define J72XX_GMII_SEL_MODE_QSGMII_SUB 6 @@ -106,6 +107,11 @@ static int phy_gmii_sel_mode(struct phy *phy, enum phy_mode mode, int submode) gmii_sel_mode = J72XX_GMII_SEL_MODE_QSGMII_SUB; break; + case PHY_INTERFACE_MODE_SGMII: + if (!(soc_data->extra_modes & BIT(PHY_INTERFACE_MODE_SGMII))) + goto unsupported; + else + gmii_sel_mode = J72XX_GMII_SEL_MODE_SGMII; default: goto unsupported; } From patchwork Thu Mar 9 06:22:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13166814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0CE9C61DA4 for ; Thu, 9 Mar 2023 06:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2LRsh0DgBgHXdnCdPrgiAqwH4wUi1xoy5kX8WDxEy5k=; b=gLBElWMZ9mSMrH fwme2lSRuoHW0YoKHlJ14bYa0p966SZzL73Ek3BfJYtj+DdYd7Gt4mdIKXHpy5gYQwMg+ZNMTOai0 NwL8gmzT9N1Ws8/1LMf6QHTnlmRo+/FAe+A0sUlcEzygvWPV24iS4iytNcT/TVcDsCikmjC9iQFFu 38L/gLSxUcDy3zK0KMxuXcIoKZPuZhz+LKZMuJDOKJMjFF12tvq/lzt9pJUqM6uAzc2ZpJ6HPcJ4g F1ls46lxYUYgGxP/bnEyp0Sw5+CL/GeRvR6WYwjUHXs96o9JxDXr7XRBiEM62mEZRArRqk7hJwji3 CkOtLr69OqsTel9E1Aew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa9gN-00845N-2L; Thu, 09 Mar 2023 06:23:19 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa9fz-0083v2-Qz; Thu, 09 Mar 2023 06:22:57 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3296Mkes059921; Thu, 9 Mar 2023 00:22:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678342966; bh=fEiF0/1C9qKisbx7pQeGaO/Vm5Hfk0llPLytiLgfvq4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vtMQE2rKVaONlbz9/iP3dXut1N/6KRPbI0fGiQ6/kL4ru6Ivh0EZd8848rv0e048y 9sKfy6RU5uxop3VXh2SIb/R4yztXcxplnFvPGHA2x6PW+u4dtOjofz/OFV59AIUg0T JP3g4qyqRTcO097y9/upXboMXVEiejZMq0dg/Q6c= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3296MkjS084407 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 Mar 2023 00:22:46 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 9 Mar 2023 00:22:46 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 9 Mar 2023 00:22:46 -0600 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3296Mca3088683; Thu, 9 Mar 2023 00:22:44 -0600 From: Siddharth Vadapalli To: , , CC: , , , , Subject: [PATCH 2/3] phy: ti: gmii-sel: Enable SGMII mode for J7200 Date: Thu, 9 Mar 2023 11:52:36 +0530 Message-ID: <20230309062237.389444-3-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309062237.389444-1-s-vadapalli@ti.com> References: <20230309062237.389444-1-s-vadapalli@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-20230308_222255_935558_3AD175D3 X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org TI's J7200 SoC supports SGMII mode with the CPSW5G instance of the CPSW Ethernet Switch. Thus, enable it by adding SGMII mode to the list of the corresponding extra_modes member. Signed-off-by: Siddharth Vadapalli --- drivers/phy/ti/phy-gmii-sel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c index 351173aeb0a6..b0335a8abc18 100644 --- a/drivers/phy/ti/phy-gmii-sel.c +++ b/drivers/phy/ti/phy-gmii-sel.c @@ -219,7 +219,7 @@ static const struct phy_gmii_sel_soc_data phy_gmii_sel_cpsw5g_soc_j7200 = { .use_of_data = true, .regfields = phy_gmii_sel_fields_am654, - .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII), + .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII) | BIT(PHY_INTERFACE_MODE_SGMII), .num_ports = 4, .num_qsgmii_main_ports = 1, }; From patchwork Thu Mar 9 06:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13166813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91BBDC64EC4 for ; Thu, 9 Mar 2023 06:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NHyv0xUbzdAVMqNmfl0rqZh/us9JJbcvTNqzRrfGRAg=; b=CJDLKLMlSXX+yC nhQNlX3ZW2KOiYTmDLxBs5eN8APvkouON1zPFU6WNLP3Py/nPVgDiIP8tgC2BJBC8xU7gI1e2Kx7N N4RSRhPV52pkiTXIKNdh+mZSA0iR+OSIg5fJDFE4bQgvqTWuFsil0yw9N5Pqci2qNdEiKy22JPrvW zthpBimA94qHvr7xYNXWCfsLNzoOiGtNYdxQZ/NE45qgKqTD6/GDfVpmsdob6wfGe+TuLXhnnDY5n KhEPnr58yPEqOVOoTxvpv02ilzh6KUTULfx3zCaUlq4RkEsJl6XfU6j1YViO30Xmvti9N4rmyC2qX Z5wU4GvuPfvsE04Ahbyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa9gE-00841T-SM; Thu, 09 Mar 2023 06:23:11 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa9fx-0083vY-Ds; Thu, 09 Mar 2023 06:22:54 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3296Mnkx130022; Thu, 9 Mar 2023 00:22:49 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678342969; bh=SarMmzoDst6FpFLh4XmlLgNV3RN5yzyGtHul1q4FhFk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=k5V7vKelUc2/WOkplt1tTMbuI+0EXbPbdtAfDIqEV7HmAn/Dn3JopREjcroMUmctk tWZ7FKbE3tKqThEdUGwkYwVLT5Cy86nirwnrD5TA/w+ckVEFTim9vtRE6gIcCsDntv 6hbe9ebaJaTaz9bE/Zllg4AthUN66GMzLWYSRAw0= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3296MniN103508 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 Mar 2023 00:22:49 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 9 Mar 2023 00:22:48 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 9 Mar 2023 00:22:48 -0600 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3296Mca4088683; Thu, 9 Mar 2023 00:22:46 -0600 From: Siddharth Vadapalli To: , , CC: , , , , Subject: [PATCH 3/3] phy: ti: gmii-sel: Enable SGMII mode for J721E Date: Thu, 9 Mar 2023 11:52:37 +0530 Message-ID: <20230309062237.389444-4-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309062237.389444-1-s-vadapalli@ti.com> References: <20230309062237.389444-1-s-vadapalli@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-20230308_222253_530212_748174FB X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org TI's J721E SoC supports SGMII mode with the CPSW9G instance of the CPSW Ethernet Switch. Thus, enable it by adding SGMII mode to the list of the corresponding extra_modes member. Signed-off-by: Siddharth Vadapalli --- drivers/phy/ti/phy-gmii-sel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c index b0335a8abc18..fd934a38b71d 100644 --- a/drivers/phy/ti/phy-gmii-sel.c +++ b/drivers/phy/ti/phy-gmii-sel.c @@ -228,7 +228,7 @@ static const struct phy_gmii_sel_soc_data phy_gmii_sel_cpsw9g_soc_j721e = { .use_of_data = true, .regfields = phy_gmii_sel_fields_am654, - .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII), + .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII) | BIT(PHY_INTERFACE_MODE_SGMII), .num_ports = 8, .num_qsgmii_main_ports = 2, };