arm64: implement arch_system_halt

When PSCI is enabled, implement `arch_system_halt` using
PSCI_SHUTDOWN.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
This commit is contained in:
Henri Xavier 2022-11-22 10:08:07 +01:00 committed by Carles Cufí
commit b54ba9877f
3 changed files with 42 additions and 1 deletions

View file

@ -66,6 +66,20 @@ int pm_cpu_on(unsigned long cpuid,
return psci_to_dev_err(ret);
}
int pm_system_off(void)
{
int ret;
if (psci_data.conduit == SMCCC_CONDUIT_NONE) {
return -EINVAL;
}
/* A compliant PSCI implementation will never return from this call */
ret = psci_data.invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
return psci_to_dev_err(ret);
}
static unsigned long __invoke_psci_fn_hvc(unsigned long function_id,
unsigned long arg0,
unsigned long arg1,