diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2020-05-18 10:12:20 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-05-20 19:10:37 +0100 |
commit | f2ae97062a48b114bcf8fb2e99574d9ed2c2cd1b (patch) | |
tree | 15ae441ab539114219be045bc40663142f23cfe3 /drivers/firmware/smccc/smccc.c | |
parent | ad5a57dfe434b02ab28852703d7ad5510998ccef (diff) | |
download | lwn-f2ae97062a48b114bcf8fb2e99574d9ed2c2cd1b.tar.gz lwn-f2ae97062a48b114bcf8fb2e99574d9ed2c2cd1b.zip |
firmware: smccc: Refactor SMCCC specific bits into separate file
In order to add newer SMCCC v1.1+ functionality and to avoid cluttering
PSCI firmware driver with SMCCC bits, let us move the SMCCC specific
details under drivers/firmware/smccc/smccc.c
We can also drop conduit and smccc_version from psci_operations structure
as SMCCC was the sole user and now it maintains those.
No functionality change in this patch though.
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Etienne Carriere <etienne.carriere@st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@st.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20200518091222.27467-6-sudeep.holla@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/firmware/smccc/smccc.c')
-rw-r--r-- | drivers/firmware/smccc/smccc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c new file mode 100644 index 000000000000..de92a4b9f8f6 --- /dev/null +++ b/drivers/firmware/smccc/smccc.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2020 Arm Limited + */ + +#define pr_fmt(fmt) "smccc: " fmt + +#include <linux/init.h> +#include <linux/arm-smccc.h> + +static u32 smccc_version = ARM_SMCCC_VERSION_1_0; +static enum arm_smccc_conduit smccc_conduit = SMCCC_CONDUIT_NONE; + +void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit) +{ + smccc_version = version; + smccc_conduit = conduit; +} + +enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void) +{ + if (smccc_version < ARM_SMCCC_VERSION_1_1) + return SMCCC_CONDUIT_NONE; + + return smccc_conduit; +} |