]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fpga: xilinx: pass compatible flags to load() callback
authorOleksandr Suvorov <oleksandr.suvorov@foundries.io>
Fri, 22 Jul 2022 14:16:10 +0000 (17:16 +0300)
committerMichal Simek <michal.simek@amd.com>
Tue, 26 Jul 2022 07:34:21 +0000 (09:34 +0200)
These flags may be used to check whether an FPGA driver is able to
load a particular FPGA bitstream image.

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

index fe37752210b491e2a913c94fbe23887e1caa3d1d..47692e32076b39fd6f9608055bbbefb65b5553a3 100644 (file)
@@ -40,7 +40,7 @@ static int spartan2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize);
 /* ------------------------------------------------------------------------- */
 /* Spartan-II Generic Implementation */
 static int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize,
-                        bitstream_type bstype)
+                        bitstream_type bstype, int flags)
 {
        int ret_val = FPGA_FAIL;
 
index 4850c99352ddf330eb37a798be1a26a54bc3fd4c..918f6db5065c3f698dc54d3df4ae28cca398e727 100644 (file)
@@ -45,7 +45,7 @@ static int spartan3_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize);
 /* ------------------------------------------------------------------------- */
 /* Spartan-II Generic Implementation */
 static int spartan3_load(xilinx_desc *desc, const void *buf, size_t bsize,
-                        bitstream_type bstype)
+                        bitstream_type bstype, int flags)
 {
        int ret_val = FPGA_FAIL;
 
index c44a7d3455751257e8913ccbb5453b85649306ba..d3876a8f541a215df7db947d55faab3923f368a6 100644 (file)
@@ -27,7 +27,7 @@ static ulong versal_align_dma_buffer(ulong *buf, u32 len)
 }
 
 static int versal_load(xilinx_desc *desc, const void *buf, size_t bsize,
-                      bitstream_type bstype)
+                      bitstream_type bstype, int flags)
 {
        ulong bin_buf;
        int ret;
index 2e764bdcd526f592d55838d7ad5138a48a98b020..51b8d3120567925f6b163ace0b2ee29501806e76 100644 (file)
@@ -83,7 +83,7 @@ static int virtex2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize);
 static int virtex2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize);
 
 static int virtex2_load(xilinx_desc *desc, const void *buf, size_t bsize,
-                       bitstream_type bstype)
+                       bitstream_type bstype, int flags)
 {
        int ret_val = FPGA_FAIL;
 
index d9951ca3ecff44814570433c7bc191047a66b30d..8170c3368ef6f89646e8617d869f1ca1f38b8cea 100644 (file)
@@ -151,7 +151,7 @@ int xilinx_load(xilinx_desc *desc, const void *buf, size_t bsize,
                return FPGA_FAIL;
        }
 
-       return desc->operations->load(desc, buf, bsize, bstype);
+       return desc->operations->load(desc, buf, bsize, bstype, flags);
 }
 
 #if defined(CONFIG_CMD_FPGA_LOADFS)
index 19d079c9d9f27b3d7366db85a9027e9b217062fa..a062456788204e0f9459a824e1735e5ab7ac2014 100644 (file)
@@ -200,7 +200,7 @@ static int zynqmp_validate_bitstream(xilinx_desc *desc, const void *buf,
 }
 
 static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
-                    bitstream_type bstype)
+                    bitstream_type bstype, int flags)
 {
        ALLOC_CACHE_ALIGN_BUFFER(u32, bsizeptr, 1);
        u32 swap = 0;
index 2de40109a814db7e8248e98b50009da5192ad2f1..d8ebd542abda5acfc03890a55f23fa91ead9a00f 100644 (file)
@@ -371,7 +371,7 @@ static int zynq_validate_bitstream(xilinx_desc *desc, const void *buf,
 }
 
 static int zynq_load(xilinx_desc *desc, const void *buf, size_t bsize,
-                    bitstream_type bstype)
+                    bitstream_type bstype, int flags)
 {
        unsigned long ts; /* Timestamp */
        u32 isr_status, swap;
index 0bbf14d8a1da50affb88d027afb434e6cabd01b2..e5f6db33fa2562d1fede0ea76dbbea4aa838b3fa 100644 (file)
@@ -53,7 +53,7 @@ typedef struct {              /* typedef xilinx_desc */
 
 struct xilinx_fpga_op {
        int (*load)(xilinx_desc *desc, const void *buf, size_t bsize,
-                   bitstream_type bstype);
+                   bitstream_type bstype, int flags);
        int (*loadfs)(xilinx_desc *desc, const void *buf, size_t bsize,
                      fpga_fs_info *fpga_fsinfo);
        int (*loads)(xilinx_desc *desc, const void *buf, size_t bsize,