public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC
@ 2024-09-11 17:39 Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node Andrew Halaney
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andrew Halaney @ 2024-09-11 17:39 UTC (permalink / raw)
  To: Apurva Nandan, Tom Rini
  Cc: Keerthy, Neha Malcom Francis, Eric Chanudet, Enric Balletbo,
	Udit Kumar, j-humphreys, Nishanth Menon, u-boot, Andrew Halaney

NOTE: this relies on the linked devicetree changes to land in Linux
first and get synced here, otherwise the board will fail to boot!
I'm leaving this as a RFC/RFT at this time for that reason until
things get merged and synced over (if there's a faster way to get that
done please let me know, otherwise I'll be patient. Maybe the
cherry-picking described over at
https://docs.u-boot.org/en/latest/develop/devicetree/control.html#resyncing-with-devicetree-rebasing
would be appropriate to do *in* this series after that is merged in
Linux?).

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

I've tested this series (with the linked change) on the k3-j784s4-evm,
but not its sibling the k3-am69-sk. I'd appreciate at a minimum someone
to test on that platform to ensure this doesn't break boot.

Link: https://lore.kernel.org/lkml/20240911-j784s4-tps6594-bootph-v2-0-a83526264ab1@redhat.com/
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
Changes in v2:
- Loop over ESMs, only configure if prior was successful
  as without all of them they're not useful (Udit)
- Add am69-sk PMIC ESM node (Udit)
- Link to v1: https://lore.kernel.org/r/20240906-j784s4-esm-enable-v1-0-b83b17d5a744@redhat.com

---
Andrew Halaney (2):
      arm: dts: k3-am69-r5-evm: Add the PMIC ESM node
      configs: j784s4_evm_r5: Enable ESM related configs

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

Neha Malcom Francis (1):
      arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node

 arch/arm/dts/k3-am69-r5-sk.dts    |  7 +++++++
 arch/arm/dts/k3-j784s4-r5-evm.dts |  7 +++++++
 board/ti/j784s4/evm.c             | 24 ++++++++++++++++++++++++
 configs/j784s4_evm_r5_defconfig   |  7 +++++++
 4 files changed, 45 insertions(+)
---
base-commit: 1630ff26cc960439b5949b80cfc604a2c8aa47dd
change-id: 20240906-j784s4-esm-enable-4c4f698fe7c4

Best regards,
-- 
Andrew Halaney <ahalaney@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH RFC/RFT v2 1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node
  2024-09-11 17:39 [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Andrew Halaney
@ 2024-09-11 17:39 ` Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 2/4] arm: dts: k3-am69-r5-evm: " Andrew Halaney
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Halaney @ 2024-09-11 17:39 UTC (permalink / raw)
  To: Apurva Nandan, Tom Rini
  Cc: Keerthy, Neha Malcom Francis, Eric Chanudet, Enric Balletbo,
	Udit Kumar, j-humphreys, Nishanth Menon, u-boot, Andrew Halaney

From: Neha Malcom Francis <n-francis@ti.com>

Add the PMIC ESM node which is responsible for triggering the PMIC
reset.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Link: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ea82cf77031e
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
 arch/arm/dts/k3-j784s4-r5-evm.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/dts/k3-j784s4-r5-evm.dts b/arch/arm/dts/k3-j784s4-r5-evm.dts
index bef4573d3d2..7714ef87388 100644
--- a/arch/arm/dts/k3-j784s4-r5-evm.dts
+++ b/arch/arm/dts/k3-j784s4-r5-evm.dts
@@ -104,3 +104,10 @@
 &mcu_udmap {
 	ti,sci = <&dm_tifs>;
 };
+
+&tps659413 {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		bootph-pre-ram;
+	};
+};

-- 
2.46.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RFC/RFT v2 2/4] arm: dts: k3-am69-r5-evm: Add the PMIC ESM node
  2024-09-11 17:39 [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node Andrew Halaney
@ 2024-09-11 17:39 ` Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 3/4] board: ti: j784s4: Initialize the ESM & PMIC ESM Andrew Halaney
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Halaney @ 2024-09-11 17:39 UTC (permalink / raw)
  To: Apurva Nandan, Tom Rini
  Cc: Keerthy, Neha Malcom Francis, Eric Chanudet, Enric Balletbo,
	Udit Kumar, j-humphreys, Nishanth Menon, u-boot, Andrew Halaney

Add the PMIC ESM node which is responsible for triggering the PMIC
reset.

Suggested-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
 arch/arm/dts/k3-am69-r5-sk.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/dts/k3-am69-r5-sk.dts b/arch/arm/dts/k3-am69-r5-sk.dts
index f177f563527..a7738c0f948 100644
--- a/arch/arm/dts/k3-am69-r5-sk.dts
+++ b/arch/arm/dts/k3-am69-r5-sk.dts
@@ -104,3 +104,10 @@
 &mcu_udmap {
 	ti,sci = <&dm_tifs>;
 };
+
+&tps659413 {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		bootph-pre-ram;
+	};
+};

-- 
2.46.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RFC/RFT v2 3/4] board: ti: j784s4: Initialize the ESM & PMIC ESM
  2024-09-11 17:39 [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 2/4] arm: dts: k3-am69-r5-evm: " Andrew Halaney
@ 2024-09-11 17:39 ` Andrew Halaney
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 4/4] configs: j784s4_evm_r5: Enable ESM related configs Andrew Halaney
  2024-09-12  7:58 ` [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Kumar, Udit
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Halaney @ 2024-09-11 17:39 UTC (permalink / raw)
  To: Apurva Nandan, Tom Rini
  Cc: Keerthy, Neha Malcom Francis, Eric Chanudet, Enric Balletbo,
	Udit Kumar, j-humphreys, Nishanth Menon, u-boot, Andrew Halaney

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

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>
Link: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/board/ti/j784s4/evm.c?h=ti-u-boot-2024.04&id=9d8b40958ce792808bc571d828197dbc2e7978d6
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
 board/ti/j784s4/evm.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/board/ti/j784s4/evm.c b/board/ti/j784s4/evm.c
index 548dbd5925d..0f4d383b420 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>
@@ -72,4 +73,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);
+	}
 }

-- 
2.46.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RFC/RFT v2 4/4] configs: j784s4_evm_r5: Enable ESM related configs
  2024-09-11 17:39 [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Andrew Halaney
                   ` (2 preceding siblings ...)
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 3/4] board: ti: j784s4: Initialize the ESM & PMIC ESM Andrew Halaney
@ 2024-09-11 17:39 ` Andrew Halaney
  2024-09-12  7:58 ` [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Kumar, Udit
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Halaney @ 2024-09-11 17:39 UTC (permalink / raw)
  To: Apurva Nandan, Tom Rini
  Cc: Keerthy, Neha Malcom Francis, Eric Chanudet, Enric Balletbo,
	Udit Kumar, j-humphreys, Nishanth Menon, u-boot, Andrew Halaney

Like other TI platforms, let's enable the ESM. This allows the ESM to be
programmed during boot, and the PMIC associated with the ESM output,
enabling blocks like the RTI watchdogs to actually cause the system to
reset.

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
 configs/j784s4_evm_r5_defconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configs/j784s4_evm_r5_defconfig b/configs/j784s4_evm_r5_defconfig
index 543b0a50d7a..4d3bc68528c 100644
--- a/configs/j784s4_evm_r5_defconfig
+++ b/configs/j784s4_evm_r5_defconfig
@@ -97,6 +97,8 @@ CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
 CONFIG_FS_LOADER=y
 CONFIG_SPL_FS_LOADER=y
+CONFIG_ESM_K3=y
+CONFIG_ESM_PMIC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SPL_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
@@ -123,6 +125,11 @@ CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_TI_POWER_DOMAIN=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_TPS65941=y
+CONFIG_DM_REGULATOR=y
+CONFIG_SPL_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_TPS65941=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_RESET_TI_SCI=y

-- 
2.46.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC
  2024-09-11 17:39 [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Andrew Halaney
                   ` (3 preceding siblings ...)
  2024-09-11 17:39 ` [PATCH RFC/RFT v2 4/4] configs: j784s4_evm_r5: Enable ESM related configs Andrew Halaney
@ 2024-09-12  7:58 ` Kumar, Udit
  4 siblings, 0 replies; 6+ messages in thread
From: Kumar, Udit @ 2024-09-12  7:58 UTC (permalink / raw)
  To: Andrew Halaney, Tom Rini
  Cc: Keerthy, Neha Malcom Francis, Eric Chanudet, Enric Balletbo,
	j-humphreys, Nishanth Menon, u-boot, u-kumar1

Andrew Thanks,

On 9/11/2024 11:09 PM, Andrew Halaney wrote:
> NOTE: this relies on the linked devicetree changes to land in Linux
> first and get synced here, otherwise the board will fail to boot!
> I'm leaving this as a RFC/RFT at this time for that reason until
> things get merged and synced over (if there's a faster way to get that
> done please let me know, otherwise I'll be patient. Maybe the
> cherry-picking described over at
> https://docs.u-boot.org/en/latest/develop/devicetree/control.html#resyncing-with-devicetree-rebasing
> would be appropriate to do *in* this series after that is merged in
> Linux?).
>
> This enables the ESMs and the associated PMIC. Programming these bits is
> a requirement to make the watchdog actually reset the board.
>
> I've tested this series (with the linked change) on the k3-j784s4-evm,
> but not its sibling the k3-am69-sk. I'd appreciate at a minimum someone
> to test on that platform to ensure this doesn't break boot.
>
> Link: https://lore.kernel.org/lkml/20240911-j784s4-tps6594-bootph-v2-0-a83526264ab1@redhat.com/
> Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
> ---
> Changes in v2:
> - Loop over ESMs, only configure if prior was successful
>    as without all of them they're not useful (Udit)
> - Add am69-sk PMIC ESM node (Udit)
> - Link to v1: https://lore.kernel.org/r/20240906-j784s4-esm-enable-v1-0-b83b17d5a744@redhat.com

LGTM

For AM69, please use

Tested-by: Udit Kumar <u-kumar1@ti.com>


Test logs (WDT working as expected)  after locally applying patch

https://lore.kernel.org/lkml/20240911-j784s4-tps6594-bootph-v2-0-a83526264ab1@redhat.com/ 
into u-boot DTS.

https://gist.github.com/uditkumarti/3ec9afac94c081d09515b66b7ae6c0e5


> ---
> Andrew Halaney (2):
>        arm: dts: k3-am69-r5-evm: Add the PMIC ESM node
>        configs: j784s4_evm_r5: Enable ESM related configs
>
> Keerthy (1):
>        board: ti: j784s4: Initialize the ESM & PMIC ESM
>
> Neha Malcom Francis (1):
>        arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node
>
>   arch/arm/dts/k3-am69-r5-sk.dts    |  7 +++++++
>   arch/arm/dts/k3-j784s4-r5-evm.dts |  7 +++++++
>   board/ti/j784s4/evm.c             | 24 ++++++++++++++++++++++++
>   configs/j784s4_evm_r5_defconfig   |  7 +++++++
>   4 files changed, 45 insertions(+)
> ---
> base-commit: 1630ff26cc960439b5949b80cfc604a2c8aa47dd
> change-id: 20240906-j784s4-esm-enable-4c4f698fe7c4
>
> Best regards,

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-12  7:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 17:39 [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Andrew Halaney
2024-09-11 17:39 ` [PATCH RFC/RFT v2 1/4] arm: dts: k3-j784s4-r5-evm: Add the PMIC ESM node Andrew Halaney
2024-09-11 17:39 ` [PATCH RFC/RFT v2 2/4] arm: dts: k3-am69-r5-evm: " Andrew Halaney
2024-09-11 17:39 ` [PATCH RFC/RFT v2 3/4] board: ti: j784s4: Initialize the ESM & PMIC ESM Andrew Halaney
2024-09-11 17:39 ` [PATCH RFC/RFT v2 4/4] configs: j784s4_evm_r5: Enable ESM related configs Andrew Halaney
2024-09-12  7:58 ` [PATCH RFC/RFT v2 0/4] k3-j784s4-r5-evm: Enable ESMs and related PMIC Kumar, Udit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox