[PATCH 1/4] firmware: zynqmp: Swap addr_hi/low when PM_FPGA_LOAD is called

Simon Glass sjg at chromium.org
Mon Oct 12 05:34:57 CEST 2020


On Wed, 7 Oct 2020 at 07:40, Michal Simek <michal.simek at xilinx.com> wrote:
>
> Don't know reason but in regular flow addr_hi/low are swapped in ATF. It
> means when fpga load is done from EL3 there is a need to swap it for PMUFW
> to load bitstream.
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
>  drivers/firmware/firmware-zynqmp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Simon Glass <sjg at chromium.org>

Is this a bug?


>
> diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
> index 7583f24a200d..d4dc856bafa4 100644
> --- a/drivers/firmware/firmware-zynqmp.c
> +++ b/drivers/firmware/firmware-zynqmp.c
> @@ -165,6 +165,14 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
>                  */
>                 u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
>
> +               if (api_id == PM_FPGA_LOAD) {
> +                       /* Swap addr_hi/low because of incompatibility */
> +                       u32 temp = regs[1];
> +
> +                       regs[1] = regs[2];
> +                       regs[2] = temp;
> +               }
> +
>                 ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload, PAYLOAD_ARG_CNT);
>  #else
>                 return -EPERM;
> --
> 2.28.0
>


More information about the U-Boot mailing list