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 4/4] ARM: i.MX6UL: initialize SNVS
Date: Wed, 03 Jun 2026 15:33:45 +0200 [thread overview]
Message-ID: <20260603-feature-snvs-imx6ul-v1-4-6305f63bd3fa@pengutronix.de> (raw)
In-Reply-To: <20260603-feature-snvs-imx6ul-v1-0-6305f63bd3fa@pengutronix.de>
The snvs lpgr register can only be written after initializing the snvs
peripheral. Which is identical across the i.MX8/7/6 families.
Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
---
arch/arm/mach-imx/Kconfig | 2 +-
arch/arm/mach-imx/cpu_init.c | 2 ++
arch/arm/mach-imx/snvs.c | 8 ++++++++
include/mach/imx/snvs.h | 1 +
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 7f78e5282f..9d198e5406 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -70,7 +70,7 @@ config ARCH_IMX_TZASC
config ARCH_IMX_SNVS
bool
- depends on ARCH_IMX7 || ARCH_IMX8M
+ depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8M
default y
#
diff --git a/arch/arm/mach-imx/cpu_init.c b/arch/arm/mach-imx/cpu_init.c
index e0fa459fe7..4fd72a6f30 100644
--- a/arch/arm/mach-imx/cpu_init.c
+++ b/arch/arm/mach-imx/cpu_init.c
@@ -12,6 +12,7 @@
#include <mach/imx/imx8mq-regs.h>
#include <mach/imx/imx8m-ccm-regs.h>
#include <mach/imx/imx9-regs.h>
+#include <mach/imx/snvs.h>
#include <mach/imx/trdc.h>
#include <io.h>
#include <asm/cache.h>
@@ -52,6 +53,7 @@ void imx6ul_cpu_lowlevel_init(void)
{
cortex_a7_lowlevel_init();
arm_cpu_lowlevel_init();
+ imx6_setup_snvs();
}
void imx7_cpu_lowlevel_init(void)
diff --git a/arch/arm/mach-imx/snvs.c b/arch/arm/mach-imx/snvs.c
index 8ec8accf6a..eb049eaf6f 100644
--- a/arch/arm/mach-imx/snvs.c
+++ b/arch/arm/mach-imx/snvs.c
@@ -3,6 +3,7 @@
#include <io.h>
#include <linux/bits.h>
#include <mach/imx/snvs.h>
+#include <mach/imx/imx6-regs.h>
#include <mach/imx/imx7-regs.h>
#include <mach/imx/imx8m-regs.h>
@@ -36,6 +37,13 @@ void imx7_setup_snvs(void)
snvs_init(snvs);
}
+void imx6_setup_snvs(void)
+{
+ void __iomem *snvs = IOMEM(MX6_SNVS_BASE_ADDR);
+
+ snvs_init(snvs);
+}
+
void imx8m_setup_snvs(void)
{
void __iomem *snvs = IOMEM(MX8M_SNVS_BASE_ADDR);
diff --git a/include/mach/imx/snvs.h b/include/mach/imx/snvs.h
index 65e1da34f0..dde2602074 100644
--- a/include/mach/imx/snvs.h
+++ b/include/mach/imx/snvs.h
@@ -3,6 +3,7 @@
#ifndef __MACH_IMX_SNVS_H
#define __MACH_IMX_SNVS_H
+void imx6_setup_snvs(void);
void imx7_setup_snvs(void);
void imx8m_setup_snvs(void);
--
2.47.3
next prev parent reply other threads:[~2026-06-03 13:35 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 ` [PATCH 2/4] ARM: i.MX8M/i.MX7: initialize SNVS glitch detection for all families Stefan Kerkmann
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 ` Stefan Kerkmann [this message]
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-4-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