From: Keerthy Date: Sun, 27 Apr 2025 07:03:22 +0000 (+0530) Subject: board: ti: j784s4: Initialize the ESM & PMIC ESM X-Git-Tag: v2025.07-rc2~37^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61c6d134868a7c888a90c9d5612fd18c0274b01e;p=pandora-u-boot.git 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 --- 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); + } }