From patchwork Fri Jan 3 11:16:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925505 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 76BCAE7718F for ; Fri, 3 Jan 2025 11:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mHO73eZ4Zyam8xJy0OuivfQ5bgy3B7zgOoSDsnku8tY=; b=Wph8FqnIoSOUNng4NkgkD/qYYv PUOJAx47bGqZNATFbo+3idaEi9rVkY7J3HBPAs55HF0YKR4uu+7v/1b+gOO+700gfZjoe1vq6Z6OD SpfpLrxT7DHjvM3QctPPEd10p5AGUAGZ54Ax4pFuDZchfHSUGH4QMIUXuhq5+Y7SfYYDF+Q3HsR2e F1xlfk3VUzukMkmCdK2T16jViuqX7rij+wT//K5xxioh/YNWsE0JML3XdpjStbhsZ8BN749UdzVkG QuKx85nnicmnUviUTIpqSqZqlxIlrcX40pXs5zcobOQ7n7MQDRtZxol3HJpZGbnW1ZalD1kch34Ao hel5Byzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfhi-0000000CoaV-2ueq; Fri, 03 Jan 2025 11:18:58 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffd-0000000Co4T-1sA8; Fri, 03 Jan 2025 11:16:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mHO73eZ4Zyam8xJy0OuivfQ5bgy3B7zgOoSDsnku8tY=; b=k+Yvh/tL2iCshIm06FH3fLQiHp 23biTiZNQUVZ6llbZgdfWBYIVvYNZTGT7mlsLiU/wKJmO62waJeX/NpVSUkVlBHHeZK6dKWl9omyf Du6vlY/iaURiMJu/aFwv2OcdTcJB/ibt5w/SstS9kB5DUH9jbaeCkc58+Ne8xfSHo30nVnoErlsBd VHgsL8GrnFcboYNuyao/a4ZqWr8XMogZIsLxDZOrGJWiueWrXGNE+GaYBRt5PhPRNPrkKM8sCldYL lXJEraFGCM6EScJABIkeAgbXHr4f0b1uqzAfHa1rKHhXZWk2IBwj5+16Yyr6pqDYJ9LuLwBXbFk1R q2a59OFQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55396 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tTffN-00030A-2o; Fri, 03 Jan 2025 11:16:34 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffL-007RoD-1Y; Fri, 03 Jan 2025 11:16:31 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 1/6] net: phylink: add support for PCS supported_interfaces bitmap MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:31 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031649_493909_5205F332 X-CRM114-Status: GOOD ( 16.80 ) 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 for the PCS to specify which interfaces it supports, which can be used by MAC drivers to build the main supported_interfaces bitmap. Phylink also validates that the PCS returned by the MAC driver supports the interface that the MAC was asked for. An empty supported_interfaces bitmap from the PCS indicates that it does not provide this information, and we handle that appropriately. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 11 +++++++++++ include/linux/phylink.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 6d50c2fdb190..31754d5fd659 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -691,6 +691,17 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, return -EINVAL; } + /* Ensure that this PCS supports the interface which the MAC + * returned it for. It is an error for the MAC to return a PCS + * that does not support the interface mode. + */ + if (!phy_interface_empty(pcs->supported_interfaces) && + !test_bit(state->interface, pcs->supported_interfaces)) { + phylink_err(pl, "MAC returned PCS which does not support %s\n", + phy_modes(state->interface)); + return -EINVAL; + } + /* Validate the link parameters with the PCS */ if (pcs->ops->pcs_validate) { ret = pcs->ops->pcs_validate(pcs, supported, state); diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 5462cc6a37dc..4b7a20620b49 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -393,6 +393,8 @@ struct phylink_pcs_ops; /** * struct phylink_pcs - PHYLINK PCS instance + * @supported_interfaces: describing which PHY_INTERFACE_MODE_xxx + * are supported by this PCS. * @ops: a pointer to the &struct phylink_pcs_ops structure * @phylink: pointer to &struct phylink_config * @neg_mode: provide PCS neg mode via "mode" argument @@ -409,6 +411,7 @@ struct phylink_pcs_ops; * the PCS driver. */ struct phylink_pcs { + DECLARE_PHY_INTERFACE_MASK(supported_interfaces); const struct phylink_pcs_ops *ops; struct phylink *phylink; bool neg_mode; From patchwork Fri Jan 3 11:16:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925511 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 B28F0E77188 for ; Fri, 3 Jan 2025 11:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IZCni5EAPNv32fyYrhVKtEvOmSsbHmeJ2aH/4kersBw=; b=wAZAomq2c50XfFgNbPkUtezSph bkp8kL8mKBRD4jZ7f+A3dNNDXi03vxO4vM0AA/+Uy/J2O02iu/qCYs1ECTL6GN2IvaPnj5PLpqNFU BCOsuNWPBkNeaL6MtvMJtQ6oZiAGTXVeL8MQ7bTGHMIc7YpoH00DXpjYgrir3rI/+7w6LsHx7+RKt GqCd9sW6DVHzKabrjBIfvvzR0LtEFQWoebakvAAJGJ5nPb8UzubwOb3H7rGKbQOCbwWp5LScPOYeO 49GMvzEYQJbe7rTCU1+PvvQGJaMQfN98gt0urOxUmQDQrYVi1VPYnlbLLs090v4gvDCnSocijM5k6 ji9cX2xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfiu-0000000Col7-2e5X; Fri, 03 Jan 2025 11:20:12 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffg-0000000Co5d-1Asl; Fri, 03 Jan 2025 11:16:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IZCni5EAPNv32fyYrhVKtEvOmSsbHmeJ2aH/4kersBw=; b=MUzEwKxwl2kfzS6jbMSOKhZP7/ tSLBVm0qPr+LmI6AZhac7wX95dFIehy7HllBfegUp5rPvNYDHJv+V6i2oxQqJQwb1IKJU31FSynQX yzUSBIKjmKv6lHJwTteE2lE9+xudM8nlUnyzYPtpyIcKiCHsvqghEwO0V/eG6smtEMEpnrshLFB0a z2k4gfZGGSj/oxVwUvpE3Xvlz3fpyR/lthYK1ug/BMHwflSDUvZNLJDDR9yYE6JqW8gw7CXyEUFOR 87Yoe7bg03VBwt+pM/dAtL3pMUgu+oF2+PGP4BnPDt5BgaB6hxBDh+d0GLCVAtfhTSYatscZ/uTap ZPJ/OREg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55410 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tTffT-00030L-0N; Fri, 03 Jan 2025 11:16:39 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffQ-007RoJ-4u; Fri, 03 Jan 2025 11:16:36 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 2/6] net: pcs: xpcs: fill in PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:36 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031652_321299_3B516E54 X-CRM114-Status: UNSURE ( 8.81 ) X-CRM114-Notice: Please train this message. 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 Fill in the new PCS supported_interfaces member with the interfaces that XPCS supports. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/pcs/pcs-xpcs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index f70ca39f0905..cf41dc5e74e8 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -1446,6 +1446,8 @@ static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev) if (ret) goto out_clear_clks; + xpcs_get_interfaces(xpcs, xpcs->pcs.supported_interfaces); + if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) xpcs->pcs.poll = false; else From patchwork Fri Jan 3 11:16:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925512 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 D0C84E7718F for ; Fri, 3 Jan 2025 11:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hL0ZbxOvLUwgHuliz128Mrezo851lPPSOc8xeQi6TDw=; b=sLs/+iEUllbN8JVUW7jgUwV8Z4 QvwQ6Hdck8ZQrdiqNzfcIlzlSLncOR+Y/QJuIDdctGmGiyqISFCcAZJ9tv60pSBOKn/pCc4Sk/yOy pNwkeWZmsVF+AdLkcxo5geemQ3EGlDP8cNwRqh3f7v3W6BdmrEf+gdS1N18jFzIItx+ecBDYeybl6 KszOPkV6Ua9odDgdOweF1OSeoGqP+ZlbhuYftkgDVNRaU8oAw2kKPE1fI4Tvt2f59ow1YhFbiEaaa 2siKwV27aHpRCet0lppScSSmjol79CmvLTwxtdKP1z9haPlJywqsn3WZ2/ptdBFT5ct+mCyzTmekl tOsS15bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfk6-0000000CozI-2xpJ; Fri, 03 Jan 2025 11:21:26 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffi-0000000Co6U-3vIw; Fri, 03 Jan 2025 11:16:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hL0ZbxOvLUwgHuliz128Mrezo851lPPSOc8xeQi6TDw=; b=LnxFpI2DSEawHRP3DJLehbZVvH YKkaKYeya3Y72uJTwy3apkWewS1NTzaJ3k4E4qdo/iZ9Fv0uB2QQaQ7CltfH1p7y9LLWM5ZPzXgWj BWEhuZt4Zm2IUxjjmcBydgdiJIs+qbZbtSp6PtIYSFx1uTXYzrIH74TKudYNkj1wNclV+G7dc39gK JwzkWZaiRBoFK3goxr7KEpoTR2xw4Gvr8tgE/tUefoNgtTXpFKm8UEIMuh2BCR/Rl+64no5gHOOWo ARpfERx//JhgmCOXAfp1FJvKpYexcveYdPJpIxcmdGXeMZpGwFYcI+KSyVfjUJ/VRCGpbDnR/mkqL W3t6JSIQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50404 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tTffY-00030b-0V; Fri, 03 Jan 2025 11:16:44 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffV-007RoP-8D; Fri, 03 Jan 2025 11:16:41 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 3/6] net: pcs: mtk-lynxi: fill in PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:41 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031654_969340_52E9F33A X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. 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 Fill in the new PCS supported_interfaces member with the interfaces that the Mediatek LynxI supports. Signed-off-by: Russell King (Oracle) Acked-by: Daniel Golle Reviewed-by: Andrew Lunn --- drivers/net/pcs/pcs-mtk-lynxi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c index 7de804535229..a6153e9999a7 100644 --- a/drivers/net/pcs/pcs-mtk-lynxi.c +++ b/drivers/net/pcs/pcs-mtk-lynxi.c @@ -306,6 +306,10 @@ struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev, mpcs->pcs.poll = true; mpcs->interface = PHY_INTERFACE_MODE_NA; + __set_bit(PHY_INTERFACE_MODE_SGMII, mpcs->pcs.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_1000BASEX, mpcs->pcs.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_2500BASEX, mpcs->pcs.supported_interfaces); + return &mpcs->pcs; } EXPORT_SYMBOL(mtk_pcs_lynxi_create); From patchwork Fri Jan 3 11:16:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925513 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 80500E7718F for ; Fri, 3 Jan 2025 11:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3fPVeRok7tYyHKGOJNHqGUAhct3mDxnPXluFsW2qsWM=; b=j5IALSY8ZnYcT8SYyEoC5SSAfa w2xONnSxZtNQDNByH49y4sphjf+hpKbTNdeRBkVg/SpiGlIocrHu1BIz55b4d4uJE82YMC+7OG8fK ZzCuZQTQWjIxYDuMccxLf4thE/C5lqusxbST/tFPTUyD1B90UZkvwK0uPnqPB1QlEi5of6h6xUTdA PjKoeiACndbnTVyTgs3eTaw8Ny7yYhvob+qiHawl6uRnW5/PS3A18ibZGuJWC5+3PoXKxHiPbC6Yd PPx7z26ObPQURi45f+5doV3j/q+yokJAuEngt/VyVYjj9tZxEfX00iWjBeJ9YbLY5IVEgIfKGTz+0 W+paCrkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTflH-0000000CpBx-2eVw; Fri, 03 Jan 2025 11:22:39 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffr-0000000Co8n-1YjY; Fri, 03 Jan 2025 11:17:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3fPVeRok7tYyHKGOJNHqGUAhct3mDxnPXluFsW2qsWM=; b=gOefpy8xxs5g/L1BY+Zh8RPhQj v9KfDZSN/ifIgCYkqe781yncGB0YH4fGoElH1eC5LYFFI9M2MOf6DAGXcmDfGLooBdkujx5X1XBOi tqOKjWrTLKzx+8/FB6B18Y3o7ICKFHioYewNNR0KdPC/wjOLne5MnMloOeujheh+51WK/18y5hUc+ V8kwKQ6mzN/FsYHidfWMW67ooW4EppvxiUiZCxhqH9n+QWahTgSgDznMDQcOAv3e9zDRDAmdl5Ua4 mhEC7/GoL07FAZA8+OH8tjwu+DR6Euq+BzoCOZeI94cM3vRJEZHyHy6U9kwkp6aGSQoyPq23aQF0q /42PUrSA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50410 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tTffd-00030z-1d; Fri, 03 Jan 2025 11:16:49 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffa-007RoV-Bo; Fri, 03 Jan 2025 11:16:46 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 4/6] net: pcs: lynx: fill in PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:46 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031703_442270_7033F528 X-CRM114-Status: GOOD ( 10.80 ) 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 Fill in the new PCS supported_interfaces member with the interfaces that Lynx supports. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/pcs/pcs-lynx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index 767a8c0714ac..6457190ec6e7 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -334,9 +334,19 @@ static const struct phylink_pcs_ops lynx_pcs_phylink_ops = { .pcs_link_up = lynx_pcs_link_up, }; +static const phy_interface_t lynx_interfaces[] = { + PHY_INTERFACE_MODE_SGMII, + PHY_INTERFACE_MODE_QSGMII, + PHY_INTERFACE_MODE_1000BASEX, + PHY_INTERFACE_MODE_2500BASEX, + PHY_INTERFACE_MODE_10GBASER, + PHY_INTERFACE_MODE_USXGMII, +}; + static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) { struct lynx_pcs *lynx; + int i; lynx = kzalloc(sizeof(*lynx), GFP_KERNEL); if (!lynx) @@ -348,6 +358,9 @@ static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) lynx->pcs.neg_mode = true; lynx->pcs.poll = true; + for (i = 0; i < ARRAY_SIZE(lynx_interfaces); i++) + __set_bit(lynx_interfaces[i], lynx->pcs.supported_interfaces); + return lynx_to_phylink_pcs(lynx); } From patchwork Fri Jan 3 11:16:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925514 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 6EC7CE7718F for ; Fri, 3 Jan 2025 11:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4s396obXaI1f8Yz3z+7hU/+8e3s2TBg9V0/XcDUux8s=; b=FCgpGdMJyiReTzWmvEgNsyfCKZ k2p1oJHhPgDq1ShHbBQ/qsji2UqGxUjSgCILPhaQGrMyGXbyLl1oyDvrp+if9E4+Q1Hocpdafi9Ij yuowkAphozD1ncMk5esoNxxox1bVKF1rSMfnZoRAnojx3NtLTzGDxWzXzOJ6c821LT5ebKGAhWuku vXWMf0TSl69wP+tqk46oIW4ZeLpmUFSR3bUXmKUb3zZQMuEuw27VhXe2F5n8XKuL1y6nfpznkkEax j7Gx/7pBPET12lo53VRhSitcz978gnpYgx0331yOBeseBzraTiS32J5e5kkhl1hN/qWiuI9/HQR2S c4FcDdRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfmR-0000000CpIp-2I12; Fri, 03 Jan 2025 11:23:51 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffw-0000000CoAp-1AVX; Fri, 03 Jan 2025 11:17:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4s396obXaI1f8Yz3z+7hU/+8e3s2TBg9V0/XcDUux8s=; b=P7wgdPrI4AcqfEfWWuDx1a/tNT 0Ax1clrro5GRgNFgLC8VP3GtrZYGo/YJNafuQ01+Lgv6h+TC4LRtbGfBunbBWoEXzV/2KoggfwLiv vwD/IHr0bV/PVYwuhdIeTG9jn4q4zxkOemjdPO0SLtPXymx4W8tEc3dBKRPr0XPU4IPRBK+W/LEOf tbwCumzIj9YiwFyYiKT8B3f0k/sK9OGW98C+ZCEReksBwvdTd3RoJD9VNpvQLkiFxv/QqAF2wcC7q /cLRRUFbHMIbpVPX3o9AiUubFdmaMScAPhUYMH0aAx68R83LfavnW39ixzTxTK0c0/QJdt/iDPcfv EDLSZ1iw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38368 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tTffj-00031K-0s; Fri, 03 Jan 2025 11:16:55 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTfff-007Roc-Ff; Fri, 03 Jan 2025 11:16:51 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 5/6] net: stmmac: use PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:51 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031708_315844_943C2CF1 X-CRM114-Status: GOOD ( 10.41 ) 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 Use the PCS' supported_interfaces member to build the MAC level supported_interfaces bitmap. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6bc10ffe7a2b..fcb5649fb738 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1203,6 +1203,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) struct stmmac_mdio_bus_data *mdio_bus_data; int mode = priv->plat->phy_interface; struct fwnode_handle *fwnode; + struct phylink_pcs *pcs; struct phylink *phylink; priv->phylink_config.dev = &priv->dev->dev; @@ -1224,8 +1225,14 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) /* If we have an xpcs, it defines which PHY interfaces are supported. */ if (priv->hw->xpcs) - xpcs_get_interfaces(priv->hw->xpcs, - priv->phylink_config.supported_interfaces); + pcs = xpcs_to_phylink_pcs(priv->hw->xpcs); + else + pcs = priv->hw->phylink_pcs; + + if (pcs) + phy_interface_or(priv->phylink_config.supported_interfaces, + priv->phylink_config.supported_interfaces, + pcs->supported_interfaces); fwnode = priv->plat->port_node; if (!fwnode) From patchwork Fri Jan 3 11:16:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925516 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 0F90AE77188 for ; Fri, 3 Jan 2025 11:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/MH/1XbuHmmzMIpU0/jitxqDYSfeHmJOlhMeOQiQWSQ=; b=zhZ1QJjTIdiPx29XqXeaF1MVfg WjU7sgVDreN1IysvymL8mDTQVak2flbOxnLvyzgoBNFPRBIcOIlG2NuLlTw09JfrYmJldfY4gob6o wUmPqgI+TG9APGvcDiMrPGk2afHs8m4TJ8EVBUS2J2H+PLgADLW0yY6bJStwXnJq7RwqN3+J25k4s JN2sVto8m020MljgCSKITxix5IcxVcQMKWMpS9/I17bwWaM3DktqpI0BLCnsMF65SABjfQv7IFoFi Pixy0cISvHKn4DdSp++h2iU+tw2WpEFRThWQZmoIYenEQTuqQnZ3jaRALt2fzC07aKpHqrZ9+C0U1 QGrmnxMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfnb-0000000CpQZ-36cX; Fri, 03 Jan 2025 11:25:03 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTfg0-0000000CoCR-0IBf; Fri, 03 Jan 2025 11:17:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/MH/1XbuHmmzMIpU0/jitxqDYSfeHmJOlhMeOQiQWSQ=; b=kyq2ffionUdzxezwxw1n7SSUNJ QOwJve95yZcDFYj/8AbI4Cd7R27VoBHYCihpPknn1P/j1BxO3KEhCfgxJqhvq0TnDSeEOzj3Ps0uh zHmXaY0gXRIM9i/eJtzcnExq8UkRkzCESa+xUsBtpWvg7x7gJALYXj1t8eHTgWxUdlMPzinWZeX7G cJARELl9wB4lXw1v7OAaH+hyFepu73JhFPIMuxmjWQ39FAw/ZJHwPRBEuZHOvrPH9XijDcPAm+QBz sr8R3d8+C0vbT6YLCbMOodxu7X5mr9qbkCvtWOcMjJ4r8iBbqV0myf5LRi4BWRNrGhHc466Pv5EPn IAOHlwDA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39002 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tTffn-00031h-2c; Fri, 03 Jan 2025 11:16:59 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffk-007Roi-JM; Fri, 03 Jan 2025 11:16:56 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 6/6] net: pcs: xpcs: make xpcs_get_interfaces() static MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:56 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031712_110254_6AAB3ED0 X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. 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 xpcs_get_interfaces() should no longer be used outside of the XPCS code, so make it static. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn --- drivers/net/pcs/pcs-xpcs.c | 3 +-- include/linux/pcs/pcs-xpcs.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index cf41dc5e74e8..c06b66f40022 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -594,14 +594,13 @@ static unsigned int xpcs_inband_caps(struct phylink_pcs *pcs, } } -void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) +static void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) { const struct dw_xpcs_compat *compat; for (compat = xpcs->desc->compat; compat->supported; compat++) __set_bit(compat->interface, interfaces); } -EXPORT_SYMBOL_GPL(xpcs_get_interfaces); int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) { diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h index b5b5d17998b8..733f4ddd2ef1 100644 --- a/include/linux/pcs/pcs-xpcs.h +++ b/include/linux/pcs/pcs-xpcs.h @@ -50,7 +50,6 @@ struct dw_xpcs; struct phylink_pcs *xpcs_to_phylink_pcs(struct dw_xpcs *xpcs); int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface); -void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces); int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable); struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr);