mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 10/10] ARM: Layerscape: LS1028a: fixup psci node
Date: Tue,  9 Jan 2024 10:16:03 +0100	[thread overview]
Message-ID: <20240109091603.235589-11-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240109091603.235589-1-s.hauer@pengutronix.de>

The upstream LS1028a dtsi files do not have a psci node, so add one
in a fixup. This is necessary to bring up the secondary CPU core.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-layerscape/Kconfig |  1 +
 arch/arm/mach-layerscape/soc.c   | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/mach-layerscape/Kconfig b/arch/arm/mach-layerscape/Kconfig
index 5658a63b33..97f2061eee 100644
--- a/arch/arm/mach-layerscape/Kconfig
+++ b/arch/arm/mach-layerscape/Kconfig
@@ -20,6 +20,7 @@ config ARCH_LS1028
 	select SYS_SUPPORTS_64BIT_KERNEL
 	select ARM_ATF
 	select FIRMWARE_LS1028A_ATF
+	select ARM_PSCI_OF
 
 config ARCH_LS1046
 	bool
diff --git a/arch/arm/mach-layerscape/soc.c b/arch/arm/mach-layerscape/soc.c
index 70c1dedb46..30fbb5d1bf 100644
--- a/arch/arm/mach-layerscape/soc.c
+++ b/arch/arm/mach-layerscape/soc.c
@@ -3,7 +3,9 @@
 #include <io.h>
 #include <init.h>
 #include <memory.h>
+#include <linux/arm-smccc.h>
 #include <linux/bug.h>
+#include <asm/psci.h>
 #include <mach/layerscape/layerscape.h>
 #include <of.h>
 
@@ -84,6 +86,19 @@ static int ls1021a_init(void)
 	return 0;
 }
 
+static int ls1028a_psci_fixup(struct device_node *root, void *unused)
+{
+	unsigned long psci_version;
+	struct arm_smccc_res res = {};
+
+	arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
+	psci_version = res.a0;
+
+	of_psci_fixup(root, psci_version, "smc");
+
+	return 0;
+}
+
 static int ls1028a_init(void)
 {
 	if (!IS_ENABLED(CONFIG_ARCH_LS1028))
@@ -91,6 +106,7 @@ static int ls1028a_init(void)
 
 	layerscape_register_pbl_image_handler();
 	ls1028a_setup_icids();
+	of_register_fixup(ls1028a_psci_fixup, NULL);
 
 	reserve_sdram_region("tfa", LS1028A_TFA_RESERVED_START, LS1028A_TFA_RESERVED_SIZE);
 
-- 
2.39.2




  parent reply	other threads:[~2024-01-09  9:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09  9:15 [PATCH 00/10] Add more Layerscape LS1028a stuff Sascha Hauer
2024-01-09  9:15 ` [PATCH 01/10] ARM: Layerscape: consolidate initcalls into one Sascha Hauer
2024-01-09  9:15 ` [PATCH 02/10] ARM: Layerscape: LS1028a: reserve DDR region for TF-A Sascha Hauer
2024-01-09  9:37   ` Ahmad Fatoum
2024-01-09 10:25     ` Sascha Hauer
2024-01-09  9:15 ` [PATCH 03/10] ARM: Layerscape: icid: make readonly arrays const Sascha Hauer
2024-01-09  9:15 ` [PATCH 04/10] ARM: Layerscape: icid: rename functions Sascha Hauer
2024-01-09  9:15 ` [PATCH 05/10] ARM: Layerscape: icid: move re-usable code to separate functions Sascha Hauer
2024-01-09  9:34   ` Ahmad Fatoum
2024-01-09  9:15 ` [PATCH 06/10] ARM: Layerscape: icids: factor out setup_icid_offsets() Sascha Hauer
2024-01-09  9:16 ` [PATCH 07/10] immap_lsch3: Add more stuff Sascha Hauer
2024-01-09  9:16 ` [PATCH 08/10] ARM: Layerscape: LS1028a: fixup icids Sascha Hauer
2024-01-09  9:28   ` Ahmad Fatoum
2024-01-09  9:16 ` [PATCH 09/10] ARM: psci: make header self contained Sascha Hauer
2024-01-09  9:27   ` Ahmad Fatoum
2024-01-09  9:16 ` Sascha Hauer [this message]
2024-01-09  9:26   ` [PATCH 10/10] ARM: Layerscape: LS1028a: fixup psci node Ahmad Fatoum
2024-01-09  9:37     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240109091603.235589-11-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox