Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12983978rwl; Wed, 4 Jan 2023 01:37:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXv+5uwRxdcAgUhGkUtlqXaiiLjEaDuil9YbeIdzLfQvY0p3K+pFPq6GU4tL+EiILrdo4w9H X-Received: by 2002:aa7:9465:0:b0:582:ca4d:f6ad with SMTP id t5-20020aa79465000000b00582ca4df6admr4339060pfq.7.1672825055113; Wed, 04 Jan 2023 01:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672825055; cv=none; d=google.com; s=arc-20160816; b=B9yEe2vTRRAuI9V9oIIzKQK9ZnF4Ta0hjzNRr4i2m3LMbautQY+yaOUlgLGvnKUkdl aamejxyyf8KgW7zmo9/POkQQMM8+NZ5uzJHC+NzpQH6znlZqmnveLQJGWd9d3i9tzTnD lSZWsMjggSDXLzIZY/aC72gncbWquFRNArNZ92fvc8Y+uSagPDw+UjqfBICWS5USnb5R 2BWuDlul95gw+r6x0IM4hh3RoYsdIvWD3y4JRmjYP6aQybtZgyTG0nmDqIuwG1JKzhmH mFfXHMlLRmNONp1CPuu7qnTL2R4tH+hMp6ELq7OEib2JaPymS7kjGjsbmUBQyd4MkKqQ ZikQ== 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=mwPFtENayOcwv0+Odh6BvfAE3BGsZ9Lzvp9Eo8BQ9K8seT59ZUGEGI8t1M3DAnh+kz bH4Cu04yWEXoCaRvNgG4ZHWQn03hjFebF/YN9gjeXNVeUddIYliCToKmMDDbJhRoRw8B +knBB/AezbOBhejkHHpEy/ej+KmuAhQ3WljVcLNjasixPaOrTfwytACjOOlZGqbQekEn 0HiGNG6BHNnkYrGoKfy3ek17cV96tAtuQw/FcAR9FZxhfZxM0u3xBNwhjRlOFVSvS1zZ nVT1zslX1ZaXY+YGas0IbTD5jYmAPCYNZkGcdDiBULwtc9iI3QYb3EygNzw7Tij+5Wo3 TOEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qaQb4n7a; 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 f9-20020a056a00238900b0057f905fb1easi11871328pfc.335.2023.01.04.01.37.27; Wed, 04 Jan 2023 01:37:35 -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=qaQb4n7a; 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 S234838AbjADI7p (ORCPT + 57 others); Wed, 4 Jan 2023 03:59:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234100AbjADI7V (ORCPT ); Wed, 4 Jan 2023 03:59:21 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CF4B27F; Wed, 4 Jan 2023 00:59:13 -0800 (PST) X-UUID: fb8cd0b99ae54e27b612c3d872a41584-20230104 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=qaQb4n7a1F6x73eMcXxbzxxabLfL+o+PAvg3LkVlsGirP326+fO4d4DR0GlSbXoAahj/iigrqrPIpPD7Pj9c+7/MJEt9ic3V8MV8KsXIarshVJLAMPPCoy+UAO5dUYukckkOQSKh2tIz6kz2ZXRbRj6yO58ujBkjAb9otDfMYrI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.16,REQID:d8164132-03af-4c00-930d-883366537a7f,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.16,REQID:d8164132-03af-4c00-930d-883366537a7f,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:09771b1,CLOUDID:8a189b53-dd49-462e-a4be-2143a3ddc739,B ulkID:230104165906MBZUWZHV,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0 X-CID-BVR: 0,NGT X-UUID: fb8cd0b99ae54e27b612c3d872a41584-20230104 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2047017507; Wed, 04 Jan 2023 16:59:05 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 4 Jan 2023 16:59:03 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (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, 4 Jan 2023 16:59:02 +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 v7 1/2] stmmac: dwmac-mediatek: remove the dwmac_fix_mac_speed Date: Wed, 4 Jan 2023 16:58:56 +0800 Message-ID: <20230104085857.2410-2-biao.huang@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104085857.2410-1-biao.huang@mediatek.com> References: <20230104085857.2410-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=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no 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