1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2021 ARM Ltd.
6 #include <linux/printk.h>
10 static void __arm_ffa_fn_smc(ffa_value_t args
, ffa_value_t
*res
)
12 arm_smccc_1_2_smc(&args
, res
);
15 static void __arm_ffa_fn_hvc(ffa_value_t args
, ffa_value_t
*res
)
17 arm_smccc_1_2_hvc(&args
, res
);
20 int __init
ffa_transport_init(ffa_fn
**invoke_ffa_fn
)
22 enum arm_smccc_conduit conduit
;
24 if (arm_smccc_get_version() < ARM_SMCCC_VERSION_1_2
)
27 conduit
= arm_smccc_1_1_get_conduit();
28 if (conduit
== SMCCC_CONDUIT_NONE
) {
29 pr_err("%s: invalid SMCCC conduit\n", __func__
);
33 if (conduit
== SMCCC_CONDUIT_SMC
)
34 *invoke_ffa_fn
= __arm_ffa_fn_smc
;
36 *invoke_ffa_fn
= __arm_ffa_fn_hvc
;