• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: messed up uboot var prevent booting on sheevaplug (bad magic number)  (Read 4350 times)
Mwoua
Newbie
*

Karma: 0
Posts: 5


View Profile
« on: February 08, 2012, 02:47:56 AM »

Hi,

i received my sheeva plug lst week, and while i was looking into the boot change boot device, and long story short, all my ubbot var were changed to this :

Code:
Marvell>> printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
run_diag=yes
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x1                                                                                                                               00000(root)
mainlineLinux=no
CASset=min
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
bootcmd=tftpboot 0x2000000 $(image_name); setenv bootargs $(console) $(bootargs_                                                                                                                               root) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(bootargs_end) $(                                                                                                                               mvNetConfig) $(mvPhoneConfig);  bootm 0x2000000;
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/m                                                                                                                               tdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x20                                                                                                                               00000;
bootdelay=3
disaMvPnp=no
ethaddr=00:50:43:00:21:02
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
enaAutoRecovery=yes
pcieTune=no
ethact=egiga0
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x

i've changed them back to default config thanks to a post in official forum but now i have that :

Code:

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|
 ** MARVELL BOARD: SHEEVA PLUG LE

U-Boot 1.1.4 (Dec 27 2009 - 22:03:21) Marvell version: 3.4.27

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFEE0

Soc: 88F6281 A1 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB
DRAM CS[1] base 0x10000000   size 256MB
DRAM Total size 512MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x100000, size 0x400000

Reading data from 0x4ff800 -- 100% complete.
 4194304 bytes read: OK
## Booting image at 00800000 ...
Bad Magic Number
Marvell>>

Here is my print env if it can help

Code:
Marvell>> printenv
loads_echo=0
serverip=10.4.50.5
netmask=255.255.255.0
run_diag=yes
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
ethact=egiga0
arcNumber=2097
autoload=no
baudrate=115200
bootargs_console=console=ttyS0,115200
e=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
rcvrip=169.254.100.100
loadaddr=0x02000000
bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
mtdpartitions=mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
disL2prefetch=yes
rootpath=/mnt/ARM_FS
ethaddr=F0:AD04E:00:A0:2E
bootargs_root_nand=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
bootargs_root_mmc=root=/dev/mmcblk0p2 rootdelay=5
ipaddr=192.168.1.2
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
filesize=37B8DF
real_bootcmd=run bootcmd_mmc; run bootcmd_nand
bootcmd_nand=setenv bootargs $(bootargs nand); nand read.e 0x8000000 0x100000 0x400000; bootm 0x800000
bootcmd=run bootcmd_nand
stdin=serial
stdout=serial
stderr=serial
nandEnvBase=x=yes
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no

Environment size: 1671/131068 bytes

Thanks in advance

« Last Edit: February 08, 2012, 02:50:07 AM by Mwoua » Logged

bigbear59
Newbie
*

Karma: 0
Posts: 26


View Profile
« Reply #1 on: February 12, 2012, 02:08:29 AM »

Too many Zeros  Cry
Quote
bootcmd_nand=setenv bootargs $(bootargs nand); nand read.e 0x8000000 0x100000 0x400000; bootm 0x800000
« Last Edit: February 12, 2012, 02:11:35 AM by bigbear59 » Logged

Give me a fish, I eat for a day.  Teach me to fish, I eat for a lifetime.
"Do you have any spades?"

Mwoua
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #2 on: February 12, 2012, 06:03:13 AM »

Nice find !

But i still got the same error.

Gonna try to reinstall debian as soon as possible, but my internet is broken at the moment.

Thanks anyway
Logged

bigbear59
Newbie
*

Karma: 0
Posts: 26


View Profile
« Reply #3 on: February 13, 2012, 10:43:16 AM »

From the PLUGWIKI:
     Addresses (0x0) - PlugWiki  <--- Click here

Quote
RAM Memory use
0x800000 (8 MB)

This is the default RAM address into which the kernel image is loaded (on the SheevaPlug) for execution.

Why this number? Because 0x0 - 0x800000 are reserved for U-Boot. (Really, look at the messages U-Boot prints when starting, before the kernel is copied.)

I've tested loading the kernel into other RAM addresses, and there does not seem to be a problem. But, if the memory manager is trying to handle two block (one above and one below the kernel), there might be a minor amount of extra work required. Generally, I'd suggest loading the kernel at the low end (0x800000) and allowing all the remaining memory to be managed as a single block.

With that in mind, it is very common to also see this address used in the commands fatload, ext2load, or tftpboot as a safe place to load an image into RAM temporarily before writing it to Flash.

Maybe your uImage in 0x800000 is hosed, you can rewrite a clean one with these instructions:
     Flashing the SheevaPlug Kernel from a USB Drive with U-Boot <--- Click here

Good Luck,
BigBear59
Logged

Give me a fish, I eat for a day.  Teach me to fish, I eat for a lifetime.
"Do you have any spades?"

Mwoua
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #4 on: February 14, 2012, 10:04:07 AM »

I've tried the first step (without writing the uimage to the nand, just reading it) with the uimage from here :
http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html

But it's stuck after

Code:
Marvell>> fatload usb 0 0x800000 uimage
reading uimage
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
..

1435184 bytes read
Marvell>> md 0x800000 0x10
00800000: 56190527 19dd11b3 447f1c4f f0e51500    '..V....O..D....
00800010: 00800000 00800000 bab75fed 00020205    ........._......
00800020: 69626544 6b206e61 656e7265 0000006c    Debian kernel...
00800030: 00000000 00000000 00000000 00000000    ................
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Debian kernel
   Created:      2012-01-22  21:27:32 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1435120 Bytes =  1.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.


Logged

bigbear59
Newbie
*

Karma: 0
Posts: 26


View Profile
« Reply #5 on: February 14, 2012, 10:33:00 AM »

Did you upgrade the Uboot?

http://www.plugcomputer.org/plugforum/index.php?topic=6057.0


Quote
Unfortunately, anyone else that takes the link from the Debian Linux page will also see the recommendation to upgrade u-boot.

http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html

"You have to upgrade the u-boot boot loader before you can install Debian. "
Logged

Give me a fish, I eat for a day.  Teach me to fish, I eat for a lifetime.
"Do you have any spades?"

Mwoua
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #6 on: February 14, 2012, 11:57:49 AM »

Same after upgrading.

Maybe my whole Debian install is fucked up and i need to reinstall everything (i've just used the uimage from my link with the method you gave me)

Maybe i should try to use the uInitrd aswell (but my internet is still broken and i guess it needs it), i dunno what the uinitrd is, im kinda new to linux
Logged

Mwoua
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #7 on: March 04, 2012, 03:17:22 PM »

Hi again.

I've finally gotten my internet back, so i tried to fix my sheevaplug

I've installed a clean Debian install on SD card following this :
 http://www.plugcomputer.org/plugwiki/index.php/Installing_Debian_To_Flash

Tried putting in on the nand, and boot on it, but it doesnt work
i think that my var are not good

Here is what i getd

Code:
U-Boot 2011.12 (Jan 08 2012 - 21:53:47)
Marvell-Sheevaplug - eSATA - SD/MMC

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  512 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
Marvell>> printenv
arcNumber=2097
baudrate=115200
bootargs=console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
bootargs_console=console=ttyS0,115200
bootcmd=setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x00800000 0                                                        x01100000
bootcmd_mmc=mmc init; ext2load mmc 0:1 0x00800000 /uImage; ext2load mmc 0:1 0x01                                                        100000 /uInitrd
bootdelay=3
ethact=egiga0
ethaddr=F0:Ad04E:A0:2E
fileaddr=2000000
filesize=2C9270
ipaddr=192.168.0.40
mainlineLinux=yes
serverip=192.168.0.1
stderr=serial
stdin=serial
stdout=serial
x_bootargs=console=ttyS0,115200 mtdparts=orion_nand:512k(uboot),4m@1m(kernel),50                                                        7m@5m(rootfs) rw
x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000
x_bootcmd_sata=ide reset;
x_bootcmd_usb=usb start;

Environment size: 819/131068 bytes
Marvell>> setenv mtdpartitions 'mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)'
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x60000 -- 100% complete.
Writing to Nand... done
Marvell>> setenv bootargs_console 'console=ttyS0,115200'
Marvell>> setenv bootargs_console
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x60000 -- 100% complete.
Writing to Nand... done
Marvell>> setenv bootcmd 'setenv bootargs $(bootargs) $(mtdpartitions); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
Marvell>> setenv e 'ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)'
Marvell>> bootcmd
Unknown command 'bootcmd' - try 'help'
Marvell>> boot

NAND read: device 0 offset 0x100000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.2.9
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2921008 Bytes = 2.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Initializing cgroup subsys cpu
Linux version 3.2.9 (kelly@bbb.internal) (gcc version 4.5.3 (PlugComputer G++ 20110530) ) #2 PREEMPT Thu Mar 1 02:57:30 MST 2012
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell SheevaPlug Reference Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 513424k/513424k available, 10864k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xe0800000 - 0xfe800000   ( 480 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc056cb14   (5523 kB)
      .init : 0xc056d000 - 0xc0597000   ( 168 kB)
      .data : 0xc0598000 - 0xc05d2df8   ( 236 kB)
       .bss : 0xc05d2e1c - 0xc062e66c   ( 367 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Console: colour dummy device 80x30
Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Initializing cgroup subsys cpuacct
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
Kirkwood: MV88F6281-A1, TCLK=200000000.
Feroceon L2: Cache support initialised.
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource orion_clocksource
FS-Cache: Loaded
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
FS-Cache: Netfs 'nfs' registered for caching
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 4011, nTxLock = 32089
msgmni has been set to 1002
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
brd: module loaded
loop: module loaded
ONFI flash detected
NAND device: Manufacturer ID: 0xad, Chip ID: 0xdc (Hynix NAND 512MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 49 at 0x000000620000
Bad eraseblock 154 at 0x000001340000
Bad eraseblock 670 at 0x0000053c0000
Bad eraseblock 1574 at 0x00000c4c0000
Bad eraseblock 1575 at 0x00000c4e0000
Bad eraseblock 2819 at 0x000016060000
Bad eraseblock 3809 at 0x00001dc20000
2 cmdlinepart partitions found on MTD device orion_nand
Creating 2 MTD partitions on "orion_nand":
0x000000100000-0x000000500000 : "uImage"
0x000000500000-0x000020000000 : "rootfs"
UBI error: ubi_init: UBI error: cannot initialize UBI, error -19
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address f0:4e:a0:2e:00:00
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mousedev: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
i2c /dev entries driver
cpuidle: using governor ladder
cpuidle: using governor menu
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)
sdhci-pltfm: SDHCI platform and OF driver helper
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
Registering the dns_resolver key type
registered taskstats version 1
rtc-mv rtc-mv: setting system clock to 2012-03-04 21:53:28 UTC (1330898008)
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00            4096 mtdblock0  (driver?)
1f01          519168 mtdblock1  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c000d1e0>] (unwind_backtrace+0x0/0xe0) from [<c0407250>] (panic+0x58/0x188)
[<c0407250>] (panic+0x58/0x188) from [<c056dbec>] (mount_block_root+0x1bc/0x1fc)
[<c056dbec>] (mount_block_root+0x1bc/0x1fc) from [<c056de9c>] (prepare_namespace+0x88/0x1c0)
[<c056de9c>] (prepare_namespace+0x88/0x1c0) from [<c056d850>] (kernel_init+0xe4/0x118)
[<c056d850>] (kernel_init+0xe4/0x118) from [<c0009598>] (kernel_thread_exit+0x0/0x8)

Then it crashed and couldnt do anything
Logged

Pages: [1]
Print
Jump to: