]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xilinx: firmware: Move dcache handling directly to pmufw load config
authorMichal Simek <michal.simek@xilinx.com>
Thu, 18 Nov 2021 12:00:02 +0000 (13:00 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 5 Jan 2022 09:22:02 +0000 (10:22 +0100)
Core function should make sure that data is stored properly that's why move
cache operations directly to zynqmp_pmufw_load_config_object() to be able
to call it from other functions.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/8c92edd3650ce34a3cfd1c1e4e9103980830b1fa.1637236800.git.michal.simek@xilinx.com
board/xilinx/zynqmp/cmds.c
drivers/firmware/firmware-zynqmp.c

index b15c0f599bda6d5e19680c34f57ad262d1911d8d..5a277c712f6061512e2c21e5df1e755c303ec77e 100644 (file)
@@ -211,7 +211,6 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc,
 
        addr = hextoul(argv[2], NULL);
        size = hextoul(argv[3], NULL);
-       flush_dcache_range((ulong)addr, (ulong)(addr + size));
 
        zynqmp_pmufw_load_config_object((const void *)(uintptr_t)addr,
                                        (size_t)size);
index b44fede3079938708060511bc6a69c73e20fadb1..aa20e33b4046f708530e90f27d0f7a40a457daa3 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
 #include <zynqmp_firmware.h>
@@ -99,6 +100,8 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
 
        printf("Loading new PMUFW cfg obj (%ld bytes)\n", size);
 
+       flush_dcache_range((ulong)cfg_obj, (ulong)(cfg_obj + size));
+
        err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0,
                                0, ret_payload);
        if (err == XST_PM_NO_ACCESS) {