树莓派的启动顺序很不寻常。
The Boot Order of the Raspberry Pi Is Unusual

原始链接: https://patrickmccanna.net/the-raspberry-pi-boot-order-is-unusual/

## 树莓派启动过程:独特的方案 与通过BIOS和CPU优先启动的传统PC不同,树莓派采用GPU优先的启动过程,这源于其Broadcom芯片的起源(最初设计用于优先快速加载UI的机顶盒)。上电后,VideoCore GPU首先初始化,并作为初始“信任根”,*在*ARM CPU被激活之前。 GPU的ROM代码加载固件(来自SD卡/USB/网络)——关键在于,该固件是基于GPU的,而非ARM代码。然后它配置系统,分配内存,并最终释放ARM CPU开始执行Linux内核。 这种架构解释了Pi的一些特殊之处:没有BIOS/UEFI,`config.txt`的重要性(由GPU解析),以及简化的内核替换。Pi的安全启动是GPU锚定的,验证固件但*不*提供硬件强制的用户/内核边界或防止受损GPU固件的保护——这是与PC安全启动的关键区别。 本质上,Pi的启动顺序优先考虑GPU控制,在CPU接管之前定义硬件布局,从而产生根本不同的信任链:GPU ROM → GPU固件 → ARM内核 → Linux。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 工作 | 提交 登录 树莓派的启动顺序很不寻常 (patrickmccanna.net) 13 分,由 0o_MrPatrick_o0 7小时前发布 | 隐藏 | 过去的 | 收藏 | 3 条评论 messe 11分钟前 | 下一个 [–] > 这解释了几个树莓派的奇怪之处:> 树莓派没有 BIOS / UEFI 这对于 ARM SoC 来说并不奇怪。 回复 dmitrygr 1小时前 | 上一个 [–] 如何“发现”数据手册和谷歌上就有记载的东西 https://forums.raspberrypi.com/viewtopic.php?t=266130, https://www.google.com/search?q=raspberry+pi+boot+chain 回复 atoav 21分钟前 | 父级 [–] 作为一名电气工程师:你会惊讶于有多少人“发现”长期存在的真理,比如你可以使用设备的 MPN(“制造商零件编号”)来找到它的文档,而这些文档有时包含有用的数据。 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

I discovered that the Raspberry Pi doesn’t boot the same way traditional PC’s do. This was interesting and I thought I’d share.

At a high level, Raspberry Pi booting is firmware-driven, not BIOS-driven like a PC. On Raspberry Pi, the GPU (VideoCore) is powered first and is the root of trust for booting. The ARM CPU is not the initial execution environment. This is a deliberate architectural choice dating back to the original Pi.

Boot sequence (simplified):

1. Power applied

  • Power management IC brings up rails\
  • VideoCore GPU comes up first
  • ARM CPU is held in reset

2. VideoCore ROM Executes (GPU Side)

  • Immutable GPU boot ROM runs
  • This code:
    • Initializes minimal SDRAM
    • Reads boot configuration
    • Locates next-stage bootloader

The ARM cores are still powered down.

3. GPU Loads Firmware

  • GPU reads EEPROM bootloader
  • EEPROM bootloader then loads firmware from SD / USB / Network

The loaded firmware files are GPU Binaries- not ARM code!

4. GPU Configures the System

The GPU:

  • Parses config.txt
  • Applies device tree overlays
  • Allocates memory split (GPU vs ARM)
  • Initializes clocks and peripherals
  • Loads the ARM kernel image into RAM

At this point, the system hardware layout is defined by the GPU, not the CPU.

5. GPU Releases the ARM CPU from Reset

Only after:

  • Firmware is loaded
  • Memory is mapped
  • Kernel is staged

…does the GPU release the ARM core(s) and set their entry point.

This is when the CPU first executes instructions.

6. ARM CPU Starts Linux

  • CPU jumps directly into:
    • kernel7.img / kernel8.img
  • Linux takes over
  • GPU becomes a peripheral (mailbox, display, VPU, etc.)

This explains several Raspberry Pi oddities:

  • The Raspberry Pi has No BIOS / UEFI
  • The config.txt is not a Linux File
  • Kernel Replacement Is Trivial
  • Boot failures before Linux is loaded are invisible to Linux

Even with the EEPROM bootloader:

  • The GPU still executes first
  • The EEPROM code is executed by the GPU
  • ARM remains gated until kernel handoff

EEPROM just replaces bootcode.bin; it does not change authority.

The trust chain for the pi is:

GPU ROM → GPU firmware → ARM kernel → Linux userspace

The trust chain choices have consequences!

  • ARM cannot verify GPU firmware
  • Secure boot (where enabled) is GPU-anchored
  • This is why Raspberry Pi secure boot is not comparable to PC Secure Boot

The Raspberry Pi Secure boot implementation ensures that:

  • Only cryptographically signed boot firmware and kernel images are executed
  • The chain of trust starts in the VideoCore GPU, not the ARM CPU
  • The system can be locked to a specific vendor or deployment

It does not:

  • Provide a hardware-enforced user/kernel trust boundary
  • Protect against a malicious or compromised GPU firmware
  • Provide measured boot or TPM-style attestation
  • Prevent runtime compromise of Linux

Here’s the order of operations for boot up on a traditional PC:

Traditional PC Boot:

  ┌─────────────┐
  │    BIOS     │
  │   (CPU)     │
  └──────┬──────┘
         ↓
  ┌─────────────┐
  │  Bootloader │
  │   (CPU)     │
  └──────┬──────┘
         ↓
  ┌─────────────┐
  │   Kernel    │
  │   (CPU)     │
  └─────────────┘

The firmware embedded in the motherboard powers up the CPU. The CPU loads the bootloader. The bootloader hopefully correctly does cryptographic operations to load an unmodified kernel. From here, the boot process continues with init/systemd and our services are brought online for a running system.

The pi’s totally different. Instead of starting with the CPU, we start with the GPU.

Raspberry Pi Boot:

┌─────────────┐
│  VideoCore  │ ← GPU boots FIRST
│    (GPU)    │
└──────┬──────┘
       ↓
┌─────────────┐
│ Loads ARM   │
│   kernel    │
└──────┬──────┘
       ↓
┌─────────────┐
│  ARM CPU    │ ← CPU starts LAST
│   wakes up  │
└─────────────┘

Why? The Raspberry Pi uses Broadcom BCM2xxx chips where The “main” processor is a VideoCore IV/VI GPU is activated at power-on. It runs proprietary firmware that handles the boot. The BCM2xxx chips are typically used in set-top boxes for video streaming/entertainment. For these types of devices, the goal is to quickly get to a flashy user interface. The Raspberry Pi Foundation chose these inexpensive chips as their base that leave them with an odd boot order.

联系我们 contact @ memedata.com