When the power is first applied to the Raspberry Pi, or it has been reset, a boot sequence is initiated. It is actually the Pi’s GPU that brings up the ARM CPU. Originally, the way that the Raspberry Pi was designed, it had to be booted from firmware found on the SD card. RISC code for the GPU is provided by the Raspberry Pi Foundation in the file bootcode.bin. After the second-stage boot loader was executed, it was possible to load other operating systems or boot loaders, such as U-Boot.
Due to public interest, changes have been introduced along the way to allow a direct boot from USB. This chapter covers the process of booting in its various configuratons.
Booting ARM Linux
- 1.
At power-up (or reset), the ARM CPU is offline, but the GPU is powered up.
- 2.
A small RISC core in the GPU begins to execute the OTP (one time programmable) ROM code (first-stage boot loader).
- 3.By default, it determines booting from the following priority list:
- a.
SD card boot
- b.
USB device boot
- c.
GPIO boot mode
- a.
GPIO boot mode is described here:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/bootflow.md
OTP settings cannot be undone.
Do not try to use program_gpio_bootmode unless your firmware is dated Oct. 20, 2017 or later.
The program_gpio_bootmode is perhaps more applicable to the compute module than the regular Pi.
- 4.
The GPU initializes the SD card/USB/GPIO hardware.
- 5.The GPU looks at the FAT (file allocation table) partition(s) in the SD card or USB media. The search continues with FAT partitions until the file bootcode.bin is found. The sequence changes if the OTP settings are modified. Normally:
- a.
The SD card is checked first, which takes up to 5 seconds to fail (when not present).
- b.
Then USB mode boot will be tried when enabled by OTP (this requires at least 3 seconds to allow for drive spinup and enumeration).
- a.
- 6.
The second-stage boot-loader firmware named bootcode.bin is loaded into the local 128k cache.
- 7.
The GPU control passes to the loaded bootcode.bin firmware and it enables SDRAM.
- 8.
The file start.elf is loaded by the GPU into RAM from the same partition and the GPU gives it control.
- 9.
The file config.txt is examined for configuration parameters that need to be processed.
- 10.
Information found in cmdline.txt is also processed by start.elf.
- 11.
The GPU allows the ARM CPU to execute the program start.elf.
- 12.
The kernel image is loaded into RAM by the GPU running start.elf.
- 13.
Finally, the GPU starts the kernel executing on the ARM CPU.
Boot Files
/boot Files
File Name | Purpose | Format |
|---|---|---|
bootcode.bin | Second-stage boot loader | Binary |
config.txt | Configuration parameters | Text |
cmdline.txt | Command-line parameters for kernel | Text |
fixup*.dat | Partitions the SDRAM between ARM CPU and GPU | Binary |
start.elf | ARM CPU code to be launched | Binary |
kernel.img | Kernel to be loaded | Binary |
Name can be overridden with kernel= parameter in config.txt |
config.txt
Unlike many PCs that contain a BIOS system, the Raspberry Pi uses the config.txt file. This file is optional, so when it is missing, defaults apply. When Raspbian Linux is booted, this file is found in /boot/config.txt.
Because the support for the original and new options keep changing, with each new model that is released, you can review this resource:
Composite Aspect Ratio
sdtv_aspect | Description |
|---|---|
1 | 4:3 (default) |
2 | 14:9 |
3 | 16:9 |
Color Burst
sdtv_disable_colourburst | Description |
|---|---|
0 | Color burst enabled (default) |
1 | Color burst disabled (monochrome) |
High-Definition Video
This section covers config.txt settings that affect HDMI operation.
HDMI Safe Mode
hdmi_safe | Description |
|---|---|
0 | Disabled (default) |
1 | Enabled |
hdmi_force_hotplug=1
config_hdmi_boost=4
hdmi_group=1
hdmi_mode=1
disable_overscan=0
HDMI Force Hot-Plug
hdmi_force_hotplug | Description |
|---|---|
0 | Disabled (non-NOOBS default) |
1 | Use HDMI mode even when no HDMI monitor is detected (NOOBS default) |
HDMI Ignore Hot-Plug
hdmi_ignore_hotplug | Description |
|---|---|
0 | Disabled (default) |
1 | Use composite video even if an HDMI display is detected |
HDMI Drive
hdmi_drive | Description |
|---|---|
1 | Normal DVI mode (no sound) |
2 | Normal HDMI mode (sound will be sent if supported and enabled) |
HDMI Ignore EDID
hdmi_ignore_edid | Description |
|---|---|
Unspecified | Read EDID information |
0xa5000080 | Ignore EDID information |
HDMI EDID File
hdmi_edid_file | Description |
|---|---|
0 | Read EDID data from device (default) |
1 | Read EDID data from edid.txt file |
HDMI Force EDID Audio
hdmi_force_edid_audio | Description |
|---|---|
0 | Use EDID-provided values (default) |
1 | Pretend all audio formats are supported |
Avoid EDID Fuzzy Match
avoid_edid_fuzzy_match | Description |
|---|---|
0 | Use fuzzy matching (default) |
1 | Avoid fuzzy matching |
HDMI Group
hdmi_group | Description |
|---|---|
0 | Use the preferred group reported by the EDID (default) |
1 | CEA |
2 | DMT |
HDMI Mode
H means 16:9 variant of a normally 4:3 mode.
2x means pixel doubled (higher clock rate).
4x means pixel quadrupled (higher clock rate).
R means reduced blanking (fewer bytes are used for blanking within the data stream, resulting in lower clock rates).
HDMI Mode Settings
Group | CEA | DMT | ||||
|---|---|---|---|---|---|---|
Mode | Resolution | Refresh | Modifiers | Resolution | Refresh | Notes |
1 | VGA | 640×350 | 85 Hz | |||
2 | 480 p | 60 Hz | 640×400 | 85 Hz | ||
3 | 480 p | 60 Hz | H | 720×400 | 85 Hz | |
4 | 720 p | 60 Hz | 640×480 | 60 Hz | ||
5 | 1080 i | 60 Hz | 640×480 | 72 Hz | ||
6 | 480 i | 60 Hz | 640×480 | 75 Hz | ||
7 | 480 i | 60 Hz | H | 640×480 | 85 Hz | |
8 | 240 p | 60 Hz | 800×600 | 56 Hz | ||
9 | 240 p | 60 Hz | H | 800×600 | 60 Hz | |
10 | 480 i | 60 Hz | 4x | 800×600 | 72 Hz | |
11 | 480 i | 60 Hz | 4x H | 800×600 | 75 Hz | |
12 | 240 p | 60 Hz | 4x | 800×600 | 85 Hz | |
13 | 240 p | 60 Hz | 4x H | 800×600 | 120 Hz | |
14 | 480 p | 60 Hz | 2x | 848×480 | 60 Hz | |
15 | 480 p | 60 Hz | 2x H | 1024×768 | 43 Hz | Don’t use |
16 | 1080 p | 60 Hz | 1024×768 | 60 Hz | ||
17 | 576 p | 50 Hz | 1024×768 | 70 Hz | ||
18 | 576 p | 50 Hz | H | 1024×768 | 75 Hz | |
19 | 720 p | 50 Hz | 1024×768 | 85 Hz | ||
20 | 1080 i | 50 Hz | 1024×768 | 120 Hz | ||
21 | 576 i | 50 Hz | 1152×864 | 75 Hz | ||
22 | 576 i | 50 Hz | H | 1280×768 | R | |
23 | 288 p | 50 Hz | 1280×768 | 60 Hz | ||
24 | 288 p | 50 Hz | H | 1280×768 | 75 Hz | |
25 | 576 i | 50 Hz | 4x | 1280×768 | 85 Hz | |
26 | 576 i | 50 Hz | 4x H | 1280×768 | 120 Hz | R |
27 | 288 p | 50 Hz | 4x | 1280×800 | R | |
28 | 288 p | 50 Hz | 4x H | 1280×800 | 60 Hz | |
29 | 576 p | 50 Hz | 2x | 1280×800 | 75 Hz | |
30 | 576 p | 50 Hz | 2x H | 1280×800 | 85 Hz | |
31 | 1080 p | 50 Hz | 1280×800 | 120 Hz | R | |
32 | 1080 p | 24 Hz | 1280×960 | 60 Hz | ||
33 | 1080 p | 25 Hz | 1280×960 | 85 Hz | ||
34 | 1080 p | 30 Hz | 1280×960 | 120 Hz | R | |
35 | 480 p | 60 Hz | 4x | 1280×1024 | 60 Hz | |
36 | 480 p | 60 Hz | 4x H | 1280×1024 | 75 Hz | |
37 | 576 p | 50 Hz | 4x | 1280×1024 | 85 Hz | |
38 | 576 p | 50 Hz | 4x H | 1280×1024 | 120 Hz | R |
39 | 1080 i | 50 Hz | R | 1360×768 | 60 Hz | |
40 | 1080 i | 100 Hz | 1360×768 | 120 Hz | R | |
41 | 720 p | 100 Hz | 1400×1050 | R | ||
42 | 576 p | 100 Hz | 1400×1050 | 60 Hz | ||
43 | 576 p | 100 Hz | H | 1400×1050 | 75 Hz | |
44 | 576 i | 100 Hz | 1400×1050 | 85 Hz | ||
45 | 576 i | 100 Hz | H | 1400×1050 | 120 Hz | R |
46 | 1080 i | 120 Hz | 1440×900 | R | ||
47 | 720 p | 120 Hz | 1440×900 | 60 Hz | ||
48 | 480 p | 120 Hz | 1440×900 | 75 Hz | ||
49 | 480 p | 120 Hz | H | 1440×900 | 85 Hz | |
50 | 480 i | 120 Hz | 1440×900 | 120 Hz | R | |
51 | 480 i | 120 Hz | H | 1600×1200 | 60 Hz | |
52 | 576 p | 200 Hz | 1600×1200 | 65 Hz | ||
53 | 576 p | 200 Hz | H | 1600×1200 | 70 Hz | |
54 | 576 i | 200 Hz | 1600×1200 | 75 Hz | ||
55 | 576 i | 200 Hz | H | 1600×1200 | 85 Hz | |
56 | 480 p | 240 Hz | 1600×1200 | 120 Hz | R | |
57 | 480 p | 240 Hz | H | 1680×1050 | R | |
58 | 480 i | 240 Hz | 1680×1050 | 60 Hz | ||
59 | 480 i | 240 Hz | H | 1680×1050 | 75 Hz | |
60 | 1680×1050 | 85 Hz | ||||
61 | 1680×1050 | 120 Hz | R | |||
62 | 1792×1344 | 60 Hz | ||||
63 | 1792×1344 | 75 Hz | ||||
64 | 1792×1344 | 120 Hz | R | |||
65 |
| 1856×1392 | 60 Hz | |||
66 | 1856×1392 | 75 Hz | ||||
67 | 1856×1392 | 120 Hz | R | |||
68 | 1920×1200 | R | ||||
69 | 1920×1200 | 60 Hz | ||||
70 | 1920×1200 | 75 Hz | ||||
71 | 1920×1200 | 85 Hz | ||||
72 | 1920×1200 | 120 Hz | R | |||
73 | 1920×1440 | 60 Hz | ||||
74 | 1920×1440 | 75 Hz | ||||
75 | 1920×1440 | 120 Hz | R | |||
76 |
| 2560×1600 | R | |||
77 | 2560×1600 | 60 Hz | ||||
78 | 2560×1600 | 75 Hz | ||||
79 | 2560×1600 | 85 Hz | ||||
80 | 2560×1600 | 120 Hz | R | |||
81 | 1366×768 | 60 Hz | ||||
82 | 1080 p | 60 Hz | ||||
83 |
| 1600×900 | R | |||
84 | 2048×1152 | R | ||||
85 | 720 p | 60 Hz | ||||
86 | 1366×768 | R | ||||
HDMI Boost
config_hdmi_boost | Description |
|---|---|
0 | Non-NOOBS default |
1 | |
2 | |
3 | |
4 | Use if you have interference issues (NOOBS default setting) |
5 | |
6 | |
7 | Maximum strength |
HDMI Ignore CEC Init
hdmi_ignore_cec_init | Description |
|---|---|
0 | Normal (default) |
1 | Don’t send initial active source message |
HDMI Ignore CEC
hdmi_ignore_cec | Description |
|---|---|
0 | Normal (default) |
1 | Disable CEC support |
Overscan Video
A few options control the overscan support of the composite video output. When overscan is enabled, a certain number of pixels are skipped at the sides of the screen as configured.
Disable Overscan
disable_overscan | Description |
|---|---|
0 | Overscan enabled (default) |
1 | Overscan disabled |
Overscan Left, Right, Top, and Bottom
Parameter | Pixels to Skip |
|---|---|
overscan_left=0 | At left |
overscan_right=0 | At right |
overscan_top=0 | At top |
overscan_bottom=0 | At bottom |
Frame Buffer Settings
The Linux frame buffer support is configured by a few configuration options described in this section.
Frame Buffer Width
framebuffer_width | Description |
|---|---|
default | Display width overscan |
framebuffer_width=n | Set width to n pixels |
Frame Buffer Height
framebuffer_height | Description |
|---|---|
default | Display height overscan |
framebuffer_height=n | Set height to n pixels |
Frame Buffer Depth
framebuffer_depth | Description |
|---|---|
8 | Valid, but default RGB palette makes an unreadable screen |
16 | Default |
24 | Looks better but has corruption issues as of 6/15/2012 |
32 | No corruption, but requires framebuffer_ignore_alpha=1, and shows wrong colors as of 6/15/2012 |
Frame Buffer Ignore Alpha
framebuffer_ignore_alpha | Description |
|---|---|
0 | Alpha channel enabled (default) |
1 | Alpha channel disabled |
General Video Options
The display can be flipped or rotated in different ways, according to the display_rotate option . You should be able to do both a flip and a rotate by adding the flip values to the rotate value.
display_rotate | Description |
|---|---|
0 | 0° (default) |
1 | 90° |
2 | 180° |
3 | 270° |
0x1000 | Horizontal flip |
0x2000 | Vertical flip |
While the flip options are documented, I was unable to get them to work. The rotations, however, were confirmed as working.
Licensed Codecs
Option | Notes |
|---|---|
decode_MPG2=0x12345678 | License key for hardware MPEG-2 decoding |
decode_WVC1=0x12345678 | License key for hardware VC-1 decoding |
Testing
test_mode | Description |
|---|---|
0 | Disable test mode (default) |
1 | Enable test mode |
Memory
This section summarizes configuration settings pertaining to memory.
Disable GPU L2 Cache
disable_l2cache | Description |
|---|---|
0 | Enable GPU L2 cache access |
1 | Disable GPU L2 cache access |
Boot Options
Several options in this section affect the boot process. Many options pertain to the kernel being started, while others affect file systems and devices.
Command Line
cmdline | Description |
|---|---|
unspecified | Command line is taken from cmdline.txt |
cmdline=“command” | Command line is taken from parameter |
Kernel
By default, start.elf loads the kernel from the file named kernel.img or kernel7.img depending on the Raspberry Pi model. This can be overridden to specify a specific image.
Kernel Address
kernel_address | Description |
|---|---|
0x00000000 | Default |
RAM File System File
ramfsfile | Description |
|---|---|
unspecified | No RAM FS file used |
ramfsfile=“ramfs.file” | File ramfs.file is used |
RAM File System Address
ramfsaddr | Description |
|---|---|
0x00000000 | Default address |
Init RAM File System
initramfs | Arg 1 | Arg 2 | Description |
|---|---|---|---|
initramfs | initram.gz | 0x00800000 | Example |
Device Tree Address
device_tree_address | Description |
|---|---|
0x00000000 | Default |
Init UART Baud
init_uart_baud | Description |
|---|---|
115200 | Default baud rate |
Init UART Clock
init_uart_clock | Description |
|---|---|
3000000 | Default |
Init EMMC Clock
init_emmc_clock | Description |
|---|---|
100000000 | Default |
Boot Delay

D is the computed delay in milliseconds.
b is the boot_delay value.
m is the boot_delay_ms value.
boot_delay (b) | Description |
|---|---|
1 | Default |
boot_delay_ms (m) | Description |
|---|---|
0 | Default |
Avoid Safe Mode
avoid_safe_mode | Description |
|---|---|
0 | Default (check P1-05 for safe mode) |
1 | Disable safe mode check |
cmdline.txt
This file is provided as a convenience, since the parameters can be configured in the config.txt file, using the cmdline="text" option. When the config.txt option is provided, it supersedes the cmdline.txt file.
This output is interesting because it shows details that are not present in the cmdline.txt file. Options of the format name.option=values are specific to kernel-loadable modules.
Serial console=
This references the serial device that is made available after boot-up as /dev/ttyS0. The parameter following the device name is the baud rate.
Zone | Description | Value | Raspbian Notes |
|---|---|---|---|
bbbb | Baud rate | 115200 | Can be more than four digits |
p | Parity | n | No parity |
o | Odd parity | ||
e | Even parity | ||
n | Number of bits | 7 | 7 data bits |
8 | 8 data bits | ||
f | Flow control | r | RTS |
omitted | No RTS |
Virtual console=
root=
Reviewing that output confirms that the partition named "rootfs" is being used as the root file system. The partition in this example is specified by the partition UUID (a shortened version of a UUID, which is a universally unique identifier).
root=MMmm: Boot from major device MM, minor mm (hexadecimal).
root=/dev/nfs: Boot a NFS disk specified by nfsroot (see also nfs-root= and ip=).
root=/dev/name: Boot from a device named /dev/name.
root=PARTUUID=: Boot from a locally unique partition identified by as shortened UUID.
rootfstype=
This example indicates that the root file system is the ext4 type.
The Linux kernel can examine the device given in the root parameter to determine the file system type. But there are scenarios where the kernel cannot resolve the type or gets confused. Otherwise, you may need to force a certain file system type.
elevator=
Name | Description | Notes |
|---|---|---|
noop | No special ordering of requests | |
cfq | Completely fair scheduler | Older |
deadline | Cyclic scheduler, but requests have deadlines | Newest |
The deadline I/O scheduler is the newest implementation, designed for greater efficiency and fairness. The deadline scheduler uses a cyclic elevator, except that it additionally logs a deadline for the request. A cyclic elevator is one where the requests are ordered according to sector numbers and head movement (forward and backward). The deadline scheduler will use the cyclic elevator behavior, but if it looks like the request is about to expire, it is given immediate priority.
rootwait=
This option is used when the device used for the root file system is a device that is started asynchronously with other kernel boot functions. This is usually needed for USB and MMC devices, which may take extra time to initialize. The rootwait option forces the kernel to wait until the root device becomes ready.
nfsroot=
Field | Description |
|---|---|
server-ip | NFS server IP number (default uses ip=) |
root-dir | Root dir on NFS server. If there is a %s present, the IP address will be inserted there. |
nfs-options | NFS options like ro, separated by commas |
When unspecified, the default of /tftpboot/client_ip_address will be used. This requires that root=/dev/nfs be specified and optionally ip= may be added.
From this example, we see that both the older NFS (nfs) and the newer NFS4 file systems are supported.
ip=
ip= Kernel Parameter
Field | Description | Default |
|---|---|---|
ip-client | IP address of the client | Autoconfigured |
ip-server | IP address of NFS server, required only for NFS root | Autoconfigured |
gw-ip | IP address of server if on a separate subnet | Autoconfigured |
netmask | Netmask for local IP address | Autoconfigured |
hostname | Hostname to provide to DHCP | Client IP address |
device | Name of interface to use | When more than one is available, autoconf |
autoconf | Autoconfiguration method | Any |
Autoconfiguration Protocols
Protocol | Description |
|---|---|
off or none | Don’t autoconfigure |
on or any | Use any protocol available (default) |
dhcp | Use DHCP |
bootp | Use BOOTP |
rarp | Use RARP |
both | Use BOOTP or RARP but not DHCP |
With the kernel exchanged and the configuration restored to safe options, it should now be possible to boot the emergency kernel. Log in and rescue.
- 1.
Rename kernel.img to kernel_emergency.img (for future rescues).
- 2.
Rename kernel.bak to kernel.img (reinstate your normal kernel).
- 3.
Restore/alter your config.txt configuration, if necessary.
- 4.
Restore/alter your cmdline.txt configuration, if necessary.
At this point, you can reboot with your original kernel and configuration.