SPI Flash partitions/U-boot corrupt?
Posted: Fri Dec 19, 2014 2:13 am
I flashed my Vocore with the stock image from OpenWRT. I used mtd to do it, and it appeared to complete successfully. I rebooted and my Vocore was unresponsive.
I pulled out my trusty 3.3v USB to TTL cable, connected it, and found out I was getting the "bad magic number" error.
I first followed the guide to flash via serial, http://vonger.cn/?topic=connecting-and- ... t-with-osx, and still the bad magic number remained. I then tried the tftpboot trick, and that didn't work either. In a last ditch effort, I tried loading the firmware via TFTP. Still nothing works.
This is when I realized that I wasn't getting exactly what I should've been getting from the "erase linux" command. Based on MarkusZ's output, "erase linux" should erase the linux bank of the flash chip, starting at 0x50000 and going to 0x7b0000. I'm also noticing that cp.linux fails completely. The following is what I'm getting:
I thought something on the dock might be causing this, so I removed the dock, reconnected my USB TTL cable, and supplied a regulated 5V to the Vocore. I get all the same things.
While I'm good with Linux, I have no experience in U-boot, and from my Googling, I'm seeing that the ralink/vocore version of u-boot seems a bit neutered.
At this point I am not too sure what my options are. The only thing I can think of is somehow doing a "factory" flash, to fix the partitions and repair U-boot, and then flash my image.
Any help would be greatly appreciated.
On a side note, I know that the Vocore is operating properly because after some Googling, I tried this with both my custom image and the most recent Vonger released image (they both fail at mounting/enumerating the flash partitions, which I expected due to the flash chip issues detailed above):
I pulled out my trusty 3.3v USB to TTL cable, connected it, and found out I was getting the "bad magic number" error.
I first followed the guide to flash via serial, http://vonger.cn/?topic=connecting-and- ... t-with-osx, and still the bad magic number remained. I then tried the tftpboot trick, and that didn't work either. In a last ditch effort, I tried loading the firmware via TFTP. Still nothing works.
This is when I realized that I wasn't getting exactly what I should've been getting from the "erase linux" command. Based on MarkusZ's output, "erase linux" should erase the linux bank of the flash chip, starting at 0x50000 and going to 0x7b0000. I'm also noticing that cp.linux fails completely. The following is what I'm getting:
- Code: Select all
VoCore> erase linux
Erase linux kernel block !!
From 0x50000 length 0x3B0000
raspi_erase: offs:50000 len:3b0000
...........................................................
VoCore> cp.linux 540004
current count: 5505028
Copy linux image[5505028 byte] to SPI Flash[0x00050000]....
raspi_write: to:50000 len:540004
VoCore>
I thought something on the dock might be causing this, so I removed the dock, reconnected my USB TTL cable, and supplied a regulated 5V to the Vocore. I get all the same things.
While I'm good with Linux, I have no experience in U-boot, and from my Googling, I'm seeing that the ralink/vocore version of u-boot seems a bit neutered.
At this point I am not too sure what my options are. The only thing I can think of is somehow doing a "factory" flash, to fix the partitions and repair U-boot, and then flash my image.
Any help would be greatly appreciated.
On a side note, I know that the Vocore is operating properly because after some Googling, I tried this with both my custom image and the most recent Vonger released image (they both fail at mounting/enumerating the flash partitions, which I expected due to the flash chip issues detailed above):
- Code: Select all
U-Boot for VoCore(based on RT5350)Warning: un-recognized chip ID, please update bootloader!
..
Version: May 30 2014 20:52:36
Press 'x' to console...
.
VoCore> setenv ipaddr 192.168.1.234
VoCore> setenv serverip 192.168.1.24
VoCore> tftp 0x1000000 openwrt.bin
netboot_common, argc= 3
NetTxPacket = 0x81FE59C0
KSEG1ADDR(NetTxPacket) = 0xA1FE59C0
NetLoop,call eth_halt !
NetLoop,call eth_init !
Trying Eth0 (10/100-M)
Waitting for RX_DMA_BUSY status Start... done
Header Payload scatter function is Disable !!
ETH_STATE_ACTIVE!!
Using Eth0 (10/100-M) device
TFTP from server 192.168.1.24; our IP address is 192.168.1.234
Filename 'openwrt.bin'.
TIMEOUT_COUNT=10,Load address: 0x1000000
Loading: checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
Got ARP REPLY, set server/gtwy eth addr (d0:50:99:01:48:6c)
Got it
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
####################################
done
Bytes transferred = 5505028 (540004 hex)
NetBootFileXferSize= 00540004
VoCore> bootm
Booting image at 01000000
Image Name: MIPS OpenWrt Linux-3.14.26
Created: 2014-12-17 23:16:37 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1005290 Bytes = 981.7 kB
Load Address: 80000000
Entry Point: 80000000
Load Kernel:
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
[ 0.000000] Linux version 3.14.26 (iancorbitt@ubuntu) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r43707) ) #10 Wed Dec 17 15:16:25 PST 2014
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is VoCore
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=00036d03
[ 0.000000] Readback ErrCtl register=00036d03
[ 0.000000] Memory: 29356K/32768K available (2201K kernel code, 115K rwdata, 392K rodata, 164K init, 180K bss, 3412K reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU Clock: 360MHz
[ 0.000000] systick: running - mult: 214748, shift: 32
[ 0.000000] genirq: Flags mismatch irq 7. 00014600 (timer) vs. 00014600 (systick)
[ 0.010000] Calibrating delay loop... 479.23 BogoMIPS (lpj=2396160)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090000] pinctrl core: initialized pinctrl subsystem
[ 0.090000] NET: Registered protocol family 16
[ 0.120000] bio: create slab <bio-0> at 0
[ 0.120000] rt2880_gpio 10000600.gpio: registering 22 gpios
[ 0.130000] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[ 0.130000] rt2880_gpio 10000660.gpio: registering 6 gpios
[ 0.140000] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[ 0.150000] Switched to clocksource systick
[ 0.150000] NET: Registered protocol family 2
[ 0.170000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.210000] TCP: reno registered
[ 0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.220000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.240000] NET: Registered protocol family 1
[ 0.250000] rt-timer 10000100.timer: maximum frequency is 7324Hz
[ 0.270000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.330000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.360000] msgmni has been set to 57
[ 0.360000] io scheduler noop registered
[ 0.380000] io scheduler deadline registered (default)
[ 0.400000] gpio-export gpio-export.4: 17 gpio(s) exported
[ 0.420000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.430000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A
[ 0.450000] console [ttyS0] enabled
[ 0.450000] console [ttyS0] enabled
[ 0.470000] bootconsole [early0] disabled
[ 0.470000] bootconsole [early0] disabled
[ 0.490000] m25p80 spi32766.0: found w25q128, expected s25fl064k
[ 0.510000] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[ 0.510000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.530000] Creating 4 MTD partitions on "spi32766.0":
[ 0.540000] 0x000000000000-0x000000030000 : "uboot"
[ 0.550000] 0x000000030000-0x000000040000 : "uboot-env"
[ 0.570000] 0x000000040000-0x000000050000 : "factory"
[ 0.580000] 0x000000050000-0x000001000000 : "firmware"
[ 0.600000] spi spi32766.1: setup: requested speed is too low 500000 Hz
[ 0.600000] spi-rt2880 10000b00.spi: can't setup spi32766.1, status -22
[ 0.630000] spi_master spi32766: spi_device register error /palmbus@10000000/spi@b00/mmc-slot@1
[ 0.650000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[ 0.670000] rt3xxx-usbphy usbphy.3: loaded
[ 0.670000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.690000] TCP: cubic registered
[ 0.690000] NET: Registered protocol family 17
[ 0.710000] 8021q: 802.1Q VLAN Support v1.8
[ 0.710000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 0.740000] Please append a correct "root=" boot option; here are the available partitions:
[ 0.740000] 1f00 192 mtdblock0 (driver?)
[ 0.760000] 1f01 64 mtdblock1 (driver?)
[ 0.770000] 1f02 64 mtdblock2 (driver?)
[ 0.780000] 1f03 16064 mtdblock3 (driver?)
[ 0.790000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)