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: 109005 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1219817vqr; Fri, 16 Jun 2023 03:10:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tnBNUOUltSMI3ifUPwrfH9tu3Ji/r7TNIAnogYvCFttv1l7tyCFPwi+fe7ThEozzrkGE+ X-Received: by 2002:a05:6a20:7491:b0:104:8045:c952 with SMTP id p17-20020a056a20749100b001048045c952mr9153513pzd.23.1686910209829; Fri, 16 Jun 2023 03:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686910209; cv=none; d=google.com; s=arc-20160816; b=q5lUzA2q77SGZZY30/fGDPgL7GixFg5aR1R/Uuefta/V7MMOvCBQ5675tWhHJx8gi4 cykODxmJdmQ5aUfmX9y138U++wkDfSFE773wS0TfoZfw1qb9JJmVDw98SZ46mGByzRsQ 7ZckdTgVrTONEGpOdeB1uDH/0HIcsVqTe/bq8o+j8yWMfRY0FR2nZhjb+jpB1gdwB3gL ew2V8MlJPC4r+Q2QNEGqw0pNBdT3jY14Ep5uZRSABuRWglJTiZl8VmmYdkTo96qZn1Pb YaHS3ueqfySxRAhKgbvidQhTiGzC8GE5xpX4Fl7BZqhDrV1CUmmBWO4YJ9AkuO9RT+t0 aXHA== 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=TuLT0Dx8INmVuQ+Tjg5nObFk3ZPU55oE6gxmpAOjP2k=; b=oywGs7xA1wKvRQF7po7xPjoU6tkZcmntA2N6rT/Gqa4KyPcXAdess1A4KbcTMKUT/p 3vki7m4V42vnOL3IcWqQY9sWyM0hpLf3UNFbUwvTq7CSlkkoUTD7RuBXwrU0bNNGT0aI mAOyXXHP2pyBUOOL0HbcetxpBP3oGVyr6rD5OOR70+Yak2lRgBuYJFesllWIRS6CHxlv M0zCCEEOSPPmK5Z4a5jFZ27/PKw6dRti/NseajhD4i/GeU7mwUyvt85sQVG1MmJcD81B oEv4oPQyQe+sZJG5Jbm3U3fs68qPJKXaI7w+vRZhQgdgHbd669R2fCW5Db/VNNLxt9X/ xrbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lzUlV6Vl; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z8-20020a63b908000000b005533c53f3fbsi1651336pge.800.2023.06.16.03.09.54; Fri, 16 Jun 2023 03:10:09 -0700 (PDT) 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=@bootlin.com header.s=gm1 header.b=lzUlV6Vl; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244629AbjFPKF6 (ORCPT + 99 others); Fri, 16 Jun 2023 06:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbjFPKFj (ORCPT ); Fri, 16 Jun 2023 06:05:39 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4352B2D67; Fri, 16 Jun 2023 03:05:38 -0700 (PDT) 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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768853560101256367?= X-GMAIL-MSGID: =?utf-8?q?1768853560101256367?= 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);