Skip to contentSkip to conversation

J721S2: Enable ESMs and related PMIC

PATCH In review Udit Kumar 2 participants 5 messages Nov 26, 2024 – Dec 13, 2024 Arm (32-bit)

lore
Share & tools
lore

Udit Kumar

author
#0 lore raw

cover J721S2: Enable ESMs and related PMIC

This enables the ESMs and the associated PMIC. Programming these bits is a requirement to make the watchdog actually reset the board.

Logs
WDT reset J721S2
https://gist.github.com/uditkumarti/93cfe863d1f3fe3abb82b1821105f274#file-j721s2-L2708

AM68 boot (this does not support WDT)
https://gist.github.com/uditkumarti/93cfe863d1f3fe3abb82b1821105f274#file-am68

Keerthy (1):
board: ti: j721s2: Initialize the ESM & PMIC ESM

Manorit Chawdhry (2):
arch: arm: dts: k3-j721s2-r5-common-proc-board: Add esm node
configs: j721s2_evm_r5_defconfig: Add ESM configs

 .../dts/k3-j721s2-r5-common-proc-board.dts    |  4 ++++
 board/ti/j721s2/evm.c                         | 23 +++++++++++++++++++
 configs/am68_sk_r5_defconfig                  |  2 ++
 configs/j721s2_evm_r5_defconfig               |  2 ++
 4 files changed, 31 insertions(+)
Signature · 1 line
2.34.1
author
#1 lore raw

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

From: Keerthy <[email protected]>

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

---
 board/ti/j721s2/evm.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
board/ti/j721s2/evm.c +23 -0
index 2cfeb3bec6c..9bcf67b7bfb 100644
@@ -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@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);
+	}
 }
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/3 arch: arm: dts: k3-j721s2-r5-common-proc-board: Add esm node

In reply to Udit Kumar

From: Manorit Chawdhry <[email protected]>

Add esm node for j721s2.

---
 arch/arm/dts/k3-j721s2-r5-common-proc-board.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/k3-j721s2-r5-common-proc-board.dts +4 -0
index 506ad9b7910..09afdf3954a 100644
@@ -13,6 +13,10 @@
 
 &tps659411 {
 	bootph-pre-ram;
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		bootph-pre-ram;
+	};
 };
 
 &wkup_vtm0 {
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 3/3 configs: j721s2_evm_r5_defconfig: Add ESM configs

In reply to Udit Kumar

From: Manorit Chawdhry <[email protected]>

Enables ESM configs for j721s2 and disables them for AM68 as AM68 includes J721s2 configs by default.

---
 configs/am68_sk_r5_defconfig    | 2 ++
 configs/j721s2_evm_r5_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/am68_sk_r5_defconfig +2 -0
index f4800ef1b8a..5e5f7bf7ceb 100644
@@ -5,7 +5,9 @@ CONFIG_ARCH_K3=y
 CONFIG_SOC_K3_J721S2=y
 CONFIG_TARGET_J721S2_R5_EVM=y
 
+CONFIG_ESM_K3=n
 CONFIG_K3_AVS0=n
+CONFIG_ESM_PMIC=n
 CONFIG_DM_REGULATOR_TPS65941=n
 CONFIG_PMIC_TPS65941=n
 
configs/j721s2_evm_r5_defconfig +2 -0
index f4441d6667e..23ae991e2f6 100644
@@ -111,7 +111,9 @@ CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
 CONFIG_FS_LOADER=y
 CONFIG_SPL_FS_LOADER=y
+CONFIG_ESM_K3=y
 CONFIG_K3_AVS0=y
+CONFIG_ESM_PMIC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SPL_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
Signature · 1 line
2.34.1