Just want to note that I (gena2x) decided to provide and support u-boot as far as I can. To find info on my latest u-boot version with bug-fixes, description how to setup u-boot, list of known bugs please visit [[U-boot-gena2x]]

+

Just want to note that I (gena2x) decided to provide and support U-Boot as far as I can. To find info on my latest U-Boot version with bug-fixes, description how to setup u-boot, list of known bugs please visit '''[[U-boot-gena2x]]'''

'''U-Boot''' is a [[bootloader]] which can be used on the [[Neo 1973]] and [[Neo FreeRunner]]. It takes care of device functionality until the operating system is booted. This includes [[USB DFU]] for [[Flashing the Neo FreeRunner]], a splash screen, a boot menu, a console for [[bootloader commands]], configuration via [[bootloader environment]], and loading a [[kernel]].

+

'''U-Boot''' is a [[bootloader]] which can be used on the [[Neo 1973]] and [[Neo FreeRunner]]. It takes care of device functionality until the operating system is booted. This includes [[USB DFU]] for [[Flashing the Neo FreeRunner]], a [[Configuring_the_boot_splash_screens#U-Boot_Splash|splash screen]], a boot menu, a console for [[U-Boot commands]], configuration via [[U-Boot environment]], and loading a [[kernel]].

−

== Booting into U-boot ==

+

== Booting into U-Boot ==

* Make sure that your phone has had the battery and USB cable removed for at least 30 seconds.

* Make sure that your phone has had the battery and USB cable removed for at least 30 seconds.

Line 17:

Line 18:

* Connect to /dev/ttyACM0 with a terminal program on the Linux host (you might need to chown uucp.uucp /dev/ttyACM0; see also below)

* Connect to /dev/ttyACM0 with a terminal program on the Linux host (you might need to chown uucp.uucp /dev/ttyACM0; see also below)

* Note that the cdc_acm /dev/ttyACM0 access disappears as soon as the Neo boots, and is replaced by the cdc_ether usb0 network access.

* Note that the cdc_acm /dev/ttyACM0 access disappears as soon as the Neo boots, and is replaced by the cdc_ether usb0 network access.

−

* You're now at the bootloader prompt.

+

* You're now at the U-Boot prompt.

−

* Set the bootdelay uboot environment variable to -1 if you want it to always halt at the bootloader on power-up.

+

* Set the bootdelay U-Boot environment variable to -1 if you want it to always halt at the U-Boot on power-up.

== General ==

== General ==

−

More information on u-boot can be found at

+

More information on U-Boot can be found at

* http://www.denx.de/wiki/DULG

* http://www.denx.de/wiki/DULG

* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot

* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot

* http://linuxdevices.com/articles/AT5085702347.html

* http://linuxdevices.com/articles/AT5085702347.html

−

Additions to the vanilla u-boot already implemented include:

+

Additions to the vanilla U-Boot already implemented include:

* Support for boot from NAND flash using [[S3C2410 Steppingstone]]

* Support for boot from NAND flash using [[S3C2410 Steppingstone]]

* Support for S3C2410 NAND flash

* Support for S3C2410 NAND flash

Line 33:

Line 34:

* Support to display bootup logo / status on S3C2410 Framebuffer

* Support to display bootup logo / status on S3C2410 Framebuffer

−

However, u-boot still doesn't support many of the features that GTA01 needs, such as

+

However, U-Boot still doesn't support many of the features that GTA01 needs, such as

* Support for reading kernel/initrd from SD/Transflash

* Support for reading kernel/initrd from SD/Transflash

[[User:HaraldWelte|HaraldWelte]] is working on those issues, and in fact most of them have already been implemented.

[[User:HaraldWelte|HaraldWelte]] is working on those issues, and in fact most of them have already been implemented.

−

== Bootloader source code ==

+

== U-Boot source code ==

−

The current bootloader source can be found at http://git.openmoko.org/?p=u-boot.git;a=shortlog;h=stable .

+

The current U-Boot source can be found at http://git.openmoko.org/?p=u-boot.git;a=shortlog;h=stable .

−

To get u-boot by git:

+

To get U-Boot by git:

git clone git://git.openmoko.org/git/u-boot.git openmoko/u-boot

git clone git://git.openmoko.org/git/u-boot.git openmoko/u-boot

−

To build u-boot:

+

To build U-Boot:

* Clone the git tree and check out the stable branch (commands from above)

* Clone the git tree and check out the stable branch (commands from above)

git checkout origin/stable

git checkout origin/stable

Line 58:

Line 59:

cd openmoko/u-boot

cd openmoko/u-boot

git checkout origin/stable

git checkout origin/stable

−

export CROSS_COMPILE=arm-angstrom-linux-gnueabi

+

export CROSS_COMPILE=arm-angstrom-linux-gnueabi-

make gta02v5_config

make gta02v5_config

make u-boot.udfu

make u-boot.udfu

−

== Bootloader binary ==

+

== U-Boot binary ==

−

The latest bootloader binary builds can be found under:

+

The latest U-Boot binary builds can be found under:

* Before 20100131? Are there any newer that supports ubifs? Can it be replaced by [[Qi]]?:

* Before 20100131? Are there any newer that supports ubifs? Can it be replaced by [[Qi]]?:

** http://downloads.openmoko.org/distro/unstable/daily/

** http://downloads.openmoko.org/distro/unstable/daily/

All versions of the GTA02 (Neo FreeRunner) that have been sold to the public are version 5 hardware, so look for a file with "gta02" and "v5" in the name, for example:

All versions of the GTA02 (Neo FreeRunner) that have been sold to the public are version 5 hardware, so look for a file with "gta02" and "v5" in the name, for example:

−

uboot-gta02v5-latest.bin

+

uboot-gta02v5-latest.bin

The file should be written to the NAND flash address 0x00000000 (size 0x30000) (the first [[Partitions|partition]]).

The file should be written to the NAND flash address 0x00000000 (size 0x30000) (the first [[Partitions|partition]]).

−

== Bootloader development ==

+

== U-Boot development ==

=== QT2410 ===

=== QT2410 ===

−

If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.

+

If you want to do U-Boot development on the QT2410, it's easier to work with a U-Boot image that can be downloaded via USB into RAM instead of flashing.

To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".

To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".

Line 84:

Line 85:

=== Neo 1973 ===

=== Neo 1973 ===

−

Doing bootloader development on the [[Neo 1973]] is a bit more tricky. First, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.

+

Doing U-Boot development on the [[Neo 1973]] is a bit more tricky. First, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.

The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this

The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this

Line 125:

Line 126:

</pre>

</pre>

−

* Download the u-boot RAM image to 0x33f80000

+

* Download the U-Boot RAM image to 0x33f80000

<pre>

<pre>

> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000

> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000

Line 154:

Line 155:

== Creating bootable images ==

== Creating bootable images ==

−

U-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:

+

U-Boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:

As of the Phase-0 release, our u-boot version now features an on-screen boot menu. The items are defined by [[bootloader environment#menu|menu entries in the environment]].

+

As of the Phase-0 release, our U-Boot version now features an on-screen boot menu. The items are defined by [[U-Boot environment#menu|menu entries in the environment]].

=== Accessing the boot menu ===

=== Accessing the boot menu ===

Line 175:

Line 176:

By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.

By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.

−

== Bootloader prompt ==

+

== U-Boot prompt ==

−

=== Accessing the bootloader prompt ===

+

=== Accessing the U-Boot prompt ===

−

The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).

+

The U-Boot prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).

−

Whether the serial port or usb is used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.

+

Whether the serial port or usb is used depends on the U-Boot environment variables '''stdin''', '''stdout''' and '''stderr'''.

Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.

Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.

−

The bootloader is currently configured to wait for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.

+

The U-Boot is currently configured to wait for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.

==== Using usbtty from Linux ====

==== Using usbtty from Linux ====

−

Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttyACM0. If not, check that module cdc_acm is loaded or CONFIG_USB_ACM=y (Device Drivers -> USB support -> USB Modem (CDC ACM) support). (Instructions for MacOS users are [[MacOS_X#USB_Serial|here]])

+

Just by connecting the phone in U-Boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttyACM0. If not, check that module cdc_acm is loaded or CONFIG_USB_ACM=y (Device Drivers -> USB support -> USB Modem (CDC ACM) support). (Instructions for MacOS users are [[MacOS_X#USB_Serial|here]])

* Now let devirginator generate a new u-boot_env partition for us, - that contains the partition table from our u-boot_env, - and all changes we wanted to make; Note that the -D GTA02 is needed for the neo FreeRunner only, and has to come before the other options.

* Now let devirginator generate a new u-boot_env partition for us, - that contains the partition table from our u-boot_env, - and all changes we wanted to make; Note that the -D GTA02 is needed for the neo FreeRunner only, and has to come before the other options.

Line 371:

Line 372:

== Device Firmware Upgrade ==

== Device Firmware Upgrade ==

−

Our version of u-boot also implements [[USB DFU]]. This can be useful to

+

Our version of U-Boot also implements [[USB DFU]]. This can be useful to

load files and kernel for quick testing.

load files and kernel for quick testing.

−

To find out whether your version of u-boot supports this, use the output of

+

To find out whether your version of U-Boot supports this, use the output of

$ lsusb -v -d 1457:5119

$ lsusb -v -d 1457:5119

while the phone is in u-boot mode.

while the phone is in u-boot mode.

Line 445:

Line 446:

=== USB connectivity problems ===

=== USB connectivity problems ===

−

I once got errors like this (in dmesg or /var/log/messages) on the host side while connecting the neo in u-boot:

+

I once got errors like this (in dmesg or /var/log/messages) on the host side while connecting the Neo in U-Boot:

usb 2-1: device descriptor read/64, error -110

usb 2-1: device descriptor read/64, error -110

Line 465:

Line 466:

== Related pages ==

== Related pages ==

−

See [[Flashing the Neo 1973]] and [[Flashing the Neo FreeRunner]] for instructions on using dfu-util to install a new bootloader in your phone.

+

See [[Flashing the Neo 1973]] and [[Flashing the Neo FreeRunner]] for instructions on using dfu-util to install a new U-Boot in your phone.

Just want to note that I (gena2x) decided to provide and support U-Boot as far as I can. To find info on my latest U-Boot version with bug-fixes, description how to setup u-boot, list of known bugs please visit U-boot-gena2x

Outdated warning ! This article or section is significantly outdated, either by significant hardware or software changes. Procedures mentioned in this page may well not work for current hardware/software.

Doing U-Boot development on the Neo 1973 is a bit more tricky. First, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.

The main problem is: The S3C2410 Steppingstone unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this

The U-Boot prompt is available either on the serial console (via Debug Board), or as virtual USB Serial device (USB CDC_ACM).
Whether the serial port or usb is used depends on the U-Boot environment variables stdin, stdout and stderr.

Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.

The U-Boot is currently configured to wait for three seconds. If a key press on the stdin is received within those three seconds, auto-boot is aborted.

Just by connecting the phone in U-Boot mode to your Linux pc should make it detect a CDC ACM device, and you should get a new tty device called /dev/ttyACM0. If not, check that module cdc_acm is loaded or CONFIG_USB_ACM=y (Device Drivers -> USB support -> USB Modem (CDC ACM) support). (Instructions for MacOS users are here)

You can adapt the instructions for USB-serial from the Mac OS page.
If you don't have a favorite, try just "cu -l dev/ttyACM0". It is in the taylor-uucp package, use "apt-get install cu" if it is not yet installed

Enter Bootprompt with:

cu -l /dev/ttyACM0

You might need to

chown uucp.uucp /dev/ttyACM0

to get the necessary rights (even as root, must be done each time). For example, if cu prints "cu: /dev/ttyACM0: Line in use", then try chowning /dev/ttyACM0 to uucp.uucp; apparently cu can be pretty picky about permissions.

Now let devirginator generate a new u-boot_env partition for us, - that contains the partition table from our u-boot_env, - and all changes we wanted to make; Note that the -D GTA02 is needed for the neo FreeRunner only, and has to come before the other options.

./envedit.pl -D GTA02 -i env.in -f environment.in -o env.out

On my box the partition layout didn't seem to match the idea of envedit.pl, so it issued 2 warnings:

Just want to note that I (gena2x) decided to provide and support u-boot as far as I can. To find info on my latest u-boot version with bug-fixes, description how to setup u-boot, list of known bugs please visit U-boot-gena2x

Outdated warning ! This article or section is significantly outdated, either by significant hardware or software changes. Procedures mentioned in this page may well not work for current hardware/software.

Bootloader binary

All versions of the GTA02 (Neo FreeRunner) that have been sold to the public are version 5 hardware, so look for a file with "gta02" and "v5" in the name, for example:
uboot-gta02v5-latest.bin

The file should be written to the NAND flash address 0x00000000 (size 0x30000) (the first partition).

Bootloader development

QT2410

If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.

To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".

The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the s3c2410_boot_usb program.

Neo 1973

Doing bootloader development on the Neo 1973 is a bit more tricky. First, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.

The main problem is: The S3C2410 Steppingstone unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this

Boot menu

Accessing the boot menu

You can access the boot menu by pressing and holding the Neo1973 AUX Button together with the power button while switching the phone on.

Using the boot menu

By pressing the Neo1973 AUX Button you can cycle through the menu items. Use the POWER button to select one item.

Bootloader prompt

Accessing the bootloader prompt

The bootloader prompt is available either on the serial console (via Debug Board), or as virtual USB Serial device (USB CDC_ACM).
Whether the serial port or usb is used depends on the u-boot environment variables stdin, stdout and stderr.

Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.

The bootloader is currently configured to wait for three seconds. If a key press on the stdin is received within those three seconds, auto-boot is aborted.

Using usbtty from Linux

Just by connecting the phone in u-boot mode to your Linux pc should make it detect a CDC ACM device, and you should get a new tty device called /dev/ttyACM0. If not, check that module cdc_acm is loaded or CONFIG_USB_ACM=y (Device Drivers -> USB support -> USB Modem (CDC ACM) support). (Instructions for MacOS users are here)

You can adapt the instructions for USB-serial from the Mac OS page.
If you don't have a favorite, try just "cu -l dev/ttyACM0". It is in the taylor-uucp package, use "apt-get install cu" if it is not yet installed

Enter Bootprompt with:

cu -l /dev/ttyACM0

You might need to

chown uucp.uucp /dev/ttyACM0

to get the necessary rights (even as root, must be done each time). For example, if cu prints "cu: /dev/ttyACM0: Line in use", then try chowning /dev/ttyACM0 to uucp.uucp; apparently cu can be pretty picky about permissions.

Now let devirginator generate a new u-boot_env partition for us, - that contains the partition table from our u-boot_env, - and all changes we wanted to make; Note that the -D GTA02 is needed for the neo FreeRunner only, and has to come before the other options.

./envedit.pl -D GTA02 -i env.in -f environment.in -o env.out

On my box the partition layout didn't seem to match the idea of envedit.pl, so it issued 2 warnings: