From patchwork Thu Feb 9 15:16:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 54999 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp393861wrn; Thu, 9 Feb 2023 07:18:44 -0800 (PST) X-Google-Smtp-Source: AK7set9Y7vGRZ2qEwM0Cc7Hdrn72Mxi/RH0h6ml7vX5mMp9JCKXD/8Tx1FliOper0Cll52Ap8aBE X-Received: by 2002:a17:90b:180f:b0:22b:fe1a:1e94 with SMTP id lw15-20020a17090b180f00b0022bfe1a1e94mr13066358pjb.23.1675955924262; Thu, 09 Feb 2023 07:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675955924; cv=none; d=google.com; s=arc-20160816; b=NURF9f0+R4pL4MqxKR+dYQDIWeiYDv7V6zrFEIfoJsprgD5KAd5a8ANRfbNo4MPgZN stPTEOTqfzKbtO5OwPHCRlCQYijo/EtjFqbaRJobx8IQokA04Ify4y3FCnxvoQK5nTCY 9sue9d/2+VvBwcJbkZhrBYLqGBPqQMmvadHeaF0rFqgQEi4lXoIDPod//qtENjM2fPP0 CVETZmP2EkQjfGKrYd1O86rJ2HhqTNMuTwQxUFcisNtaXTnxZwMapRVB0h3juCNdaqHE puTUeGaOQgx+Ni50l7IpnXHWzmvJZvW0NDuvjsjqayt0mSJ7SlMI6HI+yZfRavOPWDdC cEfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z1T2buUEtUaS4iwijK+9hDQD5MTQSBYcjfGbgwJHtZo=; b=jljrArc0+6mzpax3kdo1fOggPyS/gvp5034RZ8W2x5cOWOkspbEJOxGc7O4HwLeASo tgxmmyRKCqKbrs88UWUsJl9QnXMZcQd0tLNlpqBgE2nFY+5+Tn7/zTAhIi/SpZYNL1h5 1p1P5h3ve52MG8FOQdcXje9577ASYVe6rSA4pIigezzhE0EuQvcdyoKIw6c1AhCmbmMU WFhD5K6rD3LZyJnu/mdhgy9s84F9A+iH5W+j6aMLYGNmiEB3eLNiT4WLH0tgir5a5pDG IKAbXC+4s+enT6PEmAWVG7TJa3TjIHmgGcJ2+bugti+vFPtHe0nfJUCs+MaMI8fMe+zU ggig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=aZ1JEgyn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu7-20020a17090b388700b002294419acc9si6499123pjb.107.2023.02.09.07.18.31; Thu, 09 Feb 2023 07:18:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=aZ1JEgyn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbjBIPOm (ORCPT + 99 others); Thu, 9 Feb 2023 10:14:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbjBIPOf (ORCPT ); Thu, 9 Feb 2023 10:14:35 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9545260BA8; Thu, 9 Feb 2023 07:14:32 -0800 (PST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 32FF2100006; Thu, 9 Feb 2023 15:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675955671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z1T2buUEtUaS4iwijK+9hDQD5MTQSBYcjfGbgwJHtZo=; b=aZ1JEgynImYFrGvJgTcRxJ6Bpcv2W4DpjJ/aY65E2KUSnT+hEERXUwbanWLyc//F82Uy8f Lvd3PSTuHd6a/6GeszmypOvPjs1XXW2b177bSOyEMYakIzCAji0ZetUwYKqk3uthc2Dti1 hUEJEpwS+0VHMYdP2+SL8H/PPPJgVfDsJ0la5nuH5abHSI20kJsITBHecKopYY5EgzLbOC QQB76kY1xL/ymHGGjYQ8N6jZPil/S4Zybi4+KtMkOE8rCJucVfnifNB6lu5MLmW2ayh2jH FChxWMw2r9KNMro2jlM3AKqtxEAgVIiAv7UChRO73BZuRgbni/uH5+nVv2AceQ== From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , Wong Vee Khee , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Kurt Kanzenbach , Revanth Kumar Uppala , Tan Tee Min Cc: Thomas Petazzoni , Herve Codina , =?utf-8?q?Miqu=C3=A8l_Raynal?= , Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Mohammad Athari Bin Ismail , Jon Hunter , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v3 3/6] net: stmmac: add support to provide pcs from platform data Date: Thu, 9 Feb 2023 16:16:29 +0100 Message-Id: <20230209151632.275883-4-clement.leger@bootlin.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230209151632.275883-1-clement.leger@bootlin.com> References: <20230209151632.275883-1-clement.leger@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757367159236108345?= X-GMAIL-MSGID: =?utf-8?q?1757367159236108345?= Add a pcs field in platform_data to allow providing platform data. This is going to be used by the "renesas,rzn1-gmac" compatible driver which can make use of a PCS. Signed-off-by: Clément Léger --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ include/linux/stmmac.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 9a8721227b17..8bf5f73eb4c8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7295,6 +7295,9 @@ int stmmac_dvr_probe(struct device *device, goto error_xpcs_setup; } + if (priv->plat->pcs) + priv->hw->phylink_pcs = priv->plat->pcs; + ret = stmmac_phy_setup(priv); if (ret) { netdev_err(ndev, "failed to setup phy (%d)\n", ret); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index a152678b82b7..104b3d1101c0 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -273,5 +273,6 @@ struct plat_stmmacenet_data { bool use_phy_wol; bool sph_disable; bool serdes_up_after_phy_linkup; + struct phylink_pcs *pcs; }; #endif