From patchwork Mon Aug 7 16:07:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 13344494 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 A1F6AC00528 for ; Mon, 7 Aug 2023 16:08:33 +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=35qUhCtL9//nGCcSah5n9BmfCYmRk8HkeOoeVLLbIJY=; b=rbkCMuDKYkU7V4 nROhZg3pWAT7MVLv7xpR9u5TK+U+5mXz1tR1UcDVDv0YbVkhezb3EaREOv/qBSZSdu9WoTvZTIVM9 1g8kVj2irOOEdBbrViEeoiBWE8Oafq+Fc/KGyRWHUye2JR3ZpzbtKLsfUk2Tos4rAT9UVlAkl+p8d ADLfqDOPWDjGHmjD/2yfFVfHkFTZ1jTmcVTpFV8Aa+dmkX3p8SKMSHRtW82ddC4gyLHy+JXhtyUnu GB4vmzj4vqRXI8TB+iF/jX3QyO3cjUlFgPnn4puWOd1SEa7hyiP+pmkqMJ/i0kGwTVggm+33oAbxG 2JVVvILqmfdoaH0DJdGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qT2m3-0008Sm-2r; Mon, 07 Aug 2023 16:08:03 +0000 Received: from mail-vi1eur05on2060c.outbound.protection.outlook.com ([2a01:111:f400:7d00::60c] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qT2lx-0008Pi-1P; Mon, 07 Aug 2023 16:07:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FwsyQB3g+YjyhAf6hQ/RoFa/zVn+oaEzQcFm9AEA+BNnuvtvOBwTRe4NnCpzQ8hUaIQb4QuJfGQyqsG47L3jEN5hY5G/hW+Ri4FsHbBW5AxfTdmOn1Vw2FX7jaLlafn21s7PwWanaYz8c9b4NAYov8D4H/z8n9B9SfEf0XmaDeDdDFwUp5MDHap4YV02M0WW79br6Yl6xRJ1fK3MU1mW7ed7VkNOHnswB3Ff6lPSUGT5tZ3heUie8leJks+5qZC4G/fTXcTY/Pqyjrfo5t8kadpjfFhq3S0TJ3DrInTqtGHXoQwsRXFLClBQ462/WWVtbHaAulJrsgu6grslJN3EZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nJHNcttfzLVG38suNVLIrHaSeK8/UYAGA4te8F6Bb6A=; b=Ffyr4PdBCg+9ArLi4ibZfEfVJEsgbXTljFLtmhEhSgCClvvS8wKKig+NoDq8l4+//JKc9UjD4Zvu0ak0d8k8P0XaXiX448mRyEPtP1xJLPcxAZy/jn3MDDmshviWz+JJWux/id9JND0ILHACRkJsfsICurj83pyU+LKWMiCUJfzkqFscNPrHLVdQtOyYDc2LS6yddlBwHQh28xjh//HZQ7DPLSAlt2wVN+IRXuG38GFq8CdlD5B4eFDFzk2y+RcCMdF08zo1ya+AdxElC6ceZ8qpJrWIxPmPUkr6ywmuUnrn4aID/WIWvdH8WZ8SJW6gFJBwL15Moz0pNQOdCNuQVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nJHNcttfzLVG38suNVLIrHaSeK8/UYAGA4te8F6Bb6A=; b=UgDTiFvm8wig/cPJ/MmzFvK/D9LiNW9W3C1MDTYTyBJeV0e+koMw7Q+JFfDKdBUoh5tq2HqcHytupyBw0SpXgx//MF4toSWo42o2sptLvnj7PkALq3QuPmJl00jfG2TCu9RkOku4wunDuvaqcwquqxEfrb8mkBksn6Y3OZTSBKY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by AM9PR04MB8414.eurprd04.prod.outlook.com (2603:10a6:20b:3ef::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 16:07:50 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::d4ee:8daa:92f4:9671]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::d4ee:8daa:92f4:9671%3]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 16:07:50 +0000 From: Shenwei Wang To: Marc Kleine-Budde , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Shawn Guo , Sascha Hauer , Neil Armstrong , Kevin Hilman , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Jerome Brunet , Martin Blumenstingl , Bhupesh Sharma , Nobuhiro Iwamatsu , Simon Horman , Andrew Halaney , Bartosz Golaszewski , Shenwei Wang , Wong Vee Khee , Revanth Kumar Uppala , Jochen Henneberg , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, imx@lists.linux.dev Subject: [PATCH v5 net-next 1/2] net: stmmac: add new mode parameter for fix_mac_speed Date: Mon, 7 Aug 2023 11:07:15 -0500 Message-Id: <20230807160716.259072-2-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807160716.259072-1-shenwei.wang@nxp.com> References: <20230807160716.259072-1-shenwei.wang@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|AM9PR04MB8414:EE_ X-MS-Office365-Filtering-Correlation-Id: ed99738b-b9a8-48dd-eeec-08db976072dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CwN22Xt0a8qtTIK8jjoHbHA2Itf2VzjSUL3PyCZ8Z1JxWvnKETr3qXC22XbctWQ0fl2X7omTdyv+fTGNeDjw72wYGMcs9RMAwPL2zfK+SoP9JdvdfdnWzRYgH+/anuOdMLlQHxHOF41pG1J/Qvj3IKqzOaKI/eQsK9a2Wn9Jl9dgmsYHPJ5jbWzlqFzGquswrx2HVTclz9ggJlxmXh9KimPGofRx1p8td4HpN98TRe2CboUJecgHUv4MRhpZRwN+el1gZmvRciW1y5wjUl0a/nl4XMeBK6YL0UE3rwY4u5vhi7uyfLu/yGj3pqOGHf+U92D7FscGcWWQScqeooxrcPZM8SRvhnljYOIzeTAb4ZqQEHpjmNqeqRjoRjM95k5gLAw+K0Q1xspCshRAtHpth2ZT5wEuCYE1qs7aDxHi8QN08eRFjPhPF8N/3qFx8YhwprJ6k6MXHf+dOHCE6pBJIepwJ1N/p6DyZ6Oaa9BjcAVr/Wmmj5cdy5cTvVCLWM83tCix3R4Ntfb9q6A6Qzl50BZZhNXnUZr8Hyvwd/tAkswnxbQdIdYvwrQdE6BPl5C+cr1WwOjUTqgH7vqHVc056XKXwna7NA/n4TBWbPn/N4zVHJDP8A6JKeS5Pr6guTFHZ56I4WqpfQe1j58EX4oaRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(366004)(346002)(39860400002)(396003)(186006)(1800799003)(451199021)(83380400001)(2616005)(921005)(54906003)(110136005)(2906002)(38350700002)(4326008)(30864003)(316002)(5660300002)(8936002)(7406005)(44832011)(8676002)(7416002)(66946007)(66476007)(66556008)(38100700002)(86362001)(6512007)(478600001)(6666004)(6486002)(52116002)(41300700001)(36756003)(6506007)(26005)(1076003)(55236004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i+N98T2xhZNv5lPwiswFaNk8v6zzJLfO3mU5U4Neebhr6zjdUgtuhtE6wRL2g1OaKz4zrJBxV0v5mYQrTW4tS/wFGXcCdWrbmsRfj4nzKKVHp4Tt5piVj89ZgOBbC/01Gfd/cm4UO+SUQDnx1+csXWhNn/XIgD25TdOjDL9uZroZujB4W4+xBUgffVnNm6ij9uhD5sB/AsP89h0NCekOJv1gyrnqWX9W6Dg2XRodvDpA0XwDla95Htr1SBl1uZNXNN/G5T0p40tPlS/7InG0D78iUfdGjbMQjySs2bLchgG+g1QGjNyHoH2Ft27sg/RhzS3dCfpxV2lML7POetY+bIIP4qSoEwHtuCAOHWgY+iv2uUY6jcG4hkeSskls+UatvcktLoTn9+yALQ4zqDACf2UXCikZxIacadIHP9ETkyACXqDrwqO8st4c1+c4IgVdN14kSyoj69NOIWm9vcBq8G+HmzmGfOmxW7XzIYMLS+YYpiGnUTW9P66UGLuMzPbTYcmk6kPB8NjP+1vkFV219oyuxsRkr9hByv7fuyl6Quz4+Kup35FwQWG/KRr6vb6pVqxgIVRvM7cy34/pS9WINGvlrpXcXpyyBf4uAgceLlfA83nrYoOvFvohQbKXeVg11kUlcoPUq5gv4tDsfbSnsr/KhUsUAdSbkbkxlNCqXNwq1zT+61389nCumUORaA2WB8Ue5CIQNVVZrRPQDvrQ/+xApVnkUd7IkZi6MRUZ41to01RjT0aTwp4qmGzgdfHfZ342X582Q4CAFX6S01yvroz04rx8bQYDLvBZapaqIjzCMyrPUn6r+a2nF9oT2s4BlWQD9chhWE+IzvTB48KQt0iH6YhosayA11bFb92pItLe8JEfepj/h3jGyymRw7zWDljvnBSXkSP708q1+jEXfZiXK3XO4dvf59X6j4Xd/1bgC8gDl/B5RMxSFNrfUdyPAmyEMcXXamd7TGP93pRQzobbWD75NRzV3Lr1cpCJrAWUc9VHdosuwUDrH90gcvE7yW/jFr4kj4c/zFPy+SBa35mxns0GgZtEyKgBDXpLPskc1x9ucIv9iCdAD8FQuZFCdGAJH/aUUqdFRvldwqj9FX2vougCSChWDt0KV5OZfhgMCs6aBNsJ4lsXNX4vufLGeY+OX+HySim0L/wutCZZuP3zz8S0hR/FEmR0ZAbDUaoGteY3EZGwary6e3ITnivDFwq8QwEHuBcWBfd2KeRn7v/P5oAsemZ9JXf7YVpORreCH5R41p1puqRc9MekJjmtPBY/xL6ElADi2XT7WwKu+bdZEWeiqd4rfFW+5bDwaVXUmoSTQ6U9S6u4vEVku826U1OpNd1k5yWEfVkQE2yuNdsPesRZTpWCwnQ3LZLNmY8nrdd+nbPJj1ov2JfPjLDyPngezDXNfn2PC7qoHI3EbmDCHelhVxF3ll5tZAgGSNQF1xyWh9GBEcQ+zlhRuM2bE2bpwuvqzMTsAGongkwBe5KuZ2yTYo3/7eLfE9lsY3PS2BTOuL0prqUsgXwGPLDx8WMgkQw7o0Kx9BSYPaXjSWxyYA7cZ2DqFPSw2pdcv0TwULXilS2dkz0fKr9GwYE3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed99738b-b9a8-48dd-eeec-08db976072dc X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 16:07:50.5396 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nOpGBWG0krikuoFIcfwodYB3Y1uysURpVJdn4KTl6r5F5Y970QBQZNKrxo6MQUaDR1YKQ74SoGQlElFp4BzSGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8414 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_090757_636884_64D99CB4 X-CRM114-Status: GOOD ( 15.97 ) 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 A mode parameter has been added to the callback function of fix_mac_speed to indicate the physical layer type. The mode can be one the following: MLO_AN_PHY - Conventional PHY MLO_AN_FIXED - Fixed-link mode MLO_AN_INBAND - In-band protocol Signed-off-by: Shenwei Wang --- drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 8 ++++---- drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- include/linux/stmmac.h | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index b5efd9c2eac7..55162d798319 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -178,7 +178,7 @@ static void dwc_qos_remove(struct platform_device *pdev) #define AUTO_CAL_STATUS 0x880c #define AUTO_CAL_STATUS_ACTIVE BIT(31) -static void tegra_eqos_fix_speed(void *priv, unsigned int speed) +static void tegra_eqos_fix_speed(void *priv, unsigned int speed, unsigned int mode) { struct tegra_eqos *eqos = priv; unsigned long rate = 125000000; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index b9378a63f0e8..3eb6b4457494 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -178,7 +178,7 @@ static void imx_dwmac_exit(struct platform_device *pdev, void *priv) /* nothing to do now */ } -static void imx_dwmac_fix_speed(void *priv, unsigned int speed) +static void imx_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mode) { struct plat_stmmacenet_data *plat_dat; struct imx_priv_data *dwmac = priv; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c index a5e639ab0b9e..d352a14f9d48 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c @@ -22,13 +22,13 @@ struct intel_dwmac { }; struct intel_dwmac_data { - void (*fix_mac_speed)(void *priv, unsigned int speed); + void (*fix_mac_speed)(void *priv, unsigned int speed, unsigned int mode); unsigned long ptp_ref_clk_rate; unsigned long tx_clk_rate; bool tx_clk_en; }; -static void kmb_eth_fix_mac_speed(void *priv, unsigned int speed) +static void kmb_eth_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct intel_dwmac *dwmac = priv; unsigned long rate; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c index e39406df8516..9b0200749109 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c @@ -257,7 +257,7 @@ static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac) return PTR_ERR_OR_ZERO(gmac->qsgmii_csr); } -static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed) +static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct ipq806x_gmac *gmac = priv; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c index 7aa5e6bc04eb..959f88c6da16 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c @@ -22,7 +22,7 @@ struct meson_dwmac { void __iomem *reg; }; -static void meson6_dwmac_fix_mac_speed(void *priv, unsigned int speed) +static void meson6_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct meson_dwmac *dwmac = priv; unsigned int val; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 735525ba8b93..405ab645f1cb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -631,7 +631,7 @@ static int ethqos_configure(struct qcom_ethqos *ethqos) return ethqos->configure_func(ethqos); } -static void ethqos_fix_mac_speed(void *priv, unsigned int speed) +static void ethqos_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct qcom_ethqos *ethqos = priv; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index d81591b470a2..91553475c38b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1785,7 +1785,7 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac) gmac_clk_enable(gmac, false); } -static void rk_fix_speed(void *priv, unsigned int speed) +static void rk_fix_speed(void *priv, unsigned int speed, unsigned int mode) { struct rk_priv_data *bsp_priv = priv; struct device *dev = &bsp_priv->pdev->dev; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 6267bcb60206..7db176e8691f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -61,7 +61,7 @@ struct socfpga_dwmac { struct mdio_device *pcs_mdiodev; }; -static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed) +static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv; void __iomem *splitter_base = dwmac->splitter_base; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index d3a39d2fb3a9..9c700590bf25 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c @@ -22,7 +22,7 @@ struct starfive_dwmac { struct clk *clk_tx; }; -static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed) +static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct starfive_dwmac *dwmac = priv; unsigned long rate; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index dcbb17c4f07a..a7ea982bb81f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c @@ -104,11 +104,11 @@ struct sti_dwmac { struct regmap *regmap; bool gmac_en; u32 speed; - void (*fix_retime_src)(void *priv, unsigned int speed); + void (*fix_retime_src)(void *priv, unsigned int speed, unsigned int mode); }; struct sti_dwmac_of_data { - void (*fix_retime_src)(void *priv, unsigned int speed); + void (*fix_retime_src)(void *priv, unsigned int speed, unsigned int mode); }; static u32 phy_intf_sels[] = { @@ -136,7 +136,7 @@ static u32 stih4xx_tx_retime_val[] = { | STIH4XX_ETH_SEL_INTERNAL_NOTEXT_PHYCLK, }; -static void stih4xx_fix_retime_src(void *priv, u32 spd) +static void stih4xx_fix_retime_src(void *priv, u32 spd, unsigned int mode) { struct sti_dwmac *dwmac = priv; u32 src = dwmac->tx_retime_src; @@ -188,7 +188,7 @@ static int sti_dwmac_set_mode(struct sti_dwmac *dwmac) val = (iface == PHY_INTERFACE_MODE_REVMII) ? 0 : ENMII; regmap_update_bits(regmap, reg, ENMII_MASK, val); - dwmac->fix_retime_src(dwmac, dwmac->speed); + dwmac->fix_retime_src(dwmac, dwmac->speed, 0); return 0; } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c index 50963e91c347..beceeae579bf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c @@ -72,7 +72,7 @@ static void sun7i_gmac_exit(struct platform_device *pdev, void *priv) regulator_disable(gmac->regulator); } -static void sun7i_fix_speed(void *priv, unsigned int speed) +static void sun7i_fix_speed(void *priv, unsigned int speed, unsigned int mode) { struct sunxi_priv_data *gmac = priv; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c index acbb284be174..ae2a0ff664c1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c @@ -53,7 +53,7 @@ struct visconti_eth { spinlock_t lock; /* lock to protect register update */ }; -static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed) +static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct visconti_eth *dwmac = priv; struct net_device *netdev = dev_get_drvdata(dwmac->dev); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e1f1c034d325..1c26d60886be 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1060,7 +1060,7 @@ static void stmmac_mac_link_up(struct phylink_config *config, priv->speed = speed; if (priv->plat->fix_mac_speed) - priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed); + priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed, mode); if (!duplex) ctrl &= ~priv->hw->link.duplex; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index ef67dba775d0..4876735ebe41 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -253,7 +253,7 @@ struct plat_stmmacenet_data { u8 tx_sched_algorithm; struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES]; struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES]; - void (*fix_mac_speed)(void *priv, unsigned int speed); + void (*fix_mac_speed)(void *priv, unsigned int speed, unsigned int mode); int (*fix_soc_reset)(void *priv, void __iomem *ioaddr); int (*serdes_powerup)(struct net_device *ndev, void *priv); void (*serdes_powerdown)(struct net_device *ndev, void *priv);