From patchwork Fri Jun 16 10:04:02 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: 109016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1225311vqr; Fri, 16 Jun 2023 03:18:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5S94UB9zG9KNN6EEwCpK6wwD9lHhEIL4jvgQUyeUXyti0CNP4XkjmdvIuGCVgxlTnhE95I X-Received: by 2002:a17:902:ab5c:b0:1b0:522d:8ff4 with SMTP id ij28-20020a170902ab5c00b001b0522d8ff4mr1331931plb.21.1686910694071; Fri, 16 Jun 2023 03:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686910694; cv=none; d=google.com; s=arc-20160816; b=HnE9Ae694uCjDF0+/ARBTRVJb3lx499o0htzp5eBvXSA4JRb7dUF4sIvPYTYnIj8Bl RgEGCczmlzOqrtN/0CqsYJAB++tgKdiVv1rVX2nvZ57GcXsynqrRzHrwubWiaxt5wW0B IWZeoqSq78JiiS7gAVkXiTSGhYyXJ4N/5WiCUxz21tjzopPYBfM3Uz5Kd9f+0l7IuxHU ddokMm0XZj+KT1zRq0EddhqNDGbILnQ/+2ReUSMcJTL1xFzrVo60ZHYopXxiRiexrX3V ETwqz2c7b0iVpJrP5LN678zN8tRI4eeW7o12Ogp/krkqybPHACxUU9BVwV7XEuJfvcMJ yd/g== 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=ZQ1+xbvMnidBmGeXT0nP+KHmlPyfa+N1kU3ye5N9Y2M=; b=q/qgbcVfiwZZj78TMdog6bAtIAC4kyQV1Rnx0T90yp0sX49jBvIn+RGfWGzGRaQgVV chYVEUpPEVrcO7jkMQFUS1LJr77Gis2Zip0oozwjMisQHe0HCSZTmr5ZxG3+apkiG7VW fkku2jwGaHHZnUJa15qoYPpdr2i5YDr40mPLuujo/IGc/Wu/oaTLJDT3WqedchnkA2YJ ysMJ91zSmJOc0sfk3Yvh6wJxYUD5vj+XJCfc7HepJqAxKmVXZ/eKTGCyD1CARN+WHpOT qe4blJdr2eTBnEWGuKWo+kT3lq1+nRC5CT1exB3dhnNczNXkRhtht6/JCA7Q5kmygeUn 4HuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Sicjf9ks; 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 p5-20020a170902e74500b001ab147e4539si13623505plf.419.2023.06.16.03.17.59; Fri, 16 Jun 2023 03:18:14 -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=Sicjf9ks; 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 S232085AbjFPKFj (ORCPT + 99 others); Fri, 16 Jun 2023 06:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjFPKFe (ORCPT ); Fri, 16 Jun 2023 06:05:34 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3168C2137; Fri, 16 Jun 2023 03:05:33 -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=1686909931; 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=ZQ1+xbvMnidBmGeXT0nP+KHmlPyfa+N1kU3ye5N9Y2M=; b=Sicjf9ks2PJoF/K2iAiEzxbRBrNIvgpB0mTA1GqD4eEWaZ/tLOB7KOSnyaLhISAEocTwyv RPPNUS3DqAW37JRUxacbu68edCx2UY30ktDi8ZHWIPaU3ya2meksVLKyBsbYx8Z9NbUvDu TufohlkapBs05jQMj4Z1KYsaobvwW/QyXoaLG2TKo6rfGryl2XQ/dTwFIZfZAjjr+0dl3Z uho3Q9qfYJAsLMrKUaCReSYe1T/RMrWJp3tNl2W3+RR20V7o1YE5iN3C/mCGPEeHFOqnDc FRadOLh+++SFziNFZf4WOF9z9MFgLm/RUxOx94IdYHQeAe/56hJzx92ZbJ5n1w== 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 83BF520003; Fri, 16 Jun 2023 10:05:30 +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 1/8] net: stmmac: add IP-specific callbacks for auxiliary snapshot Date: Fri, 16 Jun 2023 12:04:02 +0200 Message-ID: <20230616100409.164583-2-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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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?1768854067828682891?= X-GMAIL-MSGID: =?utf-8?q?1768854067828682891?= From: Alexis Lothoré Since auxiliary snapshots configuration registers may be different depending the DWMAC IP, we need a specific set of callbacks to - configure timestamp snapshot triggers - clear the snapshots FIFO Signed-off-by: Alexis Lothoré --- drivers/net/ethernet/stmicro/stmmac/hwif.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index 6ee7cf07cfd7..d0b2f13510aa 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -419,6 +419,10 @@ struct stmmac_ops { void (*fpe_send_mpacket)(void __iomem *ioaddr, enum stmmac_mpacket_type type); int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *dev); + /* Auxiliary snapshots */ + void (*extts_configure)(void __iomem *ioaddr, int ext_snapshot_num, + bool on, struct net_device *dev); + int (*clear_snapshot_fifo)(void __iomem *ioaddr); }; #define stmmac_core_init(__priv, __args...) \ @@ -523,6 +527,10 @@ struct stmmac_ops { stmmac_do_void_callback(__priv, mac, fpe_send_mpacket, __args) #define stmmac_fpe_irq_status(__priv, __args...) \ stmmac_do_callback(__priv, mac, fpe_irq_status, __args) +#define stmmac_extts_configure(__priv, __args...) \ + stmmac_do_void_callback(__priv, mac, extts_configure, __args) +#define stmmac_clear_snapshot_fifo(__priv, __args...) \ + stmmac_do_callback(__priv, mac, clear_snapshot_fifo, __args) /* PTP and HW Timer helpers */ struct stmmac_hwtimestamp {