[PATCH 4/4] ARM: i.MX6UL: initialize SNVS

Stefan Kerkmann <[email protected]>
Newsgroups org.infradead.lists.barebox
Message-ID <[email protected]>
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 <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.