Quantcast
Channel: Linux Device Hacking - uBoot
Viewing all articles
Browse latest Browse all 902

[How To] Set U-Boot envs for USB booting with Kirkwood plugs (1 reply)

$
0
0
This is a basic but completed set of U-Boot environment variables that is good for booting Debian/Arch using USB. Please be aware that mistakes in changing U-Boot envs could block you out the box, so please use this as a guide only if you have serial console or netconsole.

1. U-Boot version must be one that was installed by Jeff's script, or newer U-Boot that was manually installed (stock U-Boot won't work).

2. And the kernel on the USB rootfs must support your plug. You can find it here: Linux Kernel 3.14.0 Kirkwood package and rootfs (Non Flattened Device Tree).

3. This particular example is for the Pogo V4/Mobile. But it can be adjusted for any Kirkwood plugs. Note these 2variables must match your Kirkwood plug (3960 and f78 are for Pogo V4/Mobile)
arcNumber=3960
machid=f78

4. The ethaddr needs to be the MAC addr that on the sticker for this specific plug:
ethaddr=00:xx:x:xx:xx:xx

5. mtdparts must match what is for your Kirkwood plug, this is the Pogo V4/Mobile:
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)


6. The partition that contains the rootfs on USB must be labeled as rootfs (use tune2fs -L rootfs /dev/sda1, for example). This partition also must be formatted as Ext3.

The completed set of U-Boot envs:
baudrate=115200
bootcmd=run bootcmd_usb; usb stop; reset
bootcmd_usb=run usb_init; run usb_load_uimage; run set_bootargs_usb; run usb_boot;
bootdelay=3
console=ttyS0,115200
ethact=egiga0
ethaddr=00:xx:x:xx:xx:xx
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
partition=nand0,2
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts
stderr=serial
stdin=serial
stdout=serial
usb_boot=if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000;else bootm 0x800000;fi;
usb_device=0:1
usb_init=usb start
usb_load_uimage=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage
usb_rootdelay=10
arcNumber=3960
machid=f78
usb_root=LABEL=rootfs
usb_rootfstype=ext3

Note that it is just a basic set of envs that works for a single USB drive attached. Jeff's script installs a much more robust set of envs that takes into account different types of environment.

Viewing all articles
Browse latest Browse all 902

Trending Articles