All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] AM62x ESM support
@ 2022-07-01 12:30 Julien Panis
  2022-07-01 12:30 ` [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices Julien Panis
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Julien Panis @ 2022-07-01 12:30 UTC (permalink / raw)
  To: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna
  Cc: u-boot, Julien Panis

[ERRATUM] Patch sent previously with wrong subject prefix. I am sorry.

This patch series adds support for AM62x ESM (Error Signaling Modules).

The Error Signaling Module (ESM) aggregates events and errors
from throughout the device into one location. It can signal
interrupts to a processor to deal with an event, and manipulate
an error pin to signal an external hardware that an error has
occurred. Therefore an external controller is able to reset the
device. Two ESM can be used : one for main domain devices and
another one for MCU domain devices. Event outputs generated by
main ESM can be routed to MCU ESM as inputs, and trigger
MCU ESM generating its event outputs.

Following are required in defconfig:
	CONFIG_ESM_K3=y
	CONFIG_SPL_MISC=y
	CONFIG_SPL_DRIVERS_MISC=y

Julien Panis (3):
  arm64: dts: k3-am625-r5: Add support for ESM devices
  arm64: mach-k3: am625_init: Probe ESM nodes
  configs: am62x_evm_r5: Add support for ESM

 arch/arm/dts/k3-am625-r5-sk.dts               | 16 +++++++++++++
 arch/arm/mach-k3/am625_init.c                 | 23 +++++++++++++++++++
 arch/arm/mach-k3/include/mach/am62_hardware.h |  3 +++
 configs/am62x_evm_r5_defconfig                |  3 +++
 4 files changed, 45 insertions(+)

-- 
2.25.1


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

* [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices
  2022-07-01 12:30 [PATCH v1 0/3] AM62x ESM support Julien Panis
@ 2022-07-01 12:30 ` Julien Panis
  2022-07-25 21:20   ` Tom Rini
  2022-07-01 12:30 ` [PATCH v1 2/3] arm64: mach-k3: am625_init: Probe ESM nodes Julien Panis
  2022-07-01 12:30 ` [PATCH v1 3/3] configs: am62x_evm_r5: Add support for ESM Julien Panis
  2 siblings, 1 reply; 7+ messages in thread
From: Julien Panis @ 2022-07-01 12:30 UTC (permalink / raw)
  To: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna
  Cc: u-boot, Julien Panis

Add main ESM and MCU ESM nodes to AM625-R5 device tree.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
 arch/arm/dts/k3-am625-r5-sk.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/dts/k3-am625-r5-sk.dts b/arch/arm/dts/k3-am625-r5-sk.dts
index 2691af40a145..54896937d270 100644
--- a/arch/arm/dts/k3-am625-r5-sk.dts
+++ b/arch/arm/dts/k3-am625-r5-sk.dts
@@ -78,6 +78,15 @@
 	ti,secure-host;
 };
 
+&cbass_mcu {
+	mcu_esm: esm@4100000 {
+		compatible = "ti,j721e-esm";
+		reg = <0x0 0x4100000 0x0 0x1000>;
+		ti,esm-pins = <0>, <1>, <2>, <85>;
+		u-boot,dm-spl;
+	};
+};
+
 &cbass_main {
 	sa3_secproxy: secproxy@44880000 {
 		u-boot,dm-spl;
@@ -95,6 +104,13 @@
 		mbox-names = "tx", "rx", "boot_notify";
 		u-boot,dm-spl;
 	};
+
+	main_esm: esm@420000 {
+		compatible = "ti,j721e-esm";
+		reg = <0x0 0x420000 0x0 0x1000>;
+		ti,esm-pins = <160>, <161>, <162>, <163>, <177>, <178>;
+		u-boot,dm-spl;
+	};
 };
 
 &mcu_pmx0 {
-- 
2.25.1


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

* [PATCH v1 2/3] arm64: mach-k3: am625_init: Probe ESM nodes
  2022-07-01 12:30 [PATCH v1 0/3] AM62x ESM support Julien Panis
  2022-07-01 12:30 ` [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices Julien Panis
@ 2022-07-01 12:30 ` Julien Panis
  2022-07-25 21:20   ` Tom Rini
  2022-07-01 12:30 ` [PATCH v1 3/3] configs: am62x_evm_r5: Add support for ESM Julien Panis
  2 siblings, 1 reply; 7+ messages in thread
From: Julien Panis @ 2022-07-01 12:30 UTC (permalink / raw)
  To: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna
  Cc: u-boot, Julien Panis

On AM62x devices, main ESM error event outputs can be routed to
MCU ESM as inputs. So, two ESM device nodes are expected in the
device tree : one for main ESM and another one for MCU ESM.
MCU ESM error output can trigger the reset logic to reset
the device when CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RESET_EN_Z is
set to '0'.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
 arch/arm/mach-k3/am625_init.c                 | 23 +++++++++++++++++++
 arch/arm/mach-k3/include/mach/am62_hardware.h |  3 +++
 2 files changed, 26 insertions(+)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 0d9525992bb0..dfd95b8053b5 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -64,6 +64,15 @@ static void ctrl_mmr_unlock(void)
 	mmr_unlock(PADCFG_MMR1_BASE, 1);
 }
 
+static __maybe_unused void enable_mcu_esm_reset(void)
+{
+	/* Set CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RST_EN_Z  to '0' (low active) */
+	u32 stat = readl(CTRLMMR_MCU_RST_CTRL);
+
+	stat &= RST_CTRL_ESM_ERROR_RST_EN_Z_MASK;
+	writel(stat, CTRLMMR_MCU_RST_CTRL);
+}
+
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;
@@ -142,6 +151,20 @@ void board_init_f(ulong dummy)
 	/* Output System Firmware version info */
 	k3_sysfw_print_ver();
 
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
+		/* Probe/configure ESM0 */
+		ret = uclass_get_device_by_name(UCLASS_MISC, "esm@420000", &dev);
+		if (ret)
+			printf("esm main init failed: %d\n", ret);
+
+		/* Probe/configure MCUESM */
+		ret = uclass_get_device_by_name(UCLASS_MISC, "esm@4100000", &dev);
+		if (ret)
+			printf("esm mcu init failed: %d\n", ret);
+
+		enable_mcu_esm_reset();
+	}
+
 #if defined(CONFIG_K3_AM64_DDRSS)
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret)
diff --git a/arch/arm/mach-k3/include/mach/am62_hardware.h b/arch/arm/mach-k3/include/mach/am62_hardware.h
index cfabd20cbd79..9118d052042a 100644
--- a/arch/arm/mach-k3/include/mach/am62_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am62_hardware.h
@@ -29,6 +29,7 @@
 #define MAIN_DEVSTAT_BACKUP_BOOTMODE_SHIFT	10
 #define MAIN_DEVSTAT_BACKUP_BOOTMODE_CFG_MASK	BIT(13)
 #define MAIN_DEVSTAT_BACKUP_BOOTMODE_CFG_SHIFT	13
+#define RST_CTRL_ESM_ERROR_RST_EN_Z_MASK	(~BIT(17))
 
 /* Primary Bootmode MMC Config macros */
 #define MAIN_DEVSTAT_PRIMARY_MMC_PORT_MASK	0x4
@@ -67,6 +68,8 @@
 #define MCU_CTRL_DEVICE_CLKOUT_32K_CTRL		(MCU_CTRL_MMR0_BASE + 0x8058)
 #define MCU_CTRL_DEVICE_CLKOUT_LFOSC_SELECT_VAL	(0x3)
 
+#define CTRLMMR_MCU_RST_CTRL			(MCU_CTRL_MMR0_BASE + 0x18170)
+
 #define ROM_ENTENDED_BOOT_DATA_INFO		0x43c3f1e0
 
 /* Use Last 2K as Scratch pad */
-- 
2.25.1


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

* [PATCH v1 3/3] configs: am62x_evm_r5: Add support for ESM
  2022-07-01 12:30 [PATCH v1 0/3] AM62x ESM support Julien Panis
  2022-07-01 12:30 ` [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices Julien Panis
  2022-07-01 12:30 ` [PATCH v1 2/3] arm64: mach-k3: am625_init: Probe ESM nodes Julien Panis
@ 2022-07-01 12:30 ` Julien Panis
  2022-07-25 21:20   ` Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: Julien Panis @ 2022-07-01 12:30 UTC (permalink / raw)
  To: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna
  Cc: u-boot, Julien Panis

Enable ESM driver for AM62x in R5 SPL/u-boot build.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
 configs/am62x_evm_r5_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_evm_r5_defconfig b/configs/am62x_evm_r5_defconfig
index 2e340cd6f416..64cd4a4acd09 100644
--- a/configs/am62x_evm_r5_defconfig
+++ b/configs/am62x_evm_r5_defconfig
@@ -96,3 +96,6 @@ CONFIG_SPL_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_LIB_RATIONAL=y
 CONFIG_SPL_LIB_RATIONAL=y
+CONFIG_ESM_K3=y
+CONFIG_SPL_MISC=y
+CONFIG_SPL_DRIVERS_MISC=y
-- 
2.25.1


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

* Re: [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices
  2022-07-01 12:30 ` [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices Julien Panis
@ 2022-07-25 21:20   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2022-07-25 21:20 UTC (permalink / raw)
  To: Julien Panis
  Cc: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna, u-boot

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

On Fri, Jul 01, 2022 at 02:30:10PM +0200, Julien Panis wrote:

> Add main ESM and MCU ESM nodes to AM625-R5 device tree.
> 
> Signed-off-by: Julien Panis <jpanis@baylibre.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH v1 2/3] arm64: mach-k3: am625_init: Probe ESM nodes
  2022-07-01 12:30 ` [PATCH v1 2/3] arm64: mach-k3: am625_init: Probe ESM nodes Julien Panis
@ 2022-07-25 21:20   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2022-07-25 21:20 UTC (permalink / raw)
  To: Julien Panis
  Cc: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna, u-boot

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

On Fri, Jul 01, 2022 at 02:30:11PM +0200, Julien Panis wrote:

> On AM62x devices, main ESM error event outputs can be routed to
> MCU ESM as inputs. So, two ESM device nodes are expected in the
> device tree : one for main ESM and another one for MCU ESM.
> MCU ESM error output can trigger the reset logic to reset
> the device when CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RESET_EN_Z is
> set to '0'.
> 
> Signed-off-by: Julien Panis <jpanis@baylibre.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH v1 3/3] configs: am62x_evm_r5: Add support for ESM
  2022-07-01 12:30 ` [PATCH v1 3/3] configs: am62x_evm_r5: Add support for ESM Julien Panis
@ 2022-07-25 21:20   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2022-07-25 21:20 UTC (permalink / raw)
  To: Julien Panis
  Cc: d-gerlach, nm, a-govindraju, vigneshr, g-tammana, s-anna, u-boot

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

On Fri, Jul 01, 2022 at 02:30:12PM +0200, Julien Panis wrote:

> Enable ESM driver for AM62x in R5 SPL/u-boot build.
> 
> Signed-off-by: Julien Panis <jpanis@baylibre.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-07-25 21:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 12:30 [PATCH v1 0/3] AM62x ESM support Julien Panis
2022-07-01 12:30 ` [PATCH v1 1/3] arm64: dts: k3-am625-r5: Add support for ESM devices Julien Panis
2022-07-25 21:20   ` Tom Rini
2022-07-01 12:30 ` [PATCH v1 2/3] arm64: mach-k3: am625_init: Probe ESM nodes Julien Panis
2022-07-25 21:20   ` Tom Rini
2022-07-01 12:30 ` [PATCH v1 3/3] configs: am62x_evm_r5: Add support for ESM Julien Panis
2022-07-25 21:20   ` 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.