Skip to contentSkip to conversation

ESM support for TI K3 SoCs

PATCH New Tero Kristo 3 participants 10 messages Feb 14, 2020 – Feb 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ESM support for TI K3 SoCs

Hi,

V2 contains changes proposed by Lokesh.

- Move main_esm under R5 .dts file (patch #4)
- Move ESM probing to the board file (patch #6)
- Enabled SPL board init in the r5 defconfig (needed for patch #6 change, done in patch #7)

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

#1 lore raw

PATCH v2 1/7 power: pmic: tps65941: Add support for probing the child devices

TPS65941 can have child devices under it (like the ESM support), so probe these once the master pmic node completes probe.

---
 drivers/power/pmic/tps65941.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/pmic/tps65941.c +2 -2
index e8f3c950bd..7b3416ae6e 100644
@@ -59,8 +59,8 @@ static int tps65941_bind(struct udevice *dev)
 	if (!children)
 		printf("%s: %s - no child found\n", __func__, dev->name);
 
-	/* Always return success for this device */
-	return 0;
+	/* Probe all the child devices */
+	return dm_scan_fdt_dev(dev);
 }
 
 static struct dm_pmic_ops tps65941_ops = {
Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#2 lore raw

PATCH v2 2/7 misc: k3_esm: Add support for Texas Instruments K3 ESM driver

In reply to Tero Kristo

The ESM (Error Signaling Module) is used to route error signals within the K3 SoCs somewhat similar to interrupts. The handling for these is different though, and can be routed for hardware error handling, to be handled by safety processor or just as error interrupts handled by the main processor. The u-boot level ESM driver is just used to configure the ESM signals so that they get routed to proper destination.

---
 doc/device-tree-bindings/misc/esm-k3.txt | 25 +++++++
 drivers/misc/Kconfig                     |  5 ++
 drivers/misc/Makefile                    |  1 +
 drivers/misc/k3_esm.c                    | 87 ++++++++++++++++++++++++
 4 files changed, 118 insertions(+)
 create mode 100644 doc/device-tree-bindings/misc/esm-k3.txt
 create mode 100644 drivers/misc/k3_esm.c
doc/device-tree-bindings/misc/esm-k3.txt new file +25 -0
new file mode 100644
index 0000000000..01c8b6b294
@@ -0,0 +1,25 @@
+Texas Instruments K3 ESM Binding
+======================
+
+ESM (Error Signaling Module) is an IP block on TI K3 devices that allows
+handling of safety events somewhat similar to what interrupt controller
+would do. The safety signals have their separate paths within the SoC,
+and they are handled by the ESM, which routes them to the proper
+destination, which can be system reset, interrupt controller, etc. In
+the simplest configuration the signals are just routed to reset the
+SoC.
+
+Required properties :
+- compatible	: "ti,j721e-esm"
+- ti,esm-pins	: integer array of esm events IDs to route to external event
+		  pin which can be used to reset the SoC. The array can
+		  have arbitrary amount of event IDs listed on it.
+
+Example
+=======
+
+	main_esm: esm at 700000 {
+		compatible = "ti,j721e-esm";
+		reg = <0x0 0x700000 0x0 0x1000>;
+		ti,esm-pins = <344>, <345>;
+	};
drivers/misc/Kconfig +5 -0
index f18aa8f7ba..38588b2cbd 100644
@@ -462,6 +462,11 @@ config IHS_FPGA
 	  gdsys devices, which supply the majority of the functionality offered
 	  by the devices. This driver supports both CON and CPU variants of the
 	  devices, depending on the device tree entry.
+config ESM_K3
+	bool "Enable K3 ESM driver"
+	depends on ARCH_K3
+	help
+	  Support ESM (Error Signaling Module) on TI K3 SoCs.
 
 config MICROCHIP_FLEXCOM
 	bool "Enable Microchip Flexcom driver"
drivers/misc/Makefile +1 -0
index 2b843de93c..60406c3e0a 100644
@@ -72,3 +72,4 @@ obj-$(CONFIG_WINBOND_W83627) += winbond_w83627.o
 obj-$(CONFIG_JZ4780_EFUSE) += jz4780_efuse.o
 obj-$(CONFIG_MICROCHIP_FLEXCOM) += microchip_flexcom.o
 obj-$(CONFIG_K3_AVS0) += k3_avs.o
+obj-$(CONFIG_ESM_K3) += k3_esm.o
drivers/misc/k3_esm.c new file +87 -0

87 lines not on this page · raw message

Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#3 lore raw

PATCH v2 2/7 misc: k3_esm: Add support for Texas Instruments K3 ESM driver

Quoted 53 lines · Tero Kristo

The ESM (Error Signaling Module) is used to route error signals within the K3 SoCs somewhat similar to interrupts. The handling for these is different though, and can be routed for hardware error handling, to be handled by safety processor or just as error interrupts handled by the main processor. The u-boot level ESM driver is just used to configure the ESM signals so that they get routed to proper destination.

---
 doc/device-tree-bindings/misc/esm-k3.txt | 25 +++++++
 drivers/misc/Kconfig                     |  5 ++
 drivers/misc/Makefile                    |  1 +
 drivers/misc/k3_esm.c                    | 87 ++++++++++++++++++++++++
 4 files changed, 118 insertions(+)
 create mode 100644 doc/device-tree-bindings/misc/esm-k3.txt
 create mode 100644 drivers/misc/k3_esm.c
doc/device-tree-bindings/misc/esm-k3.txt new file +25 -0
new file mode 100644
index 0000000000..01c8b6b294
@@ -0,0 +1,25 @@
+Texas Instruments K3 ESM Binding
+======================
+
+ESM (Error Signaling Module) is an IP block on TI K3 devices that allows
+handling of safety events somewhat similar to what interrupt controller
+would do. The safety signals have their separate paths within the SoC,
+and they are handled by the ESM, which routes them to the proper
+destination, which can be system reset, interrupt controller, etc. In
+the simplest configuration the signals are just routed to reset the
+SoC.
+
+Required properties :
+- compatible	: "ti,j721e-esm"
+- ti,esm-pins	: integer array of esm events IDs to route to external event
+		  pin which can be used to reset the SoC. The array can
+		  have arbitrary amount of event IDs listed on it.
+
+Example
+=======
+
+	main_esm: esm at 700000 {
+		compatible = "ti,j721e-esm";
+		reg = <0x0 0x700000 0x0 0x1000>;
+		ti,esm-pins = <344>, <345>;
+	};
drivers/misc/Kconfig +0 -0
index f18aa8f7ba..38588b2cbd 100644

drivers/misc/Kconfig config IHS_FPGA · line 464

Quoted 3 lines
drivers/misc/Kconfig +0 -0
@@ -462,6 +462,11 @@ config IHS_FPGA
 	  gdsys devices, which supply the majority of the functionality offered
 	  by the devices. This driver supports both CON and CPU variants of the
 	  devices, depending on the device tree entry.

missing space.

Otherwise:

And if there's no other feedback, Lokesh, please just fix that up when applying, thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200214/a0511f3a/attachment.sig>
#4 lore raw

PATCH v2 3/7 misc: pmic_esm: Add support for PMIC ESM driver

In reply to Tero Kristo

The ESM (Error Signal Monitor) is used on certain PMIC versions to handle error signals propagating from rest of the system. If these reach the PMIC, it is typically a last resort fatal error which requires a system reset. The ESM driver does the proper configuration for the ESM module to reach this end goal. Initially, only TPS65941 PMIC is supported for this.

---
 doc/device-tree-bindings/misc/esm-pmic.txt | 19 ++++++
 drivers/misc/Kconfig                       |  7 +++
 drivers/misc/Makefile                      |  1 +
 drivers/misc/esm_pmic.c                    | 69 ++++++++++++++++++++++
 4 files changed, 96 insertions(+)
 create mode 100644 doc/device-tree-bindings/misc/esm-pmic.txt
 create mode 100644 drivers/misc/esm_pmic.c
doc/device-tree-bindings/misc/esm-pmic.txt new file +19 -0
new file mode 100644
index 0000000000..a60ad74679
@@ -0,0 +1,19 @@
+PMIC ESM Binding
+======================
+
+Certain Power Management ICs contain safety handling logic within them,
+allowing automatic reset of the board in case a safety error is signaled.
+For this purpose, ESM (Error Signal Monitor) is implemented within
+the PMIC running its own state machine.
+
+Required properties :
+- compatible	: "ti,tps659413-esm"
+
+Example
+=======
+
+&tps659413a {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+	};
+};
drivers/misc/Kconfig +7 -0
index 38588b2cbd..766402745d 100644
@@ -486,4 +486,11 @@ config K3_AVS0
 	  optimized voltage from the efuse, so that it can be programmed
 	  to the PMIC on board.
 
+config ESM_PMIC
+	bool "Enable PMIC ESM driver"
+	depends on DM_PMIC
+	help
+	  Support ESM (Error Signal Monitor) on PMIC devices. ESM is used
+	  typically to reboot the board in error condition.
+
 endmenu
drivers/misc/Makefile +1 -0
index 60406c3e0a..68e0e7ad17 100644
@@ -73,3 +73,4 @@ obj-$(CONFIG_JZ4780_EFUSE) += jz4780_efuse.o
 obj-$(CONFIG_MICROCHIP_FLEXCOM) += microchip_flexcom.o
 obj-$(CONFIG_K3_AVS0) += k3_avs.o
 obj-$(CONFIG_ESM_K3) += k3_esm.o
+obj-$(CONFIG_ESM_PMIC) += esm_pmic.o
drivers/misc/esm_pmic.c new file +69 -0

69 lines not on this page · raw message

Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#5 lore raw

PATCH v2 4/7 arm: dts: k3-k721e: Add Main domain ESM support

In reply to Tero Kristo

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.

---
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 9 +++++++++
 arch/arm/dts/k3-j721e.dtsi                     | 1 +
 2 files changed, 10 insertions(+)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +9 -0
index 1f14d71438..c8dea666c8 100644
@@ -75,6 +75,15 @@
 	};
 };
 
+&cbass_main {
+	main_esm: esm at 700000 {
+		compatible = "ti,j721e-esm";
+		reg = <0x0 0x700000 0x0 0x1000>;
+		ti,esm-pins = <344>, <345>;
+		u-boot,dm-spl;
+	};
+};
+
 &dmsc {
 	mboxes= <&mcu_secproxy 8>, <&mcu_secproxy 6>, <&mcu_secproxy 5>;
 	mbox-names = "tx", "rx", "notify";
arch/arm/dts/k3-j721e.dtsi +1 -0
index 68ba517e50..e470d3a1b5 100644
@@ -135,6 +135,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 0x01000000 0x00 0x01000000 0x00 0x0af02400>, /* Most peripherals */
Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#6 lore raw

PATCH v2 5/7 arm: dts: k3-j721e: Add ESM PMIC support for tps659413 based board

In reply to Tero Kristo

The ESM handling on J7 processor board requires routing the MCU_SAFETY_ERROR signal to the PMIC on the board for critical safety error handling. The PMIC itself should then reset the board based on receiving it. Enable the support for the board by adding the esm node in place.

---
 .../arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi
arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi new file +11 -0
new file mode 100644
index 0000000000..c6c60b44ec
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
+ */
+
+&tps659413a {
+	esm: esm {
+		compatible = "ti,tps659413-esm";
+		u-boot,dm-spl;
+	};
+};
Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#7 lore raw

PATCH v2 6/7 board: ti: j721e: initialize ESM support

In reply to Tero Kristo

Initialize both ESM and ESM_PMIC support if available for the board. If support is not available for either, a warning is printed out.

ESM signals are only properly routed on PM2 version of the J721E SOM, so only probe the drivers on this device.

---
 board/ti/j721e/evm.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
board/ti/j721e/evm.c +26 -0
index aa2240b852..c068bb86b5 100644
@@ -15,6 +15,8 @@
 #include <asm/io.h>
 #include <spl.h>
 #include <asm/arch/sys_proto.h>
+#include <dm.h>
+#include <dm/uclass-internal.h>
 
 #include "../common/board_detect.h"
 
@@ -343,5 +345,29 @@ int board_late_init(void)
 
 void spl_board_init(void)
 {
+#if defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC)
+	struct udevice *dev;
+	int ret;
+#endif
+
 	probe_daughtercards();
+
+#ifdef CONFIG_ESM_K3
+	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+		ret = uclass_get_device_by_driver(UCLASS_MISC,
+						  DM_GET_DRIVER(k3_esm), &dev);
+		if (ret)
+			printf("ESM 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_GET_DRIVER(pmic_esm),
+						  &dev);
+		if (ret)
+			printf("ESM PMIC init failed: %d\n", ret);
+	}
+#endif
 }
Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#8 lore raw

PATCH v2 7/7 configs: j721e_evm_r5_defconfig: Enable ESM modules

In reply to Tero Kristo

Enable ESM modules for both PMIC and SoC side for proper watchdog handling on the board.

SPL_BOARD_INIT is also enabled so that the board init function probing the drivers is called.

---
 configs/j721e_evm_r5_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/j721e_evm_r5_defconfig +3 -0
index 19fbd450c7..a28ea30372 100644
@@ -122,3 +122,6 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6163
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_FS_EXT4=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_ESM_K3=y
+CONFIG_ESM_PMIC=y
+CONFIG_SPL_BOARD_INIT=y
Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#9 lore raw

v2 cover ESM support for TI K3 SoCs

In reply to Tero Kristo
Quoted 3 lines · Tero Kristo

Hi,

V2 contains changes proposed by Lokesh.

Series applied to u-boot-ti next branch.

Thanks and regards,
Lokesh