OpenWrt Forum Archive

Topic: TEW-673GRU serial recovery

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys,

Got the above-mentioned router (a clone of Dlink DIR-825v.B1). The device was bricked after trying to flash a new firmware image and not responding for about an hour.

Did some soldering and established serial connection with putty and  finally got to the u-boot prompt.
The info i got is as follows:

U-Boot 1.1.4 (Apr  9 2009 - 15:45:22)

AP94 (ar7100) U-boot 0.0.12
HTTP-UID AP94: DRAM:  b8050000: 0xc0140180
64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 214k for U-Boot at: 83fc8000
Reserving 192k for malloc() at: 83f98000
Reserving 44 Bytes for Board Info at: 83f97fd4
Reserving 36 Bytes for Global Data at: 83f97fb0
Reserving 128k for boot params() at: 83f77fb0
Stack Pointer at: 83f77f98
Now running in RAM - U-Boot at: 83fc8000
ar7100 flash_init: start
ar7100_spi_flash_unblock: start
ar7100_flash: id read: start
flash size 8MB, sector count = 128
Flash:  8 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth_initialize: ag7100_enet_initialize
rtl8366sr_phy_setup  ethUnit=0
ar7100.c: eth0 using default MAC: 00:14:d1:e6:8b:e6
eth0 up
ar7100.c: eth1 using default MAC: 00:14:d1:e6:8b:e7
eth1 up
eth0, eth1
### main_loop entered: bootdelay=1

### main_loop: bootcmd="bootm 0xbf050000"
Hit any key to stop autoboot:  0
### main_loop: no key string, allow autoboot
### main_loop: abortboot
## Booting image at bf050000 ...
checksum:b5ff500c
   Image Name:   MIPS Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma  compressed)
   Data Size:    926953 Bytes = 905.2 kB
   Load Address: 80060000
   Entry Point:  80064950
   Verifying Checksum ... OK
   LZMA Umcompressing Kernel Image ...    Image loaded from 80060000-802fa5c8
OK
   Boot image os 5=IH_OS_LINUX
## do_bootm_linux start....
No initrd
## Transferring control to Linux (at address 80064950) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] booting platform Atheros AR7161 rev 2 (0xaa)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] Primary instruction cache 64kB, 4-way, VIPT, I-cache aliases, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Linux version 3.5.7.33 (root@dd-wrt.buildserver) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r42002) ) #18201 Sun Jan 4 02:25:25 CET 2015
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 root=1f02 rootfstype=squashfs noinitrd init=/sbin/init
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 61612k/65536k available (2153k kernel code, 3924k reserved, 351k data, 160k init, 0k highmem)
[    0.000000] NR_IRQS:80
[    0.000000] irq init done
[    0.000000] plat_time_init: plat time init done
[    0.000000] Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 512
[    0.070000] NET: Registered protocol family 16
[    3.070000] registering PCI controller with io_map_base unset
[    3.080000] bio: create slab <bio-0> at 0
[    3.080000] usbcore: registered new interface driver usbfs
[    3.090000] usbcore: registered new interface driver hub
[    3.090000] usbcore: registered new device driver usb
[    3.100000] PCI host bridge to bus 0000:00
[    3.100000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    3.110000] pci_bus 0000:00: root bus resource [io  0x0000]
[    3.110000] found calibration data for slot 0 on 0xBF661000
[    3.120000] PCI: fixup device 0000:00:00.0
[    3.130000] found calibration data for slot 1 on 0xBF665000
[    3.140000] PCI: fixup device 0000:00:01.0
[    3.140000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1000ffff]
[    3.150000] pci 0000:00:01.0: BAR 0: assigned [mem 0x10010000-0x1001ffff]
[    3.150000] Switching to clocksource MIPS
[    3.160000] NET: Registered protocol family 2
[    3.160000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    3.170000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    3.180000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    3.180000] TCP: Hash tables configured (established 2048 bind 2048)
[    3.190000] TCP: reno registered
[    3.190000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    3.200000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    3.200000] NET: Registered protocol family 1
[    3.210000] gpio_proc: module loaded and /proc/gpio/ created
[    3.210000] Register LED Device
[    3.220000] wl0gpio_proc: module loaded and /proc/wl0gpio/ created
[    3.220000] AR7100 GPIOC major 0
[    3.230000] squashfs: version 3.0 (2006/03/15) Phillip Lougher
[    3.230000] msgmni has been set to 120
[    3.240000] io scheduler noop registered
[    3.240000] io scheduler deadline registered (default)
[    3.250000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    3.280000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 19) is a 16550A
[    3.280000] console [ttyS0] enabled, bootconsole disabled
[    3.280000] console [ttyS0] enabled, bootconsole disabled
[    3.290000] guessed flashsize = 8M
[    3.300000] scanning for root partition
[    3.300000] uboot detected
[    3.300000] bootloader size = 50000
[    3.310000]
[    3.310000] found squashfs at 133000
[    3.320000] Creating 8 MTD partitions on "ar7100-nor0":
[    3.320000] 0x000000000000-0x000000050000 : "RedBoot"
[    3.330000] 0x000000050000-0x000000800000 : "linux"
[    3.330000] 0x000000133000-0x000000650000 : "rootfs"
[    3.340000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    3.350000] mtd: partition "rootfs" set to be root filesystem
[    3.360000] 0x000000670000-0x0000007e0000 : "ddwrt"
[    3.360000] 0x0000007e0000-0x0000007f0000 : "nvram"
[    3.370000] 0x0000007f0000-0x000000800000 : "FIS directory"
[    3.380000] 0x0000007f0000-0x000000800000 : "board_config"
[    3.380000] 0x000000000000-0x000000800000 : "fullflash"
[    3.390000] ->Oops: flash id 0x202017 .
[    3.390000] tun: Universal TUN/TAP device driver, 1.6
[    3.400000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    3.410000] Found an RTL8366S switch
[    3.410000] Realtek RTL8366S ethernet switch driver version 0.2.2
[    3.420000] rtl8366s rtl8366s: using GPIO pins 5 (SDA) and 7 (SCK)
[    3.420000] rtl8366s rtl8366s: RTL8366 ver. 1 chip found
[    3.450000] rtl8366s rtl8366s: applying initvals
[    3.470000] rtl8366s: probed
[    3.870000] PPP generic driver version 2.4.2
[    3.880000] PPP BSD Compression module registered
[    3.880000] PPP Deflate Compression module registered
[    3.890000] PPP MPPE Compression module registered
[    3.890000] NET: Registered protocol family 24
[    3.910000] u32 classifier
[    3.910000]     Performance counters on
[    3.910000]     input device check on
[    3.920000]     Actions configured
[    3.920000] Netfilter messages via NETLINK v0.30.
[    3.930000] nf_conntrack version 0.5.0 (962 buckets, 3848 max)
[    3.930000] nf_conntrack_rtsp v0.6.21 loading
[    3.940000] nf_nat_rtsp v0.6.21 loading
[    3.940000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    3.950000] IPP2P v0.8.2 loading
[    3.950000] TCP: westwood registered
[    3.950000] TCP: hybla registered
[    3.960000] TCP: vegas registered
[    3.960000] NET: Registered protocol family 17
[    3.960000] Bridge firewalling registered
[    3.970000] 8021q: 802.1Q VLAN Support v1.8
[    3.970000] searching for nvram
[    3.980000] nvram size = 0
[    4.010000] Atheros AR71xx hardware watchdog driver version 0.1.0
[    4.020000] ar71xx-wdt: timeout=15 secs (max=25) ref freq=170000000
[    4.030000] SQUASHFS error: Unknown inode type 12 in squashfs_iget!
[    4.040000] List of all partitions:
[    4.040000] 1f00             320 mtdblock0  (driver?)
[    4.050000] 1f01            7872 mtdblock1  (driver?)
[    4.050000] 1f02            5236 mtdblock2  (driver?)
[    4.060000] 1f03            1472 mtdblock3  (driver?)
[    4.060000] 1f04              64 mtdblock4  (driver?)
[    4.070000] 1f05              64 mtdblock5  (driver?)
[    4.070000] 1f06              64 mtdblock6  (driver?)
[    4.080000] 1f07            8192 mtdblock7  (driver?)
[    4.080000] No filesystem could mount root, tried:  squashfs
[    4.090000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[    4.090000] Rebooting in 1 seconds..


After successfully entering u-boot prompt i have:

U-Boot 1.1.4 (Apr  9 2009 - 15:45:22)
ar7100> printenv
bootargs=console=ttyS0,115200 root=31:03 mem=64M rootfstype=squashfs,jffs2 init=/sbin/init mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata)
bootcmd=bootm 0xbf050000
bootdelay=1
baudrate=115200
ipaddr=192.168.0.1
serverip=192.168.0.107
stdin=serial
stdout=serial
stderr=serial
ethact=eth0

So my questions are:

1. which exact memory addresses should I use to perform: tftpboot 0xXXXXXXX openwrt-ar71xx-generic-tew-673gru-squashfs-factory.bin
2. should I first perform memory erase as in this example:
ar7100> erase 0xbf020000 +7c0000
First 0x2 last 0x7d sector size 0x10000    Erased 124 sectors

If yes - which memory address should be used

Thanks in advance to anyone responding.

Anyone at all?

The discussion might have continued from here.