Skip to contentSkip to conversation

Add ESM support for J721E and J7200

PATCH In review Neha Malcom Francis 3 participants 13 messages Apr 10, 2023 – Apr 12, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add ESM support for J721E and J7200

Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.

Gowtham Tammana (6):
arm: dts: k3-j7200: Add Main domain ESM support
arm: dts: k3-j7200-r5-common: Add pmic node for esm
arm: dts: k3-j7200: Add ESM PMIC support for tps659413
j721e_init: initialize ESM support for J7200 SOM
power: pmic: tps65491: Dont fail on master node
configs: j7200_evm_r5_defconfig: Enable ESM modules

Tero Kristo (2):
arm: mach-k3: j721e_init: initialize ESM support
arm: dts: k3-k721e: Add Main domain ESM support

 .../k3-j7200-common-proc-board-u-boot.dtsi    |  4 +++
 arch/arm/dts/k3-j7200-main.dtsi               |  6 +++++
 .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++
 .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++---
 arch/arm/dts/k3-j7200.dtsi                    |  1 +
 arch/arm/dts/k3-j721e.dtsi                    |  1 +
 arch/arm/mach-k3/j721e_init.c                 | 25 ++++++++++++++++++-
 configs/j7200_evm_r5_defconfig                |  2 ++
 drivers/power/pmic/tps65941.c                 |  1 -
 9 files changed, 59 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/8 arm: mach-k3: j721e_init: initialize ESM support

From: Tero Kristo <[email protected]>

Initialize both ESM and ESM_PMIC support if available for the board. If support is not available for either, a warning is printed out.

---
 arch/arm/mach-k3/j721e_init.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
arch/arm/mach-k3/j721e_init.c +22 -1
index 9cae3ac67e..b22530f39d 100644
@@ -23,6 +23,7 @@
 #include <fdtdec.h>
 #include <mmc.h>
 #include <remoteproc.h>
+#include "../../../board/ti/common/board_detect.h"
 
 #ifdef CONFIG_K3_LOAD_SYSFW
 struct fwl_data cbass_hc_cfg0_fwls[] = {
@@ -189,7 +190,8 @@ void do_dt_magic(void)
 
 void board_init_f(ulong dummy)
 {
-#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW)
+#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW) || \
+	defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC)
 	struct udevice *dev;
 	int ret;
 #endif
@@ -277,6 +279,25 @@ void board_init_f(ulong dummy)
 		printf("AVS init failed: %d\n", ret);
 #endif
 
+#ifdef CONFIG_ESM_K3
+	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+		ret = uclass_get_device_by_driver(UCLASS_MISC,
+						  DM_DRIVER_GET(k3_esm), &dev);
+		if (ret)
+			printf("MISC init failed: %d\n", ret);
+	}
+#endif
+
+#ifdef CONFIG_ESM_PMIC
+	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+		ret = uclass_get_device_by_driver(UCLASS_MISC,
+						  DM_DRIVER_GET(pmic_esm),
+						  &dev);
+		if (ret)
+			printf("ESM PMIC init failed: %d\n", ret);
+	}
+#endif
+
 #if defined(CONFIG_K3_J721E_DDRSS)
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret)
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/8 arm: dts: k3-k721e: Add Main domain ESM support

In reply to Neha Malcom Francis

From: Tero Kristo <[email protected]>

Main domain ESM support is needed to configure main domain watchdogs to generate ESM pin events by default. On J7 processor board these propagate to the PMIC to generate a reset when watchdog expires.

---
 arch/arm/dts/k3-j721e.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/k3-j721e.dtsi +1 -0
index f0587fde14..d7f73f61db 100644
@@ -126,6 +126,7 @@
 		#size-cells = <2>;
 		ranges = <0x00 0x00100000 0x00 0x00100000 0x00 0x00020000>, /* ctrl mmr */
 			 <0x00 0x00600000 0x00 0x00600000 0x00 0x00031100>, /* GPIO */
+			 <0x00 0x00700000 0x00 0x00700000 0x00 0x00001000>, /* ESM */
 			 <0x00 0x00900000 0x00 0x00900000 0x00 0x00012000>, /* serdes */
 			 <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */
 			 <0x00 0x06000000 0x00 0x06000000 0x00 0x00400000>, /* USBSS0 */
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/8 arm: dts: k3-j7200: Add Main domain ESM support

In reply to Neha Malcom Francis

From: Gowtham Tammana <[email protected]>

Main domain ESM support is needed to configure main domain watchdog interrupts to generate ESM pin events. On J7200 boards ESM error pin output is propagated to PMIC to generate reset.

---
 arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi | 4 ++++
 arch/arm/dts/k3-j7200-main.dtsi                     | 6 ++++++
 arch/arm/dts/k3-j7200.dtsi                          | 1 +
 3 files changed, 11 insertions(+)
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +4 -0
index f57c2306ba..088fdb4072 100644
@@ -196,3 +196,7 @@
 &main_r5fss0 {
 	ti,cluster-mode = <0>;
 };
+
+&main_esm {
+	bootph-pre-ram;
+};
arch/arm/dts/k3-j7200-main.dtsi +6 -0
index e8a41d09b4..4c8ba123dc 100644
@@ -774,4 +774,10 @@
 			ti,loczrama = <1>;
 		};
 	};
+
+	main_esm: esm@700000 {
+		compatible = "ti,j721e-esm";
+		reg = <0x0 0x700000 0x0 0x1000>;
+		ti,esm-pins = <656>, <657>;
+	};
 };
arch/arm/dts/k3-j7200.dtsi +1 -0
index b7005b8031..9252d97399 100644
@@ -124,6 +124,7 @@
 		#size-cells = <2>;
 		ranges = <0x00 0x00100000 0x00 0x00100000 0x00 0x00020000>, /* ctrl mmr */
 			 <0x00 0x00600000 0x00 0x00600000 0x00 0x00031100>, /* GPIO */
+			 <0x00 0x00700000 0x00 0x00700000 0x00 0x00001000>, /* ESM */
 			 <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */
 			 <0x00 0x01000000 0x00 0x01000000 0x00 0x0d000000>, /* Most peripherals */
 			 <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>, /* MAIN NAVSS */
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/8 arm: dts: k3-j7200-r5-common: Add pmic node for esm

In reply to Neha Malcom Francis

From: Gowtham Tammana <[email protected]>

Add pmic tps659413 node needed for ESM error event handling.

---
 arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +10 -3
index 55ad6153dd..01e3a507d4 100644
@@ -248,13 +248,20 @@
 
 &wkup_i2c0 {
 	bootph-pre-ram;
+	pinctrl-names = "default";
+	pinctrl-0 = <&wkup_i2c0_pins_default>;
+	clock-frequency = <400000>;
+
+	tps659413: tps659413@48 {
+		compatible = "ti,tps659413";
+		reg = <0x48>;
+		bootph-pre-ram;
+	};
+
 	lp876441: lp876441@4c {
 		compatible = "ti,lp876441";
 		reg = <0x4c>;
 		bootph-pre-ram;
-		pinctrl-names = "default";
-		pinctrl-0 = <&wkup_i2c0_pins_default>;
-		clock-frequency = <400000>;
 
 		regulators: regulators {
 			bootph-pre-ram;
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/8 arm: dts: k3-j7200: Add ESM PMIC support for tps659413

In reply to Neha Malcom Francis

From: Gowtham Tammana <[email protected]>

On J7200 processor board MCU_SAFETY_ERROR signal is routed to PMIC for ESM error handling. The PMIC resets the board on receipt of the signal. Enable the support for the board by adding ESM PMIC node.

---
 .../arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi new file +11 -0
new file mode 100644
index 0000000000..9cd4dd09ca
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/
+ */
+
+&tps659413 {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		bootph-pre-ram;
+	};
+};
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/8 j721e_init: initialize ESM support for J7200 SOM

In reply to Neha Malcom Francis

From: Gowtham Tammana <[email protected]>

ESM and ESM PMIC support is available for J7200X-PM2-SOM board, as such enable support for it.

---
 arch/arm/mach-k3/j721e_init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-k3/j721e_init.c +4 -2
index b22530f39d..294aeb2f88 100644
@@ -280,7 +280,8 @@ void board_init_f(ulong dummy)
 #endif
 
 #ifdef CONFIG_ESM_K3
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (board_ti_k3_is("J721EX-PM2-SOM") ||
+	    board_ti_k3_is("J7200X-PM2-SOM")) {
 		ret = uclass_get_device_by_driver(UCLASS_MISC,
 						  DM_DRIVER_GET(k3_esm), &dev);
 		if (ret)
@@ -289,7 +290,8 @@ void board_init_f(ulong dummy)
 #endif
 
 #ifdef CONFIG_ESM_PMIC
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (board_ti_k3_is("J721EX-PM2-SOM") ||
+	    board_ti_k3_is("J7200X-PM2-SOM")) {
 		ret = uclass_get_device_by_driver(UCLASS_MISC,
 						  DM_DRIVER_GET(pmic_esm),
 						  &dev);
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/8 power: pmic: tps65491: Dont fail on master node

In reply to Neha Malcom Francis

From: Gowtham Tammana <[email protected]>

TPS65941 can have child only ESM nodes with no regulators, so dont fail on regulator probe failure.

---
 drivers/power/pmic/tps65941.c | 1 -
 1 file changed, 1 deletion(-)
drivers/power/pmic/tps65941.c +0 -1
index 83d0f83c64..06a3c1406c 100644
@@ -51,7 +51,6 @@ static int tps65941_bind(struct udevice *dev)
 	if (!ofnode_valid(regulators_node)) {
 		debug("%s: %s regulators subnode not found!\n", __func__,
 		      dev->name);
-		return -ENXIO;
 	}
 
 	debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
Signature · 1 line
2.34.1
#8 lore raw

PATCH 8/8 configs: j7200_evm_r5_defconfig: Enable ESM modules

In reply to Neha Malcom Francis

From: Gowtham Tammana <[email protected]>

Enable ESM modules for both PMIC and SoC for watchdog error intterupt handling on the board.

---
 configs/j7200_evm_r5_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/j7200_evm_r5_defconfig +2 -0
index 00ec48b83b..7b3b4766f0 100644
@@ -168,3 +168,5 @@ CONFIG_FS_EXT4=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LIB_RATIONAL=y
 CONFIG_SPL_LIB_RATIONAL=y
+CONFIG_ESM_K3=y
+CONFIG_ESM_PMIC=y
Signature · 1 line
2.34.1
#9 lore raw
In reply to Neha Malcom Francis

Hi Neha!

On April 10, 2023 thus sayeth Neha Malcom Francis:

Quoted 17 lines

Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.

Gowtham Tammana (6):
arm: dts: k3-j7200: Add Main domain ESM support
arm: dts: k3-j7200-r5-common: Add pmic node for esm
arm: dts: k3-j7200: Add ESM PMIC support for tps659413
j721e_init: initialize ESM support for J7200 SOM
power: pmic: tps65491: Dont fail on master node
configs: j7200_evm_r5_defconfig: Enable ESM modules

Tero Kristo (2):
arm: mach-k3: j721e_init: initialize ESM support
arm: dts: k3-k721e: Add Main domain ESM support

Quoted 12 lines
 .../k3-j7200-common-proc-board-u-boot.dtsi    |  4 +++
 arch/arm/dts/k3-j7200-main.dtsi               |  6 +++++
 .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++
 .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++---
 arch/arm/dts/k3-j7200.dtsi                    |  1 +
 arch/arm/dts/k3-j721e.dtsi                    |  1 +
 arch/arm/mach-k3/j721e_init.c                 | 25 ++++++++++++++++++-
 configs/j7200_evm_r5_defconfig                |  2 ++
 drivers/power/pmic/tps65941.c                 |  1 -
 9 files changed, 59 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi

I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly

Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.

Though I guess we can treat the dt updates as a DONOTMERGE

~Bryan

#10 lore raw

Hi Bryan

Quoted 36 lines · Bryan Brattlof

Hi Neha!

On April 10, 2023 thus sayeth Neha Malcom Francis:

Quoted 27 lines

Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.

Gowtham Tammana (6):
arm: dts: k3-j7200: Add Main domain ESM support
arm: dts: k3-j7200-r5-common: Add pmic node for esm
arm: dts: k3-j7200: Add ESM PMIC support for tps659413
j721e_init: initialize ESM support for J7200 SOM
power: pmic: tps65491: Dont fail on master node
configs: j7200_evm_r5_defconfig: Enable ESM modules

Tero Kristo (2):
arm: mach-k3: j721e_init: initialize ESM support
arm: dts: k3-k721e: Add Main domain ESM support

  .../k3-j7200-common-proc-board-u-boot.dtsi    |  4 +++
  arch/arm/dts/k3-j7200-main.dtsi               |  6 +++++
  .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++
  .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++---
  arch/arm/dts/k3-j7200.dtsi                    |  1 +
  arch/arm/dts/k3-j721e.dtsi                    |  1 +
  arch/arm/mach-k3/j721e_init.c                 | 25 ++++++++++++++++++-
  configs/j7200_evm_r5_defconfig                |  2 ++
  drivers/power/pmic/tps65941.c                 |  1 -
  9 files changed, 59 insertions(+), 5 deletions(-)
Quoted 2 lines

create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi

I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly

Quoted 6 lines

Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.

Though I guess we can treat the dt updates as a DONOTMERGE

Thanks for summarising! However I'm inclined to send a v2 of this patch series here without using board and SoC dts and using only -u-boot.dtsi since I do not think ESM support will be needed in the kernel at any point. What do you think?

Quoted 2 lines

~Bryan

Signature · 2 lines
Thanking You
Neha Malcom Francis
#11 lore raw
Quoted 44 lines · Neha Malcom Francis

Hi Bryan

Quoted 41 lines · Bryan Brattlof

Hi Neha!

On April 10, 2023 thus sayeth Neha Malcom Francis:

Quoted 26 lines

Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.

Gowtham Tammana (6):
   arm: dts: k3-j7200: Add Main domain ESM support
   arm: dts: k3-j7200-r5-common: Add pmic node for esm
   arm: dts: k3-j7200: Add ESM PMIC support for tps659413
   j721e_init: initialize ESM support for J7200 SOM
   power: pmic: tps65491: Dont fail on master node
   configs: j7200_evm_r5_defconfig: Enable ESM modules

Tero Kristo (2):
   arm: mach-k3: j721e_init: initialize ESM support
   arm: dts: k3-k721e: Add Main domain ESM support

  .../k3-j7200-common-proc-board-u-boot.dtsi    |  4 +++ arch/arm/dts/k3-j7200-main.dtsi               |  6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi                    |  1 + arch/arm/dts/k3-j721e.dtsi                    |  1 + arch/arm/mach-k3/j721e_init.c                 | 25 ++++++++++++++++++- configs/j7200_evm_r5_defconfig                |  2 ++ drivers/power/pmic/tps65941.c                 |  1 -

Quoted 3 lines
  9 files changed, 59 insertions(+), 5 deletions(-)

  create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi

I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly

Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.

Quoted 5 lines
Quoted 1 line

Though I guess we can treat the dt updates as a DONOTMERGE

Thanks for summarising! However I'm inclined to send a v2 of this patch series here without using board and SoC dts and using only -u-boot.dtsi since I do not think ESM support will be needed in the kernel at any point. What do you think?

DT isn't concerned with who uses a node or not, it should be a universal description of the hardware as it actually is. I know that isn't always the case today (GPU nodes *grumble*), but it is still a goal. So if the ESM hardware exists in the chip, it should be described in the DT file. If Linux/U-Boot/OPTEE/Zephyr/etc actually use the node for anything is up to that piece of software.

Andrew

Quoted 3 lines
Quoted 2 lines

~Bryan

#12 lore raw

Hi Andrew,

Quoted 54 lines · Andrew Davis
Quoted 45 lines · Neha Malcom Francis

Hi Bryan

Quoted 42 lines · Bryan Brattlof

Hi Neha!

On April 10, 2023 thus sayeth Neha Malcom Francis:

Quoted 27 lines

Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.

Gowtham Tammana (6):
   arm: dts: k3-j7200: Add Main domain ESM support
   arm: dts: k3-j7200-r5-common: Add pmic node for esm
   arm: dts: k3-j7200: Add ESM PMIC support for tps659413
   j721e_init: initialize ESM support for J7200 SOM
   power: pmic: tps65491: Dont fail on master node
   configs: j7200_evm_r5_defconfig: Enable ESM modules

Tero Kristo (2):
   arm: mach-k3: j721e_init: initialize ESM support
   arm: dts: k3-k721e: Add Main domain ESM support

  .../k3-j7200-common-proc-board-u-boot.dtsi    |  4 +++ arch/arm/dts/k3-j7200-main.dtsi               |  6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi                    |  1 + arch/arm/dts/k3-j721e.dtsi                    |  1 + arch/arm/mach-k3/j721e_init.c                 | 25
++++++++++++++++++-
  configs/j7200_evm_r5_defconfig                |  2 ++ drivers/power/pmic/tps65941.c                 |  1 -

Quoted 3 lines
  9 files changed, 59 insertions(+), 5 deletions(-)

  create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi

I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly

Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.

Quoted 7 lines
Quoted 1 line

Though I guess we can treat the dt updates as a DONOTMERGE

Thanks for summarising! However I'm inclined to send a v2 of this patch series here without using board and SoC dts and using only -u-boot.dtsi since I do not think ESM support will be needed in the
kernel at any point. What do you think?

Quoted 6 lines

DT isn't concerned with who uses a node or not, it should be a universal description of the hardware as it actually is. I know that isn't always the case today (GPU nodes *grumble*), but it is still a goal. So if the ESM hardware exists in the chip, it should be described in the DT file. If Linux/U-Boot/OPTEE/Zephyr/etc actually use the node for anything is up to that piece of software.

Got it, thanks for explaining; I'll try getting this into kernel first.

Quoted 5 lines

Andrew

Quoted 3 lines
Quoted 2 lines

~Bryan

Signature · 2 lines
Thanking You
Neha Malcom Francis