Welcome! Log In Create A New Profile

Advanced

uBoot don't save the environment vars on MSS2

Posted by atomical 
uBoot don't save the environment vars on MSS2
April 03, 2012 02:12PM
I have a disk with Arch Linux ARM installed on which boots on the Maxtor Shared Storage II (MSS2) - how I do this is described here http://forum.doozan.com/read.php?3,6540,7530#msg-7530


My problem is - the MSS2 won't save my edited environment variables in flash.

First the output from uboot after switching on the device:

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__|  ** LOADER **
 ** MARVELL BOARD: RD-88F5182-NAS-MXO LE 

U-Boot 1.1.1 (Jun 22 2006 - 15:24:29) Marvell version: MSS2_1.7.301 Maxtor v1.07

DRAM CS[0] base 0x00000000   size  32MB 
DRAM Total size  32MB 
[256kB@fffc0000] Flash: 256 kB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done

Soc: MV88F5182 Rev 2
CPU: ARM926 (Rev 0) running @ 500Mhz 
SysClock = 166Mhz , TClock = 166Mhz 


USB 0: host mode
USB 1: host mode
Gpp: Front button is NOT pressed
Gpp: Reset button is NOT pressed
Single drive system detected
Net:   egiga0 [PRIME]
Testing memory from 0x400000 to 0xc00000 len 8388608
Memory test (0x55 pattern)... Pass
Memory test (0xAA pattern)... Pass
Memory test (0x55 pattern)... Pass
Burning Maxtor Params at 0xfffff000 sector 63

.
RD_MAXTOR defined
RD_88F5182 defined
MXO_SATA2 is NOT defined

Marvell Serial ATA Adapter
Intergrated Sata device found
  Device 0: OK
Model: SAMSUNG HD321KJ                          Firm: CP100-10 Ser#: S0MQJ1NP204518      
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 305244.3 MB = 298.0 GB (625140335 x 512)

IDE device 0: Model: SAMSUNG HD321KJ                          Firm: CP100-10 Ser#: S0MQJ1NP204518      
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 305244.3 MB = 298.0 GB (625140335 x 512)
.
Un-Protected 1 sectors
Erasing Flash...
.
Erased 1 sectors
Writing to Flash... done
.
Protected 1 sectors
Booting in normal mode
Hit any key to stop autoboot:  0 
Marvell>>

Here the output of printenv:

Marvell>> printenv
baudrate=115200
loads_echo=0
ipaddr=192.168.1.99
serverip=192.168.1.100
cpuName=926
CASset=min
MALLOC_len=4
ethprime=egiga0
bootargs_end=:::DB88FXX81:egiga0:none
standalone=fsload 0x400000 $(image_name);setenv bootargs $(bootargs) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x400000;
usb0Mode=host
usb1Mode=host
ethact=egiga0
ethaddr=00:10:75:FF:cb:7a
stdin=serial
stdout=serial
stderr=serial
enaMonExt=no
enaFlashBuf=yes
enaCpuStream=no
bootdelay=3
disaMvPnp=no
overEthAddr=no
root=root=/dev/nfs rw init=/linuxrc
rootpath=/opt/Orion-SDK/arm
image_name=uImage
default_load_addr=0x200000
bootargs=console=ttyS0,115200
bootargs_root=root=/dev/sda1 rw
bootcmd=ide reset; ide reset; ext2load ide 1:1 0x00200000 /boot/uImage; setenv bootargs $(bootargs) $(bootargs_root); bootm 0x00200000
bootmode=normal

Environment size: 827/4092 bytes

Here what I have to do to boot my disk with Arch Linux ARM:

Marvell>> setenv bootcmd 'ide reset; ext2load ide 0:1 0x00200000 /boot/uImage; setenv bootargs $(bootargs) $(bootargs_root); bootm 0x00200000'
Marvell>> setenv bootargs_root 'root=/dev/sda2 rw'

Now the MSS2 will boot the Arch Linux ARM on my disk by typing boot

Here what I tried to save the environment in flash:

Marvell>> protect off all
Un-Protect Flash Bank # 1
................................................................ done
Marvell>> saveenv
Saving Environment to Flash...
.
Un-Protected 1 sectors
Erasing Flash...
.
Erased 1 sectors
Writing to Flash... done
.
Protected 1 sectors
Marvell>> protect on all
Protect Flash Bank # 1
................................................................ done
Marvell>>


But if I repower the device now nothing of my values is saved - maybe I do something wrong?

On the original disk the first two partitions are completely identical - both with the maxtor adapted linux system - and it seems that the device will boot some times from the first and some times from the second partition.

This won't work for me because I have the kernel on the first and the rootfs on the second partition (due to a ext2 inode issue with the installed uboot version ... see above linked thread).

Any hints how I could manage this? I will try next to get some more information how to format a bigger partition like these on the original partitions with the maxtor firmware.
Re: uBoot don't save the environment vars on MSS2
April 03, 2012 04:11PM
OK - I tried something ...

you have to format the partition with "mkfs.ext2 -I 128 /dev/sdX" to get it readable for the MSS2 uboot ...

... so I created two partitions (first and second partition on the disk) a 4gb on my disk with the full Arch Linux ARM rootfs identically on both ...


... I plugged this disk in the MSS2 ...


... now it tries to boot - after 5 failed attempts to boot it starts one of both identical systems (rootfs is found, init-scripts are started) ...


... but ~26 seconds after the boot countdown (while you can press space for interrupting autoboot) it reboots again - to start the next boot for ~26 seconds followed by reboot and so on


So for now I have to search the original System to stop this behavior.

Any hints?



Edited 1 time(s). Last edit at 04/03/2012 04:12PM by atomical.
Re: uBoot don't save the environment vars on MSS2
April 08, 2012 06:47AM
OK - the problems are solved.

There are some maxtor-specific binaries in the original firmware located in /usr/sbin

I needed mxoparam 3 times (I copied it to /usr/sbin in my Arch Linux ARM rootfs)


  • to disable the watchdog (the output "watchdog enabled" is wrong - it is now disabled)
      mxoparam -f  
  • to set the boot partition (set boot partition to disk 0 partition 1 - the uboot environment is recreated every boot with this value - so I can't save the evironment vars needed for booting in the uboot shell)
      mxoparam -q 0  
  • to set or unset "wait for button pressed" before uboot boots the kernel (set to 1 before shutdown / set to 0 before reboot)
      mxoparam -c 1  

Now the system boots every time from the first partition on the first disk.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: