From 1bb69dcf22ff8ca12ce4950c6743c98ada3380f8 Mon Sep 17 00:00:00 2001 From: bma Date: Thu, 20 Mar 2025 20:09:46 +0100 Subject: [PATCH 1/3] kcu105: add fpga package in description --- src/board.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/board.hpp b/src/board.hpp index 881db31..00abb85 100644 --- a/src/board.hpp +++ b/src/board.hpp @@ -174,7 +174,7 @@ static std::map board_list = { 0, 0, CABLE_DEFAULT), DFU_BOARD("icebreaker-bitsy", "", "dfu", 0x1d50, 0x6146, 0), JTAG_BOARD("kc705", "", "digilent", 0, 0, CABLE_DEFAULT), - JTAG_BOARD("kcu105", "", "jtag-smt2-nc", 0, 0, CABLE_DEFAULT), + JTAG_BOARD("kcu105", "xcku040-ffva1156", "jtag-smt2-nc", 0, 0, CABLE_DEFAULT), JTAG_BOARD("kcu116", "xcku5p-ffvb676", "jtag-smt2-nc", 0, 0, CABLE_DEFAULT), JTAG_BOARD("LD-SCHOKO", "LFE5U-45F-6CABGA256", "", 0, 0, CABLE_MHZ(6)), DFU_BOARD("LD-SCHOKO-DFU", "", "dfu", 0x16d0, 0x116d, 0), From 1c78344ca5368f8e912391d740e1fc2e96c839ea Mon Sep 17 00:00:00 2001 From: bma Date: Thu, 20 Mar 2025 20:11:02 +0100 Subject: [PATCH 2/3] kcu105: add secondary qspi detection and dump --- src/main.cpp | 3 ++- src/xilinx.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5df9f80..cdb4f47 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1043,7 +1043,8 @@ int parse_opt(int argc, char **argv, struct arguments *args, args->secondary_bit_file.empty() && !args->protect_flash && !args->unprotect_flash && - !args->bulk_erase_flash + !args->bulk_erase_flash && + !args->detect ) { printError("Error: secondary bitfile not specified"); cout << options.help() << endl; diff --git a/src/xilinx.cpp b/src/xilinx.cpp index b33e498..d2a7d29 100644 --- a/src/xilinx.cpp +++ b/src/xilinx.cpp @@ -313,7 +313,7 @@ Xilinx::Xilinx(Jtag *jtag, const std::string &filename, _secondary_file_extension = secondary_filename.substr( secondary_filename.find_last_of(".") + 1); _mode = Device::SPI_MODE; - if (!(_device_package == "xcvu9p-flga2104" || _device_package == "xcku5p-ffvb676")) { + if (!(_device_package == "xcvu9p-flga2104" || _device_package == "xcku5p-ffvb676" || _device_package == "xcku040-ffva1156")) { throw std::runtime_error("Error: secondary flash unavailable"); } } From e6d20ab6d56cd2cb3c74e7c5b954a56a57207516 Mon Sep 17 00:00:00 2001 From: bma Date: Thu, 20 Mar 2025 20:33:17 +0100 Subject: [PATCH 3/3] doc: add kcu105 dual qspi command examples --- doc/boards.yml | 2 +- doc/guide/advanced.rst | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/boards.yml b/doc/boards.yml index 1f45d8c..41baddc 100644 --- a/doc/boards.yml +++ b/doc/boards.yml @@ -494,7 +494,7 @@ URL: https://www.xilinx.com/products/boards-and-kits/kcu105.html FPGA: Kintex UltraScale xcku040-ffva1156 Memory: OK - Flash: OK + Flash: OK (primary and secondary) - ID: kcu116 Description: Xilinx KCU116 diff --git a/doc/guide/advanced.rst b/doc/guide/advanced.rst index c375a86..5e81002 100644 --- a/doc/guide/advanced.rst +++ b/doc/guide/advanced.rst @@ -34,7 +34,7 @@ Reading the bitstream from STDIN .. code-block:: bash # FPGA side - nc -lp port | openFPGALoader --file-type xxx [option + nc -lp port | openFPGALoader --file-type xxx [option] # Bitstream side nc -q 0 host port < /path/to/bitstream.ext @@ -83,6 +83,35 @@ Writing to an arbitrary address in flash memory With FPGA using an external SPI flash (*xilinx*, *lattice ECP5/nexus/ice40*, *anlogic*, *efinix*) option ``-o`` allows one to write raw binary file to an arbitrary adress in FLASH. +Detect/read/write on primary/secondary flash memories +===================================================== + +With FPGA using two external SPI flash (some *xilinx* boards) option ``--target-flash`` allows to select the QSPI chip. + +To detect: + +.. code-block:: bash + + openFPGALoader -b kcu105 -f --target-flash {primary,secondary} --detect + +To read the primary flash memory: + +.. code-block:: bash + + openFPGALoader -b kcu105 -f --target-flash primary --dump-flash --file-size N_BYTES mydump.bin + +and the second flash memory: + +.. code-block:: bash + + openFPGALoader -b kcu105 -f --target-flash secondary --dump-flash --file-size N_BYTES --secondary-bitstream mydump.bin + +To write on secondary flash memory: + +.. code-block:: bash + + openFPGALoader -b kcu105 -f --target-flash secondary --secondary-bitstream mySecondaryBitstream.bin + Using an alternative directory for *spiOverJtag* ================================================