]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fpga: zynqmp: add str2flags call
authorOleksandr Suvorov <oleksandr.suvorov@foundries.io>
Fri, 22 Jul 2022 14:16:05 +0000 (17:16 +0300)
committerMichal Simek <michal.simek@amd.com>
Tue, 26 Jul 2022 07:34:21 +0000 (09:34 +0200)
Add a call to convert FPGA "compatible" string to a binary flag.

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-5-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/fpga/zynqmppl.c
include/xilinx.h

index 8ff12bf50a0c2a8bd1ea24c23d5d1ca27ca7c02d..19d079c9d9f27b3d7366db85a9027e9b217062fa 100644 (file)
@@ -304,10 +304,19 @@ static int zynqmp_pcap_info(xilinx_desc *desc)
        return ret;
 }
 
+static int __maybe_unused zynqmp_str2flag(xilinx_desc *desc, const char *str)
+{
+       if (!strncmp(str, "u-boot,fpga-legacy", 18))
+               return FPGA_LEGACY;
+
+       return 0;
+}
+
 struct xilinx_fpga_op zynqmp_op = {
        .load = zynqmp_load,
+       .info = zynqmp_pcap_info,
 #if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
        .loads = zynqmp_loads,
+       .str2flag = zynqmp_str2flag,
 #endif
-       .info = zynqmp_pcap_info,
 };
index d9e4b8da96871bdb81ba19b3499ee1b998e30ec8..ff5486d98a72b541d4213980186b3e43f754862a 100644 (file)
@@ -60,6 +60,9 @@ struct xilinx_fpga_op {
                     struct fpga_secure_info *fpga_sec_info);
        int (*dump)(xilinx_desc *desc, const void *buf, size_t bsize);
        int (*info)(xilinx_desc *desc);
+#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
+       int (*str2flag)(xilinx_desc *desc, const char *string);
+#endif
 };
 
 /* Generic Xilinx Functions