summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8/fsl-layerscape/mp.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2022-04-22 14:53:27 +0530
committerPriyanka Jain <priyanka.jain@nxp.com>2022-04-26 17:13:57 +0530
commitcb14cc8867cde068aa798375ba14eaef12cff6c4 (patch)
tree339fc073462d5613e23baffbbcd2aad186ef4d00 /arch/arm/cpu/armv8/fsl-layerscape/mp.c
parenteb217200efab6c400f96fb039474dcc840bb8404 (diff)
armv8: layerscape: get rid of smc_call()
There are two different implementations to do a secure monitor call: smc_call() and arm_smccc_smc(). The former is defined in fwcall.c and seems to be an ad-hoc implementation. The latter is imported from linux. smc_call() is also only available if CONFIG_ARMV8_PSCI is not defined. This makes it impossible to have both PSCI calls and PSCI implementation in one u-boot build. The layerscape SoC code decide at runtime via check_psci() if there is a PSCI support. Therefore, this is a prerequisite patch to add PSCI implementation support for the layerscape SoCs. Note, for the TFA part, this is only compile time tested with (ls1028ardb_tfa_defconfig). Signed-off-by: Michael Walle <michael@walle.cc> [Rebased] Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'arch/arm/cpu/armv8/fsl-layerscape/mp.c')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/mp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/mp.c b/arch/arm/cpu/armv8/fsl-layerscape/mp.c
index 2e2688eadca..72221191493 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/mp.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/mp.c
@@ -302,6 +302,7 @@ int cpu_release(u32 nr, int argc, char *const argv[])
u64 boot_addr;
u64 *table = get_spin_tbl_addr();
int pos;
+ int ret;
boot_addr = simple_strtoull(argv[0], NULL, 16);
@@ -326,16 +327,10 @@ int cpu_release(u32 nr, int argc, char *const argv[])
asm volatile("sev");
} else {
/* Use PSCI to kick the core */
- struct pt_regs regs;
-
printf("begin to kick cpu core #%d to address %llx\n",
nr, boot_addr);
- regs.regs[0] = PSCI_0_2_FN64_CPU_ON;
- regs.regs[1] = nr;
- regs.regs[2] = boot_addr;
- regs.regs[3] = 0;
- smc_call(&regs);
- if (regs.regs[0])
+ ret = invoke_psci_fn(PSCI_0_2_FN64_CPU_ON, nr, boot_addr, 0);
+ if (ret)
return -1;
}