Update jtagspi driver for 1-, 2- and 4-byte addresses

jtagspi driver always used 3-byte addresses regardless of actual
device capcity. Now select 1- to 4-byte addresses depending on
device capacity.
Some devices need a special command to activate the 4-byte address
mode, a special command to accomplish this, and a further command
for setting device properties are added.
Additionally, restriction (start of range had to be page aligned)
removed.
Tested with XCS6SLX16 board and W25Q256FV in 3- and 4-byte address
modes.

Change-Id: I88b2877517a18dac460253ae6d97f3dded054e6c
Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/4876
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
This commit is contained in:
Andreas Bolsch
2019-01-28 10:37:53 +01:00
committed by Tomas Vanek
parent b2ab2241f2
commit be57b0ab84
2 changed files with 470 additions and 90 deletions

View File

@@ -5580,6 +5580,10 @@ will not work. These include all @command{*_image} and
functionality is available through the @command{flash write_bank},
@command{flash read_bank}, and @command{flash verify_bank} commands.
According to device size, 1- to 4-byte addresses are sent. However, some
flash chips additionally have to be switched to 4-byte addresses by an extra
command, see below.
@itemize
@item @var{ir} ... is loaded into the JTAG IR to map the flash as the JTAG DR.
For the bitstreams generated from @file{xilinx_bscan_spi.py} this is the
@@ -5592,6 +5596,29 @@ set _XILINX_USER1 0x02
flash bank $_FLASHNAME spi 0x0 0 0 0 \
$_TARGETNAME $_XILINX_USER1
@end example
@deffn Command {jtagspi set} bank_id name total_size page_size read_cmd unused pprg_cmd mass_erase_cmd sector_size sector_erase_cmd
Sets flash parameters: @var{name} human readable string, @var{total_size}
size in bytes, @var{page_size} is write page size. @var{read_cmd} and @var{pprg_cmd}
are commands for read and page program, respectively. @var{mass_erase_cmd},
@var{sector_size} and @var{sector_erase_cmd} are optional.
@example
jtagspi set 0 w25q128 0x1000000 0x100 0x03 0 0x02 0xC7 0x10000 0xD8
@end example
@end deffn
@deffn Command {jtagspi cmd} bank_id resp_num cmd_byte ...
Sends command @var{cmd_byte} and at most 20 following bytes and reads
@var{resp_num} bytes afterwards. E.g. for 'Enter 4-byte address mode'
@example
jtagspi cmd 0 0 0xB7
@end example
@end deffn
@deffn Command {jtagspi always_4byte} bank_id [ on | off ]
Some devices use 4-byte addresses for all commands except the legacy 0x03 read
regardless of device size. This command controls the corresponding hack.
@end deffn
@end deffn
@deffn {Flash Driver} {xcf}

File diff suppressed because it is too large Load Diff