diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-04-26 15:04:48 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-05-06 10:41:25 +0200 |
commit | 6631db4773cd735688bf3332173a49271df23385 (patch) | |
tree | 490f9a4e9bc19b1ef92fa782125ca971e295fa53 /include | |
parent | d5dae85f23c7c902731512e451afde9a6e4a250a (diff) | |
download | u-boot-6631db4773cd735688bf3332173a49271df23385.tar.gz u-boot-6631db4773cd735688bf3332173a49271df23385.tar.bz2 u-boot-6631db4773cd735688bf3332173a49271df23385.zip |
fpga: Check device name against bitstream name
Ensure that wrong bitstream won't be loaded
to current device.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fpga.h | 2 | ||||
-rw-r--r-- | include/xilinx.h | 1 | ||||
-rw-r--r-- | include/zynqpl.h | 8 |
3 files changed, 7 insertions, 4 deletions
diff --git a/include/fpga.h b/include/fpga.h index 38f62c0c2a..ebefba8d05 100644 --- a/include/fpga.h +++ b/include/fpga.h @@ -71,5 +71,7 @@ extern int fpga_load(int devnum, const void *buf, size_t bsize); extern int fpga_loadbitstream(int devnum, char *fpgadata, size_t size); extern int fpga_dump(int devnum, const void *buf, size_t bsize); extern int fpga_info(int devnum); +extern const fpga_desc *const fpga_validate(int devnum, const void *buf, + size_t bsize, char *fn); #endif /* _FPGA_H_ */ diff --git a/include/xilinx.h b/include/xilinx.h index 592cbea1f3..bcfe76d81e 100644 --- a/include/xilinx.h +++ b/include/xilinx.h @@ -81,6 +81,7 @@ typedef struct { /* typedef Xilinx_desc */ size_t size; /* bytes of data part can accept */ void *iface_fns; /* interface function table */ int cookie; /* implementation specific cookie */ + char *name; /* device name in bitstream */ } Xilinx_desc; /* end, typedef Xilinx_desc */ /* Generic Xilinx Functions diff --git a/include/zynqpl.h b/include/zynqpl.h index bc9b948159..0247ef61cc 100644 --- a/include/zynqpl.h +++ b/include/zynqpl.h @@ -45,15 +45,15 @@ extern int zynq_info(Xilinx_desc *desc); /* Descriptor Macros */ #define XILINX_XC7Z010_DESC(cookie) \ -{ xilinx_zynq, devcfg, XILINX_XC7Z010_SIZE, NULL, cookie } +{ xilinx_zynq, devcfg, XILINX_XC7Z010_SIZE, NULL, cookie, "7z010" } #define XILINX_XC7Z020_DESC(cookie) \ -{ xilinx_zynq, devcfg, XILINX_XC7Z020_SIZE, NULL, cookie } +{ xilinx_zynq, devcfg, XILINX_XC7Z020_SIZE, NULL, cookie, "7z020" } #define XILINX_XC7Z030_DESC(cookie) \ -{ xilinx_zynq, devcfg, XILINX_XC7Z030_SIZE, NULL, cookie } +{ xilinx_zynq, devcfg, XILINX_XC7Z030_SIZE, NULL, cookie, "7z030" } #define XILINX_XC7Z045_DESC(cookie) \ -{ xilinx_zynq, devcfg, XILINX_XC7Z045_SIZE, NULL, cookie } +{ xilinx_zynq, devcfg, XILINX_XC7Z045_SIZE, NULL, cookie, "7z045" } #endif /* _ZYNQPL_H_ */ |