]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
firmware: zynqmp: Swap addr_hi/low when PM_FPGA_LOAD is called
authorMichal Simek <michal.simek@xilinx.com>
Mon, 5 Oct 2020 13:23:28 +0000 (15:23 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 27 Oct 2020 07:13:31 +0000 (08:13 +0100)
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@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/firmware/firmware-zynqmp.c

index 7583f24a200dab60c534f2158e906dbf8a05b02b..d4dc856bafa4215e588d4e65d02efbdd262d7509 100644 (file)
@@ -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;