U-Boot environment

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(chg)
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
{{Languages|Bootloader environment}}
 +
 
{{Bootloader}}
 
{{Bootloader}}
  
The bootloader environment configures the [[bootloader]]. Between reboots, the environment is stored with a checksum in the internal flash [[partition]] called "u-boot_env". On the bootloader console, there are [[bootloader commands#Environment|bootloader commands for environment manipulation]].
+
The U-Boot environment configures the [[U-Boot]]. Between reboots, the environment is stored with a checksum in the internal flash [[Partitions|partition]] called "u-boot_env". On the U-Boot console, there are [[U-Boot commands#Environment|U-Boot commands for environment manipulation]].
  
 
== Typical environment ==
 
== Typical environment ==
Line 26: Line 28:
 
== Timeouts ==
 
== Timeouts ==
  
If the boot loader menu is on the screen, the phone will power off when there hasn't been activity for a while. This is not nice if you are working on the boot loader console, but you can make the time longer:
+
If the U-Boot menu is on the screen, the phone will power off when there hasn't been activity for a while. This is not nice if you are working on the boot loader console, but you can make the time longer:
 
<pre>
 
<pre>
 
setenv boot_menu_timeout [seconds]
 
setenv boot_menu_timeout [seconds]
Line 41: Line 43:
  
 
For example the following command will add a boot menu entry that switches to autofast charging and turns off the backlight:
 
For example the following command will add a boot menu entry that switches to autofast charging and turns off the backlight:
  setenv menu_6 Autofast-Charge and Backlight Off: neo1973 charger autofast\; neo1973 backlight off
+
setenv menu_6 Autofast-Charge and Backlight Off: neo1973 charger autofast\; neo1973 backlight off
  
 
While in this state, your Neo1973 can be charged with a generic USB charger. You also need to set boot_menu_timeout to 65000 to keep it from powering down, though.
 
While in this state, your Neo1973 can be charged with a generic USB charger. You also need to set boot_menu_timeout to 65000 to keep it from powering down, though.
 +
 +
=== Booting to the menu ===
 +
To stop in the NAND menu, press and hold the AUX key after pressing the power button at startup. In recent versions of U-Boot (builds from august 5 200?), you can also permanently enter the menu by setting the <tt>stop_in_menu</tt> environment variable to <tt>yes</tt>:
 +
 +
setenv stop_in_menu yes
 +
saveenv
 +
 +
to restore normal startup, unset this variable or set it to <tt>no</tt>.
  
 
== Console ==
 
== Console ==
  
To get access to the bootloader console over USB, the following settings need to be made:
+
To get access to the U-Boot console over USB with e.g., [[NeoCon]], the following settings need to be made:
 
<pre>
 
<pre>
 
GTA01Bv2 # setenv stderr usbtty
 
GTA01Bv2 # setenv stderr usbtty
Line 53: Line 63:
 
GTA01Bv2 # setenv stdin usbtty
 
GTA01Bv2 # setenv stdin usbtty
 
</pre>
 
</pre>
{{Languages|Bootloader}}
+
 
[[Category:Software]]
+
== See also ==
[[Category:Kernel]]
+
 
[[Category:Guides]]
+
* http://lists.openmoko.org/pipermail/community/2008-September/029845.html
 +
* http://markmail.org/message/d2abi2nm5vms3unh
 +
* http://lists.openmoko.org/pipermail/community/2009-January/038827.html
 +
 
 +
[[Category:Bootloaders]]

Latest revision as of 08:59, 10 February 2012


Bootloaders

The U-Boot environment configures the U-Boot. Between reboots, the environment is stored with a checksum in the internal flash partition called "u-boot_env". On the U-Boot console, there are U-Boot commands for environment manipulation.

Contents

[edit] Typical environment

baudrate=115200
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416
usbtty=cdc_acm
bootdelay=10
stdout=serial
stderr=serial
stdin=serial
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)
mtdids=nand0=neo1973-nand
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000
pcf50606_int1=0x40
filesize=160C000
partition=nand0,0
mtddevnum=0
mtddevname=u-boot

[edit] Timeouts

If the U-Boot menu is on the screen, the phone will power off when there hasn't been activity for a while. This is not nice if you are working on the boot loader console, but you can make the time longer:

setenv boot_menu_timeout [seconds]

After the phone is powered on, there is a short period of time when you can connect to the console and cancel the automatic boot without going to the menu:

setenv bootdelay [seconds]

[edit] Menu

You can add items to the boot menu by setting environment variables of the form menu_<number> to values of the form <Title>: U-Boot-Commands.

For example the following command will add a boot menu entry that switches to autofast charging and turns off the backlight: setenv menu_6 Autofast-Charge and Backlight Off: neo1973 charger autofast\; neo1973 backlight off

While in this state, your Neo1973 can be charged with a generic USB charger. You also need to set boot_menu_timeout to 65000 to keep it from powering down, though.

[edit] Booting to the menu

To stop in the NAND menu, press and hold the AUX key after pressing the power button at startup. In recent versions of U-Boot (builds from august 5 200?), you can also permanently enter the menu by setting the stop_in_menu environment variable to yes:

setenv stop_in_menu yes saveenv

to restore normal startup, unset this variable or set it to no.

[edit] Console

To get access to the U-Boot console over USB with e.g., NeoCon, the following settings need to be made:

GTA01Bv2 # setenv stderr usbtty
GTA01Bv2 # setenv stdout usbtty
GTA01Bv2 # setenv stdin usbtty

[edit] See also

Personal tools
Bootloaders

The bootloader environment configures the bootloader. Between reboots, the environment is stored with a checksum in the internal flash partition called "u-boot_env". On the bootloader console, there are bootloader commands for environment manipulation.

Typical environment

baudrate=115200
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416
usbtty=cdc_acm
bootdelay=10
stdout=serial
stderr=serial
stdin=serial
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)
mtdids=nand0=neo1973-nand
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000
pcf50606_int1=0x40
filesize=160C000
partition=nand0,0
mtddevnum=0
mtddevname=u-boot

Timeouts

If the boot loader menu is on the screen, the phone will power off when there hasn't been activity for a while. This is not nice if you are working on the boot loader console, but you can make the time longer:

setenv boot_menu_timeout [seconds]

After the phone is powered on, there is a short period of time when you can connect to the console and cancel the automatic boot without going to the menu:

setenv bootdelay [seconds]

Menu

You can add items to the boot menu by setting environment variables of the form menu_<number> to values of the form <Title>: U-Boot-Commands.

For example the following command will add a boot menu entry that switches to autofast charging and turns off the backlight:

 setenv menu_6 Autofast-Charge and Backlight Off: neo1973 charger autofast\; neo1973 backlight off

While in this state, your Neo1973 can be charged with a generic USB charger. You also need to set boot_menu_timeout to 65000 to keep it from powering down, though.

Console

To get access to the bootloader console over USB, the following settings need to be made:

GTA01Bv2 # setenv stderr usbtty
GTA01Bv2 # setenv stdout usbtty
GTA01Bv2 # setenv stdin usbtty