Qi

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Added: default behaviour, skipping a kernel)
Line 6: Line 6:
  
 
===Features===
 
===Features===
* booting from SD partitions (1st, 2nd or 3rd)
+
* booting from primary SD partitions (1st, 2nd or 3rd)
 
* booting from NAND
 
* booting from NAND
 
* configuration by files in /boot
 
* configuration by files in /boot
 
* automatically choose correct kernel for device hardware
 
* automatically choose correct kernel for device hardware
 
* ext2/3 are supported
 
* ext2/3 are supported
 +
* symlinks are supported
  
 
===Limitations===
 
===Limitations===
Line 18: Line 19:
  
 
===Defaults===
 
===Defaults===
Qi assumes the rootfs to be on the same partition as the kernel. See [[#/boot-Partition|below]] for help with an extra /boot-partition.
+
Qi assumes the rootfs to be on the same partition as the kernel. See [[#/boot-Partition|below]] for help with an extra /boot-partition. The default rootdelay is 1 second.
  
 
===Files===
 
===Files===
 
; /boot/uImage-GTA0[123].bin
 
; /boot/uImage-GTA0[123].bin
: Kernel images, Qi will look for
+
: Kernel images, Qi will look for (can be in either uImage (u-boot image) or zImage format, file name should still be uImage-GTA0[123].bin)
 
; /boot/append-GTA0[123]
 
; /boot/append-GTA0[123]
 
: Kernel arguments
 
: Kernel arguments
Line 57: Line 58:
  
 
===Choosing a Kernel===
 
===Choosing a Kernel===
If a user presses the AUX button after successful partition mount and before start of the kernel pull (that is, while the red LED is on), this boot possibility is skipped (and GTA02 owners can feel vibration). If a user holds the POWER button just before start of the
+
If a user presses the AUX button after successful partition mount and before start of the kernel pull (that is, while the red LED is on), this boot possibility is skipped (and GTA02 owners can feel vibration).
kernel, debugging parameters are added to the kernel command line and a lot of information is output to the screen.
+
  
 
===Boot Menu===
 
===Boot Menu===
Qi's concept is to leave everything possible to Linux, that includes even the video init. Therefore Qi does NOT provide a boot menu. This should rather be implemented by a minimal Kernel, initramfs and menu system. It may be more comfortable for some users and may get them to switch from uboot to Qi. This does not exist yet.
+
Qi's concept is to leave everything possible to Linux, that includes even the video init. Therefore Qi does NOT provide a boot menu. This should rather be implemented by a minimal Kernel, initramfs and menu system. It may be more comfortable for some users and may get them to switch from uboot to Qi. This does not exist yet (it's already implemented for some Angstrom-supported devices and for Zaurus, so porting should be relatively easy).
  
 
===Download and installation===
 
===Download and installation===
Line 70: Line 70:
 
*GTA03 -> qi-s3c6410
 
*GTA03 -> qi-s3c6410
  
The installation should be flashing like;
+
The installation should be flashing like (do it in DFU mode of NOR u-boot):
 
  # dfu-util -a u-boot -R -D qi-s3c6410-andy_8589b40295653557.udfu
 
  # dfu-util -a u-boot -R -D qi-s3c6410-andy_8589b40295653557.udfu
  
Line 98: Line 98:
 
If you don't specify loglevel=8 in append-GTAXX, and booting fails with a "VFS: Cannot open root device "mmcblk0p1" or unknown-block(2,0)", the SD card needs a little bit more time to initialise.
 
If you don't specify loglevel=8 in append-GTAXX, and booting fails with a "VFS: Cannot open root device "mmcblk0p1" or unknown-block(2,0)", the SD card needs a little bit more time to initialise.
  
Put a "rootdelay=" in append-GTAXX like so:
+
Put a "rootdelay=5" in append-GTAXX like so:
  rootdelay=1
+
  rootdelay=5
  
 
== Testing speed improvements ==
 
== Testing speed improvements ==
Line 123: Line 123:
  
 
So for this particular configuration, it reduced time-to-desktop by about 28%, about 44 seconds.  Surprisingly, the later segments of booting (desktop) were also noticeably faster than with uBoot - One would have expected just the fist stages up until init (kernel finished establishing itself) to be faster.
 
So for this particular configuration, it reduced time-to-desktop by about 28%, about 44 seconds.  Surprisingly, the later segments of booting (desktop) were also noticeably faster than with uBoot - One would have expected just the fist stages up until init (kernel finished establishing itself) to be faster.
 
== Bugs ==
 
 
* Qi won't boot the 'first try' after power restored - the tester didn't count that first 10 seconds for Qi to be fair to its booting speed, not penalize it for what appears to be a bug that bears no relation to actual boot speed).
 
* The current (Oct. 12, 2008) 2.6.27 kernel does not boot from the build-in flash NAND. It only works from the uSD boot on ext3. If one tries to boot it from the flash, then AUX red LED blinks ~4/sec. This means kernel panic... It's panicking because it has no rootfs because it can't mount the jffs2 because of the CRC errors because there is a bug that the mtd are not done properly.
 
* Qi often doesn't want to resume after suspend.
 
* Qi is able to load kernels larger than 2MB correctly, uBoot has a bug.
 
  
 
[[Category:System Developers]]
 
[[Category:System Developers]]

Revision as of 17:39, 18 January 2009

Qi is a replacement for the uBoot bootloader reduced to the core bootloader functions.

Contents

About Qi

Requirements

GTA02 Hardware is recommended over GTA01, since GTA02 does have a fallback u-boot in nor that provides DFU-Mode. Qi does NOT provide DFU-Mode so GTA01-Users will have no (easy) way to flash their device!

Features

  • booting from primary SD partitions (1st, 2nd or 3rd)
  • booting from NAND
  • configuration by files in /boot
  • automatically choose correct kernel for device hardware
  • ext2/3 are supported
  • symlinks are supported

Limitations

  • no DFU-Mode
  • no boot menu
  • FAT partitions are ignored

Defaults

Qi assumes the rootfs to be on the same partition as the kernel. See below for help with an extra /boot-partition. The default rootdelay is 1 second.

Files

/boot/uImage-GTA0[123].bin
Kernel images, Qi will look for (can be in either uImage (u-boot image) or zImage format, file name should still be uImage-GTA0[123].bin)
/boot/append-GTA0[123]
Kernel arguments
/boot/noboot-GTA0[123]
make Qi skip this partition

Boot Order

  1. SD Partition 1
  2. SD Partition 2
  3. SD Partition 3
  4. NAND
  5. Memory Test

LED and Vibrator Signals

  • AUX LED is turned on either on:
    • Successful partition mount
    • Successful kernel pull
    • Successful initramfs pull
  • AUX LED is turned off and vibrator runs briefly either on:
    • Fail of kernel pull
    • Fail of initramfs pull
    • Fail of mount partition
    • Skipping of current boot possibility
  • AUX LED is turned off either on:
    • Start of the kernel
    • Start of the mem test
    • Start of the kernel pull
    • Start of the initramfs pull
  • One Blue shine every ~10 second: did not find any valid kernel to boot
  • About four RED shines per second: kernel panic.

Booting

A short press on the power-button is enough to make Qi start booting.

Choosing a Kernel

If a user presses the AUX button after successful partition mount and before start of the kernel pull (that is, while the red LED is on), this boot possibility is skipped (and GTA02 owners can feel vibration).

Boot Menu

Qi's concept is to leave everything possible to Linux, that includes even the video init. Therefore Qi does NOT provide a boot menu. This should rather be implemented by a minimal Kernel, initramfs and menu system. It may be more comfortable for some users and may get them to switch from uboot to Qi. This does not exist yet (it's already implemented for some Angstrom-supported devices and for Zaurus, so porting should be relatively easy).

Download and installation

The daily download is a qi-s3cXXXX-andy_somenumber.udfu file at http://people.openmoko.org/andy/ . Use the file appropriate to your device:

  • GTA01 -> qi-s3c2410
  • GTA02 -> qi-s3c2442
  • GTA03 -> qi-s3c6410

The installation should be flashing like (do it in DFU mode of NOR u-boot):

# dfu-util -a u-boot -R -D qi-s3c6410-andy_8589b40295653557.udfu

Source code

git://git.openmoko.org/git/qi.git , http://git.openmoko.org/?p=qi.git;a=summary . One can also just use strings(1) on the .udfu file to get an idea of where Qi currently looks for files.

README

The latest README file can be found in the git as well:http://git.openmoko.org/?p=qi.git;a=blob;f=README;hb=HEAD

Tips, Tricks, Tweaks

Enabling console messages

[1] If it's SD Card boot, just create a text file, e.g., for a GTA02 use

/boot/append-GTA02

on the rootfs in question, put in there

console=tty0 loglevel=8

and you'll see the messages on boot. If it's NAND right now you need to edit the default commandline in Qi for gta02.

/boot-Partition

If you have a Partition for /boot, you will need to add a argument for the kernel to know which partition is the rootfs. Add this in /boot/append-GTA0[123]:

root=/dev/mmcblk0p2

for a rootfs on the second partition.

SD Initialisation

If you don't specify loglevel=8 in append-GTAXX, and booting fails with a "VFS: Cannot open root device "mmcblk0p1" or unknown-block(2,0)", the SD card needs a little bit more time to initialise.

Put a "rootdelay=5" in append-GTAXX like so:

rootdelay=5

Testing speed improvements

Stopwatch results on Qi (error is approx ±1/2 second):

Booting SHR image with uBoot:

  • 0:00 power button held down
  • 0:07 splash screen appears
  • 0:15 drops to console showing kernel messages scrolling by for ~1 minute
  • 1:18 Openmoko 'please wait' splash
  • 1:31 desktop animated splash
  • 2:38 finished booting

Booting identical setup with Qi flashed over uBoot:

  • 0:00 power button held down
  • 0:06 backlit black
  • 0:13 please wait booting... (only this text on console for next 38 seconds)
  • 0:51 Angstrom console message (at the end of kernel output with uBoot, but ONLY text display to appear throughout this stage with Qi)
  • 0:54 Openmoko 'please wait' splash
  • 1:05 desktop animated splash
  • 1:54 finished booting

So for this particular configuration, it reduced time-to-desktop by about 28%, about 44 seconds. Surprisingly, the later segments of booting (desktop) were also noticeably faster than with uBoot - One would have expected just the fist stages up until init (kernel finished establishing itself) to be faster.

Personal tools

Qi is a replacement for the uBoot bootloader reduced to the core bootloader functions.

About Qi

Requirements

GTA02 Hardware is recommended over GTA01, since GTA02 does have a fallback u-boot in nor that provides DFU-Mode. Qi does NOT provide DFU-Mode so GTA01-Users will have no (easy) way to flash their device!

Features

  • booting from SD partitions (1st, 2nd or 3rd)
  • booting from NAND
  • configuration by files in /boot
  • automatically choose correct kernel for device hardware
  • ext2/3 are supported

Limitations

  • no DFU-Mode
  • no boot menu
  • FAT partitions are ignored

Defaults

Qi assumes the rootfs to be on the same partition as the kernel. See below for help with an extra /boot-partition.

Files

/boot/uImage-GTA0[123].bin
Kernel images, Qi will look for
/boot/append-GTA0[123]
Kernel arguments
/boot/noboot-GTA0[123]
make Qi skip this partition

Boot Order

  1. SD Partition 1
  2. SD Partition 2
  3. SD Partition 3
  4. NAND
  5. Memory Test

LED and Vibrator Signals

  • AUX LED is turned on either on:
    • Successful partition mount
    • Successful kernel pull
    • Successful initramfs pull
  • AUX LED is turned off and vibrator runs briefly either on:
    • Fail of kernel pull
    • Fail of initramfs pull
    • Fail of mount partition
    • Skipping of current boot possibility
  • AUX LED is turned off either on:
    • Start of the kernel
    • Start of the mem test
    • Start of the kernel pull
    • Start of the initramfs pull
  • One Blue shine every ~10 second: did not find any valid kernel to boot
  • About four RED shines per second: kernel panic.

Booting

A short press on the power-button is enough to make Qi start booting.

Choosing a Kernel

If a user presses the AUX button after successful partition mount and before start of the kernel pull (that is, while the red LED is on), this boot possibility is skipped (and GTA02 owners can feel vibration). If a user holds the POWER button just before start of the kernel, debugging parameters are added to the kernel command line and a lot of information is output to the screen.

Boot Menu

Qi's concept is to leave everything possible to Linux, that includes even the video init. Therefore Qi does NOT provide a boot menu. This should rather be implemented by a minimal Kernel, initramfs and menu system. It may be more comfortable for some users and may get them to switch from uboot to Qi. This does not exist yet.

Download and installation

The daily download is a qi-s3cXXXX-andy_somenumber.udfu file at http://people.openmoko.org/andy/ . Use the file appropriate to your device:

  • GTA01 -> qi-s3c2410
  • GTA02 -> qi-s3c2442
  • GTA03 -> qi-s3c6410

The installation should be flashing like;

# dfu-util -a u-boot -R -D qi-s3c6410-andy_8589b40295653557.udfu

Source code

git://git.openmoko.org/git/qi.git , http://git.openmoko.org/?p=qi.git;a=summary . One can also just use strings(1) on the .udfu file to get an idea of where Qi currently looks for files.

README

The latest README file can be found in the git as well:http://git.openmoko.org/?p=qi.git;a=blob;f=README;hb=HEAD

Tips, Tricks, Tweaks

Enabling console messages

[1] If it's SD Card boot, just create a text file, e.g., for a GTA02 use

/boot/append-GTA02

on the rootfs in question, put in there

console=tty0 loglevel=8

and you'll see the messages on boot. If it's NAND right now you need to edit the default commandline in Qi for gta02.

/boot-Partition

If you have a Partition for /boot, you will need to add a argument for the kernel to know which partition is the rootfs. Add this in /boot/append-GTA0[123]:

root=/dev/mmcblk0p2

for a rootfs on the second partition.

SD Initialisation

If you don't specify loglevel=8 in append-GTAXX, and booting fails with a "VFS: Cannot open root device "mmcblk0p1" or unknown-block(2,0)", the SD card needs a little bit more time to initialise.

Put a "rootdelay=" in append-GTAXX like so:

rootdelay=1

Testing speed improvements

Stopwatch results on Qi (error is approx ±1/2 second):

Booting SHR image with uBoot:

  • 0:00 power button held down
  • 0:07 splash screen appears
  • 0:15 drops to console showing kernel messages scrolling by for ~1 minute
  • 1:18 Openmoko 'please wait' splash
  • 1:31 desktop animated splash
  • 2:38 finished booting

Booting identical setup with Qi flashed over uBoot:

  • 0:00 power button held down
  • 0:06 backlit black
  • 0:13 please wait booting... (only this text on console for next 38 seconds)
  • 0:51 Angstrom console message (at the end of kernel output with uBoot, but ONLY text display to appear throughout this stage with Qi)
  • 0:54 Openmoko 'please wait' splash
  • 1:05 desktop animated splash
  • 1:54 finished booting

So for this particular configuration, it reduced time-to-desktop by about 28%, about 44 seconds. Surprisingly, the later segments of booting (desktop) were also noticeably faster than with uBoot - One would have expected just the fist stages up until init (kernel finished establishing itself) to be faster.

Bugs

  • Qi won't boot the 'first try' after power restored - the tester didn't count that first 10 seconds for Qi to be fair to its booting speed, not penalize it for what appears to be a bug that bears no relation to actual boot speed).
  • The current (Oct. 12, 2008) 2.6.27 kernel does not boot from the build-in flash NAND. It only works from the uSD boot on ext3. If one tries to boot it from the flash, then AUX red LED blinks ~4/sec. This means kernel panic... It's panicking because it has no rootfs because it can't mount the jffs2 because of the CRC errors because there is a bug that the mtd are not done properly.
  • Qi often doesn't want to resume after suspend.
  • Qi is able to load kernels larger than 2MB correctly, uBoot has a bug.