From b86726b5a5bb1d2689a786b3294e8617867d5ef4 Mon Sep 17 00:00:00 2001 From: Daniel Anselmi Date: Sat, 17 Dec 2022 13:11:30 +0100 Subject: [PATCH] jtagspi/pld: add support from intel driver Provide jtagspi with information to use jtagspi for programming spi-flash devices on intel devices using a proxy bitstream. Change-Id: Ib947b8c0dd61e2c6fa8beeb30074606131b1480f Signed-off-by: Daniel Anselmi Reviewed-on: https://review.openocd.org/c/openocd/+/7837 Tested-by: jenkins Reviewed-by: Antonio Borneo --- src/pld/intel.c | 8 +++++++- tcl/board/bemicro_cycloneiii.cfg | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pld/intel.c b/src/pld/intel.c index ee3097391b..8422c94c4b 100644 --- a/src/pld/intel.c +++ b/src/pld/intel.c @@ -362,6 +362,12 @@ static int intel_get_ipdbg_hub(int user_num, struct pld_device *pld_device, stru return ERROR_OK; } +static int intel_get_jtagspi_userircode(struct pld_device *pld_device, unsigned int *ir) +{ + *ir = USER1; + return ERROR_OK; +} + COMMAND_HANDLER(intel_set_bscan_command_handler) { unsigned int boundary_scan_length; @@ -412,7 +418,6 @@ COMMAND_HANDLER(intel_set_check_pos_command_handler) return ERROR_OK; } - PLD_CREATE_COMMAND_HANDLER(intel_pld_create_command) { if (CMD_ARGC != 4 && CMD_ARGC != 6) @@ -498,4 +503,5 @@ struct pld_driver intel_pld = { .pld_create_command = &intel_pld_create_command, .load = &intel_load, .get_ipdbg_hub = intel_get_ipdbg_hub, + .get_jtagspi_userircode = intel_get_jtagspi_userircode, }; diff --git a/tcl/board/bemicro_cycloneiii.cfg b/tcl/board/bemicro_cycloneiii.cfg index 95dd394fd4..bd1459adc4 100644 --- a/tcl/board/bemicro_cycloneiii.cfg +++ b/tcl/board/bemicro_cycloneiii.cfg @@ -16,5 +16,9 @@ source [find fpga/altera-cycloneiii.cfg] #quartus_cpf --option=bitstream_compression=off -c output_files\cycloneiii_blinker.sof cycloneiii_blinker.rbf -#openocd -f board/bemicro_cycloneiii.cfg -c "init" -c "pld load 0 cycloneiii_blinker.rbf" +#openocd -f board/bemicro_cycloneiii.cfg -c "init" -c "pld load cycloneiii.pld cycloneiii_blinker.rbf" # "ipdbg -start -tap cycloneiii.tap -hub 0x00e -tool 0 -port 5555" + + +set JTAGSPI_CHAIN_ID cycloneiii.pld +source [find cpld/jtagspi.cfg]