aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2018-06-13 12:33:47 +0000
committerAndrew Turner <andrew@FreeBSD.org>2018-06-13 12:33:47 +0000
commit5add83935a135f802f0a047281757ad13eef0be5 (patch)
treecfca986b371e0205933770da4ac82e01740974a4 /sys/dev
parent4493861b9a5962b39240082971438184cc00733d (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/psci/psci.c14
-rw-r--r--sys/dev/psci/psci.h7
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c
index b02ce11add08..bec5f9e8b7f1 100644
--- a/sys/dev/psci/psci.c
+++ b/sys/dev/psci/psci.c
@@ -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)
{
diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h
index b24154ba4a97..d636c3fcd978 100644
--- a/sys/dev/psci/psci.h
+++ b/sys/dev/psci/psci.h
@@ -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.