From patchwork Fri Jun 16 10:04:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 13282533 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 879B1EB64DA for ; Fri, 16 Jun 2023 10:06:14 +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=PPdLg/3MSBInBvBFICEF/Td0ruQY8eDNaoFwd8khqkA=; b=QKVb6vMRKpxrK3 3VIBsa4o4ZCx9RW4+OrwzV6AQ7yUeiZh0sKF2WoW1aMEhXcZu1SmVk992jes9w4XBDU0p+T0/sEd0 VGTw/qNCnoJDkrdCof1ZYCFaC+uebfii+nEgSOoScdZrJIVcn8Mm8MBJsuATtqWThlJ/jJFz7Wrjw AbIlziArWw/gRsNXY3ridadJu0wjwDg/ristcOG8gVpjby6vKZVehARtfEHJk9pTp5jT4RkzUp+Rr hDGJyrSZtRLoPqs4QI2s9GJndxpV7ERnrTfXdUD0qBkCLpfWC3xTEZrPcw7Os/hMD6ryHW/be/yDf iQXqeYVkNEDkDAnk2LHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA6L2-00HXx4-2L; Fri, 16 Jun 2023 10:05:52 +0000 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA6Ko-00HXqK-1D for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 10:05:39 +0000 X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686909936; 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=TuLT0Dx8INmVuQ+Tjg5nObFk3ZPU55oE6gxmpAOjP2k=; b=lzUlV6Vl1+7PGIIxMRVfnCBB6Dz/NpkZawq1V/uJWhuAkOFIuN+draPM1L5Gg566KO4kvF z8zjlfLDt8oXatl77D3OHSqS/P5KebT1YLOHsBw2aGvtvFrYeZsNMFFYazPh/h80l8mpzu PjKiDGTM7rvRB7E9n7NNjVRH/0TnjV+/oNTag4KyZ4mLPJGNMpdliEy5NXYRM9kHDAAqC1 NqCggXkU2o8fSr+1asolZiUSSvxvvj1VmoZOTRnkNtWvMgaGMZthqLCU+yZqKtSF6riVM0 SpxF5DQJi9JFcreWJcbOgVttfiHi08F8TPdlEpG1VL1p168dIPEAdqu27IChVw== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id ADD9920007; Fri, 16 Jun 2023 10:05:35 +0000 (UTC) From: alexis.lothore@bootlin.com To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Thomas Petazzoni , Nicolas Carrier Subject: [PATCH net-next 5/8] net: stmmac: set number of snapshot external triggers for GMAC3 Date: Fri, 16 Jun 2023 12:04:06 +0200 Message-ID: <20230616100409.164583-6-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230616100409.164583-1-alexis.lothore@bootlin.com> References: <20230616100409.164583-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_030538_581290_895A1D62 X-CRM114-Status: GOOD ( 11.06 ) 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 From: Alexis Lothoré While GMAC4 exposes number of available auxiliary snapshots inputs in MAC_HW_FEATURE2 register, GMAC3 (DWMAC1000) does not expose this information in its only hardware feature register. When running on GMAC3, hardcode the value to 1 to allow external trigger usage Signed-off-by: Alexis Lothoré --- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c index 167bfbf68911..090a9d803446 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -280,7 +280,10 @@ void stmmac_ptp_register(struct stmmac_priv *priv) priv->plat->cdc_error_adj = (2 * NSEC_PER_SEC) / priv->plat->clk_ptp_rate; stmmac_ptp_clock_ops.n_per_out = priv->dma_cap.pps_out_num; - stmmac_ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n; + /* Number of available external triggers is not provided through a + * hardware capabilities register for GMAC3 + */ + stmmac_ptp_clock_ops.n_ext_ts = priv->plat->has_gmac ? 1 : priv->dma_cap.aux_snapshot_n; rwlock_init(&priv->ptp_lock); mutex_init(&priv->aux_ts_lock);