[PATCH 0/8] Add ESM support for J721E and J7200

Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.
Gowtham Tammana (6): arm: dts: k3-j7200: Add Main domain ESM support arm: dts: k3-j7200-r5-common: Add pmic node for esm arm: dts: k3-j7200: Add ESM PMIC support for tps659413 j721e_init: initialize ESM support for J7200 SOM power: pmic: tps65491: Dont fail on master node configs: j7200_evm_r5_defconfig: Enable ESM modules
Tero Kristo (2): arm: mach-k3: j721e_init: initialize ESM support arm: dts: k3-k721e: Add Main domain ESM support
.../k3-j7200-common-proc-board-u-boot.dtsi | 4 +++ arch/arm/dts/k3-j7200-main.dtsi | 6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi | 1 + arch/arm/dts/k3-j721e.dtsi | 1 + arch/arm/mach-k3/j721e_init.c | 25 ++++++++++++++++++- configs/j7200_evm_r5_defconfig | 2 ++ drivers/power/pmic/tps65941.c | 1 - 9 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi

From: Tero Kristo t-kristo@ti.com
Initialize both ESM and ESM_PMIC support if available for the board. If support is not available for either, a warning is printed out.
Signed-off-by: Tero Kristo t-kristo@ti.com Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- arch/arm/mach-k3/j721e_init.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index 9cae3ac67e..b22530f39d 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -23,6 +23,7 @@ #include <fdtdec.h> #include <mmc.h> #include <remoteproc.h> +#include "../../../board/ti/common/board_detect.h"
#ifdef CONFIG_K3_LOAD_SYSFW struct fwl_data cbass_hc_cfg0_fwls[] = { @@ -189,7 +190,8 @@ void do_dt_magic(void)
void board_init_f(ulong dummy) { -#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW) +#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW) || \ + defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC) struct udevice *dev; int ret; #endif @@ -277,6 +279,25 @@ void board_init_f(ulong dummy) printf("AVS init failed: %d\n", ret); #endif
+#ifdef CONFIG_ESM_K3 + if (board_ti_k3_is("J721EX-PM2-SOM")) { + ret = uclass_get_device_by_driver(UCLASS_MISC, + DM_DRIVER_GET(k3_esm), &dev); + if (ret) + printf("MISC init failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ESM_PMIC + if (board_ti_k3_is("J721EX-PM2-SOM")) { + ret = uclass_get_device_by_driver(UCLASS_MISC, + DM_DRIVER_GET(pmic_esm), + &dev); + if (ret) + printf("ESM PMIC init failed: %d\n", ret); + } +#endif + #if defined(CONFIG_K3_J721E_DDRSS) ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret)

From: Tero Kristo t-kristo@ti.com
Main domain ESM support is needed to configure main domain watchdogs to generate ESM pin events by default. On J7 processor board these propagate to the PMIC to generate a reset when watchdog expires.
Signed-off-by: Tero Kristo t-kristo@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- arch/arm/dts/k3-j721e.dtsi | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/dts/k3-j721e.dtsi b/arch/arm/dts/k3-j721e.dtsi index f0587fde14..d7f73f61db 100644 --- a/arch/arm/dts/k3-j721e.dtsi +++ b/arch/arm/dts/k3-j721e.dtsi @@ -126,6 +126,7 @@ #size-cells = <2>; ranges = <0x00 0x00100000 0x00 0x00100000 0x00 0x00020000>, /* ctrl mmr */ <0x00 0x00600000 0x00 0x00600000 0x00 0x00031100>, /* GPIO */ + <0x00 0x00700000 0x00 0x00700000 0x00 0x00001000>, /* ESM */ <0x00 0x00900000 0x00 0x00900000 0x00 0x00012000>, /* serdes */ <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */ <0x00 0x06000000 0x00 0x06000000 0x00 0x00400000>, /* USBSS0 */

From: Gowtham Tammana g-tammana@ti.com
Main domain ESM support is needed to configure main domain watchdog interrupts to generate ESM pin events. On J7200 boards ESM error pin output is propagated to PMIC to generate reset.
Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi | 4 ++++ arch/arm/dts/k3-j7200-main.dtsi | 6 ++++++ arch/arm/dts/k3-j7200.dtsi | 1 + 3 files changed, 11 insertions(+)
diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi index f57c2306ba..088fdb4072 100644 --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi @@ -196,3 +196,7 @@ &main_r5fss0 { ti,cluster-mode = <0>; }; + +&main_esm { + bootph-pre-ram; +}; diff --git a/arch/arm/dts/k3-j7200-main.dtsi b/arch/arm/dts/k3-j7200-main.dtsi index e8a41d09b4..4c8ba123dc 100644 --- a/arch/arm/dts/k3-j7200-main.dtsi +++ b/arch/arm/dts/k3-j7200-main.dtsi @@ -774,4 +774,10 @@ ti,loczrama = <1>; }; }; + + main_esm: esm@700000 { + compatible = "ti,j721e-esm"; + reg = <0x0 0x700000 0x0 0x1000>; + ti,esm-pins = <656>, <657>; + }; }; diff --git a/arch/arm/dts/k3-j7200.dtsi b/arch/arm/dts/k3-j7200.dtsi index b7005b8031..9252d97399 100644 --- a/arch/arm/dts/k3-j7200.dtsi +++ b/arch/arm/dts/k3-j7200.dtsi @@ -124,6 +124,7 @@ #size-cells = <2>; ranges = <0x00 0x00100000 0x00 0x00100000 0x00 0x00020000>, /* ctrl mmr */ <0x00 0x00600000 0x00 0x00600000 0x00 0x00031100>, /* GPIO */ + <0x00 0x00700000 0x00 0x00700000 0x00 0x00001000>, /* ESM */ <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */ <0x00 0x01000000 0x00 0x01000000 0x00 0x0d000000>, /* Most peripherals */ <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>, /* MAIN NAVSS */

From: Gowtham Tammana g-tammana@ti.com
Add pmic tps659413 node needed for ESM error event handling.
Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index 55ad6153dd..01e3a507d4 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -248,13 +248,20 @@
&wkup_i2c0 { bootph-pre-ram; + pinctrl-names = "default"; + pinctrl-0 = <&wkup_i2c0_pins_default>; + clock-frequency = <400000>; + + tps659413: tps659413@48 { + compatible = "ti,tps659413"; + reg = <0x48>; + bootph-pre-ram; + }; + lp876441: lp876441@4c { compatible = "ti,lp876441"; reg = <0x4c>; bootph-pre-ram; - pinctrl-names = "default"; - pinctrl-0 = <&wkup_i2c0_pins_default>; - clock-frequency = <400000>;
regulators: regulators { bootph-pre-ram;

From: Gowtham Tammana g-tammana@ti.com
On J7200 processor board MCU_SAFETY_ERROR signal is routed to PMIC for ESM error handling. The PMIC resets the board on receipt of the signal. Enable the support for the board by adding ESM PMIC node.
Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- .../arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi new file mode 100644 index 0000000000..9cd4dd09ca --- /dev/null +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ + */ + +&tps659413 { + esm: esm { + compatible = "ti,tps659413-esm"; + bootph-pre-ram; + }; +};

From: Gowtham Tammana g-tammana@ti.com
ESM and ESM PMIC support is available for J7200X-PM2-SOM board, as such enable support for it.
Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- arch/arm/mach-k3/j721e_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index b22530f39d..294aeb2f88 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -280,7 +280,8 @@ void board_init_f(ulong dummy) #endif
#ifdef CONFIG_ESM_K3 - if (board_ti_k3_is("J721EX-PM2-SOM")) { + if (board_ti_k3_is("J721EX-PM2-SOM") || + board_ti_k3_is("J7200X-PM2-SOM")) { ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_esm), &dev); if (ret) @@ -289,7 +290,8 @@ void board_init_f(ulong dummy) #endif
#ifdef CONFIG_ESM_PMIC - if (board_ti_k3_is("J721EX-PM2-SOM")) { + if (board_ti_k3_is("J721EX-PM2-SOM") || + board_ti_k3_is("J7200X-PM2-SOM")) { ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(pmic_esm), &dev);

From: Gowtham Tammana g-tammana@ti.com
TPS65941 can have child only ESM nodes with no regulators, so dont fail on regulator probe failure.
Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- drivers/power/pmic/tps65941.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/power/pmic/tps65941.c b/drivers/power/pmic/tps65941.c index 83d0f83c64..06a3c1406c 100644 --- a/drivers/power/pmic/tps65941.c +++ b/drivers/power/pmic/tps65941.c @@ -51,7 +51,6 @@ static int tps65941_bind(struct udevice *dev) if (!ofnode_valid(regulators_node)) { debug("%s: %s regulators subnode not found!\n", __func__, dev->name); - return -ENXIO; }
debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);

From: Gowtham Tammana g-tammana@ti.com
Enable ESM modules for both PMIC and SoC for watchdog error intterupt handling on the board.
Signed-off-by: Gowtham Tammana g-tammana@ti.com Signed-off-by: Neha Malcom Francis n-francis@ti.com --- configs/j7200_evm_r5_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig index 00ec48b83b..7b3b4766f0 100644 --- a/configs/j7200_evm_r5_defconfig +++ b/configs/j7200_evm_r5_defconfig @@ -168,3 +168,5 @@ CONFIG_FS_EXT4=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_LIB_RATIONAL=y CONFIG_SPL_LIB_RATIONAL=y +CONFIG_ESM_K3=y +CONFIG_ESM_PMIC=y

Hi Neha!
On April 10, 2023 thus sayeth Neha Malcom Francis:
Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.
Gowtham Tammana (6): arm: dts: k3-j7200: Add Main domain ESM support arm: dts: k3-j7200-r5-common: Add pmic node for esm arm: dts: k3-j7200: Add ESM PMIC support for tps659413 j721e_init: initialize ESM support for J7200 SOM power: pmic: tps65491: Dont fail on master node configs: j7200_evm_r5_defconfig: Enable ESM modules
Tero Kristo (2): arm: mach-k3: j721e_init: initialize ESM support arm: dts: k3-k721e: Add Main domain ESM support
.../k3-j7200-common-proc-board-u-boot.dtsi | 4 +++ arch/arm/dts/k3-j7200-main.dtsi | 6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi | 1 + arch/arm/dts/k3-j721e.dtsi | 1 + arch/arm/mach-k3/j721e_init.c | 25 ++++++++++++++++++- configs/j7200_evm_r5_defconfig | 2 ++ drivers/power/pmic/tps65941.c | 1 - 9 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly
Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.
Though I guess we can treat the dt updates as a DONOTMERGE
~Bryan

Hi Bryan
On 10/04/23 20:09, Bryan Brattlof wrote:
Hi Neha!
On April 10, 2023 thus sayeth Neha Malcom Francis:
Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.
Gowtham Tammana (6): arm: dts: k3-j7200: Add Main domain ESM support arm: dts: k3-j7200-r5-common: Add pmic node for esm arm: dts: k3-j7200: Add ESM PMIC support for tps659413 j721e_init: initialize ESM support for J7200 SOM power: pmic: tps65491: Dont fail on master node configs: j7200_evm_r5_defconfig: Enable ESM modules
Tero Kristo (2): arm: mach-k3: j721e_init: initialize ESM support arm: dts: k3-k721e: Add Main domain ESM support
.../k3-j7200-common-proc-board-u-boot.dtsi | 4 +++ arch/arm/dts/k3-j7200-main.dtsi | 6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi | 1 + arch/arm/dts/k3-j721e.dtsi | 1 + arch/arm/mach-k3/j721e_init.c | 25 ++++++++++++++++++- configs/j7200_evm_r5_defconfig | 2 ++ drivers/power/pmic/tps65941.c | 1 - 9 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly
Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.
Though I guess we can treat the dt updates as a DONOTMERGE
Thanks for summarising! However I'm inclined to send a v2 of this patch series here without using board and SoC dts and using only -u-boot.dtsi since I do not think ESM support will be needed in the kernel at any point. What do you think?
~Bryan

On 4/11/23 4:21 AM, Neha Malcom Francis wrote:
Hi Bryan
On 10/04/23 20:09, Bryan Brattlof wrote:
Hi Neha!
On April 10, 2023 thus sayeth Neha Malcom Francis:
Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.
Gowtham Tammana (6): arm: dts: k3-j7200: Add Main domain ESM support arm: dts: k3-j7200-r5-common: Add pmic node for esm arm: dts: k3-j7200: Add ESM PMIC support for tps659413 j721e_init: initialize ESM support for J7200 SOM power: pmic: tps65491: Dont fail on master node configs: j7200_evm_r5_defconfig: Enable ESM modules
Tero Kristo (2): arm: mach-k3: j721e_init: initialize ESM support arm: dts: k3-k721e: Add Main domain ESM support
.../k3-j7200-common-proc-board-u-boot.dtsi | 4 +++ arch/arm/dts/k3-j7200-main.dtsi | 6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi | 1 + arch/arm/dts/k3-j721e.dtsi | 1 + arch/arm/mach-k3/j721e_init.c | 25 ++++++++++++++++++- configs/j7200_evm_r5_defconfig | 2 ++ drivers/power/pmic/tps65941.c | 1 - 9 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly
Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.
Though I guess we can treat the dt updates as a DONOTMERGE
Thanks for summarising! However I'm inclined to send a v2 of this patch series here without using board and SoC dts and using only -u-boot.dtsi since I do not think ESM support will be needed in the kernel at any point. What do you think?
DT isn't concerned with who uses a node or not, it should be a universal description of the hardware as it actually is. I know that isn't always the case today (GPU nodes *grumble*), but it is still a goal. So if the ESM hardware exists in the chip, it should be described in the DT file. If Linux/U-Boot/OPTEE/Zephyr/etc actually use the node for anything is up to that piece of software.
Andrew
~Bryan

Hi Andrew,
On 11/04/23 21:00, Andrew Davis wrote:
On 4/11/23 4:21 AM, Neha Malcom Francis wrote:
Hi Bryan
On 10/04/23 20:09, Bryan Brattlof wrote:
Hi Neha!
On April 10, 2023 thus sayeth Neha Malcom Francis:
Add support for ESM (Error Signalling Module) in J721E and J7200. The ESM error pin output is routed to the PMIC (Power Management IC) which can reset the board. The dts nodes for SoC and PMIC ESM modules are added (if not already) to enable them.
Gowtham Tammana (6): arm: dts: k3-j7200: Add Main domain ESM support arm: dts: k3-j7200-r5-common: Add pmic node for esm arm: dts: k3-j7200: Add ESM PMIC support for tps659413 j721e_init: initialize ESM support for J7200 SOM power: pmic: tps65491: Dont fail on master node configs: j7200_evm_r5_defconfig: Enable ESM modules
Tero Kristo (2): arm: mach-k3: j721e_init: initialize ESM support arm: dts: k3-k721e: Add Main domain ESM support
.../k3-j7200-common-proc-board-u-boot.dtsi | 4 +++ arch/arm/dts/k3-j7200-main.dtsi | 6 +++++ .../k3-j7200-r5-common-proc-board-u-boot.dtsi | 11 ++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 13 +++++++--- arch/arm/dts/k3-j7200.dtsi | 1 + arch/arm/dts/k3-j721e.dtsi | 1 + arch/arm/mach-k3/j721e_init.c | 25 ++++++++++++++++++- configs/j7200_evm_r5_defconfig | 2 ++ drivers/power/pmic/tps65941.c | 1 - 9 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board-u-boot.dtsi
I know Praneeth and Andrew have already commented internally, I just wanted to summarize publicly
Thank you for sending this out! Unfortunately some of these dt node updates where never sent to the kernel. We'll need to get these merged over there so it will be a simple copy/paste once they make it to a linux tag.
Though I guess we can treat the dt updates as a DONOTMERGE
Thanks for summarising! However I'm inclined to send a v2 of this patch series here without using board and SoC dts and using only -u-boot.dtsi since I do not think ESM support will be needed in the kernel at any point. What do you think?
DT isn't concerned with who uses a node or not, it should be a universal description of the hardware as it actually is. I know that isn't always the case today (GPU nodes *grumble*), but it is still a goal. So if the ESM hardware exists in the chip, it should be described in the DT file. If Linux/U-Boot/OPTEE/Zephyr/etc actually use the node for anything is up to that piece of software.
Got it, thanks for explaining; I'll try getting this into kernel first.
Andrew
~Bryan
participants (3)
-
Andrew Davis
-
Bryan Brattlof
-
Neha Malcom Francis