2

I connected ttl cable to my router board, and Im trying to dump firmware in order to flash second device over web interface with my backup so I have few questions:

What binary file for ex. upgrade.bin contains ? Kernel image, files, user settings ? Im asking that because Im not sure which partition do I need to dump there is few

dev:    size   erasesize  name
mtd0: 00800000 00010000 "Whole_Flash"
mtd1: 00020000 00010000 "Bootloader"
mtd2: 00010000 00010000 "defcfg"
mtd3: 00020000 00010000 "curcfg"
mtd4: 00010000 00010000 "log"
mtd5: 00180000 00010000 "kernel1"

And here is table from U-BOOT

AMAZON_S # bdinfo
boot_params = 0x81DDEFB0
memstart    = 0x80000000
memsize     = 0x02000000
flashstart  = 0xB0000000
flashsize   = 0x00800000
flashoffset = 0x00000000

I did tried with dd but on board busybox does not contain one so I need to do it over U-BOOT but I cant "initialize" SPI device

AMAZON_S # help sf
sf probe [bus:]cs [hz] [mode]   - init flash device on given SPI bus
                                  and chip select
sf read addr offset len         - read `len' bytes starting at
                                  `offset' to memory at `addr'
sf write addr offset len        - write `len' bytes from memory
                                  at `addr' to flash at `offset'
sf erase offset len             - erase `len' bytes from `offset'

AMAZON_S # sf probe 0
Failed to initialize SPI flash at 0:0

And last how could I determine how long is "Whole_Flash" or "kernel1" in order to dump correct amount of memory ?

AMAZON_S # printenv
bootcmd=run flash_flash
bootdelay=3
baudrate=115200
preboot=echo;echo Type "run flash_nfs" to mount root filesystem over NFS;echo
serverip=192.168.1.55
netdev=eth0
baudrate=115200
rootpath=/opt/nfs
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath)
ramargs=setenv bootargs root=/dev/ram rw
addip=smem=2M
vpe1_load_aotargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):on
mem=32M
vpe0mem=30M
vpe1mem=2M
vpe1_load_addr=0x81e00000
addmisc=setenv bootargs $(bootargs) console=ttyS1,$(baudrate) ethaddr=$(ethaddr) phym=$(mem) mem=$(vpe0mem) panic=1 vpe1_load_addr=$(vpe1_load_addr) vpe1_mem=$(vpe1mem) vpe1_wired_tlb_entries=1
flash_nfs=run nfsargs addip addmisc;bootm $(kernel_addr)
ramdisk_addr=B0100000
flash_self=run ramargs addip addmisc;bootm $(kernel_addr) $(ramdisk_addr)
img_uboot=u-boot.ifx
net_nfs=tftp 80500000 $(img_kernel);run nfsargs addip addmisc;bootm
net_ram=tftp 80500000 $(img_kernel);run ramargs addip addmisc;bootm
load=tftp 80500000 $(img_uboot)
flash_flash=run addip addmisc; bootm $(kernel_addr)
f_ubootconfig_addr=0xB001A000
f_ubootconfig_size=0x1000
ethaddr=20:89:86:06:B4:00
ipaddr=192.168.1.1
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
ethact=amazon_s Switch

Environment size: 1252/4092 bytes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.