0
点赞
收藏
分享

微信扫一扫

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件


文章目录

  • ​​1. 树莓派 4B 启动流程​​
  • ​​2. 引导文件目录​​
  • ​​3. config.txt 中关于引导过程的参数​​
  • ​​4. Raspberry Pi 4 bootloader 配置​​
  • ​​4.1 查看并修改 EEPROM 中配置的方法​​
  • ​​4.2 处于 EEPROM 中的 bootloader 的配置选项​​
  • ​​4.3 config.txt 中关于 bootloader 的配置项​​
  • ​​5. Advanced boot modes - Network / USB mass storage boot.​​
  • ​​5.1 USB mass storage boot.​​
  • ​​5.2 Network boot server configuration.​​
  • ​​6. Raspberry Pi 4 boot EEPROM​​
  • ​​6.1 引导诊断​​
  • ​​6.2 更新 bootloader​​
  • ​​6.2.1 Compute Module 4​​
  • ​​6.3 更新 EEPROM 中的配置​​
  • ​​6.3.1 Reading the current EEPROM configuration​​
  • ​​6.3.2 Reading the configuration file from an EEPROM image​​
  • ​​6.3.3 Editing the current bootloader configuration​​
  • ​​6.3.4 Applying a saved configuration file​​
  • ​​6.3.5 Updating the configuration in an EEPROM image​​
  • ​​6.3.6 Updating the bootloader EEPROM​​
  • ​​6.3.7 recovery.bin(恢复出厂设置)​​
  • ​​6.3.8 Firmware release status​​
  • ​​6.3.9 Changing the firmware release​​
  • ​​6.3.10 Disabling automatic updates​​








  • 初始化包中的 ​​pieeprom.bin​​​ 是 ​​bootloader update image​​ 问题?

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_加载

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_linux_02

​​https://raspberrypi.stackexchange.com/questions/120798/where-is-eeprom-in-pi4/120825#120825​​

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_运维_03

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_linux_04


【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_运维_05

1. 树莓派 4B 启动流程


​​https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/bootflow_2711.md​​

树莓派的 SoC 内部集成了ARM CPU,GPU,ROM,SDRAM…

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_运维_06

  1. first-stage bootloader:BCM2711 SoC 上电,GPU(VideoCore)执行保存在 ROM 中的代码(固化在硬件内部)(config.txt),挂载 SD 卡上的 FAT32 分区,检查 SD 卡上的引导程序恢复文件(recovery.bin),如果找到,它将执行以刷新 EEPROM,recovery.bin 将会对 EEPROM 复位,否则,从 EEPROM 加载引导程序(​​bootloader ​​,如果 Pi 4 中 SD 卡的启动分区中存在 bootcode.bin,则将其忽略。)到 GPU 的 128KB 大小的 L2Cache 中,执行。EEPROM 中存在 ​​BOOT_ORDER​​ 选项,该选项确定了执行的引导类型(SD Card Boot、NetWork Boot、USB mass storage Boot)。

4B 启动不需要 SD 卡中的 ​​bootcode.bin​​,4B 在芯片内部增加了一块 EEPROM 来规避风险(由于 4B 硬件升级,导致启动过程较为复杂,如果将代码都写到 ROM 中,会增加复杂度以及引入可能的 BUG),4B 上电运行 SPI 连接的 EEPROM 中的 bootloader 代码。

  1. second-stage bootloader:主要是 ​​bootloader ​​,对应低版本的 ​​bootcode.bin​​,​​bootloader ​​ 的工作是进行一些基本设置(初始化 RAM 等)、将 ​​start4.elf​​(位于 SD 卡的第一分区)加载到 Soc 中。
  2. third-stage bootloader:主要是 ​​start4.elf​​(GPU 固件)。其划分 RAM 空间为两部分:CPU 访问空间和 GPU 访问空间、从第一个分区中加载 config.txt 和 cmdline.txt、kernel.img、ramdisk、dtb 加载到内存的预定地址、向 CPU 发送启动信号以执行 kernel 代码。
  3. 内核启动阶段。树莓派4 默认使用 kernel7l.img 启动(32-bit),kernel8.img(64-bit)。内核启动部分主要就是做系统的引导,外围器件的驱动,内存管理,进程管理,网络协议栈的建立等工作,最后启动虚拟文件系统,启动用户进程。

启动操作系统后,GPU 代码没有被卸载。事实上,start.elf 不仅仅是 GPU 的固件,它还是一个专有的操作系统,叫做 VideoCore OS。当普通 OS (Linux) 需要一个不能直接访问的元素时,Linux 使用邮箱消息系统与 VCOS 通信。


【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_服务器_07

2. 引导文件目录

​​https://www.raspberrypi.org/documentation/configuration/boot_folder.md​​

  1. 引导文件存储在SD卡的第一个分区中,该分区使用 FAT 文件系统格式化。
  2. 当 Raspberry Pi 通电时,它将从启动分区中加载各种文件以启动各种处理器,然后引导 Linux 内核。
  3. Linux 启动后,启动分区将挂载为 /boot。

bootcode.bin

这是引导加载程序,由 SoC 在引导时加载,它进行一些非常基本的设置,然后加载 start*.elf 文件之一。 Raspberry Pi 4 上不使用 ​​bootcode.bin​​,因为它已由板载 EEPROM 中的启动代码(bootloader ?)替换。

start.elf, start_x.elf, start_db.elf, start_cd.elf, start4.elf, start4x.elf, start4cd.elf, start4db.elf

由 VideoCore(GPU) 执行这些已经被加载到 Soc 的文件,执行接下来的启动过程。

start.elf 是基本固件,start_x.elf包括摄像头驱动程序和编解码器,start_db.elf 是固件的调试版本,start_cd.elf 是精简版,不支持编解码器和3D等硬件模块,并且 在 config.txt 中指定 gpu_mem = 16时使用。

fixup.dat*

这些是链接器文件,与 start*.elf 文件匹配。

cmdline

引导时,内核命令行会传递到内核。

​dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc quiet splash​

config.txt

​​https://www.raspberrypi.org/documentation/configuration/config-txt/​​

​​https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md​​

引导过程读取的配置文件。通常使用 BIOS 编辑和存储的系统配置参数,在树莓派上存储在名为 config.txt 的可选文本中。在初始化 ARM CPU 之前,GPU 会读取它,与 bootcode.bin、start4.elf 一起位于SD 卡第一分区,如果在启动分区上没有该文件,那么只需要新建该文件即可。

格式为:​​property=value​​​,value 是整数或字符串,​​#​​ 可以添加注释。

可以使用 config.txt 文件设置一系列的参数,分为以下几个部分:

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_固件_08

# Force the monitor to HDMI mode so that sound will be sent over HDMI cable
hdmi_drive=2
# Set monitor mode to DMT
hdmi_group=2
# Set monitor resolution to 1024x768 XGA 60Hz (HDMI_DMT_XGA_60)
hdmi_mode=16
# Make display smaller to stop text spilling off the screen
overscan_left=20
overscan_right=12
overscan_top=10
overscan_bottom=10

issue.txt

Some text-based housekeeping information containing the date and git commit ID of the distribution.

ssh or ssh.txt

如果存在此文件,则将在启动时启用 SSH。内容无关紧要,可以为空。否则默认情况下禁用 SSH。

wpa_supplicant.conf

这是用于配置无线网络设置的文件(如果硬件具备此功能)。

Device Tree files

Kernel Files

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_linux_09

3. config.txt 中关于引导过程的参数

​​https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md​​

start_file, fixup_file, start_x, start_debug

这些选项制定了在引导之前传输到 VideoCore GPU 的文件。

start_file 指定要使用的 VideoCore 固件文件。 fixup_file 指定用于修复 start_file 中使用的内存位置以匹配 GPU 内存拆分的文件。 请注意,start_file和 fixup_file 是一对匹配的文件,使用不匹配的文件将阻止开发板启动。建议使用 start_x 和 start_debug。

​start_x=1​​​ 意味着,​​start_file=start_x.elf fixup_file=fixup_x.dat​

在树莓派 4 中,如果 ​​start4x.elf​​​ 和 ​​fixup4x.dat​​ 存在,那么将会使用这两个文件替代默认的选项。

On the Pi 4, if the files ​​start4x.elf​​​ and ​​fixup4x.dat​​ are present, these files will be used instead.

​start_debug=1​​​ 意味着 ​​start_file=start_db.elf fixup_file=fixup_db.dat​

Pi 4 没有特定的处理方式,如果希望使用 Pi 4 调试固件文件,需要手动指定 start_file 和 fixup_file。

​start_x=1​​ 意味着摄像头模块可以使用。

disable_commandline_tags

​disable_commandline_tags=1​​ 意味着在启动内核之前阻止 start.elf 填充 ATAGS。

Set the ​​disable_commandline_tags​​​ command to ​​1​​​ to stop ​​start.elf​​​ from filling in ATAGS (memory from ​​0x100​​) before launching the kernel.

cmdline

​cmdline=cmdline.txt # the Linux kernel command line​

cmdline 是引导分区上从中读取内核命令行字符串的备用文件名,默认值为 cmdline.txt,通过该文件中的命令,向内核发送命令。

kernel

​kernel=vmlinuz # the Linux kernel​

kernel 是引导分区上加载内核时使用的备用文件名,Pi 4 默认值为 kernel7l.img​。(kernel7l.img 为32位 arm 架构,kernel8.img 为 64 位系统)


arm_64bit

如果非零,强制加载 64 位内核,以 64 位模式启动处理器,并将 kernel8.img 设置为加载的内核映像,除非显式定义了其它内核镜像。

在所有平台上默认为 0。

64 位内核必须是未压缩的映像文件。

armstub

armtub 是引导分区上的文件名,从该文件名可以加载 ARM stub。 默认的 ARM stub 存储在固件中,并且会根据 Pi 型号和各种设置自动选择。

stub 是在内核之前运行的一小段 ARM 代码。 它的工作是在将控制权传递给内核之前,设置诸如中断控制器之类的底层硬件。

arm_peri_high

​arm_peri_high=1​​ 将会在 Pi 4 上启用 “High Peripheral” 模式,如果加载了合适的 DTB,则会自动设置。

kernel_address

内核映像应加载到的内存地址。默认情况下,将 32 位内核加载到地址 0x8000,将 64 位内核加载到地址 0x80000。 如果设置 kernel_old,则将内核加载到地址 0x0。

kernel_old

将 kernel_old 设置为 1 可将内核加载到内存地址 0x0。

bootcode_delay

bootcode_delay 命令在加载 start.elf 之前会在 bootcode.bin 中延迟给定的秒数:默认值为0。

boot_delay

boot_delay 命令指示在加载内核之前要在 start.elf 中等待给定的秒数:默认值为 1。以毫秒为单位的总延迟计算为(1000 x boot_delay)+ boot_delay_ms。 如果 SD 卡需要一段时间才能准备好才能从 Linux 引导,这将很有用。

enable_gic (Pi 4B only)

​enable_gic =0​​:中断使用旧式中断控制器,而不是通过 GIC-400 路由到 ARM 内核,预设值是 1。

On the Raspberry Pi 4B, if this value is set to ​​0​​​ then the interrupts will be routed to the ARM cores using the legacy interrupt controller, rather than via the GIC-400. The default value is ​​1​​.

force_eeprom_read

​force_eeprom_read=0​​:防止固件在加电时尝试读取 I2C HAT EEPROM(连接到 ID_SD 和 ID_SC 引脚)

disable_splash

ramfsaddr

initramfs

init_uart_baud

force_eeprom_read

init_uart_clock

os_prefix

overlay_prefix

uart_2ndstage

upstream_kernel

4. Raspberry Pi 4 bootloader 配置

​​https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md​​

4.1 查看并修改 EEPROM 中配置的方法

在编辑引导加载程序配置之前,请更新系统以获取最新版本的 rpi-eeprom 软件包。

要查看当前的 EEPROM 配置:​​rpi-eeprom-config​

对其进行编辑并更新:​​sudo -E rpi-eeprom-config --edit​

4.2 处于 EEPROM 中的 bootloader 的配置选项

本节介绍了引导加载程序中所有可用的配置项目。语法与 config.txt 相同。

BOOT_UART

​BOOT_UART=1​​:GPIO 14 和 GPIO 15 上启用 UART 调试输出。将接收调试端子配置为 115200bps,8位,无奇偶校验位,1个停止位。

默认为 0。

WAKE_ON_GPIO

​WAKE_ON_GPIO=1​​​,​​sudo halt​​ 将以低功耗模式运行,直到 GPIO3 或 GLOBAL_EN 短路接地。

默认值:1(引导加载程序2019-05-10的原始版本为0)

POWER_OFF_ON_HALT

BOOT_ORDER

BOOT_ORDER 允许灵活配置不同引导模式的优先级。32 位无符号整数,其中每个半字节代表一个引导模式(最多定义 8 位数字)。 尝试以最低有效半字节到最高有效半字节顺序进行引导模式。默认 ​​0xf41​​。

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_linux_10

尝试每种非零引导模式后,引导程序将停止。 但是,从 2020-09-03 开始,引导程序将监视 SD 卡检测引脚,如果插入了新的 SD 卡,则尝试 SD 引导。

如果 SD 卡检测引脚指示该卡已插入或更换,则引导模式 0x0 将重试 SD 引导。

RPIBOOT:与 Compute Module 4 一起使用,能够加载自定义调试镜像(eg. Linux RAM-disk),而不是正常启动。

BCM-USB-MSD:允许 Compute Module 4 从 USB 引导,无需额外的 PCle XHCL 卡。此 USB 控制器不支持 USB3.0,较 USB-MSD 要慢。

Compute Module 4 在 rpiboot 引导模式下更新 Bootloader EEPROM

MAX_RESTARTS

如果遇到 RESTART 引导模式超过 MAX_RESTARTS 次,则触发看门狗复位。

默认:-1(无限次)

SD_BOOT_MAX_RETRIES

默认:0。

NET_BOOT_MAX_RETRIES

默认:0。

DHCP_TIMEOUT

TFTP_FILE_TIMEOUT

TFTP_IP

TFTP_PREFIX

TFTP_PREFIX_STR

PXE_OPTION43

DHCP_OPTION97

Static IP address configuration

CLIENT_IP

SUBNET

GATEWAY

MAC_ADDRESS

DISABLE_HDMI

HDMI_DELAY

ENABLE_SELF_UPDATE

使引导加载程序能够从TFTP或USB大容量存储设备(MSD)引导文件系统更新自身。

如果启用了自我更新,则引导加载程序将在引导文件系统中查找更新文件(.sig / .upd)。 如果更新映像与当前映像不同,则应用更新并重置系统。 否则,如果EEPROM映像逐字节相同,则引导将继续正常进行。

默认为:1。

FREEZE_VERSION

以前,此属性仅由rpi-eeprom-update脚本检查。 但是,既然启用了自我更新,引导加载程序还将检查此属性。 如果设置为1,它将覆盖ENABLE_SELF_UPDATE以停止自动更新。 要禁用FREEZE_VERSION,您将必须使用带有recovery.bin的SD卡引导。

Custom EEPROM update scripts must also check this flag.

默认:0。

NETCONSOLE - advanced logging

USB_MSD_EXCLUDE_VID_PID

USB_MSD_DISCOVER_TIMEOUT

USB_MSD_LUN_TIMEOUT

USB_MSD_PWR_OFF_TIME

XHCI_DEBUG

4.3 config.txt 中关于 bootloader 的配置项

boot_load_flags

uart_2ndstage

​uart_2ndstage=1​​,启用调试日志记录到 UART,在较新的固件版本(Raspberry Pi OS 2020-08-20及更高版本)中,也会在 start.elf 中自动启用 UART 日志记录。

eeprom_write_protect

控制是否将引导加载程序和 VLI EEPROM 标记为写保护。

默认为 do nothing。

bootloader_update

可以将此选项设置为 0 以阻止 bootloader 更新,而无需更新 EEPROM 配置。

默认为 1。

5. Advanced boot modes - Network / USB mass storage boot.

对于网络或 USB 启动,我们建议更新到 2020-09-03 版本的 Bootloader 和 Raspberry Pi OS 2020-08-20 或更高版本。

5.1 USB mass storage boot.

SD卡启动后,您必须执行此操作,因为所有Raspberry Pi 4型号均附带了仅可从SD卡启动的EEPROM配置。

Ubuntu MATE 20.10 and newer support USB booting, but Ubuntu MATE 20.04 does not.

​​https://ubuntu.com/tutorials/how-to-install-ubuntu-desktop-on-raspberry-pi-4#4-optional-usb-boot​​

​​https://ubuntu-mate.org/ports/raspberry-pi/​​

使用装有 Ubuntu MATE 20.10 的 SD 卡启动树莓派(其他版本不一定支持 USB booting)

# 安装最新版本的 EEPROM
sudo apt install rpi-eeprom

# 将当前配置文件提取出来
sudo vcgencmd bootloader_config > bootconf.txt

# 将BOOT_ORDER选项设置为0xf41(意味着尝试SD卡,然后尝试USB大容量存储设备,然后重启)
sed -i -e '/^BOOT_ORDER=/ s/=.*$/=0xf41/' bootconf.txt

# 现在,我们使用更新配置生成EEPROM的副本:
rpi-eeprom-config --out pieeprom-new.bin --config bootconf.txt /lib/firmware/raspberrypi/bootloader/critical/pieeprom-2020-09-03.bin

# 将系统设置为在下次启动时刷新新的EEPROM固件
sudo rpi-eeprom-update -d -f ./pieeprom-new.bin

# 重启
sudo reboot

  1. 将 USB 硬盘/U盘制作为系统盘,使用 Pi Imager 将 Pi OS 写入存储设备中,将之前 SD 卡系统中 /boot 分区下的所有 ​​.dat​​、​​.elf​​ 文件复制到新的 USB 硬盘/U盘的 /boot 分区中。
  2. 关机,移除 SD 卡,插上 USB 设备,启动。

下载 Pi Imager 工具:Download the ​​Raspberry Pi Imager​​(Install Raspberry Pi OS using Raspberry Pi Imager)

除了进系统使用 ​​rpi-eeprom​​ 刷新以外,还可以使用卡刷(卡刷不仅能够很方便地更新 EEPROM 还能够恢复 EEPROM 出厂设置)。
到 https://github.com/raspberrypi/rpi-eeprom/releases 下载最新的发布版​rpi-boot-eeprom-recovery-xxxx.zip​​​,然后解压到一张 FAT32 格式的空 SD 卡中,注意,直接解压 ​​pieeprom.bin​​​、​​pieeprom.sig​​​、​​recovery.bin​​ 等文件到根目录下不能带文件夹,插卡上电,绿色 LED 快速闪烁,至少等待 10S 后 eeprom 就刷好了。卡刷的方法更简单,推荐使用。

当搜索可引导分区时,引导加载程序会并行扫描所有 USB 设备,并将选择第一个进行响应。 如果引导分区不包含合适的 start.elf 文件,则选择下一个可用设备。

存在问题:将 SD 卡和 USB 均插入时,会从 USB 引导

解决方案:安装 Ubuntu MATE 20.10 版本,刷新 EEPROM。

5.2 Network boot server configuration.

6. Raspberry Pi 4 boot EEPROM

​​https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md​​

Raspberry Pi 4 具有一个 SPI(接口协议) 连接的 EEPROM(4MBits / 512KB),其中包含用于启动系统的代码,并替换了先前在 SD 卡的启动分区中找到的 bootcode.bin。 请注意,如果 Pi 4 中 SD 卡的启动分区中存在 bootcode.bin,则将引导分区下的该文件忽略。

6.1 引导诊断

如果在引导过程中发生错误, 较新版本的引导程序将显示诊断消息,该消息将同时显示在两个 HDMI 显示屏上。

6.2 更新 bootloader

6.2.1 Compute Module 4

Compute Module 4 在 rpiboot 引导模式下更新 Bootloader EEPROM,此操作也会刷新 EMMC。

Bootloader EEPROM updates on Compute Module 4 require ​​rpiboot​​​ which is also used for flashing the EMMC. Please see the ​​Compute Module flashing guide​​ for instructions.

6.3 更新 EEPROM 中的配置

# 具体执行
jiamingpi@jiamingpi-desktop:~$ sudo rpi-eeprom-config
usage: rpi-eeprom-config [-h] [--config CONFIG] [--out OUT] eeprom
rpi-eeprom-config: error: the following arguments are required: eeprom
jiamingpi@jiamingpi-desktop:~$ sudo -E rpi-eeprom-config --edit
usage: rpi-eeprom-config [-h] [--config CONFIG] [--out OUT] eeprom
rpi-eeprom-config: error: the following arguments are required: eeprom

rpi-eeprom-config 工具可用于修改 EEPROM 镜像文件中的嵌入式配置文件。

6.3.1 Reading the current EEPROM configuration

在引导阶段运行:​​rpi-eeprom-config​​​ or ​​vcgencmd bootloader_config​

6.3.2 Reading the configuration file from an EEPROM image

​rpi-eeprom-config pieeprom.bin​

6.3.3 Editing the current bootloader configuration

以下命令将当前 EEPROM 配置加载到文本编辑器中。

sudo -E rpi-eeprom-config --edit
sudo reboot

6.3.4 Applying a saved configuration file

以下命令将 boot.conf 应用于 EEPROM 镜像,并在系统重新引导时使用 rpi-eeprom-update 安排更新。

# 直接使用配置文件替换当前文件,并更新当前配置
sudo rpi-eeprom-config --apply boot.conf
sudo reboot

6.3.5 Updating the configuration in an EEPROM image

以下命令读取 ​​pieeprom.bin​​​ 并将配置文件替换为 ​​boot.conf​​​ 的内容。结果写入 ​​new.bin​​。

rpi-eeprom-config --config boot.conf --out new.bin pieeprom.bin

6.3.6 Updating the bootloader EEPROM

以下内容将导致下次重新引导系统时对引导加载程序 EEPROM 进行更新。

# -d 表示 rpi-eeprom-update 使用 new.bin 中的 EEPROM 配置,而不是当前通过 vcgencmd 看到的配置
sudo rpi-eeprom-update -d -f new.bin

6.3.7 recovery.bin(恢复出厂设置)

开机时,BCM2711 ROM 在 sd 卡上引导分区的根目录中查找名为 recovery.bin 的文件。 如果找到有效的 recovery.bin,则 ROM 将执行 recovery.bin,而不是 SPI EEPROM 中的 bootloader。 该机制可确保 bootloader 可以被重置。

EEPROM update files(EEPROM 中的内容,有 recovery.bin、pieeprom.bin(EEPROM bootloader image)…)

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_linux_11

  • 如果 pieeprom.upd(哪里指定?)​bootloader update image​,重命名 recovery.bin(且不执行),重置 CPU,从 SPI EEPROM 中加载最新的 bootloader,实现更新。(有 .upd 意味着不执行 recovery.bin, pieeprom.upd)【ENABLE_SELF_UPDATE=1,自动】
  • If the bootloader update image is called ​​pieeprom.upd​​​ then ​​recovery.bin​​​ renames itself to ​​recovery.000​​​ and resets the CPU. Since ​​recovery.bin​​ is no longer present the ROM loads the newly updated bootloader from SPI EEPROM and the OS is booted as normal.

【linux 系统移植①】Raspberry Pi 4B 引导过程、官方文档、bootloader、配置文件_服务器_12

Raspberry Pi 4 EEPROM bootloader rescue image

The Raspberry Pi4 has a small EEPROM used to store the bootloader.

This rescue image reverts the bootloader EEPROM to factory default settings.

This rescue image also updates the USB 3.0 (VL805) firmware to the latest
version (138a1) with better full-speed Isochronous endpoint support.

To re-flash the EEPROM(s)

  1. Unzip the contents of this zip file to a blank FAT formatted SD-SDCARD.
  2. Power off the Raspberry Pi
  3. Insert the sd-card.
  4. Power on Raspberry Pi
  5. Wait at least 10 seconds.

This easiest method for creating and formatting the SD-CARD is to use the
Raspberry Pi Imager from https://raspberrypi.org/downloads

If successful, the green LED light will blink rapidly (forever), otherwise
an error pattern will be displayed.

If a HDMI display is attached then screen will display green for success
or red if failure a failure occurs.

N.B. This image is not a bootloader it simply replaces the on-board bootloader.

  • 如果pieeprom.bin​bootloader update image​,pieeprom.bin+recovery.bin, 结束后, 如果成功,HDMI 输出将变为绿色,并且绿色的 LED 会快速闪烁,否则,HDMI 输出将为红色,并且 LED 将闪烁显示错误代码。(recovery.bin + pieeprom.bin)【ENABLE_SELF_UPDATE=0,手动】
  • If the bootloader update image is called ​​pieeprom.bin​​​ the ​​recovery.bin​​​ will stop after the update has completed. On success the HDMI output will be green and the green activity LED is flashed rapidly. Otherwise, the HDMI output will be red and an ​​error code​​ will be displayed via the activity LED.
  • ​.sig​​ 文件仅包含镜像文件的 SHA256 校验码,将来可能会添加其它字段。
  • ​BCM 2711 ROM​​​ 不支持从 USB 端的存储器或 TFTP 加载 ​​recovery.bin​​,取而代之,EEPROM 则可以,它还能够自我更新以重新刷新 SPI EEPROM。

哪里指定?

EEPROM 配置文件中的 ENABLE_SELF_UPDATE 参数:控制 bootloader 从 TFTP 或 USB 大容量存储设备 (MSD) 引导分区中进行自我更新。

​ENABLE_SELF_UPDATE=1(启用自我更新,自动更新)​​​:bootloader 将从引导分区中找寻(​​.sig/.upd​​),如果有则说明需要将 EEPROM 中的 bootloader 版本更新为 .upd,系统重置。

​ENABLE_SELF_UPDATE=0(不启用自我更新,手动更新)​​:在引导分区中找寻 recovery.bin 和 pieeprom.bin 文件,手动更新。

Default: ​​1​​​ (​​0​​ in versions prior to 2020-09-03)

6.3.8 Firmware release status

默认情况下,如果 ​​rpi-eeprom​​ 镜像比当前 bootloader 镜像新,Pi OS 会自动更新 bootloader,bootloader EEPROM 配置会在升级期间升级。

​default​​​ 和 ​​latest​​​ 是 ​​critical​​​ 和 ​​latest​​ 的符号链接。

6.3.9 Changing the firmware release

你可以通过改变文件 ​​/etc/default/rpi-eeprom-update​​​ 中的 ​​FIRMWARE_RELEASE_STATUS​​ 来改变版本。

6.3.10 Disabling automatic updates

控制 EEPROM 更新。

# Disable
sudo systemctl mask rpi-eeprom-update
# Enable is again
sudo systemctl unmask rpi-eeprom-update

EEPROM 中的配置文件 ​​FREEZE_VERSION​​ 选项可以查看是否需要更新。


举报

相关推荐

0 条评论