summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_ffa
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2023-10-05 15:45:09 +0100
committerSudeep Holla <sudeep.holla@arm.com>2023-10-08 21:18:48 +0100
commit113580530ee7dc61e668b641d657920734533b9f (patch)
tree42155760ae2ec11a6cc119835bb88747a2e9fdb2 /drivers/firmware/arm_ffa
parente4607b84c6819bb59c48063ed41eee1fc7f736a0 (diff)
downloadlinux-stable-113580530ee7dc61e668b641d657920734533b9f.tar.gz
linux-stable-113580530ee7dc61e668b641d657920734533b9f.tar.bz2
linux-stable-113580530ee7dc61e668b641d657920734533b9f.zip
firmware: arm_ffa: Update memory descriptor to support v1.1 format
Update memory transaction descriptor structure to accommodate couple of new entries in v1.1 which were previously marked reserved and MBZ(must be zero). It also removes the flexible array member ep_mem_access in the memory transaction descriptor structure as it need not be at fixed offset. Also update ffa_mem_desc_offset() accessor to handle both old and new formats of memory transaction descriptors. The updated ffa_mem_region structure aligns with new format in v1.1 and hence the driver/user must take care not to use members beyond and including ep_mem_offset when using the old format. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-16-cddd3237809c@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_ffa')
-rw-r--r--drivers/firmware/arm_ffa/driver.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index c79067201487..6c5c7926b8ee 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -423,7 +423,7 @@ static u32 ffa_get_num_pages_sg(struct scatterlist *sg)
return num_pages;
}
-static u8 ffa_memory_attributes_get(u32 func_id)
+static u16 ffa_memory_attributes_get(u32 func_id)
{
/*
* For the memory lend or donate operation, if the receiver is a PE or
@@ -467,9 +467,14 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize,
ep_mem_access->reserved = 0;
}
mem_region->handle = 0;
- mem_region->reserved_0 = 0;
- mem_region->reserved_1 = 0;
mem_region->ep_count = args->nattrs;
+ if (drv_info->version <= FFA_VERSION_1_0) {
+ mem_region->ep_mem_size = 0;
+ } else {
+ mem_region->ep_mem_size = sizeof(*ep_mem_access);
+ mem_region->ep_mem_offset = sizeof(*mem_region);
+ memset(mem_region->reserved, 0, 12);
+ }
composite = buffer + composite_offset;
composite->total_pg_cnt = ffa_get_num_pages_sg(args->sg);