Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4115181rwl; Tue, 27 Dec 2022 22:35:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXuJ0HjV4VrS0tkm5eMtC7GH0Vaolf4dyzaU5zV8OMQC22NZ7kn561turofaheEI2Qk1I0SC X-Received: by 2002:a17:903:130d:b0:192:6be6:7d2b with SMTP id iy13-20020a170903130d00b001926be67d2bmr16354670plb.33.1672209349745; Tue, 27 Dec 2022 22:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672209349; cv=none; d=google.com; s=arc-20160816; b=SH2AwZsRxOB6ak/WkcxUL1N65YroRPHJOpJtHUQILhBtlvyIh+njYX3OLVAANdq9mt 9VLD21n2tFjKWD7eNxWE9WNQ5TncZlxQzfAoC0x3bLoY5Di6lEWxSMSe7NZ+sYUd3JU0 tkkx6D6QZUjf+7C9plQBsiUgoCfvAQXTh7aBytunshEJQnTKY33e7RNasQS94AMMpY1T Wh8ZUXEwcP7FpKS5kWAGYjizSTLNj76e9A2UGyoONMV5M/cRtLkPL6IzJ4ZwvZB18/5l 7qkYCX0kGoIxYloDbOW+41odIlLT7nAoCgrDyMpolgd0Cd1hsP6qC1Khc7aMYQufKFgC YwHQ== 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=gyLi655fRlGzISUNyT/xvu6TEKN5PJCN3blt5ogeZ+M=; b=XhVzsS+TRTQiQDB6h/qonz7NXyZz9RJ66ZbRhuoF1iNmESW6QBybvDaauqZ3K6pLWy nDvA0HlIv1hpCv4x48wrgKTf5Lwh6ABbi+P8lTUQnZto6lu/883quYFFyjx5vxh56/wY cmJmpmL20QeuWwG0pB/O2+P4gWD9Hq5/NXdswRsw0oe1Az8zPk44U17SRG+EOWt1s7P/ /iUhmMZ6z/veZGql42jwyGiytxk+oTSvG6Ye2aBhjt3ECDaFhYB1+v2u6JuXKYz3L0qr ZCJezrFL8cuZBCsIDFtxa3Ur4Iq14jhUJKCSTti5FMBaQXGVaN9LbFGBFOWH68VZ55gQ CKQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qqXPfTzd; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a170903228c00b0017f75654a51si17116492plh.245.2022.12.27.22.35.41; Tue, 27 Dec 2022 22:35:49 -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=@mediatek.com header.s=dk header.b=qqXPfTzd; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbiL1Gds (ORCPT + 66 others); Wed, 28 Dec 2022 01:33:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiL1Gdp (ORCPT ); Wed, 28 Dec 2022 01:33:45 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15DD2DF17; Tue, 27 Dec 2022 22:33:42 -0800 (PST) X-UUID: b77685c05b7547bf88586689e8b9513a-20221228 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=gyLi655fRlGzISUNyT/xvu6TEKN5PJCN3blt5ogeZ+M=; b=qqXPfTzdYAxeCqy+beYe6iL4oN38+oz4/WBmcBD39983I+jB1KHlaQBfCpegrGtZyNe6nw5jME4aVVnV6Jp4SjhRzFkGtwGlaJhscBkipJmN5ZM1bIlPxzQsidtIflyGUXErc8vbfI9djflrIVmufgN6PJoJc+WOpOIEmTn9aAY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:18ec9696-8c75-4b3b-958f-f248453ffff0,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:dcaaed0,CLOUDID:f59b0053-dd49-462e-a4be-2143a3ddc739,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: b77685c05b7547bf88586689e8b9513a-20221228 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 354974358; Wed, 28 Dec 2022 14:33:36 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Wed, 28 Dec 2022 14:33:35 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 28 Dec 2022 14:33:33 +0800 From: Biao Huang To: Andrew Lunn , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Matthias Brugger CC: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Maxime Coquelin , Richard Cochran , , , , , "Biao Huang" , Subject: [PATCH v6 1/2] stmmac: dwmac-mediatek: remove the dwmac_fix_mac_speed Date: Wed, 28 Dec 2022 14:33:29 +0800 Message-ID: <20221228063331.10756-2-biao.huang@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221228063331.10756-1-biao.huang@mediatek.com> References: <20221228063331.10756-1-biao.huang@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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 In current driver, MAC will always enable 2ns delay in RGMII mode, but that's not the correct usage. Remove the dwmac_fix_mac_speed() in driver, and recommend "rgmii-id" for phy-mode in device tree. Fixes: f2d356a6ab71 ("stmmac: dwmac-mediatek: add support for mt8195") Signed-off-by: Biao Huang --- .../ethernet/stmicro/stmmac/dwmac-mediatek.c | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c index d42e1afb6521..2f7d8e4561d9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -90,7 +90,6 @@ struct mediatek_dwmac_plat_data { struct mediatek_dwmac_variant { int (*dwmac_set_phy_interface)(struct mediatek_dwmac_plat_data *plat); int (*dwmac_set_delay)(struct mediatek_dwmac_plat_data *plat); - void (*dwmac_fix_mac_speed)(void *priv, unsigned int speed); /* clock ids to be requested */ const char * const *clk_list; @@ -443,32 +442,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat) return 0; } -static void mt8195_fix_mac_speed(void *priv, unsigned int speed) -{ - struct mediatek_dwmac_plat_data *priv_plat = priv; - - if ((phy_interface_mode_is_rgmii(priv_plat->phy_mode))) { - /* prefer 2ns fixed delay which is controlled by TXC_PHASE_CTRL, - * when link speed is 1Gbps with RGMII interface, - * Fall back to delay macro circuit for 10/100Mbps link speed. - */ - if (speed == SPEED_1000) - regmap_update_bits(priv_plat->peri_regmap, - MT8195_PERI_ETH_CTRL0, - MT8195_RGMII_TXC_PHASE_CTRL | - MT8195_DLY_GTXC_ENABLE | - MT8195_DLY_GTXC_INV | - MT8195_DLY_GTXC_STAGES, - MT8195_RGMII_TXC_PHASE_CTRL); - else - mt8195_set_delay(priv_plat); - } -} - static const struct mediatek_dwmac_variant mt8195_gmac_variant = { .dwmac_set_phy_interface = mt8195_set_interface, .dwmac_set_delay = mt8195_set_delay, - .dwmac_fix_mac_speed = mt8195_fix_mac_speed, .clk_list = mt8195_dwmac_clk_l, .num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l), .dma_bit_mask = 35, @@ -619,8 +595,6 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev, plat->bsp_priv = priv_plat; plat->init = mediatek_dwmac_init; plat->clks_config = mediatek_dwmac_clks_config; - if (priv_plat->variant->dwmac_fix_mac_speed) - plat->fix_mac_speed = priv_plat->variant->dwmac_fix_mac_speed; plat->safety_feat_cfg = devm_kzalloc(&pdev->dev, sizeof(*plat->safety_feat_cfg), -- 2.25.1