From patchwork Tue Nov 8 02:08:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gan, Yi Fang" X-Patchwork-Id: 16805 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2431062wru; Mon, 7 Nov 2022 18:17:28 -0800 (PST) X-Google-Smtp-Source: AMsMyM5eP2PLk98GPg4E9c5FpHGbF+syzcPEO6ZzE6mCjqdKHc3h9v9wAoHTxE0MWPrrE+ExuKyk X-Received: by 2002:a17:907:80d:b0:73d:a576:dfbd with SMTP id wv13-20020a170907080d00b0073da576dfbdmr50520804ejb.402.1667873848349; Mon, 07 Nov 2022 18:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667873848; cv=none; d=google.com; s=arc-20160816; b=KXY8jp9hj6RxXfVaj7h4cRSU/bUpQPaR25Wvzu4dczkguiyP8lnhEF6JxKi7WFqREG XzEcyW1LrAa0P9dB/Cm/yttCVsdqVsO9/5H5hBsZ2zhGyX1QKKuiHrXVbomDP9NdzB0n y1sTwKKFMhihTHRj042+HamBE77WFvSTioIj1jI73B+vwNlnWlWDvWy64TNcH+uk+1Gk rX3GDlFNwN5WdKRaWAu7TOqoH9Dv9nZY/cFHky7BKKFN6eP6XH+1ZrTZDIvHJye9UpnQ HIiOjSJ9e0fcMZy/NHdMF7poJqpRYD15cJnHyy3qNzyalnNpS0TFzPUDAisr5TjKcQqg OwoQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lWBSWI3qST+7NAUEsz4e5w2I36X3QuceDbE+mlHULAM=; b=yOVZgKcqjITJXmw6U6G3tzeOD9QV5yxSNkJ0XxyhdaiA9LPYqaPS+cVUTEM86K7UAB nAnVjXzOxQaYZDTwffWgTMP2In8mllum5MqokbKIijiLVG/k0a/wGjCUuOWGSF8R8jZr jxufIclaBDKi1+Jj/apqqaSz/n/7TfnAJ2QrB/wG1ruEj+NwFHKKM/i+Lh+uUt7O5y6R YUu9PO/ojMMX1AB+DMWKUBiK/3pCqhyCgeqqV+y//iCYwzTVnI0u8FWmk0e4NmEVpwC8 mvMDlxm8cd/V0yfZ+ERDQXPbiM34+SgA1FyGD7Mj+FsmJFkSXoBXvoMbwKExpEdsf60N Dptg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C6srNNIh; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a056402354700b00461e426dcb0si13235948edd.609.2022.11.07.18.17.04; Mon, 07 Nov 2022 18:17:28 -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=@intel.com header.s=Intel header.b=C6srNNIh; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232676AbiKHCIs (ORCPT + 99 others); Mon, 7 Nov 2022 21:08:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232060AbiKHCIX (ORCPT ); Mon, 7 Nov 2022 21:08:23 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E376638D; Mon, 7 Nov 2022 18:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667873302; x=1699409302; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=i/dLpV2uFjEVIuCUEjBPXiMF2Qtt/k5JOyenuO0QQz0=; b=C6srNNIhEhb76aYNHdKzhPs3/l8VECFnAW+NgYkt3TGHdi97sfFH0C3H nePra7KVgW+BUoXb4EdMu4dgYeulOlYmXXWmxZ4nTVIpwXcH3gfiiVgm4 mPNxq9G2Xja3GrJF7HBxn+jT6zOTd9NZ5LmT9awwoNIitAmwqlUAazN3M pkFufHameSMXXA+tzupDsxfTsjg+GBtmEtcj3At01S6Ucq6JwO+ebyFjF SWCx8751K4qPGcyxl6O7maMpP8P4rYsti2uIBXsp8aOF8LU702kgcAxXY HXAvlgor9SHHsPdiaxHR3p9jGsoToUnxNdAyVpSjFC8scEEED5neN7qFz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="372719715" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="372719715" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 18:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="811064706" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="811064706" Received: from ganyifangubuntu20-ilbpg12.png.intel.com ([10.88.229.31]) by orsmga005.jf.intel.com with ESMTP; 07 Nov 2022 18:08:17 -0800 From: Gan Yi Fang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Gan Yi Fang Cc: Looi Hong Aun , Voon Weifeng , Ling Pei Lee , Tan Tee Min , Zulkifli Muhammad Husaini , Sit Michael Wei Hong Subject: [PATCH net 1/1] stmmac: intel: Update PCH PTP clock rate from 200MHz to 204.8MHz Date: Mon, 7 Nov 2022 21:08:11 -0500 Message-Id: <20221108020811.12919-1-yi.fang.gan@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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?1748892488846910118?= X-GMAIL-MSGID: =?utf-8?q?1748892488846910118?= From: "Tan, Tee Min" Current Intel platform has an output of ~976ms interval when probed on 1 Pulse-per-Second(PPS) hardware pin. The correct PTP clock frequency for PCH GbE should be 204.8MHz instead of 200MHz. PSE GbE PTP clock rate remains at 200MHz. Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform") Signed-off-by: Ling Pei Lee Signed-off-by: Tan, Tee Min Signed-off-by: Voon Weifeng Signed-off-by: Gan Yi Fang --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 0a2afc1a3124..7deb1f817dac 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -629,7 +629,6 @@ static int ehl_common_data(struct pci_dev *pdev, { plat->rx_queues_to_use = 8; plat->tx_queues_to_use = 8; - plat->clk_ptp_rate = 200000000; plat->use_phy_wol = 1; plat->safety_feat_cfg->tsoee = 1; @@ -654,6 +653,8 @@ static int ehl_sgmii_data(struct pci_dev *pdev, plat->serdes_powerup = intel_serdes_powerup; plat->serdes_powerdown = intel_serdes_powerdown; + plat->clk_ptp_rate = 204800000; + return ehl_common_data(pdev, plat); } @@ -667,6 +668,8 @@ static int ehl_rgmii_data(struct pci_dev *pdev, plat->bus_id = 1; plat->phy_interface = PHY_INTERFACE_MODE_RGMII; + plat->clk_ptp_rate = 204800000; + return ehl_common_data(pdev, plat); } @@ -683,6 +686,8 @@ static int ehl_pse0_common_data(struct pci_dev *pdev, plat->bus_id = 2; plat->addr64 = 32; + plat->clk_ptp_rate = 200000000; + intel_mgbe_pse_crossts_adj(intel_priv, EHL_PSE_ART_MHZ); return ehl_common_data(pdev, plat); @@ -722,6 +727,8 @@ static int ehl_pse1_common_data(struct pci_dev *pdev, plat->bus_id = 3; plat->addr64 = 32; + plat->clk_ptp_rate = 200000000; + intel_mgbe_pse_crossts_adj(intel_priv, EHL_PSE_ART_MHZ); return ehl_common_data(pdev, plat); @@ -757,7 +764,7 @@ static int tgl_common_data(struct pci_dev *pdev, { plat->rx_queues_to_use = 6; plat->tx_queues_to_use = 4; - plat->clk_ptp_rate = 200000000; + plat->clk_ptp_rate = 204800000; plat->speed_mode_2500 = intel_speed_mode_2500; plat->safety_feat_cfg->tsoee = 1;