From fdcfd76ee4fec9d348f29320ad413099b5fe1b6d Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 5 Nov 2022 13:11:54 +0100 Subject: ARM: psci: client: don't hardcode method smc in fixup When barebox is booted as QEMU -kernel, PSCI will have method = "hvc", because QEMU will act as Hypervisor. barebox handles this correctly and will use hvc instead of smc, but of_psci_fixup() always fixes up method = "smc" thereby breaking kernel boot. Fix this by forwarding the method read from barebox DT into the kernel DT. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20221105121154.3716964-2-ahmad@a3f.at Signed-off-by: Sascha Hauer --- arch/arm/cpu/psci-client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/psci-client.c b/arch/arm/cpu/psci-client.c index 613280ad3f..f9b1c684bf 100644 --- a/arch/arm/cpu/psci-client.c +++ b/arch/arm/cpu/psci-client.c @@ -108,9 +108,9 @@ static u32 invoke_psci_fn_smc(ulong function, ulong arg0, ulong arg1, ulong arg2 return res.a0; } -static int of_psci_do_fixup(struct device_node *root, void *context) +static int of_psci_do_fixup(struct device_node *root, void *method) { - return of_psci_fixup(root, *(u32 *)context, "smc"); + return of_psci_fixup(root, version, (const void *)method); } static int __init psci_probe(struct device_d *dev) @@ -156,7 +156,7 @@ static int __init psci_probe(struct device_d *dev) version >> 16, version & 0xffff); if (actual_version != of_version) - of_register_fixup(of_psci_do_fixup, &version); + of_register_fixup(of_psci_do_fixup, (void *)method); ret = poweroff_handler_register_fn(psci_poweroff); if (ret) -- cgit v1.2.3