Add a handler for the PSCI_FEATURES function. This needs PSCI 1.0, so

check for this, returning an error if the version is too old.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Andrew Turner 2018-06-13 12:33:47 +00:00
parent 4493861b9a
commit 5add83935a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335056
2 changed files with 19 additions and 2 deletions

View File

@ -414,6 +414,20 @@ psci_find_callfn(psci_callfn_t *callfn)
return (PSCI_RETVAL_SUCCESS);
}
int32_t
psci_features(uint32_t psci_func_id)
{
if (psci_softc == NULL)
return (PSCI_RETVAL_NOT_SUPPORTED);
/* The feature flags were added to PSCI 1.0 */
if (PSCI_VER_MAJOR(psci_softc->psci_version) < 1)
return (PSCI_RETVAL_NOT_SUPPORTED);
return (psci_call(PSCI_FNID_FEATURES, psci_func_id, 0, 0));
}
int
psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id)
{

View File

@ -36,12 +36,15 @@ typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t);
extern int psci_present;
void psci_reset(void);
int psci_cpu_on(unsigned long, unsigned long, unsigned long);
void psci_reset(void);
int32_t psci_features(uint32_t);
int psci_get_version(void);
/* One of these handlers will be selected during the boot */
int psci_hvc_despatch(register_t, register_t, register_t, register_t);
int psci_smc_despatch(register_t, register_t, register_t, register_t);
int psci_get_version(void);
/*
* PSCI return codes.