Commit f94ebb72 authored by Sudeep Holla's avatar Sudeep Holla
Browse files

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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Message-Id: <20250217-ffa_updates-v3-4-bd1d9de615e7@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 8768972c
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -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();