All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/7] ESM support for TI K3 SoCs
@ 2020-02-14  9:18 Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 1/7] power: pmic: tps65941: Add support for probing the child devices Tero Kristo
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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

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

* [PATCHv2 1/7] power: pmic: tps65941: Add support for probing the child devices
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 2/7] misc: k3_esm: Add support for Texas Instruments K3 ESM driver Tero Kristo
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/power/pmic/tps65941.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/pmic/tps65941.c b/drivers/power/pmic/tps65941.c
index e8f3c950bd..7b3416ae6e 100644
--- a/drivers/power/pmic/tps65941.c
+++ b/drivers/power/pmic/tps65941.c
@@ -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 = {
-- 
2.17.1

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

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

* [PATCHv2 2/7] misc: k3_esm: Add support for Texas Instruments K3 ESM driver
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 1/7] power: pmic: tps65941: Add support for probing the child devices Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-14 15:08   ` Tom Rini
  2020-02-14  9:18 ` [PATCHv2 3/7] misc: pmic_esm: Add support for PMIC " Tero Kristo
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 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

diff --git a/doc/device-tree-bindings/misc/esm-k3.txt b/doc/device-tree-bindings/misc/esm-k3.txt
new file mode 100644
index 0000000000..01c8b6b294
--- /dev/null
+++ b/doc/device-tree-bindings/misc/esm-k3.txt
@@ -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>;
+	};
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index f18aa8f7ba..38588b2cbd 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -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"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 2b843de93c..60406c3e0a 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -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
diff --git a/drivers/misc/k3_esm.c b/drivers/misc/k3_esm.c
new file mode 100644
index 0000000000..8f270f3b5c
--- /dev/null
+++ b/drivers/misc/k3_esm.c
@@ -0,0 +1,87 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Texas Instruments' K3 Error Signalling Module driver
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ *      Tero Kristo <t-kristo@ti.com>
+ *
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <asm/io.h>
+#include <dm/device_compat.h>
+
+#define ESM_SFT_RST			0x0c
+#define ESM_SFT_RST_KEY			0x0f
+
+#define ESM_STS(i)			(0x404 + (i) / 32 * 0x20)
+#define ESM_PIN_EN_SET_OFFSET(i)	(0x414 + (i) / 32 * 0x20)
+#define ESM_PIN_MASK(i)			BIT((i) & 0x1f)
+
+static void esm_pin_enable(void __iomem *base, int pin)
+{
+	/* Enable event */
+	writel(ESM_PIN_MASK(pin), base + ESM_PIN_EN_SET_OFFSET(pin));
+}
+
+/**
+ * k3_esm_probe: configures ESM based on DT data
+ *
+ * Parses ESM info from device tree, and configures the module accordingly.
+ */
+static int k3_esm_probe(struct udevice *dev)
+{
+	int ret;
+	void __iomem *base;
+	int num_pins;
+	u32 *pins;
+	int i;
+
+	base = dev_remap_addr_index(dev, 0);
+	if (!base)
+		return -ENODEV;
+
+	num_pins = dev_read_size(dev, "ti,esm-pins");
+	if (num_pins < 0) {
+		dev_err(dev, "ti,esm-pins property missing or invalid: %d\n",
+			num_pins);
+		return num_pins;
+	}
+
+	num_pins /= sizeof(u32);
+
+	pins = kmalloc(num_pins * sizeof(u32), __GFP_ZERO);
+	if (!pins)
+		return -ENOMEM;
+
+	ret = dev_read_u32_array(dev, "ti,esm-pins", pins, num_pins);
+	if (ret < 0) {
+		dev_err(dev, "failed to read ti,esm-pins property: %d\n",
+			ret);
+		goto free_pins;
+	}
+
+	/* Clear any pending events */
+	writel(ESM_SFT_RST_KEY, base + ESM_SFT_RST);
+
+	for (i = 0; i < num_pins; i++)
+		esm_pin_enable(base, pins[i]);
+
+free_pins:
+	kfree(pins);
+	return ret;
+}
+
+static const struct udevice_id k3_esm_ids[] = {
+	{ .compatible = "ti,j721e-esm" },
+	{}
+};
+
+U_BOOT_DRIVER(k3_esm) = {
+	.name = "k3_esm",
+	.of_match = k3_esm_ids,
+	.id = UCLASS_MISC,
+	.probe = k3_esm_probe,
+};
-- 
2.17.1

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

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

* [PATCHv2 3/7] misc: pmic_esm: Add support for PMIC ESM driver
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 1/7] power: pmic: tps65941: Add support for probing the child devices Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 2/7] misc: k3_esm: Add support for Texas Instruments K3 ESM driver Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 4/7] arm: dts: k3-k721e: Add Main domain ESM support Tero Kristo
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 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

diff --git a/doc/device-tree-bindings/misc/esm-pmic.txt b/doc/device-tree-bindings/misc/esm-pmic.txt
new file mode 100644
index 0000000000..a60ad74679
--- /dev/null
+++ b/doc/device-tree-bindings/misc/esm-pmic.txt
@@ -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";
+	};
+};
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 38588b2cbd..766402745d 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -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
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 60406c3e0a..68e0e7ad17 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -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
diff --git a/drivers/misc/esm_pmic.c b/drivers/misc/esm_pmic.c
new file mode 100644
index 0000000000..92c8d68f7c
--- /dev/null
+++ b/drivers/misc/esm_pmic.c
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * PMIC Error Signal Monitor driver
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ *      Tero Kristo <t-kristo@ti.com>
+ *
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <power/pmic.h>
+#include <dm/device_compat.h>
+
+#define INT_ESM_REG		0x6c
+#define INT_ESM_MASK		0x3f
+
+#define ESM_MCU_START_REG	0x8f
+
+#define ESM_MCU_START		BIT(0)
+
+#define ESM_MCU_MODE_CFG_REG	0x92
+
+#define ESM_MCU_EN		BIT(6)
+#define ESM_MCU_ENDRV		BIT(5)
+
+/**
+ * pmic_esm_probe: configures and enables PMIC ESM functionality
+ *
+ * Configures ESM PMIC support and enables it.
+ */
+static int pmic_esm_probe(struct udevice *dev)
+{
+	int ret;
+
+	ret = pmic_reg_write(dev->parent, INT_ESM_REG, INT_ESM_MASK);
+	if (ret) {
+		dev_err(dev, "clearing ESM irqs failed: %d\n", ret);
+		return ret;
+	}
+
+	ret = pmic_reg_write(dev->parent, ESM_MCU_MODE_CFG_REG,
+			     ESM_MCU_EN | ESM_MCU_ENDRV);
+	if (ret) {
+		dev_err(dev, "setting ESM mode failed: %d\n", ret);
+		return ret;
+	}
+
+	ret = pmic_reg_write(dev->parent, ESM_MCU_START_REG, ESM_MCU_START);
+	if (ret) {
+		dev_err(dev, "starting ESM failed: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static const struct udevice_id pmic_esm_ids[] = {
+	{ .compatible = "ti,tps659413-esm" },
+	{}
+};
+
+U_BOOT_DRIVER(pmic_esm) = {
+	.name = "esm_pmic",
+	.of_match = pmic_esm_ids,
+	.id = UCLASS_MISC,
+	.probe = pmic_esm_probe,
+};
-- 
2.17.1

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

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

* [PATCHv2 4/7] arm: dts: k3-k721e: Add Main domain ESM support
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
                   ` (2 preceding siblings ...)
  2020-02-14  9:18 ` [PATCHv2 3/7] misc: pmic_esm: Add support for PMIC " Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 5/7] arm: dts: k3-j721e: Add ESM PMIC support for tps659413 based board Tero Kristo
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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>
---
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 9 +++++++++
 arch/arm/dts/k3-j721e.dtsi                     | 1 +
 2 files changed, 10 insertions(+)

diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts
index 1f14d71438..c8dea666c8 100644
--- a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts
+++ b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts
@@ -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";
diff --git a/arch/arm/dts/k3-j721e.dtsi b/arch/arm/dts/k3-j721e.dtsi
index 68ba517e50..e470d3a1b5 100644
--- a/arch/arm/dts/k3-j721e.dtsi
+++ b/arch/arm/dts/k3-j721e.dtsi
@@ -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 */
-- 
2.17.1

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

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

* [PATCHv2 5/7] arm: dts: k3-j721e: Add ESM PMIC support for tps659413 based board
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
                   ` (3 preceding siblings ...)
  2020-02-14  9:18 ` [PATCHv2 4/7] arm: dts: k3-k721e: Add Main domain ESM support Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 6/7] board: ti: j721e: initialize ESM support Tero Kristo
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 .../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

diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi
new file mode 100644
index 0000000000..c6c60b44ec
--- /dev/null
+++ b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi
@@ -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;
+	};
+};
-- 
2.17.1

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

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

* [PATCHv2 6/7] board: ti: j721e: initialize ESM support
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
                   ` (4 preceding siblings ...)
  2020-02-14  9:18 ` [PATCHv2 5/7] arm: dts: k3-j721e: Add ESM PMIC support for tps659413 based board Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-14  9:18 ` [PATCHv2 7/7] configs: j721e_evm_r5_defconfig: Enable ESM modules Tero Kristo
  2020-02-23  8:14 ` [PATCHv2 0/7] ESM support for TI K3 SoCs Lokesh Vutla
  7 siblings, 0 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 board/ti/j721e/evm.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index aa2240b852..c068bb86b5 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -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
 }
-- 
2.17.1

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

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

* [PATCHv2 7/7] configs: j721e_evm_r5_defconfig: Enable ESM modules
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
                   ` (5 preceding siblings ...)
  2020-02-14  9:18 ` [PATCHv2 6/7] board: ti: j721e: initialize ESM support Tero Kristo
@ 2020-02-14  9:18 ` Tero Kristo
  2020-02-23  8:14 ` [PATCHv2 0/7] ESM support for TI K3 SoCs Lokesh Vutla
  7 siblings, 0 replies; 10+ messages in thread
From: Tero Kristo @ 2020-02-14  9:18 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 configs/j721e_evm_r5_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/j721e_evm_r5_defconfig b/configs/j721e_evm_r5_defconfig
index 19fbd450c7..a28ea30372 100644
--- a/configs/j721e_evm_r5_defconfig
+++ b/configs/j721e_evm_r5_defconfig
@@ -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
-- 
2.17.1

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

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

* [PATCHv2 2/7] misc: k3_esm: Add support for Texas Instruments K3 ESM driver
  2020-02-14  9:18 ` [PATCHv2 2/7] misc: k3_esm: Add support for Texas Instruments K3 ESM driver Tero Kristo
@ 2020-02-14 15:08   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2020-02-14 15:08 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 14, 2020 at 11:18:15AM +0200, Tero Kristo wrote:

> 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.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  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
> 
> diff --git a/doc/device-tree-bindings/misc/esm-k3.txt b/doc/device-tree-bindings/misc/esm-k3.txt
> new file mode 100644
> index 0000000000..01c8b6b294
> --- /dev/null
> +++ b/doc/device-tree-bindings/misc/esm-k3.txt
> @@ -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>;
> +	};
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index f18aa8f7ba..38588b2cbd 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -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:
Reviewed-by: Tom Rini <trini@konsulko.com>

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

-- 
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>

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

* [PATCHv2 0/7] ESM support for TI K3 SoCs
  2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
                   ` (6 preceding siblings ...)
  2020-02-14  9:18 ` [PATCHv2 7/7] configs: j721e_evm_r5_defconfig: Enable ESM modules Tero Kristo
@ 2020-02-23  8:14 ` Lokesh Vutla
  7 siblings, 0 replies; 10+ messages in thread
From: Lokesh Vutla @ 2020-02-23  8:14 UTC (permalink / raw)
  To: u-boot



On 14/02/20 2:48 PM, Tero Kristo wrote:
> Hi,
> 
> V2 contains changes proposed by Lokesh.

Series applied to u-boot-ti next branch.

Thanks and regards,
Lokesh

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

end of thread, other threads:[~2020-02-23  8:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  9:18 [PATCHv2 0/7] ESM support for TI K3 SoCs Tero Kristo
2020-02-14  9:18 ` [PATCHv2 1/7] power: pmic: tps65941: Add support for probing the child devices Tero Kristo
2020-02-14  9:18 ` [PATCHv2 2/7] misc: k3_esm: Add support for Texas Instruments K3 ESM driver Tero Kristo
2020-02-14 15:08   ` Tom Rini
2020-02-14  9:18 ` [PATCHv2 3/7] misc: pmic_esm: Add support for PMIC " Tero Kristo
2020-02-14  9:18 ` [PATCHv2 4/7] arm: dts: k3-k721e: Add Main domain ESM support Tero Kristo
2020-02-14  9:18 ` [PATCHv2 5/7] arm: dts: k3-j721e: Add ESM PMIC support for tps659413 based board Tero Kristo
2020-02-14  9:18 ` [PATCHv2 6/7] board: ti: j721e: initialize ESM support Tero Kristo
2020-02-14  9:18 ` [PATCHv2 7/7] configs: j721e_evm_r5_defconfig: Enable ESM modules Tero Kristo
2020-02-23  8:14 ` [PATCHv2 0/7] ESM support for TI K3 SoCs Lokesh Vutla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.