From patchwork Thu Jun 18 11:54:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 242592 List-Id: U-Boot discussion From: jonathanh at nvidia.com (Jon Hunter) Date: Thu, 18 Jun 2020 12:54:38 +0100 Subject: [PATCH 1/2] firmware: PSCI: Fix PSCI support for OF live trees Message-ID: <20200618115439.25100-1-jonathanh@nvidia.com> When CONFIG_OF_LIVE is enabled, dev_of_offset() cannot be used and if used returns an invalid offset. This causes the call to fdt_stringlist_get() in the psci_probe() to fail to read the 'method' property from the PSCI node for the device and hence prevents PSCI from working. Fix this by using the ofnode_read_string() API instead of the fdt_stringlist_get() because this will handle reading the property both when CONFIG_OF_LIVE is enabled or disabled. Due to the above problem and since commit 81ea00838c68 ("efi_loader: PSCI reset and shutdown") was added, the EFI system reset has been broken for Tegra210 and Tegra196 platforms. This also fixes the EFI system reset for these Tegra platforms. Signed-off-by: Jon Hunter Tested-by: Peter Robinson --- drivers/firmware/psci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index e0d66d74f54d..23cf807591c4 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -67,11 +67,9 @@ static int psci_bind(struct udevice *dev) static int psci_probe(struct udevice *dev) { - DECLARE_GLOBAL_DATA_PTR; const char *method; - method = fdt_stringlist_get(gd->fdt_blob, dev_of_offset(dev), "method", - 0, NULL); + method = ofnode_read_string(dev_ofnode(dev), "method"); if (!method) { pr_warn("missing \"method\" property\n"); return -ENXIO; From patchwork Thu Jun 18 11:54:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 242593 List-Id: U-Boot discussion From: jonathanh at nvidia.com (Jon Hunter) Date: Thu, 18 Jun 2020 12:54:39 +0100 Subject: [PATCH 2/2] ARM: tegra: Enable PSCI support for Tegra210 and Tegra186 In-Reply-To: <20200618115439.25100-1-jonathanh@nvidia.com> References: <20200618115439.25100-1-jonathanh@nvidia.com> Message-ID: <20200618115439.25100-2-jonathanh@nvidia.com> The PSCI nodes are currently not populated for the Tegra210 and Tegra186 devices. This prevents the PSCI driver from being able to identify the PSCI method used by these devices and causes the probe of the PSCI driver to fail. Since commit 81ea00838c68 ("efi_loader: PSCI reset and shutdown") was added, which moves the PSCI EFI system reset handler into the PSCI driver, this has prevented the EFI system reset from working for Tegra210 and Tegra186. Therefore, populating these nodes is necessary to fix the EFI system reset for Tegra210 and Tegra186. Signed-off-by: Jon Hunter Tested-by: Peter Robinson --- arch/arm/dts/tegra186.dtsi | 5 +++++ arch/arm/dts/tegra210.dtsi | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/dts/tegra186.dtsi b/arch/arm/dts/tegra186.dtsi index 0a9db9825b85..edcb7aacb8ee 100644 --- a/arch/arm/dts/tegra186.dtsi +++ b/arch/arm/dts/tegra186.dtsi @@ -335,4 +335,9 @@ status = "disabled"; }; }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; }; diff --git a/arch/arm/dts/tegra210.dtsi b/arch/arm/dts/tegra210.dtsi index 3ec54b11c43f..a521a43d6cfd 100644 --- a/arch/arm/dts/tegra210.dtsi +++ b/arch/arm/dts/tegra210.dtsi @@ -867,6 +867,11 @@ }; }; + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + timer { compatible = "arm,armv8-timer"; interrupts =