Skip to contentSkip to conversation

k3-j784s4*: Enable ESMs and related PMIC

PATCH In review Udit Kumar 2 participants 6 messages Apr 27, 2025 – May 3, 2025 Arm (32-bit)

lore
Share & tools
lore

Udit Kumar

author
#0 lore raw

v3 cover k3-j784s4*: Enable ESMs and related PMIC

This series enables the ESMs and the associated PMIC. Programming these bits is a requirement to make the watchdog actually reset the board.

Series supports WDT reset on all TI platforms based upon J784S4 SOC including cut down (J742S2).

Bootlogs for reset

AM69: https://gist.github.com/uditkumarti/dca2171aafd6d50c82159346f9a0102f#file-am69-L2466

J784S4: https://gist.github.com/uditkumarti/dca2171aafd6d50c82159346f9a0102f#file-j784s4-L2704

J742S2: https://gist.github.com/uditkumarti/dca2171aafd6d50c82159346f9a0102f#file-j742s2-L2614

Changes in v3:
- Rebased to 2025.04
- Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Loop over ESMs, only configure if prior was successful
as without all of them they're not useful (Udit)
- Add am69-sk PMIC ESM node (Udit)
- Link to v1: https://lore.kernel.org/r/[email protected]

Andrew Halaney (2):
arm: dts: k3-am69-r5-evm: Add the PMIC ESM node
configs: j784s4_evm_r5: Enable ESM related configs

Keerthy (1):
board: ti: j784s4: Initialize the ESM & PMIC ESM

Neha Malcom Francis (1):
arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node

 arch/arm/dts/k3-am69-r5-sk.dts    |  7 +++++++
 arch/arm/dts/k3-j784s4-r5-evm.dts |  7 +++++++
 board/ti/j784s4/evm.c             | 24 ++++++++++++++++++++++++
 configs/j784s4_evm_r5_defconfig   |  5 +++++
 4 files changed, 43 insertions(+)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v3 1/4 arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node

From: Neha Malcom Francis <[email protected]>

Add the PMIC ESM node which is responsible for triggering the PMIC reset.

---
 arch/arm/dts/k3-j784s4-r5-evm.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/k3-j784s4-r5-evm.dts +7 -0
index 0eeffa78740..fc20438261c 100644
@@ -10,3 +10,10 @@
 #include "k3-j784s4-ddr.dtsi"
 #include "k3-j784s4-evm-u-boot.dtsi"
 #include "k3-j784s4-r5.dtsi"
+
+&tps659413 {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		bootph-pre-ram;
+	};
+};
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v3 2/4 arm: dts: k3-am69-r5-evm: Add the PMIC ESM node

In reply to Udit Kumar

From: Andrew Halaney <[email protected]>

Add the PMIC ESM node which is responsible for triggering the PMIC reset.

---
 arch/arm/dts/k3-am69-r5-sk.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/k3-am69-r5-sk.dts +7 -0
index 9c6e324ba29..e8362647c5d 100644
@@ -10,3 +10,10 @@
 #include "k3-j784s4-ddr.dtsi"
 #include "k3-am69-sk-u-boot.dtsi"
 #include "k3-j784s4-r5.dtsi"
+
+&tps659413 {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		bootph-pre-ram;
+	};
+};
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v3 3/4 board: ti: j784s4: Initialize the ESM & PMIC ESM

In reply to Udit Kumar

From: Keerthy <[email protected]>

Initialize the ESM & PMIC ESM. This allows things like the watchdog to reset the board when tripped.

---
 board/ti/j784s4/evm.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
board/ti/j784s4/evm.c +24 -0
index c6e46b7ee0e..c8d01bf0ca8 100644
@@ -7,6 +7,7 @@
  *
  */
 
+#include <dm.h>
 #include <efi_loader.h>
 #include <init.h>
 #include <spl.h>
@@ -67,4 +68,27 @@ int board_late_init(void)
 
 void spl_board_init(void)
 {
+	struct udevice *dev;
+	int ret;
+
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
+		const char * const esms[] = {"esm@700000", "esm@40800000", "esm@42080000"};
+
+		for (int i = 0; i < ARRAY_SIZE(esms); ++i) {
+			ret = uclass_get_device_by_name(UCLASS_MISC, esms[i],
+							&dev);
+			if (ret) {
+				printf("MISC init for %s failed: %d\n", esms[i], ret);
+				break;
+			}
+		}
+	}
+
+	if (IS_ENABLED(CONFIG_ESM_PMIC) && ret == 0) {
+		ret = uclass_get_device_by_driver(UCLASS_MISC,
+						  DM_DRIVER_GET(pmic_esm),
+						  &dev);
+		if (ret)
+			printf("ESM PMIC init failed: %d\n", ret);
+	}
 }
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH v3 4/4 configs: j784s4_evm_r5: Enable ESM related configs

In reply to Udit Kumar

From: Andrew Halaney <[email protected]>

Like other TI platforms, let's enable the ESM. This allows the ESM to be programmed during boot, and the PMIC associated with the ESM output, enabling blocks like the RTI watchdogs to actually cause the system to reset.

---
 configs/j784s4_evm_r5_defconfig | 5 +++++
 1 file changed, 5 insertions(+)
configs/j784s4_evm_r5_defconfig +5 -0
index 5a5b0458b9b..8e5b777526b 100644
@@ -125,6 +125,11 @@ CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_TI_POWER_DOMAIN=y
+CONFIG_ESM_K3=y
+CONFIG_ESM_PMIC=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_TPS65941=y
+CONFIG_DM_REGULATOR_TPS65941=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPL_DM_REGULATOR=y
 CONFIG_SPL_DM_REGULATOR_TPS6287X=y
Signature · 1 line
2.34.1
#5 lore raw
In reply to Udit Kumar
Quoted 8 lines · Udit Kumar

This series enables the ESMs and the associated PMIC. Programming these bits is a requirement to make the watchdog actually reset the board.

Series supports WDT reset on all TI platforms based upon J784S4 SOC including cut down (J742S2).

[...]

Applied to u-boot/master, thanks!

[1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node

      commit: b011053450f8f196c78717956cc0dd25e388f9cf
[2/4] arm: dts: k3-am69-r5-evm: Add the PMIC ESM node
      commit: 29e1d5f93826251a61a9b5640727d5b4d3e7fd9c
[3/4] board: ti: j784s4: Initialize the ESM & PMIC ESM
      commit: 61c6d134868a7c888a90c9d5612fd18c0274b01e
[4/4] configs: j784s4_evm_r5: Enable ESM related configs
      commit: 8de75de3e4529803030e2763d98db3e5aaf6b956
Signature · 1 line
Tom