[PATCH 0/3] Fix 'reset' for TI K3 AM64x and J721E/J7200 boards

Hi Lokesh,
The following patches fix the 'reset' command functionality for various TI K3 SoCs. Patches are based on the latest master that includes the AM64x board support, commit ea184cbff99e ("Merge tag 'ti-v2021.07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-ti").
The first patch is needed for J721E/J7200 SoCs with newer System Firmwares (anything newer that 2020.04 SYSFW) and is backward compatible. Without this, the 'reset' command throws the following warnings, => reset resetting ... ti-sci-sysreset sysreset-controller: ti_sci_sysreset_request: reboot_device failed (-19) ti-sci-sysreset sysreset-controller: ti_sci_sysreset_request: reboot_device failed (-19) ti-sci-sysreset sysreset-controller: ti_sci_sysreset_request: reboot_device failed (-19) System reset not supported on this platform ### ERROR ### Please RESET the board ###
The second and third patches add the required ti-sci sysreset nodes for the AM64x EVM and SK boards respectively. The required SYSRESET and SYSRESET_TI_SCI configs are already enabled in the am64x_evm_a53_defconfig.
regards Suman
Dave Gerlach (1): firmware: ti_sci: Update ti_sci_msg_req_reboot to include domain
Suman Anna (2): arm: dts: k3-am642-evm: Add sysreset controller node arm: dts: k3-am642-sk: Add sysreset controller node
arch/arm/dts/k3-am642-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/k3-am642-sk-u-boot.dtsi | 4 ++++ drivers/firmware/ti_sci.c | 1 + drivers/firmware/ti_sci.h | 2 ++ 4 files changed, 11 insertions(+)

From: Dave Gerlach d-gerlach@ti.com
The ti_sci_msg_req_reboot message payload has been extended to include a domain field, but for the purposes of u-boot this should be zero to reset the entire SoC as it did before. Include domain for completeness and set to zero to ensure proper operation.
Signed-off-by: Dave Gerlach d-gerlach@ti.com Signed-off-by: Suman Anna s-anna@ti.com --- drivers/firmware/ti_sci.c | 1 + drivers/firmware/ti_sci.h | 2 ++ 2 files changed, 3 insertions(+)
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 2aec2e34d303..4671a5e3a8a6 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -1588,6 +1588,7 @@ static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle) dev_err(info->dev, "Message alloc failed(%d)\n", ret); return ret; } + req.domain = 0;
ret = ti_sci_do_xfer(info, xfer); if (ret) { diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h index eec488f06509..e4a087c2baf4 100644 --- a/drivers/firmware/ti_sci.h +++ b/drivers/firmware/ti_sci.h @@ -137,12 +137,14 @@ struct ti_sci_msg_resp_version { /** * struct ti_sci_msg_req_reboot - Reboot the SoC * @hdr: Generic Header + * @domain: Domain to be reset, 0 for full SoC reboot. * * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic * ACK/NACK message. */ struct ti_sci_msg_req_reboot { struct ti_sci_msg_hdr hdr; + u8 domain; } __packed;
/**

The AM64x SoC uses a central Device Management and Security Controller (DMSC) processor that manages all the low-level device controls including the system-wide SoC reset. The system-wide reset is managed through the system reset driver.
Add a sysreset controller node as a child of the dmsc node to enable the "reset" command from U-Boot prompt for the K3 AM642 EVM.
Signed-off-by: Suman Anna s-anna@ti.com --- arch/arm/dts/k3-am642-evm-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi index 9b0ba6b721b3..10dea7a1cc46 100644 --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi @@ -60,6 +60,10 @@
&dmsc { u-boot,dm-spl; + k3_sysreset: sysreset-controller { + compatible = "ti,sci-sysreset"; + u-boot,dm-spl; + }; };
&k3_pds {

The AM64x SoC uses a central Device Management and Security Controller (DMSC) processor that manages all the low-level device controls including the system-wide SoC reset. The system-wide reset is managed through the system reset driver.
Add a sysreset controller node as a child of the dmsc node to enable the "reset" command from U-Boot prompt for the K3 AM642 SK.
Signed-off-by: Suman Anna s-anna@ti.com --- arch/arm/dts/k3-am642-sk-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index 4ac7f5db9135..35b49df85106 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -60,6 +60,10 @@
&dmsc { u-boot,dm-spl; + k3_sysreset: sysreset-controller { + compatible = "ti,sci-sysreset"; + u-boot,dm-spl; + }; };
&k3_pds {

On Thu, 13 May 2021 20:10:54 -0500, Suman Anna wrote:
The following patches fix the 'reset' command functionality for various TI K3 SoCs. Patches are based on the latest master that includes the AM64x board support, commit ea184cbff99e ("Merge tag 'ti-v2021.07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-ti").
The first patch is needed for J721E/J7200 SoCs with newer System Firmwares (anything newer that 2020.04 SYSFW) and is backward compatible. Without this, the 'reset' command throws the following warnings, => reset resetting ... ti-sci-sysreset sysreset-controller: ti_sci_sysreset_request: reboot_device failed (-19) ti-sci-sysreset sysreset-controller: ti_sci_sysreset_request: reboot_device failed (-19) ti-sci-sysreset sysreset-controller: ti_sci_sysreset_request: reboot_device failed (-19) System reset not supported on this platform ### ERROR ### Please RESET the board ###
[...]
Applied to https://source.denx.de/u-boot/custodians/u-boot-ti.git for-rc, thanks! [1/3] firmware: ti_sci: Update ti_sci_msg_req_reboot to include domain https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/beed30583c [2/3] arm: dts: k3-am642-evm: Add sysreset controller node https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/a97ee92e4a [3/3] arm: dts: k3-am642-sk: Add sysreset controller node https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/7194a95d13
-- Thanks and Regards, Lokesh
participants (2)
-
Lokesh Vutla
-
Suman Anna