diff mbox series

[RFC,06/10] board: ti: j721s2: Initialize the ESM & PMIC ESM

Message ID 20231003081038.24299-7-j-keerthy@ti.com
State RFC
Delegated to: Tom Rini
Headers show
Series arm: dts: j7200/j721s2: Enable the ESM and PMIC ESM | expand

Commit Message

J, KEERTHY Oct. 3, 2023, 8:10 a.m. UTC
Initialize the ESM & PMIC ESM

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 board/ti/j721s2/evm.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
diff mbox series

Patch

diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c
index 7795300abc..effa52ff5a 100644
--- a/board/ti/j721s2/evm.c
+++ b/board/ti/j721s2/evm.c
@@ -319,4 +319,31 @@  int board_late_init(void)
 
 void spl_board_init(void)
 {
+	struct udevice *dev;
+	int ret;
+
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
+		ret = uclass_get_device_by_name(UCLASS_MISC, "esm@700000",
+						&dev);
+		if (ret)
+			printf("MISC init for esm@700000 failed: %d\n", ret);
+
+		ret = uclass_get_device_by_name(UCLASS_MISC, "esm@40800000",
+						&dev);
+		if (ret)
+			printf("MISC init for esm@40800000 failed: %d\n", ret);
+
+		ret = uclass_get_device_by_name(UCLASS_MISC, "esm@42080000",
+						&dev);
+		if (ret)
+			printf("MISC init for esm@42080000 failed: %d\n", ret);
+	}
+
+	if (IS_ENABLED(CONFIG_ESM_PMIC)) {
+		ret = uclass_get_device_by_driver(UCLASS_MISC,
+						  DM_DRIVER_GET(pmic_esm),
+						  &dev);
+		if (ret)
+			printf("ESM PMIC init failed: %d\n", ret);
+	}
 }