From b011053450f8f196c78717956cc0dd25e388f9cf Mon Sep 17 00:00:00 2001 From: Neha Malcom Francis Date: Sun, 27 Apr 2025 12:33:20 +0530 Subject: [PATCH 1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node Add the PMIC ESM node which is responsible for triggering the PMIC reset. Signed-off-by: Neha Malcom Francis Signed-off-by: Andrew Halaney --- arch/arm/dts/k3-j784s4-r5-evm.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/dts/k3-j784s4-r5-evm.dts b/arch/arm/dts/k3-j784s4-r5-evm.dts index 0eeffa78740..fc20438261c 100644 --- a/arch/arm/dts/k3-j784s4-r5-evm.dts +++ b/arch/arm/dts/k3-j784s4-r5-evm.dts @@ -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; + }; +}; From 29e1d5f93826251a61a9b5640727d5b4d3e7fd9c Mon Sep 17 00:00:00 2001 From: Andrew Halaney Date: Sun, 27 Apr 2025 12:33:21 +0530 Subject: [PATCH 2/4] arm: dts: k3-am69-r5-evm: Add the PMIC ESM node Add the PMIC ESM node which is responsible for triggering the PMIC reset. Suggested-by: Udit Kumar Signed-off-by: Andrew Halaney --- arch/arm/dts/k3-am69-r5-sk.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/dts/k3-am69-r5-sk.dts b/arch/arm/dts/k3-am69-r5-sk.dts index 9c6e324ba29..e8362647c5d 100644 --- a/arch/arm/dts/k3-am69-r5-sk.dts +++ b/arch/arm/dts/k3-am69-r5-sk.dts @@ -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; + }; +}; From 61c6d134868a7c888a90c9d5612fd18c0274b01e Mon Sep 17 00:00:00 2001 From: Keerthy Date: Sun, 27 Apr 2025 12:33:22 +0530 Subject: [PATCH 3/4] board: ti: j784s4: Initialize the ESM & PMIC ESM Initialize the ESM & PMIC ESM. This allows things like the watchdog to reset the board when tripped. Signed-off-by: Keerthy Signed-off-by: Neha Malcom Francis Signed-off-by: Andrew Halaney --- board/ti/j784s4/evm.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/board/ti/j784s4/evm.c b/board/ti/j784s4/evm.c index c6e46b7ee0e..c8d01bf0ca8 100644 --- a/board/ti/j784s4/evm.c +++ b/board/ti/j784s4/evm.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include @@ -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); + } } From 8de75de3e4529803030e2763d98db3e5aaf6b956 Mon Sep 17 00:00:00 2001 From: Andrew Halaney Date: Sun, 27 Apr 2025 12:33:23 +0530 Subject: [PATCH 4/4] configs: j784s4_evm_r5: Enable ESM related configs 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. Signed-off-by: Andrew Halaney Signed-off-by: Udit Kumar --- configs/j784s4_evm_r5_defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configs/j784s4_evm_r5_defconfig b/configs/j784s4_evm_r5_defconfig index 5a5b0458b9b..8e5b777526b 100644 --- a/configs/j784s4_evm_r5_defconfig +++ b/configs/j784s4_evm_r5_defconfig @@ -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