summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_ffa
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2022-09-07 15:52:39 +0100
committerSudeep Holla <sudeep.holla@arm.com>2022-09-08 11:33:15 +0100
commit106b11b1ccd5a43432d9517f4a26629a1658cfe6 (patch)
tree7f9cd59e0db2caed5375ec05fedb046d5cef192f /drivers/firmware/arm_ffa
parentbb1be749850055d88d839eff0962e5915788f228 (diff)
downloadlinux-stable-106b11b1ccd5a43432d9517f4a26629a1658cfe6.tar.gz
linux-stable-106b11b1ccd5a43432d9517f4a26629a1658cfe6.tar.bz2
linux-stable-106b11b1ccd5a43432d9517f4a26629a1658cfe6.zip
firmware: arm_ffa: Set up 32bit execution mode flag using partiion property
FF-A v1.1 adds a flag in the partition properties to indicate if the partition runs in the AArch32 or AArch64 execution state. Use the same to set-up the 32-bit execution flag mode in the ffa_dev automatically if the detected firmware version is above v1.0 and ignore any requests to do the same from the ffa_driver. Link: https://lore.kernel.org/r/20220907145240.1683088-10-sudeep.holla@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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index 42bc22220c69..a530139083c4 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -648,11 +648,19 @@ static int ffa_partition_info_get(const char *uuid_str,
return 0;
}
-static void ffa_mode_32bit_set(struct ffa_device *dev)
+static void _ffa_mode_32bit_set(struct ffa_device *dev)
{
dev->mode_32bit = true;
}
+static void ffa_mode_32bit_set(struct ffa_device *dev)
+{
+ if (drv_info->version > FFA_VERSION_1_0)
+ return;
+
+ _ffa_mode_32bit_set(dev);
+}
+
static int ffa_sync_send_receive(struct ffa_device *dev,
struct ffa_send_direct_data *data)
{
@@ -744,6 +752,10 @@ static void ffa_setup_partitions(void)
__func__, tpbuf->id);
continue;
}
+
+ if (drv_info->version > FFA_VERSION_1_0 &&
+ !(tpbuf->properties & FFA_PARTITION_AARCH64_EXEC))
+ _ffa_mode_32bit_set(ffa_dev);
}
kfree(pbuf);
}