Lines Matching +full:smc +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0-only
12 #include <linux/arm-smccc.h>
13 #include <linux/dma-mapping.h>
19 * @args: The array of values used in registers in smc instruction
31 #define SCM_SMC_FIRST_EXT_IDX (SCM_SMC_N_REG_ARGS - 1)
32 #define SCM_SMC_N_EXT_ARGS (MAX_QCOM_SCM_ARGS - SCM_SMC_N_REG_ARGS + 1)
34 #define SCM_SMC_LAST_REG_IDX (SCM_SMC_FIRST_REG_IDX + SCM_SMC_N_REG_ARGS - 1)
36 static void __scm_smc_do_quirk(const struct arm_smccc_args *smc, in __scm_smc_do_quirk() argument
39 unsigned long a0 = smc->args[0]; in __scm_smc_do_quirk()
40 struct arm_smccc_quirk quirk = { .id = ARM_SMCCC_QUIRK_QCOM_A6 }; in __scm_smc_do_quirk()
45 arm_smccc_smc_quirk(a0, smc->args[1], smc->args[2], in __scm_smc_do_quirk()
46 smc->args[3], smc->args[4], smc->args[5], in __scm_smc_do_quirk()
47 quirk.state.a6, smc->args[7], res, &quirk); in __scm_smc_do_quirk()
49 if (res->a0 == QCOM_SCM_INTERRUPTED) in __scm_smc_do_quirk()
50 a0 = res->a0; in __scm_smc_do_quirk()
52 } while (res->a0 == QCOM_SCM_INTERRUPTED); in __scm_smc_do_quirk()
55 static void __scm_smc_do(const struct arm_smccc_args *smc, in __scm_smc_do() argument
61 __scm_smc_do_quirk(smc, res); in __scm_smc_do()
68 __scm_smc_do_quirk(smc, res); in __scm_smc_do()
72 if (res->a0 == QCOM_SCM_V2_EBUSY) { in __scm_smc_do()
77 } while (res->a0 == QCOM_SCM_V2_EBUSY); in __scm_smc_do()
85 int arglen = desc->arginfo & 0xf; in __scm_smc_call()
95 struct arm_smccc_args smc = {0}; in __scm_smc_call() local
97 smc.args[0] = ARM_SMCCC_CALL_VAL( in __scm_smc_call()
100 desc->owner, in __scm_smc_call()
101 SCM_SMC_FNID(desc->svc, desc->cmd)); in __scm_smc_call()
102 smc.args[1] = desc->arginfo; in __scm_smc_call()
104 smc.args[i + SCM_SMC_FIRST_REG_IDX] = desc->args[i]; in __scm_smc_call()
111 return -ENOMEM; in __scm_smc_call()
117 args[i] = cpu_to_le32(desc->args[i + in __scm_smc_call()
123 args[i] = cpu_to_le64(desc->args[i + in __scm_smc_call()
132 return -ENOMEM; in __scm_smc_call()
135 smc.args[SCM_SMC_LAST_REG_IDX] = args_phys; in __scm_smc_call()
138 __scm_smc_do(&smc, &smc_res, atomic); in __scm_smc_call()
146 res->result[0] = smc_res.a1; in __scm_smc_call()
147 res->result[1] = smc_res.a2; in __scm_smc_call()
148 res->result[2] = smc_res.a3; in __scm_smc_call()