[U-Boot] [PATCH 1/3] fpga: xilinx: Check for substring in device ID validation

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Check for substrings in deviceID validation check so that it can support xa bitstreams also.
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
drivers/fpga/xilinx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/fpga/xilinx.c b/drivers/fpga/xilinx.c index c765a74a25e0..d459a2f7a572 100644 --- a/drivers/fpga/xilinx.c +++ b/drivers/fpga/xilinx.c @@ -75,8 +75,8 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size, buffer[i] = *dataptr++;
if (xdesc->name) { - i = strncmp(buffer, xdesc->name, strlen(xdesc->name)); - if (i) { + i = (ulong)strstr(buffer, xdesc->name); + if (!i) { printf("%s: Wrong bitstream ID for this device\n", __func__); printf("%s: Bitstream ID %s, current device ID %d/%s\n",

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Add bitstream type BIT_NONE to the bitstream type enum. This might be useful while loading bitstreams in respective drivers.
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/fpga.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/fpga.h b/include/fpga.h index e0d12981b283..d768fb14171a 100644 --- a/include/fpga.h +++ b/include/fpga.h @@ -46,6 +46,7 @@ typedef struct { /* typedef fpga_desc */ typedef enum { BIT_FULL = 0, BIT_PARTIAL, + BIT_NONE = 0xFF, } bitstream_type;
/* root function definitions */

Signed-off-by: Michal Simek michal.simek@xilinx.com ---
common/cmd_fpga.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index 7f99aabf8a5c..8956eb1b654a 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -86,7 +86,7 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) debug("* fpga: cmdline image address = 0x%08lx\n", (ulong)fpga_data); } - debug("%s: fpga_data = 0x%x\n", __func__, (uint)fpga_data); + debug("%s: fpga_data = 0x%lx\n", __func__, (ulong)fpga_data);
case 3: /* fpga <op> <dev | data addr> */ dev = (int)simple_strtoul(argv[2], NULL, 16); @@ -107,13 +107,13 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) } else #endif { - fpga_data = (void *)dev; + fpga_data = (void *)(uintptr_t)dev; debug("* fpga: cmdline image addr = 0x%08lx\n", (ulong)fpga_data); }
- debug("%s: fpga_data = 0x%x\n", - __func__, (uint)fpga_data); + debug("%s: fpga_data = 0x%lx\n", + __func__, (ulong)fpga_data); dev = FPGA_INVALID_DEVICE; /* reset device num */ }
participants (1)
-
Michal Simek