summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2024-08-20 15:27:56 +0100
committerSudeep Holla <sudeep.holla@arm.com>2024-08-20 15:40:44 +0100
commitd37fff98262ddca6b6ef3b63f378136c04067c64 (patch)
tree83b5dbfe665b2c567c87514cba1ecc53ef514003
parent7c432a18ad216b4f7b08e93287586d60e12a3b7b (diff)
downloadlwn-d37fff98262ddca6b6ef3b63f378136c04067c64.tar.gz
lwn-d37fff98262ddca6b6ef3b63f378136c04067c64.zip
firmware: arm_ffa: Move the function ffa_features() earlier
We need to use ffa_features() in ffa_partition_probe() to detect if the newer FFA_PARTITION_INFO_GET_REGS API is supported in the platform or not. To avoid unnecessary forward declaration within the file, let us just move this ffa_features() earlier. No funtional change. Message-Id: <20240820-ffa_v1-2-v2-3-18c0c5f3c65e@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r--drivers/firmware/arm_ffa/driver.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index be77e03578cc..91681933ece9 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -212,6 +212,32 @@ static int ffa_rxtx_unmap(u16 vm_id)
return 0;
}
+static int ffa_features(u32 func_feat_id, u32 input_props,
+ u32 *if_props_1, u32 *if_props_2)
+{
+ ffa_value_t id;
+
+ if (!ARM_SMCCC_IS_FAST_CALL(func_feat_id) && input_props) {
+ pr_err("%s: Invalid Parameters: %x, %x", __func__,
+ func_feat_id, input_props);
+ return ffa_to_linux_errno(FFA_RET_INVALID_PARAMETERS);
+ }
+
+ invoke_ffa_fn((ffa_value_t){
+ .a0 = FFA_FEATURES, .a1 = func_feat_id, .a2 = input_props,
+ }, &id);
+
+ if (id.a0 == FFA_ERROR)
+ return ffa_to_linux_errno((int)id.a2);
+
+ if (if_props_1)
+ *if_props_1 = id.a2;
+ if (if_props_2)
+ *if_props_2 = id.a3;
+
+ return 0;
+}
+
#define PARTITION_INFO_GET_RETURN_COUNT_ONLY BIT(0)
/* buffer must be sizeof(struct ffa_partition_info) * num_partitions */
@@ -598,32 +624,6 @@ static int ffa_memory_reclaim(u64 g_handle, u32 flags)
return 0;
}
-static int ffa_features(u32 func_feat_id, u32 input_props,
- u32 *if_props_1, u32 *if_props_2)
-{
- ffa_value_t id;
-
- if (!ARM_SMCCC_IS_FAST_CALL(func_feat_id) && input_props) {
- pr_err("%s: Invalid Parameters: %x, %x", __func__,
- func_feat_id, input_props);
- return ffa_to_linux_errno(FFA_RET_INVALID_PARAMETERS);
- }
-
- invoke_ffa_fn((ffa_value_t){
- .a0 = FFA_FEATURES, .a1 = func_feat_id, .a2 = input_props,
- }, &id);
-
- if (id.a0 == FFA_ERROR)
- return ffa_to_linux_errno((int)id.a2);
-
- if (if_props_1)
- *if_props_1 = id.a2;
- if (if_props_2)
- *if_props_2 = id.a3;
-
- return 0;
-}
-
static int ffa_notification_bitmap_create(void)
{
ffa_value_t ret;