uboot-tools/firmware-PSCI-Fix-PSCI-supp...

301 lines
14 KiB
Diff

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 <jonathanh@nvidia.com>
X-Patchwork-Id: 1312024
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de
(client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;
envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dmarc=pass (p=none dis=none) header.from=nvidia.com
Authentication-Results: ozlabs.org; dkim=pass (2048-bit key;
unprotected) header.d=nvidia.com header.i=@nvidia.com header.a=rsa-sha256
header.s=n1 header.b=MEPdTgP3; dkim-atps=neutral
Received: from phobos.denx.de (phobos.denx.de
[IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
SHA256) (No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 49ngNv025pz9sRh
for <incoming@patchwork.ozlabs.org>; Thu, 18 Jun 2020 21:55:26 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id E19DD82081;
Thu, 18 Jun 2020 13:55:17 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=nvidia.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key;
unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="MEPdTgP3";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 19DC182082; Thu, 18 Jun 2020 13:55:16 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED
autolearn=ham autolearn_force=no version=3.4.2
Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com
[216.228.121.64])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 644B8814A4
for <u-boot@lists.denx.de>; Thu, 18 Jun 2020 13:54:59 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=nvidia.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=jonathanh@nvidia.com
Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by
hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA)
id <B5eeb55dd0002>; Thu, 18 Jun 2020 04:54:05 -0700
Received: from hqmail.nvidia.com ([172.20.161.6])
by hqpgpgate102.nvidia.com (PGP Universal service);
Thu, 18 Jun 2020 04:54:55 -0700
X-PGP-Universal: processed;
by hqpgpgate102.nvidia.com on Thu, 18 Jun 2020 04:54:55 -0700
Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL109.nvidia.com
(172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 18 Jun
2020 11:54:55 +0000
Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL111.nvidia.com
(172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via
Frontend Transport; Thu, 18 Jun 2020 11:54:55 +0000
Received: from moonraker.nvidia.com (Not Verified[10.26.72.215]) by
rnnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121)
id <B5eeb560c0003>; Thu, 18 Jun 2020 04:54:54 -0700
From: Jon Hunter <jonathanh@nvidia.com>
To: Tom Rini <trini@konsulko.com>, Tom Warren <twarren@nvidia.com>
CC: Stephen Warren <swarren@nvidia.com>, Thierry Reding <treding@nvidia.com>,
Peter Robinson <pbrobinson@redhat.com>, Heinrich Schuchardt
<xypron.glpk@gmx.de>, <u-boot@lists.denx.de>, Jon Hunter
<jonathanh@nvidia.com>
Subject: [PATCH 1/2] firmware: PSCI: Fix PSCI support for OF live trees
Date: Thu, 18 Jun 2020 12:54:38 +0100
Message-ID: <20200618115439.25100-1-jonathanh@nvidia.com>
X-Mailer: git-send-email 2.17.1
X-NVConfidentiality: public
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1;
t=1592481246; bh=06Kdq266LOYz5R2QyKOopddySBarFsUxH3Li+Ufuk5Y=;
h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer:
X-NVConfidentiality:MIME-Version:Content-Type;
b=MEPdTgP3WAds3UTss1m+sIgLur+SEpPr3iBvVPk7Wh5dOizB3FW23fLfVKyqL5OtQ
gbz3WbWd7HmOEpFYdplLfUVxmxJtfrIZwvgPWj2TqEJIedeVl14ELovHD9R9Y30dkJ
FmnUv8e34oxjz2kEeEgg+T9FEo6YAt/4Jix7q76AWZMkTCDfhykFtlVztztYg9fcju
n1QlBQR2AxHQXG1v54hiTbSNoAGS0VsOdK/QQgGI1uY7YHgNOY2j8vb+VyUqF/Ku0Z
eIbJ8SO/BsNbTjMaTOJcPRRc3LO/RgLPa1p4jNoo9Iqa/q06UxdxmgIHIE1DEpr8bQ
Q2QxwRplMIT3A==
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.30rc1
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de
X-Virus-Status: Clean
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 <jonathanh@nvidia.com>
---
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 <jonathanh@nvidia.com>
X-Patchwork-Id: 1312025
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de
(client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;
envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dmarc=pass (p=none dis=none) header.from=nvidia.com
Authentication-Results: ozlabs.org; dkim=pass (2048-bit key;
unprotected) header.d=nvidia.com header.i=@nvidia.com header.a=rsa-sha256
header.s=n1 header.b=iOzXdHGE; dkim-atps=neutral
Received: from phobos.denx.de (phobos.denx.de
[IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 49ngPK6PTdz9sRh
for <incoming@patchwork.ozlabs.org>; Thu, 18 Jun 2020 21:55:49 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 4ED3B82087;
Thu, 18 Jun 2020 13:55:24 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=nvidia.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key;
unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="iOzXdHGE";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 608F382087; Thu, 18 Jun 2020 13:55:20 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED
autolearn=ham autolearn_force=no version=3.4.2
Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com
[216.228.121.143])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 2339582033
for <u-boot@lists.denx.de>; Thu, 18 Jun 2020 13:55:05 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=nvidia.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=jonathanh@nvidia.com
Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by
hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA)
id <B5eeb55b10001>; Thu, 18 Jun 2020 04:53:21 -0700
Received: from hqmail.nvidia.com ([172.20.161.6])
by hqpgpgate101.nvidia.com (PGP Universal service);
Thu, 18 Jun 2020 04:55:01 -0700
X-PGP-Universal: processed;
by hqpgpgate101.nvidia.com on Thu, 18 Jun 2020 04:55:01 -0700
Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL105.nvidia.com
(172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 18 Jun
2020 11:55:01 +0000
Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL101.nvidia.com
(172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via
Frontend Transport; Thu, 18 Jun 2020 11:55:00 +0000
Received: from moonraker.nvidia.com (Not Verified[10.26.72.215]) by
rnnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121)
id <B5eeb56120003>; Thu, 18 Jun 2020 04:55:00 -0700
From: Jon Hunter <jonathanh@nvidia.com>
To: Tom Rini <trini@konsulko.com>, Tom Warren <twarren@nvidia.com>
CC: Stephen Warren <swarren@nvidia.com>, Thierry Reding <treding@nvidia.com>,
Peter Robinson <pbrobinson@redhat.com>, Heinrich Schuchardt
<xypron.glpk@gmx.de>, <u-boot@lists.denx.de>, Jon Hunter
<jonathanh@nvidia.com>
Subject: [PATCH 2/2] ARM: tegra: Enable PSCI support for Tegra210 and Tegra186
Date: Thu, 18 Jun 2020 12:54:39 +0100
Message-ID: <20200618115439.25100-2-jonathanh@nvidia.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20200618115439.25100-1-jonathanh@nvidia.com>
References: <20200618115439.25100-1-jonathanh@nvidia.com>
X-NVConfidentiality: public
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1;
t=1592481201; bh=uzSllbcYKOPJL8iHAIEIHwlWoILnHTezp4ATOVF+JV4=;
h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer:
In-Reply-To:References:X-NVConfidentiality:MIME-Version:
Content-Type;
b=iOzXdHGEdfeZIQXU+bHDE71+zTfyxL6xY1NHC1MlY5528MLezwOTCe7Tsw+SrrAvT
80Kw7i+HTbIPGfj62pR8l7l6nVm/8F+MpOQtmUWMHirZcR2TSnrBowB+ncNGHZ/iFK
M8BYf+2e3sDEEhBFl5oNo61viGaXxViz5PwKQuy57dhKNlPJZTBfeSbSfNVyp3Y/81
W0rcx4KuPtwQeKboaC6MSmpxipJ9hzESYwUXUin9kyqzs6m4qjTTrxymcPPAbckh+E
XKd+VJ/uSFayMJOutamX0tvAqPoFtm4x6zcbmzn3ZZUA1AMCZOmF5Vqqoo32wRk+eX
tFZhwM0IryDkg==
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.30rc1
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de
X-Virus-Status: Clean
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 <jonathanh@nvidia.com>
---
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 = <GIC_PPI 13