User:Martix/U-Boot environment

From Openmoko

< User:Martix(Difference between revisions)
Jump to: navigation, search
 
(7 intermediate revisions by one user not shown)
Line 5: Line 5:
 
<pre>
 
<pre>
 
cu -l /dev/ttyACM0
 
cu -l /dev/ttyACM0
 +
</pre>
 +
 +
You can print your current U-Boot environment.
 +
<pre>
 +
printenv
 
</pre>
 
</pre>
  
 
See also [[Bootloader commands#Environment]].
 
See also [[Bootloader commands#Environment]].
  
 +
My configuration as example.
 
<pre>
 
<pre>
 
boot_menu_timeout=300
 
boot_menu_timeout=300
Line 23: Line 29:
 
stdout=usbtty
 
stdout=usbtty
 
usbtty=cdc_acm
 
usbtty=cdc_acm
menu_2=Boot from microSD part3 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p3 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage3.bin; bootm 0x32000000
+
menu_1=Boot from microSD part2 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=8 debug ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage2.bin; bootm 0x32000000
menu_4=Boot from microSD part6 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p6 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage6.bin; bootm 0x32000000
+
menu_2=Boot from microSD part3 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p3 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage3.bin; bootm 0x32000000
menu_3=Boot from microSD part5 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p5 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage5.bin; bootm 0x32000000
+
menu_3=Boot from microSD part5 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p5 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage5.bin; bootm 0x32000000
menu_5=Boot from microSD part7 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p7 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage7.bin; bootm 0x32000000
+
menu_4=Boot from microSD part6 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p6 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage6.bin; bootm 0x32000000
bootcmd=setenv bootargs ${bootargs} ${mtdparts}; nand read.e 0x32000000 kernel 0x200000; bootm 0x32000000
+
menu_5=Boot from microSD part7 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p7 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage7.bin; bootm 0x32000000
menu_1=Boot from microSD part2 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=8 debug ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage2.bin; bootm 0x32000000
+
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel 0x300000; bootm 0x32000000
bootargs_base=rootfstype=ext3 root=/dev/mmcblk0p2 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
+
bootargs=rootfstype=ext3 root=/dev/mmcblk0p2 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootargs=rootfstype=jffs2 root=/dev/mtdblock6 init=/usr/bin/bootchart-lite console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
+
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
 
partition=nor0,0
 
partition=nor0,0
 
mtddevnum=0
 
mtddevnum=0
Line 41: Line 47:
 
You should escape ';', '$' by '\' and replace first occurence of '=' with ' ' on each line.
 
You should escape ';', '$' by '\' and replace first occurence of '=' with ' ' on each line.
 
<pre>
 
<pre>
bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x200000\; bootm 0x32000000
+
bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x300000\; bootm 0x32000000
 +
</pre>
 +
 
 +
Write configuration (line by line) to u-boot envirnment and save it.
 +
<pre>
 +
GTA02v5 # setenv bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x300000\; bootm 0x32000000
 +
GTA02v5 # saveenv
 
</pre>
 
</pre>

Latest revision as of 13:15, 30 June 2010

Custom U-Boot environment configuration with multiboot options for microSD.

See also U-boot#Using_usbtty_from_Linux.

cu -l /dev/ttyACM0

You can print your current U-Boot environment.

printenv

See also Bootloader commands#Environment.

My configuration as example.

boot_menu_timeout=300
bootdelay=1
menu_6=Reboot: reset
menu_8=Power off: neo1973 power-off
mtdids=nor0=physmap-flash,nand0=neo1973-nand
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
quiet=1
sd_image_name=uImage.bin
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 0x8800000 0x96000
stderr=usbtty
stdin=usbtty
stdout=usbtty
usbtty=cdc_acm
menu_1=Boot from microSD part2 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=8 debug ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage2.bin; bootm 0x32000000
menu_2=Boot from microSD part3 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p3 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage3.bin; bootm 0x32000000
menu_3=Boot from microSD part5 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p5 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage5.bin; bootm 0x32000000
menu_4=Boot from microSD part6 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p6 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage6.bin; bootm 0x32000000
menu_5=Boot from microSD part7 (ext3+ext3): setenv bootargs ${bootargs} rootfstype=ext3 root=/dev/mmcblk0p7 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage7.bin; bootm 0x32000000
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel 0x300000; bootm 0x32000000
bootargs=rootfstype=ext3 root=/dev/mmcblk0p2 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
partition=nor0,0
mtddevnum=0
mtddevname=nor
pcb_rev=0x000
pcf50633_int1=0x80
pcf50633_int2=0x02

You should escape ';', '$' by '\' and replace first occurence of '=' with ' ' on each line.

bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x300000\; bootm 0x32000000

Write configuration (line by line) to u-boot envirnment and save it.

GTA02v5 # setenv bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x300000\; bootm 0x32000000
GTA02v5 # saveenv
Personal tools

Custom U-Boot environment configuration with multiboot options for microSD.

See also U-boot#Using_usbtty_from_Linux.

cu -l /dev/ttyACM0

See also Bootloader commands#Environment.

boot_menu_timeout=300
bootdelay=1
menu_6=Reboot: reset
menu_8=Power off: neo1973 power-off
mtdids=nor0=physmap-flash,nand0=neo1973-nand
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
quiet=1
sd_image_name=uImage.bin
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 0x8800000 0x96000
stderr=usbtty
stdin=usbtty
stdout=usbtty
usbtty=cdc_acm
menu_2=Boot from microSD part3 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p3 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage3.bin; bootm 0x32000000
menu_4=Boot from microSD part6 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p6 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage6.bin; bootm 0x32000000
menu_3=Boot from microSD part5 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p5 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage5.bin; bootm 0x32000000
menu_5=Boot from microSD part7 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p7 rootdelay=5 ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage7.bin; bootm 0x32000000
bootcmd=setenv bootargs ${bootargs} ${mtdparts}; nand read.e 0x32000000 kernel 0x200000; bootm 0x32000000
menu_1=Boot from microSD part2 (ext3+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=8 debug ${mtdparts} ro; mmcinit; sleep 1; ext2load mmc 1 0x32000000 uImage2.bin; bootm 0x32000000
bootargs_base=rootfstype=ext3 root=/dev/mmcblk0p2 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootargs=rootfstype=jffs2 root=/dev/mtdblock6 init=/usr/bin/bootchart-lite console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
partition=nor0,0
mtddevnum=0
mtddevname=nor
pcb_rev=0x000
pcf50633_int1=0x80
pcf50633_int2=0x02

You should escape ';', '$' by '\' and replace first occurence of '=' with ' ' on each line.

bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x200000\; bootm 0x32000000