Root/qiboot/README

1Qi
2==
3
4Qi (named by Alan Cox on Openmoko kernel list) is a minimal bootloader that
5"breathes life" into Linux. Its goal is to stay close to the minimum needed
6to "load" and then "boot" Linux -- no boot menus, additional peripheral init
7or private states.
8
9
10What's wrong with U-Boot, they keep telling people to not reinvent the wheel?
11=============================================================================
12
13U-Boot is gradually becoming a simplified knockoff of Linux. After using it a
14while, it became clear we were cutting and pasting drivers into U-Boot from
15Linux, cutting them down and not having a plan to maintain the U-Boot versions
16as the Linux ones were changed.
17
18We decided that we would use full Linux for things that Linux is good at and
19only have the bootloader do the device init that is absolutely required before
20Linux can be pulled into memory and started. In practice since we had a working
21U-Boot implementation it meant cutting that right down to the bone (start.S
22mainly for s3c2442) and then building it up from scratch optimized to just do
23load and boot.
24
25
26Samsung - specific boot sequence
27================================
28
29Right now Qi supports Samsung "steppingstone" scheme devices, but in fact it's
30the same in processors like iMX31 that there is a small area of SRAM that is
31prepped with NAND content via ROM on the device. There's nothing that stops Qi
32use on processors without steppingstone, although the ATAG stuff assumes we deal
33with ARM based processor.
34
35
36Per-CPU Qi
37==========
38
39Qi has a concept of a single bootloader binary created per CPU type. The
40different devices that use that CPU are all supported in the same binary. At
41runtime after the common init is done, Qi asks each supported device code in
42turn if it recognizes the device as being handled by it, the first one to reply
43that it knows the device gets to control the rest of the process.
44
45Consequently, there is NO build-time configuration file as found on U-Boot
46except a make env var that sets the CPU type being built, eg:
47
48  make CPU=s3c6410
49
50
51Booting Heuristics
52==================
53
54Qi has one or more ways to fetch a kernel depending on the device it finds it is
55running on, for example on GTA02 it can use NAND and SD card devices. It goes
56through these device-specific storage devices in order and tries to boot the
57first viable kernel it finds, usually /boot/<uImage-device>.bin for example
58/boot/uImage-GTA02.bin.
59
60The default order for GTA02 is: 1st SD primary partition, 2nd primary
61partition, 3rd primary partition, NAND kernel partition.
62
63You can disable a rootfs for consideration for boot if you add a file
64/boot/noboot-<device>, eg, /boot/noboot-GTA02. This differs from renaming or
65deleting the kernel image because updating the kernel package would give you a
66working kernel again and allow boot, whereas the noboot indication will remain
67until you remove it.
68
69The kernel commandline used is associated with the storage device and partition,
70this allows the correct root= line to be arrived at without any work.
71
72If no kernel image can be found, Qi falls back to doing a memory test.
73
74
75Appending to commandline
76========================
77
78You can append to the Qi commandline by creating a file /boot/append-<device>,
79eg, /boot/append-GTA02 containing the additional kernel commandline you want.
80
81This means you can affect the boot per-rootfs, but that if you reimage the
82rootfs you at the same time define what is appeneded. Because these files are
83looked for with the <device> name in them, options can be selected depending on
84the device the rootfs is run on.
85
86
87Initrd support
88==============
89
90Initrd or initramfs in separate file is supported to be loaded at given
91memory address in addition to kernel image. The ATAGs are issued accordingly.
92
93
94Interactive UI
95==============
96
97Being minimalistic by its nature, Qi has very limited abilities to
98interact with a user. On GTA02 the red LED and the vibrator are used
99(if the battery is in good condition) to notify user of the following
100actions:
101
102The LED is turned on either on:
103 - Successful partition mount
104 - Successful kernel pull
105 - Successful initramfs pull
106
107The LED is turned off and vibrator runs briefly either on:
108 - Fail of kernel pull
109 - Fail of initramfs pull
110 - Fail of mount partition
111 - Skipping of current boot possibility
112
113The LED is turned off either on:
114 - Start of the kernel
115 - Start of the mem test
116 - Start of the kernel pull
117 - Start of the initramfs pull
118
119If a user presses the AUX button after successful partition mount and
120before start of the kernel pull (that is, while the red LED is on),
121this boot possibility is skipped (and GTA02 owners can feel
122vibration). If a user holds the POWER button just before start of the
123kernel, debugging parameters are added to the kernel command line
124and a lot of information is output to the screen.
125
126Functional Differences from U-Boot on GTA02
127===========================================
128
129 - Backlight and USB is not enabled until Linux starts after a few seconds
130
131 - No startup splash screen
132
133 - by default there is no boot spew on the LCM
134
135 - On GTAxx boots from first uSD ext2 / 3 partition containing
136    /boot/uImage-<devicename>.bin present, eg, /boot/uImage-GTA02.bin, it checks
137    first three partitions in turn
138
139 - On GTA01 and 02 if nothing is workable on the SD Card, or it is not present,
140    Qi will try to boot from NAND
141
142 - You can disable a partition for boot by creating /boot/noboot-<devicename>,
143    eg, /boot/noboot-GTA02, it will skip it and check the next partition
144
145 - Way faster
146
147 - There is no concept of "staying in the bootloader". The bootloader exits to
148    Linux as fast as possible, that's all it does.
149
150

Archive Download this file



interactive