Skip to content

Commit e777f8d

Browse files
authored
James h65 patch bootflow 2711 (raspberrypi#1296)
* Update bootflow.md * Create bootflow_2711.md * Update bootflow_2711.md (raspberrypi#1294) added recovery.bin and links to start.elf variant selection * Create pi4_bootloader_config.md * Update bootflow_2711.md * Update pi4_bootloader_config.md * Update pi4_bootloader_config.md * Update pi4_bootloader_config.md * Update README.md * Update bootflow_2711.md * Update bootflow_2711.md * Update bootflow_2711.md * Update booteeprom.md * Update pi4_bootloader_config.md * Update pi4_bootloader_config.md * Update and rename pi4_bootloader_config.md to bcm2711_bootloader_config.md * Update booteeprom.md * Update bootflow_2711.md * Rename hardware/raspberrypi/bootmodes/bcm2711_bootloader_config.md to hardware/raspberrypi/bcm2711_bootloader_config.md * Update booteeprom.md * Update bootflow_2711.md * Update bootflow_2711.md * Update bcm2711_bootloader_config.md * Update bcm2711_bootloader_config.md * Update bcm2711_bootloader_config.md * Update booteeprom.md * Update booteeprom.md * Update bootflow.md * Update bcm2711_bootloader_config.md sd-card to SD card * Update bootflow_2711.md sd-card to SD card * Update booteeprom.md
1 parent b1df6ea commit e777f8d

File tree

5 files changed

+152
-47
lines changed

5 files changed

+152
-47
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Pi4 Bootloader Configuration
2+
3+
You can display the currently-active configuration using
4+
```
5+
vcgencmd bootloader_config
6+
```
7+
8+
To change these bootloader configuration items, you need to extract the configuration segment, make changes, re-insert it, then reprogram the EEPROM with the new bootloader. The Raspberry Pi will need to be rebooted for changes to take effect.
9+
10+
```
11+
# Extract the configuration file
12+
cp /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2019-09-10.bin pieeprom.bin
13+
rpi-eeprom-config pieeprom.bin > bootconf.txt
14+
15+
# Edit the configuration using a text editor e.g. nano bootconf.txt
16+
17+
# Example change. If you have a UART cable then setting BOOT_UART=1 will help debug boot issues
18+
BOOT_UART=1
19+
20+
# Save the new configuration and exit editor
21+
22+
# Apply the configuration change to the EEPROM image file
23+
rpi-eeprom-config --out pieeprom-new.bin --config bootconf.txt pieeprom.bin
24+
```
25+
26+
To update the bootloader EEPROM with the edited bootloader:
27+
28+
```
29+
# Flash the bootloader EEPROM
30+
# Run 'rpi-eeprom-update -h' for more information
31+
sudo rpi-eeprom-update -d -f ./pieeprom-new.bin
32+
sudo reboot
33+
```
34+
35+
## Configuration Items
36+
37+
This section describes all the configuration items available in the bootloader.
38+
39+
40+
### BOOT_UART
41+
42+
If 1 then enable UART debug output on GPIO 14 and 15. Configure the receiving debug terminal at 115200bps, 8 bits, no parity bits, 1 stop bit.
43+
Default: 0
44+
Version: All
45+
46+
### WAKE_ON_GPIO
47+
48+
If 1 then 'sudo halt' will run in a lower power mode until either GPIO3 or GLOBAL_EN are shorted to ground.
49+
50+
Default: 0 in original version of bootloader (2019-05-10). Newer bootloaders have this set to 1.
51+
Version: All
52+
53+
### POWER_OFF_ON_HALT
54+
55+
If 1 and WAKE_ON_GPIO=0 then switch off all PMIC outputs in halt. This is lowest possible power state for halt but may cause problems with some HATs because 5V will still be on. GLOBAL_EN must be shorted to ground to boot.
56+
57+
Default: 0
58+
Version: 2019-07-15
59+
60+
### FREEZE_VERSION
61+
62+
If 1 then the `rpi-eeprom-update` will skip automatic updates on this board. The parameter is not processed by the EEPROM bootloader or recovery.bin since there is no way in software of fully write protecting the EEPROM. Custom EEPROM update scripts must also check for this flag.
63+
64+
Default: 0
65+
Version: All
66+
67+
## Configuration items (Network boot beta test bootloader only)
68+
69+
### BOOT_ORDER
70+
The BOOT_ORDER setting allows flexible configuration for the priority of different bootmodes. It is represented as 32bit unsigned integer where each nibble represents a bootmode. The bootmodes are attempted in lowest significant nibble to highest significant nibble order.
71+
72+
E.g. 0x21 means try SD first followed by network boot then stop. Where as 0x2 would mean try network boot and then stop without trying to boot from the SD card.
73+
74+
The retry counters are reset when switching to the next boot mode.
75+
76+
BOOT_ORDER fields
77+
* 0x0 - NONE (stop with error pattern)
78+
* 0x1 - SD CARD
79+
* 0x2 - NETWORK
80+
81+
Default: 0x00000001 (with 3 SD boot retries to match the current bootloader behaviour)
82+
83+
### SD_BOOT_MAX_RETRIES
84+
Specify the maximum number of times that the bootloader will retry booting from the SD card.
85+
-1 means infinite retries
86+
Default: 0
87+
88+
### NET_BOOT_MAX_RETRIES
89+
Specify the maximum number of times that the bootloader will retry network boot.
90+
-1 means infinite retries
91+
Default: 0
92+
93+
### DHCP_TIMEOUT
94+
The timeout in milliseconds for the entire DHCP sequence before failing the current iteration.
95+
Default: 45000
96+
Minimum: 5000
97+
98+
### DHCP_REQ_TIMEOUT
99+
The timeout in milliseconds before retrying DHCP DISCOVER or DHCP REQ.
100+
Default: 4000
101+
Minimum: 500
102+
103+
### TFTP_TIMEOUT
104+
The timeout in milliseconds for an individual file download via TFTP.
105+
Default: 15000
106+
Minimum: 5000
107+
108+
### TFTP_IP
109+
Optional dotted decimal ip address (e.g. 192.169.1.99) for the TFTP server which overrides the server-ip from the DHCP request.
110+
This maybe useful on home networks because tftpd-hpa can be used instead of dnsmasq where broadband router is the DHCP server.
111+
Default: ""

hardware/raspberrypi/booteeprom.md

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,11 @@ The `FREEZE_VERSION` option in the EEPROM config file may be used to indicate th
4747

4848
There is no software write protection for the boot EEPROM but there will be a mechanism in Raspbian to skip any future updates to the EEPROM. However, it is possible to physically write-protect both EEPROMs via a simple resistor change on the board. Details will be published in the [schematics](./schematics/README.md).
4949

50-
## EEPROM configuration options
50+
EEPROM image files contain a small user-modifiable config file, which may be modified using the `rpi-eeprom-config` script included in the `rpi-eeprom` package. See the [Bootloader Configuration Page](./bcm2711_bootloader_config.md) for configuration details.
5151

52-
EPROM image files contain a small user-modifiable config file, which may be modified using the `rpi-eeprom-config` script included in the `rpi-eeprom` package.
5352

54-
### Update the EEPROM config
55-
```
56-
# Copy the EEPROM of interest from /lib/firmware/raspberrypi/bootloader/critical/
57-
58-
# To extract the configuration file from an EEPROM image.
59-
rpi-eeprom-config pieeprom.bin --out bootconf.txt
60-
61-
# To update the configuration file in an EEPROM image.
62-
rpi-eeprom-config pieeprom.bin --config bootconf.txt --out pieeprom-new.bin
63-
64-
# To flash the new image
65-
# -d means that the configuration in the file should be used, otherwise, rpi-eeprom-update
66-
# will automatically migrate the current bootloader's configuration to the new image.
67-
sudo rpi-eeprom-update -d -f ./pieeprom-new.bin
68-
```
53+
## Checking if an update is available
6954

70-
### Checking if an update is available
7155
Running the rpi-eeprom-update command with no parameters indicates whether an update is required. An update is required if the timestamp of the most recent file in the firmware directory (normally `/lib/firmware/raspberrypi/bootloader/critical`) is newer than that reported
7256
by the current bootloader.
7357
The images under `/lib/firmware/raspberrypi/bootloader` are part of the `rpi-eeprom` package and are only updated via `apt update`.
@@ -95,34 +79,11 @@ Change FIRMWARE_RELEASE_STATUS="critical"
9579
to FIRMWARE_RELEASE_STATUS="beta"
9680
```
9781

98-
### Configuration options
99-
100-
#### BOOT_UART
101-
102-
If 1 then enable UART debug output on GPIO 14 and 15. Configure the debug terminal at 115200bps, 8 bits, no parity bits, 1 stop bit.
103-
Default: 0
104-
Version: All
105-
106-
#### WAKE_ON_GPIO
82+
## EEPROM Bootloader configuration options
10783

108-
If 1 then 'sudo halt' will run in a lower power mode until either GPIO3 or GLOBAL_EN are shorted to ground.
84+
See the [Bootloader Configuration Page](./bcm2711_bootloader_config.md) for configuration details.
10985

110-
Default: 0 in original version of bootloader (2019-05-10). Newer bootloaders have this set to 1.
111-
Version: All
112-
113-
#### POWER_OFF_ON_HALT
114-
115-
If 1 and WAKE_ON_GPIO=0 then switch off all PMIC outputs in halt. This is lowest possible power state for halt but may cause problems with some HATs because 5V will still be on. GLOBAL_EN must be shorted to ground to boot.
116-
117-
Default: 0
118-
Version: 2019-07-15
119-
120-
#### FREEZE_VERSION
121-
122-
If 1 then the `rpi-eeprom-update` will skip automatic updates on this board. The parameter is not processed by the EEPROM bootloader or recovery.bin since there is no way in software of fully write protecting the EEPROM. Custom EEPROM update scripts must also check for this flag.
86+
## Release Notes
87+
* [Release notes](https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware/release-notes.md) for bootloader EEPROMs.
12388

124-
Default: 0
125-
Version: All
12689

127-
# Release Notes
128-
* [Release notes](https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware/release-notes.md) for bootloader EEPROMs.

hardware/raspberrypi/bootmodes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The Raspberry Pi has a number of different stages of booting. This document expl
1919
## Special bootcode.bin-only boot mode
2020
USB host and Ethernet boot can be performed by BCM2837-based Raspberry Pis - that is, Pi 2B version 1.2, Pi 3B, and Pi 3B+ (Raspberry Pi 3A+ cannot net boot since it does not have a built-in Ethernet interface). In addition, all Raspberry Pi models **except Pi 4B** can use a new bootcode.bin-only method to enable USB host boot.
2121

22-
**Note:** The Raspberry Pi 4B does not use the bootcode.bin file - instead the bootloader is located in an on-board EEPROM chip. The Pi 4B bootloader currently only supports booting from an SD card. Support for USB host mode boot and Ethernet boot will be added by a future software update. See [SPI Boot EEPROM](../booteeprom.md).
22+
**Note:** The Raspberry Pi 4B does not use the bootcode.bin file - instead the bootloader is located in an on-board EEPROM chip. The Pi 4B bootloader currently only supports booting from an SD card. Support for USB host mode boot and Ethernet boot will be added by a future software update. See [Pi4 Bootflow](./bootflow_2711.md) and [SPI Boot EEPROM](../booteeprom.md).
2323

2424
Format an SD card as FAT32 and copy on the latest [bootcode.bin](https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin). The SD card must be present in the Pi for it to boot. Once bootcode.bin is loaded from the SD card, the Pi continues booting using USB host mode.
2525

hardware/raspberrypi/bootmodes/bootflow.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Boot sequence
22

3-
**The following boot sequence applies to the BCM2837-based models of Raspberry Pi only. On all other models, the Pi will try [SD card boot](sdcard.md), followed by [USB device mode boot](device.md).**
3+
**The following boot sequence applies to the BCM2837 and BCM2837B0 based models of Raspberry Pi only. On models prior to this, the Pi will try [SD card boot](sdcard.md), followed by [USB device mode boot](device.md). For the Raspberry Pi4 boot sequence please see [this](bootflow_2711.md) page**
4+
5+
USB boot defaults on the Raspberry Pi 3 will depend on which version is being used. See this [page](./msd.md) for information on enabling USB boot modes when not enabled by default.
46

57
The boot sequence begins with reading the OTP to determine which boot modes are enabled. By default, this is SD card boot followed by USB device boot. Subsequently, the boot ROM checks to see whether the GPIO boot mode OTP bits have been programmed — one to enable GPIO boot mode, and one to select the bank of GPIOs it uses to disable boot modes (low = GPIOs 22-26, high = GPIOs 39-43). This makes it possible to use hardware attached to the GPIO connector to choose between different boot modes.
68

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Pi4 Bootflow
2+
3+
The Pi4 with the BCM2711 SoC has a new, more sophisticated boot process. The addition of an EEPROM means that the `bootcode.bin` file found in `/boot` is no longer required. Details of the EEPROM can be found [here](../booteeprom.md).
4+
5+
The boot flow for the Pi4 is as follows:
6+
7+
* BCM2711 SoC powers up
8+
* On board bootrom checks for bootloader recovery file (recovery.bin) on the SD card. If found, it executes it to flash the EEPROM and recovery.bin triggers a reset.
9+
* Otherwise, the bootrom loads the main bootloader from the EEPROM.
10+
* Bootloader checks it's inbuilt BOOT_ORDER configuration item to determine what type of boot to do.
11+
* SD Card
12+
* Network
13+
* USB mass storage
14+
15+
16+
## SD Card Boot
17+
The bootloader loads the files in the [boot folder](../../../configuration/boot_folder.md) according to the [boot options](../../../configuration/config-txt/boot.md) in config.txt
18+
19+
## Network boot (BETA)
20+
21+
Details of the network booting can be found [here](https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware/raspberry_pi4_network_boot_beta.md)
22+
23+
## USB mass storage boot
24+
25+
USB booting is still under development.
26+
27+
28+
## BOOT_ORDER (BETA)
29+
30+
The `BOOT_ORDER` configuration item is embedded inside the bootloader code in the EEPROM. See the [Pi4 Bootloader Configuration](../bcm2711_bootloader_config.md) page for details on how to change the bootloader configuration.
31+

0 commit comments

Comments
 (0)