[PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC

NOTE: this relies on the linked devicetree changes to land in Linux first and get synced here, otherwise the board will fail to boot! I'm leaving this as a RFC/RFT at this time for that reason until things get merged and synced over (if there's a faster way to get that done please let me know, otherwise I'll be patient. Maybe the cherry-picking described over at https://docs.u-boot.org/en/latest/develop/devicetree/control.html#resyncing-... would be appropriate to do *in* this series after that is merged in Linux?).
This enables the ESMs and the associated PMIC. Programming these bits is a requirement to make the watchdog actually reset the board.
I've tested this series (with the linked change) on the k3-j784s4-evm, but not its sibling the k3-am69-sk. I'd appreciate at a minimum someone to test on that platform to ensure this doesn't break boot.
Link: https://lore.kernel.org/lkml/20240911-j784s4-tps6594-bootph-v2-0-a83526264ab... Signed-off-by: Andrew Halaney ahalaney@redhat.com --- 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/20240906-j784s4-esm-enable-v1-0-b83b17d5a744@redha...
--- 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 | 7 +++++++ 4 files changed, 45 insertions(+) --- base-commit: 1630ff26cc960439b5949b80cfc604a2c8aa47dd change-id: 20240906-j784s4-esm-enable-4c4f698fe7c4
Best regards,

From: Neha Malcom Francis n-francis@ti.com
Add the PMIC ESM node which is responsible for triggering the PMIC reset.
Signed-off-by: Neha Malcom Francis n-francis@ti.com Link: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ea82cf77031e Signed-off-by: Andrew Halaney ahalaney@redhat.com --- 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 bef4573d3d2..7714ef87388 100644 --- a/arch/arm/dts/k3-j784s4-r5-evm.dts +++ b/arch/arm/dts/k3-j784s4-r5-evm.dts @@ -104,3 +104,10 @@ &mcu_udmap { ti,sci = <&dm_tifs>; }; + +&tps659413 { + esm: esm { + compatible = "ti,tps659413-esm"; + bootph-pre-ram; + }; +};

Add the PMIC ESM node which is responsible for triggering the PMIC reset.
Suggested-by: Udit Kumar u-kumar1@ti.com Signed-off-by: Andrew Halaney ahalaney@redhat.com --- 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 f177f563527..a7738c0f948 100644 --- a/arch/arm/dts/k3-am69-r5-sk.dts +++ b/arch/arm/dts/k3-am69-r5-sk.dts @@ -104,3 +104,10 @@ &mcu_udmap { ti,sci = <&dm_tifs>; }; + +&tps659413 { + esm: esm { + compatible = "ti,tps659413-esm"; + bootph-pre-ram; + }; +};

From: Keerthy j-keerthy@ti.com
Initialize the ESM & PMIC ESM. This allows things like the watchdog to reset the board when tripped.
Signed-off-by: Keerthy j-keerthy@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com Link: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/board/ti/j784s4/evm.c?h=t... Signed-off-by: Andrew Halaney ahalaney@redhat.com --- 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 548dbd5925d..0f4d383b420 100644 --- a/board/ti/j784s4/evm.c +++ b/board/ti/j784s4/evm.c @@ -7,6 +7,7 @@ * */
+#include <dm.h> #include <efi_loader.h> #include <init.h> #include <spl.h> @@ -72,4 +73,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); + } }

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 ahalaney@redhat.com --- configs/j784s4_evm_r5_defconfig | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/configs/j784s4_evm_r5_defconfig b/configs/j784s4_evm_r5_defconfig index 543b0a50d7a..4d3bc68528c 100644 --- a/configs/j784s4_evm_r5_defconfig +++ b/configs/j784s4_evm_r5_defconfig @@ -97,6 +97,8 @@ CONFIG_DM_MAILBOX=y CONFIG_K3_SEC_PROXY=y CONFIG_FS_LOADER=y CONFIG_SPL_FS_LOADER=y +CONFIG_ESM_K3=y +CONFIG_ESM_PMIC=y CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_SPL_MMC_HS400_SUPPORT=y CONFIG_MMC_SDHCI=y @@ -123,6 +125,11 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y +CONFIG_DM_REGULATOR=y +CONFIG_SPL_DM_REGULATOR=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_REMOTEPROC_TI_K3_ARM64=y CONFIG_RESET_TI_SCI=y

Andrew Thanks,
On 9/11/2024 11:09 PM, Andrew Halaney wrote:
NOTE: this relies on the linked devicetree changes to land in Linux first and get synced here, otherwise the board will fail to boot! I'm leaving this as a RFC/RFT at this time for that reason until things get merged and synced over (if there's a faster way to get that done please let me know, otherwise I'll be patient. Maybe the cherry-picking described over at https://docs.u-boot.org/en/latest/develop/devicetree/control.html#resyncing-... would be appropriate to do *in* this series after that is merged in Linux?).
This enables the ESMs and the associated PMIC. Programming these bits is a requirement to make the watchdog actually reset the board.
I've tested this series (with the linked change) on the k3-j784s4-evm, but not its sibling the k3-am69-sk. I'd appreciate at a minimum someone to test on that platform to ensure this doesn't break boot.
Link: https://lore.kernel.org/lkml/20240911-j784s4-tps6594-bootph-v2-0-a83526264ab... Signed-off-by: Andrew Halaney ahalaney@redhat.com
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/20240906-j784s4-esm-enable-v1-0-b83b17d5a744@redha...
LGTM
For AM69, please use
Tested-by: Udit Kumar u-kumar1@ti.com
Test logs (WDT working as expected) after locally applying patch
https://lore.kernel.org/lkml/20240911-j784s4-tps6594-bootph-v2-0-a83526264ab... into u-boot DTS.
https://gist.github.com/uditkumarti/3ec9afac94c081d09515b66b7ae6c0e5
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 | 7 +++++++ 4 files changed, 45 insertions(+)
base-commit: 1630ff26cc960439b5949b80cfc604a2c8aa47dd change-id: 20240906-j784s4-esm-enable-4c4f698fe7c4
Best regards,
participants (2)
-
Andrew Halaney
-
Kumar, Udit