#! /usr/local/bin/jtag

# Example: read whole 1M*16 flash on the BR-6104KP router / print server.
# WARNING: flash writing with "flashmem" not tested yet, needs
# a volunteer with a bricked box (nothing to lose if it doesn't work).

# Xilinx-compatible JTAG cable, PCI parallel port recommended for speed
cable ppdev /dev/parport1 DLC5

# auto-detection not possible (device id = 0x00000001)
detect
include admtek/adm5120/adm5120

# detect CFI flash (physical address 0x1fc00000, 16-bit access)
detectflash 0x3fc00000

# read flash (32-bit access, faster - only about 30 minutes...)
readmem 0x5fc00000 0x200000 adm5120-flash.bin

