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()
83 int arglen = desc->arginfo & 0xf; in scm_smc_call()
94 struct arm_smccc_args smc = {0}; in scm_smc_call() local
96 smc.args[0] = ARM_SMCCC_CALL_VAL( in scm_smc_call()
99 desc->owner, in scm_smc_call()
100 SCM_SMC_FNID(desc->svc, desc->cmd)); in scm_smc_call()
101 smc.args[1] = desc->arginfo; in scm_smc_call()
103 smc.args[i + SCM_SMC_FIRST_REG_IDX] = desc->args[i]; in scm_smc_call()
110 return -ENOMEM; in scm_smc_call()
116 args[i] = cpu_to_le32(desc->args[i + in scm_smc_call()
122 args[i] = cpu_to_le64(desc->args[i + in scm_smc_call()
131 return -ENOMEM; in scm_smc_call()
134 smc.args[SCM_SMC_LAST_REG_IDX] = args_phys; in scm_smc_call()
137 __scm_smc_do(&smc, &smc_res, atomic); in scm_smc_call()
145 res->result[0] = smc_res.a1; in scm_smc_call()
146 res->result[1] = smc_res.a2; in scm_smc_call()
147 res->result[2] = smc_res.a3; in scm_smc_call()