Skip to content
  • Tobias Diedrich's avatar
    flash: Add support for Atheros (ath79) SPI interface · 6b9d19d3
    Tobias Diedrich authored
    Supported SoCs: AR71xx, AR724x, AR91xx, AR93xx, QCA9558
    
    Extended and revised version of my original patch submitted by Dmytro
    here: http://openocd.zylin.com/#/c/3390
    
    
    
    This driver is using pure SPI mode, so the flash base address is not
    used except some flash commands (e.g. "flash program") need it to
    distinguish the banks.
    
    Example config with all 3 chip selects:
    flash bank flash0 ath79 0 0 0 0 $_TARGETNAME cs0
    flash bank flash1 ath79 0x10000000 0 0 0 $_TARGETNAME cs1
    flash bank flash2 ath79 0x20000000 0 0 0 $_TARGETNAME cs2
    
    Example usage:
    > flash probe flash0
    Found flash device 'win w25q128fv' (ID 0x001840ef)
    flash 'ath79' found at 0x00000000
    > flash probe flash1
    No SPI flash found
    > flash probe flash2
    No SPI flash found
    > flash banks
    > flash read_bank flash0 /tmp/test.bin 0x00000000 0x1000
    reading 4096 bytes from flash @0x00000000
    wrote 4096 bytes to file /tmp/test.bin from flash bank 0 at offset
    0x00000000 in 28.688066s (0.139 KiB/s)
    
    Change-Id: I5feb697722c07e83a9c1b361a9db7b06bc699aa8
    Signed-off-by: default avatarTobias Diedrich <ranma+openocd@tdiedrich.de>
    Reviewed-on: http://openocd.zylin.com/3612
    
    
    Tested-by: jenkins
    Reviewed-by: default avatarDmytro <dioptimizer@hotmail.com>
    Reviewed-by: default avatarPaul Fertser <fercerpav@gmail.com>
    6b9d19d3