Add a function to find the PSCI version the firmware implements from

outside the PSCI driver.

MFC after:	1 week
Sponsored by:	DARPA, AFRL
This commit is contained in:
Andrew Turner 2018-01-09 15:57:09 +00:00
parent 4bb409fb8d
commit 8ab09f8a4e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327728
2 changed files with 12 additions and 2 deletions

View File

@ -314,7 +314,7 @@ psci_attach(device_t dev, psci_initfn_t psci_init)
}
static int
psci_get_version(struct psci_softc *sc)
_psci_get_version(struct psci_softc *sc)
{
uint32_t fnid;
@ -326,6 +326,15 @@ psci_get_version(struct psci_softc *sc)
return (PSCI_RETVAL_NOT_SUPPORTED);
}
int
psci_get_version(void)
{
if (psci_softc == NULL)
return (PSCI_RETVAL_NOT_SUPPORTED);
return (_psci_get_version(psci_softc));
}
#ifdef FDT
static int
psci_fdt_callfn(psci_callfn_t *callfn)
@ -487,7 +496,7 @@ psci_v0_2_init(device_t dev)
sc->psci_fnids[PSCI_FN_SYSTEM_OFF] = PSCI_FNID_SYSTEM_OFF;
sc->psci_fnids[PSCI_FN_SYSTEM_RESET] = PSCI_FNID_SYSTEM_RESET;
version = psci_get_version(sc);
version = _psci_get_version(sc);
if (version == PSCI_RETVAL_NOT_SUPPORTED)
return (1);

View File

@ -41,6 +41,7 @@ int psci_cpu_on(unsigned long, unsigned long, unsigned long);
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.