All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: mach-k3: am642_init: Unlock MCU PADCFG regs
@ 2021-12-15 15:10 Christian Gmeiner
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Gmeiner @ 2021-12-15 15:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Michael Liebert, Christian Gmeiner, Dave Gerlach, Lokesh Vutla,
	Aswath Govindraju, Keerthy, u-boot

From: Michael Liebert <liebert@ibv-augsburg.de>

Currently only the PADCFG registers of the main domain are unlocked.
Also unlock PADCFG registers of MCU domain, so MCU pin muxing can be configured by u-boot or Linux.

Signed-off-by: Michael Liebert <liebert@ibv-augsburg.de>
Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 arch/arm/mach-k3/am642_init.c                 | 3 +++
 arch/arm/mach-k3/include/mach/am64_hardware.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 533905daeb..958fa05af4 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -37,6 +37,9 @@ static void ctrl_mmr_unlock(void)
 	mmr_unlock(CTRL_MMR0_BASE, 3);
 	mmr_unlock(CTRL_MMR0_BASE, 5);
 	mmr_unlock(CTRL_MMR0_BASE, 6);
+
+	/* Unlock all MCU_PADCFG_MMR1 module registers */
+	mmr_unlock(MCU_PADCFG_MMR1_BASE, 1);
 }
 
 /*
diff --git a/arch/arm/mach-k3/include/mach/am64_hardware.h b/arch/arm/mach-k3/include/mach/am64_hardware.h
index 96383437d5..e06e1f9532 100644
--- a/arch/arm/mach-k3/include/mach/am64_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am64_hardware.h
@@ -12,6 +12,8 @@
 
 #define PADCFG_MMR1_BASE				0xf0000
 
+#define MCU_PADCFG_MMR1_BASE				0x04080000
+
 #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_MASK		0x00000078
 #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_SHIFT		3
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] arm: mach-k3: am642_init: Unlock MCU PADCFG regs
@ 2021-12-15 15:14 Christian Gmeiner
  2022-01-14 19:27 ` Nishanth Menon
  2022-01-17 18:36 ` Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Gmeiner @ 2021-12-15 15:14 UTC (permalink / raw)
  To: u-boot
  Cc: Michael Liebert, Christian Gmeiner, Lokesh Vutla, Dave Gerlach,
	Aswath Govindraju, Keerthy

From: Michael Liebert <liebert@ibv-augsburg.de>

Currently only the PADCFG registers of the main domain are unlocked.
Also unlock PADCFG registers of MCU domain, so MCU pin muxing can be configured by u-boot or Linux.

Signed-off-by: Michael Liebert <liebert@ibv-augsburg.de>
Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 arch/arm/mach-k3/am642_init.c                 | 3 +++
 arch/arm/mach-k3/include/mach/am64_hardware.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 533905daeb..958fa05af4 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -37,6 +37,9 @@ static void ctrl_mmr_unlock(void)
 	mmr_unlock(CTRL_MMR0_BASE, 3);
 	mmr_unlock(CTRL_MMR0_BASE, 5);
 	mmr_unlock(CTRL_MMR0_BASE, 6);
+
+	/* Unlock all MCU_PADCFG_MMR1 module registers */
+	mmr_unlock(MCU_PADCFG_MMR1_BASE, 1);
 }
 
 /*
diff --git a/arch/arm/mach-k3/include/mach/am64_hardware.h b/arch/arm/mach-k3/include/mach/am64_hardware.h
index 96383437d5..e06e1f9532 100644
--- a/arch/arm/mach-k3/include/mach/am64_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am64_hardware.h
@@ -12,6 +12,8 @@
 
 #define PADCFG_MMR1_BASE				0xf0000
 
+#define MCU_PADCFG_MMR1_BASE				0x04080000
+
 #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_MASK		0x00000078
 #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_SHIFT		3
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-17 18:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 15:10 [PATCH] arm: mach-k3: am642_init: Unlock MCU PADCFG regs Christian Gmeiner
2021-12-15 15:14 Christian Gmeiner
2022-01-14 19:27 ` Nishanth Menon
2022-01-17 18:36 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.