firmware: arm_ffa: Fix big-endian support in __ffa_partition_info_get()

Currently the FF-A driver doesn't support big-endian correctly. It is
hard to regularly test the setup due to lack of test infrastructure and
tools.

In order to support full stack, we need to take small steps in getting
the support for big-endian kernel added slowly. This change fixes the
support in __ffa_partition_info_get() so that the response from the
firmware are converted correctly as required. With this change, we can
enumerate all the FF-A devices correctly in the big-endian kernel.

Tested-by: Viresh Kumar <viresh.kumar@linaro.org>
Message-Id: <20250217-ffa_updates-v3-4-bd1d9de615e7@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Sudeep Holla
2025-02-17 15:38:45 +00:00
parent 8768972cbb
commit f94ebb7240

View File

@@ -276,9 +276,21 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3,
}
if (buffer && count <= num_partitions)
for (idx = 0; idx < count; idx++)
memcpy(buffer + idx, drv_info->rx_buffer + idx * sz,
buf_sz);
for (idx = 0; idx < count; idx++) {
struct ffa_partition_info_le {
__le16 id;
__le16 exec_ctxt;
__le32 properties;
uuid_t uuid;
} *rx_buf = drv_info->rx_buffer + idx * sz;
struct ffa_partition_info *buf = buffer + idx;
buf->id = le16_to_cpu(rx_buf->id);
buf->exec_ctxt = le16_to_cpu(rx_buf->exec_ctxt);
buf->properties = le32_to_cpu(rx_buf->properties);
if (buf_sz > 8)
import_uuid(&buf->uuid, (u8 *)&rx_buf->uuid);
}
ffa_rx_release();