Re: [PATCH v11 06/10] arm_ffa: introduce sandbox FF-A support

Simon Glass
2023-04-19T01:54:54Z

Hi Abdellatif,

On Wed, 12 Apr 2023 at 03:43, Abdellatif El Khlifi
<abdellatif.elkhlifi@arm.com> wrote:
>
> Emulate Secure World's FF-A ABIs and allow testing U-Boot FF-A support
>
> Features of the sandbox FF-A support:
>
> - Introduce an FF-A emulator
> - Introduce an FF-A device driver for FF-A comms with emulated Secure World
> - Provides test methods allowing to read the status of the inspected ABIs
>
> The sandbox FF-A emulator supports only 64-bit direct messaging.
>
> Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Jens Wiklander <jens.wiklander@linaro.org>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> ---
> Changelog:
> ===============
>
> v11:
>
> * rename ffa_try_discovery() to sandbox_ffa_discover()
> * rename sandbox_ffa_query_core_state() to sandbox_query_ffa_emul_state()
> * store the sandbox emulator pointer in the FF-A device uc_priv (struct ffa_priv)
> * set the emulator as parent of the sandbox FF-A device

This is close, but not quite what I expected.

I suspect the emulator should be the child of the FF-A device, not the
parent? You should update the devicetree to show that. You should not
need to reparent anything.

Then you put this in your FFA uclass so it binds the emulator:

.post_bind = dm_scan_fdt_dev,

Finding the emulator is probably then just a case of calling
device_find_first_child().

I notice that you are sometimes breaking lines very short, e.g. the
memset() lines. Please try to use all 80cols if you can.

Regards,
Simon