]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: fit: pass real compatible flags to fpga_load()
authorOleksandr Suvorov <oleksandr.suvorov@foundries.io>
Fri, 22 Jul 2022 14:16:09 +0000 (17:16 +0300)
committerMichal Simek <michal.simek@amd.com>
Tue, 26 Jul 2022 07:34:21 +0000 (09:34 +0200)
Convert taken FPGA image "compatible" string to a binary compatible
flag and pass it to an FPGA driver.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-9-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
common/spl/spl_fit.c

index 3c5a91916cc9caad84f9b6c7feb105051c35988a..a35be52965679e683c56b8e935a40e177c18d080 100644 (file)
@@ -588,10 +588,15 @@ static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node,
              (u32)fpga_image->load_addr, fpga_image->size);
 
        compatible = fdt_getprop(ctx->fit, node, "compatible", NULL);
-       if (!compatible)
+       if (!compatible) {
                warn_deprecated("'fpga' image without 'compatible' property");
-       else if (strcmp(compatible, "u-boot,fpga-legacy"))
-               printf("Ignoring compatible = %s property\n", compatible);
+       } else {
+               if (CONFIG_IS_ENABLED(FPGA_LOAD_SECURE))
+                       flags = fpga_compatible2flag(devnum, compatible);
+               if (strcmp(compatible, "u-boot,fpga-legacy"))
+                       debug("Ignoring compatible = %s property\n",
+                             compatible);
+       }
 
        ret = fpga_load(devnum, (void *)fpga_image->load_addr,
                        fpga_image->size, BIT_FULL, flags);