Skip to content

Commit f5ed5c4

Browse files
authored
Merge pull request #529 from mer0m/master
kcu105: add support for secondary QSPI
2 parents 8435bbd + 4e5fd9f commit f5ed5c4

5 files changed

Lines changed: 35 additions & 5 deletions

File tree

doc/boards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@
494494
URL: https://www.xilinx.com/products/boards-and-kits/kcu105.html
495495
FPGA: Kintex UltraScale xcku040-ffva1156
496496
Memory: OK
497-
Flash: OK
497+
Flash: OK (primary and secondary)
498498

499499
- ID: kcu116
500500
Description: Xilinx KCU116

doc/guide/advanced.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Reading the bitstream from STDIN
3434
.. code-block:: bash
3535
3636
# FPGA side
37-
nc -lp port | openFPGALoader --file-type xxx [option
37+
nc -lp port | openFPGALoader --file-type xxx [option]
3838
3939
# Bitstream side
4040
nc -q 0 host port < /path/to/bitstream.ext
@@ -83,6 +83,35 @@ Writing to an arbitrary address in flash memory
8383
With FPGA using an external SPI flash (*xilinx*, *lattice ECP5/nexus/ice40*, *anlogic*, *efinix*) option ``-o`` allows
8484
one to write raw binary file to an arbitrary adress in FLASH.
8585

86+
Detect/read/write on primary/secondary flash memories
87+
=====================================================
88+
89+
With FPGA using two external SPI flash (some *xilinx* boards) option ``--target-flash`` allows to select the QSPI chip.
90+
91+
To detect:
92+
93+
.. code-block:: bash
94+
95+
openFPGALoader -b kcu105 -f --target-flash {primary,secondary} --detect
96+
97+
To read the primary flash memory:
98+
99+
.. code-block:: bash
100+
101+
openFPGALoader -b kcu105 -f --target-flash primary --dump-flash --file-size N_BYTES mydump.bin
102+
103+
and the second flash memory:
104+
105+
.. code-block:: bash
106+
107+
openFPGALoader -b kcu105 -f --target-flash secondary --dump-flash --file-size N_BYTES --secondary-bitstream mydump.bin
108+
109+
To write on secondary flash memory:
110+
111+
.. code-block:: bash
112+
113+
openFPGALoader -b kcu105 -f --target-flash secondary --secondary-bitstream mySecondaryBitstream.bin
114+
86115
Using an alternative directory for *spiOverJtag*
87116
================================================
88117

src/board.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static std::map <std::string, target_board_t> board_list = {
174174
0, 0, CABLE_DEFAULT),
175175
DFU_BOARD("icebreaker-bitsy", "", "dfu", 0x1d50, 0x6146, 0),
176176
JTAG_BOARD("kc705", "", "digilent", 0, 0, CABLE_DEFAULT),
177-
JTAG_BOARD("kcu105", "", "jtag-smt2-nc", 0, 0, CABLE_DEFAULT),
177+
JTAG_BOARD("kcu105", "xcku040-ffva1156", "jtag-smt2-nc", 0, 0, CABLE_DEFAULT),
178178
JTAG_BOARD("kcu116", "xcku5p-ffvb676", "jtag-smt2-nc", 0, 0, CABLE_DEFAULT),
179179
JTAG_BOARD("LD-SCHOKO", "LFE5U-45F-6CABGA256", "", 0, 0, CABLE_MHZ(6)),
180180
DFU_BOARD("LD-SCHOKO-DFU", "", "dfu", 0x16d0, 0x116d, 0),

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,8 @@ int parse_opt(int argc, char **argv, struct arguments *args,
10441044
args->secondary_bit_file.empty() &&
10451045
!args->protect_flash &&
10461046
!args->unprotect_flash &&
1047-
!args->bulk_erase_flash
1047+
!args->bulk_erase_flash &&
1048+
!args->detect
10481049
) {
10491050
printError("Error: secondary bitfile not specified");
10501051
cout << options.help() << endl;

src/xilinx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ Xilinx::Xilinx(Jtag *jtag, const std::string &filename,
313313
_secondary_file_extension = secondary_filename.substr(
314314
secondary_filename.find_last_of(".") + 1);
315315
_mode = Device::SPI_MODE;
316-
if (!(_device_package == "xcvu9p-flga2104" || _device_package == "xcku5p-ffvb676")) {
316+
if (!(_device_package == "xcvu9p-flga2104" || _device_package == "xcku5p-ffvb676" || _device_package == "xcku040-ffva1156")) {
317317
throw std::runtime_error("Error: secondary flash unavailable");
318318
}
319319
}

0 commit comments

Comments
 (0)