From e80884e89ed30c7543320c27f300d2efaf43a9c8 Mon Sep 17 00:00:00 2001 From: Sudeep Holla Date: Mon, 18 May 2020 10:12:19 +0100 Subject: [PATCH] BACKPORT: firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead Instead of maintaining 2 sets of enums/macros for tracking SMCCC version, let us drop smccc_version enum and use ARM_SMCCC_VERSION_1_x directly instead. This is in preparation to drop smccc_version here and move it separately under drivers/firmware/smccc. Signed-off-by: Sudeep Holla Tested-by: Etienne Carriere Reviewed-by: Steven Price Reviewed-by: Etienne Carriere Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20200518091222.27467-5-sudeep.holla@arm.com Signed-off-by: Will Deacon (cherry picked from commit ad5a57dfe434b02ab28852703d7ad5510998ccef) Change-Id: I8b3625d3adbaea003c1dadcbc028c62a2f4f59ba Signed-off-by: XiaoDong Huang --- drivers/firmware/psci.c | 8 ++++---- include/linux/psci.h | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index d855c20de663..4ed756bf80f6 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -61,12 +61,12 @@ bool psci_tos_resident_on(int cpu) struct psci_operations psci_ops = { .conduit = PSCI_CONDUIT_NONE, - .smccc_version = SMCCC_VERSION_1_0, + .smccc_version = ARM_SMCCC_VERSION_1_0, }; enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void) { - if (psci_ops.smccc_version < SMCCC_VERSION_1_1) + if (psci_ops.smccc_version < ARM_SMCCC_VERSION_1_1) return SMCCC_CONDUIT_NONE; switch (psci_ops.conduit) { @@ -537,8 +537,8 @@ static void __init psci_init_smccc(void) if (feature != PSCI_RET_NOT_SUPPORTED) { u32 ret; ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0); - if (ret == ARM_SMCCC_VERSION_1_1) { - psci_ops.smccc_version = SMCCC_VERSION_1_1; + if (ret >= ARM_SMCCC_VERSION_1_1) { + psci_ops.smccc_version = ret; ver = ret; } } diff --git a/include/linux/psci.h b/include/linux/psci.h index 8b1b3b5935ab..c550f1fe5087 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -31,11 +31,6 @@ enum psci_conduit { PSCI_CONDUIT_HVC, }; -enum smccc_version { - SMCCC_VERSION_1_0, - SMCCC_VERSION_1_1, -}; - struct psci_operations { u32 (*get_version)(void); int (*cpu_suspend)(u32 state, unsigned long entry_point); @@ -46,7 +41,7 @@ struct psci_operations { unsigned long lowest_affinity_level); int (*migrate_info_type)(void); enum psci_conduit conduit; - enum smccc_version smccc_version; + u32 smccc_version; }; extern struct psci_operations psci_ops;