From patchwork Wed Nov 6 09:03:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 13864136 X-Patchwork-Delegate: kuba@kernel.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7150F1DA631; Wed, 6 Nov 2024 09:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730883824; cv=none; b=uW74mUwOM+YT2L/8qipH0aiKj06yi6Sip5/vmWbL19oARsiSda3IYHlwJ4k1VfPdDY6A6bT65E7LffbK7Txj1tJ0BOv2iZg/KghtpV5OrgM1Fqx1M32vu2oOQo9rGXn0WpuonlQ9mTJNp2hZCY3P6UVFejW16igQ/0LLXgwp7ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730883824; c=relaxed/simple; bh=wHSkO3i4E3QVVJuUzsudtVocN6toZEOaX0qWO3m4zzI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E2VIFCWc2RkAffDtfKf4Bg7Yw92LBVJA24erxpCYJT5zKYagkN2JKZuLC2VSfUll0NWc49xywIxP0NYxBlGgSJH1oVq8oZIoVGMeBl4WldmVSUK7oPN1qLb66YqhL/1ugc/Cdk4w42au+wrjJX+ZVAVklLeEMq4ZIhoaYYIr20M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=XUpUb+JT; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="XUpUb+JT" Received: by mail.gandi.net (Postfix) with ESMTPSA id 1AC37C000E; Wed, 6 Nov 2024 09:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1730883820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bsLQRHH9qcfVm0KFq9nbu7CAMOKMnDfpEsC1vjJ0/qg=; b=XUpUb+JT6rjH1kpItlNyHplkrG9yd0WFPn/4A272FO38lRygb+7vRZeZF87FVMA1+KVHuP 9d7x0xGXW4XOMxQBvhpZEoYOLcUYrK8V3DXejJil2BlVTG3Z5VU5gMGmFbRv66lyBTWUW4 RjN7z5G02uX7prPHiOjVQNrTw98Se6eDYNCjBOzxQi93xpFREQaJyzXNqm7F1bfjZCdW5X nUx2gaw4YiQXqwJBPJprBfY4wr1XaR68ftcIqs+IREamQgBcviKsDuGYcihuvzxYt8jSLq oH/tr8EnhdN0x00dELjl7FqKL8TYKw7CY5CVs5FNtHRDbkV6S0ewPEE2jM+iGg== From: Maxime Chevallier To: Alexandre Torgue , Jose Abreu , Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran Cc: Maxime Chevallier , =?utf-8?q?Alexis_Loth?= =?utf-8?q?or=C3=A9?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 6/9] net: stmmac: Enable timestamping interrupt on dwmac1000 Date: Wed, 6 Nov 2024 10:03:27 +0100 Message-ID: <20241106090331.56519-7-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106090331.56519-1-maxime.chevallier@bootlin.com> References: <20241106090331.56519-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-Patchwork-Delegate: kuba@kernel.org The default configuration for the interrupts on dwmac1000 have the timestamping interrupt masked. Now that the timestamping has been adapted to dwmac1000, enable the timestamping interrupt on these platforms. On dwmac1000, the external snapshot interrupt is configured through a dedicated bit, that is set as reserved on other dwmac variants. The timestaming interrupt is acknowledged by reading the GMAC3_X_TIMESTAMP_STATUS register. Make sure that this interrupt is enabled when snapshot is enabled, and masked when disabled. Signed-off-by: Maxime Chevallier --- .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index dbbd834f9fc8..37374f5a15c4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c @@ -595,6 +595,20 @@ void dwmac1000_timestamp_interrupt(struct stmmac_priv *priv) /* DWMAC 1000 ptp_clock_info ops */ +static void dwmac1000_timestamp_interrupt_cfg(struct stmmac_priv *priv, bool en) +{ + void __iomem *ioaddr = priv->ioaddr; + + u32 intr_mask = readl(ioaddr + GMAC_INT_MASK); + + if (en) + intr_mask &= ~GMAC_INT_DISABLE_TIMESTAMP; + else + intr_mask |= GMAC_INT_DISABLE_TIMESTAMP; + + writel(intr_mask, ioaddr + GMAC_INT_MASK); +} + int dwmac1000_ptp_enable(struct ptp_clock_info *ptp, struct ptp_clock_request *rq, int on) { @@ -628,6 +642,8 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp, ret = readl_poll_timeout(ptpaddr + PTP_TCR, tcr_val, !(tcr_val & GMAC_PTP_TCR_ATSFC), 10, 10000); + + dwmac1000_timestamp_interrupt_cfg(priv, on); break; default: