[PATCH 1/3] board: ti: j721s2: Initialize the ESM & PMIC ESM

Udit Kumar u-kumar1 at ti.com
Tue Nov 26 06:34:24 CET 2024


From: Keerthy <j-keerthy at ti.com>

Initialize the 3 instances of SOC ESM & PMIC ESM.
This is needed for watchdog functionality.

Signed-off-by: Keerthy <j-keerthy at ti.com>
Signed-off-by: Udit Kumar <u-kumar1 at ti.com>
---
 board/ti/j721s2/evm.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c
index 2cfeb3bec6c..9bcf67b7bfb 100644
--- a/board/ti/j721s2/evm.c
+++ b/board/ti/j721s2/evm.c
@@ -326,4 +326,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 at 700000", "esm at 40800000", "esm at 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);
+	}
 }
-- 
2.34.1



More information about the U-Boot mailing list