mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Stefan Kerkmann <s.kerkmann@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 "open list:BAREBOX" <barebox@lists.infradead.org>
Cc: Stefan Kerkmann <s.kerkmann@pengutronix.de>
Subject: [PATCH 2/4] ARM: i.MX8M/i.MX7: initialize SNVS glitch detection for all families
Date: Wed, 03 Jun 2026 15:33:43 +0200	[thread overview]
Message-ID: <20260603-feature-snvs-imx6ul-v1-2-6305f63bd3fa@pengutronix.de> (raw)
In-Reply-To: <20260603-feature-snvs-imx6ul-v1-0-6305f63bd3fa@pengutronix.de>

The value and register is identical across i.MX8M and i.MX7 so move the
block to the shared snvs_init() function.

Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
---
 arch/arm/mach-imx/snvs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-imx/snvs.c b/arch/arm/mach-imx/snvs.c
index 80df62ad96..414e927b05 100644
--- a/arch/arm/mach-imx/snvs.c
+++ b/arch/arm/mach-imx/snvs.c
@@ -22,6 +22,11 @@ static void snvs_init(void __iomem *snvs)
 	val = readl(snvs + SNVS_HPCOMR);
 	val |= SNVS_HPCOMR_NPSWA_EN;
 	writel(val, snvs + SNVS_HPCOMR);
+
+	/* Initialize glitch detect */
+	writel(SNVS_LPPGDR_INIT, snvs + SNVS_LPLVDR);
+	/* Clear interrupt status */
+	writel(0xffffffff, snvs + SNVS_LPSR);
 }
 
 void imx7_snvs_init(void)
@@ -35,10 +40,5 @@ void imx8m_setup_snvs(void)
 {
 	void __iomem *snvs = IOMEM(MX8M_SNVS_BASE_ADDR);
 
-        /* Initialize glitch detect */
-        writel(SNVS_LPPGDR_INIT, snvs + SNVS_LPLVDR);
-        /* Clear interrupt status */
-        writel(0xffffffff, snvs + SNVS_LPSR);
-
-        snvs_init(snvs);
+	snvs_init(snvs);
 }

-- 
2.47.3




  parent reply	other threads:[~2026-06-03 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 13:33 [PATCH 0/4] ARM: i.MX6UL: initialize snvs peripheral Stefan Kerkmann
2026-06-03 13:33 ` [PATCH 1/4] nvmem: snvs_lpgpr: remove unnecessary cfg->name assignment Stefan Kerkmann
2026-06-03 14:41   ` Ahmad Fatoum
2026-06-03 13:33 ` Stefan Kerkmann [this message]
2026-06-03 13:33 ` [PATCH 3/4] ARM: i.MX7: snvs: rename imx7_snvs_init -> imx7_setup_snvs Stefan Kerkmann
2026-06-03 13:33 ` [PATCH 4/4] ARM: i.MX6UL: initialize SNVS Stefan Kerkmann
2026-06-04  7:02 ` [PATCH 0/4] ARM: i.MX6UL: initialize snvs peripheral Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260603-feature-snvs-imx6ul-v1-2-6305f63bd3fa@pengutronix.de \
    --to=s.kerkmann@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox