diff options
author | Keerthy <j-keerthy@ti.com> | 2025-04-27 12:33:22 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-05-02 14:24:13 -0600 |
commit | 61c6d134868a7c888a90c9d5612fd18c0274b01e (patch) | |
tree | 03a74fb9a5ada4ba0a248387fb8c650d651db814 | |
parent | 29e1d5f93826251a61a9b5640727d5b4d3e7fd9c (diff) |
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 <j-keerthy@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
-rw-r--r-- | board/ti/j784s4/evm.c | 24 |
1 files changed, 24 insertions, 0 deletions
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 <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); + } } |