# rockchip-linux/u-boot architecture

> Architecture diagram of the GitHub repository rockchip-linux/u-boot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rockchip-linux/u-boot
- Repository: https://github.com/rockchip-linux/u-boot

## Overview

U-Boot is an embedded boot loader and hardware monitor. Its documented startup begins in architecture-specific code, performs early and board initialization, then provides monitor commands and mechanisms to load and run application images. The README also documents network and storage boot, Linux-image support, and dynamically loaded utilities. The tree shows corresponding runtime subsystems, but sampled source does not establish most of their call paths, so the graph uses README-supported relationships and leaves other wiring unspecified.

Main entry points: [`cmd`](https://github.com/rockchip-linux/u-boot/tree/next-dev/cmd) (Monitor commands), [`arch`](https://github.com/rockchip-linux/u-boot/tree/next-dev/arch) (Architecture startup), [`board`](https://github.com/rockchip-linux/u-boot/tree/next-dev/board) (Board initialization), [`common/main.c`](https://github.com/rockchip-linux/u-boot/blob/next-dev/common/main.c) (Command monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Platform startup"]
  node_arch_start["Architecture startup"]
  node_cpu_init["CPU initialization"]
  node_board_init["Board initialization"]
end

subgraph group_monitor["Monitor and boot"]
  node_monitor["Command monitor<br/>[main.c]"]
  node_commands["Monitor commands"]
  node_image_load["Image loading"]
  node_boot_run["Image handoff"]
end

subgraph group_io["Devices and transport"]
  node_network["Network stack"]
  node_device_drivers["Device drivers"]
  node_usb_mass["USB mass storage<br/>[f_mass_storage.c]"]
end

subgraph group_storage["Storage and filesystems"]
  node_disk["Disk partitions"]
  node_filesystems["Filesystems"]
  node_persistent_store["Persistent storage<br/>[api_storage.c]"]
end

subgraph group_interfaces["Display and APIs"]
  node_display["Display subsystem<br/>[rockchip_vop2.c]"]
  node_external_api["External application API"]
end

node_power(("Power-on"))
node_application(("Loaded application"))

node_power -->|"starts"| node_arch_start
node_arch_start -->|"initializes"| node_cpu_init
node_cpu_init -->|"continues startup"| node_board_init
node_board_init -.->|"enters monitor"| node_monitor
node_monitor -.->|"dispatches commands"| node_commands
node_commands -.->|"loads image"| node_image_load
node_image_load -.->|"hands off"| node_boot_run
node_boot_run -->|"runs image"| node_application
node_commands -->|"network boot"| node_network
node_commands -->|"storage boot"| node_disk
node_commands -.->|"storage boot"| node_filesystems

click node_arch_start "https://github.com/rockchip-linux/u-boot/tree/next-dev/arch"
click node_cpu_init "https://github.com/rockchip-linux/u-boot/tree/next-dev/arch"
click node_board_init "https://github.com/rockchip-linux/u-boot/tree/next-dev/board"
click node_monitor "https://github.com/rockchip-linux/u-boot/blob/next-dev/common/main.c"
click node_commands "https://github.com/rockchip-linux/u-boot/tree/next-dev/cmd"
click node_image_load "https://github.com/rockchip-linux/u-boot/tree/next-dev/common"
click node_boot_run "https://github.com/rockchip-linux/u-boot/tree/next-dev/arch"
click node_network "https://github.com/rockchip-linux/u-boot/tree/next-dev/net"
click node_device_drivers "https://github.com/rockchip-linux/u-boot/tree/next-dev/drivers"
click node_usb_mass "https://github.com/rockchip-linux/u-boot/blob/next-dev/drivers/usb/gadget/f_mass_storage.c"
click node_disk "https://github.com/rockchip-linux/u-boot/tree/next-dev/disk"
click node_filesystems "https://github.com/rockchip-linux/u-boot/tree/next-dev/fs"
click node_persistent_store "https://github.com/rockchip-linux/u-boot/blob/next-dev/api/api_storage.c"
click node_display "https://github.com/rockchip-linux/u-boot/blob/next-dev/drivers/video/drm/rockchip_vop2.c"
click node_external_api "https://github.com/rockchip-linux/u-boot/tree/next-dev/api"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_arch_start,node_cpu_init,node_board_init toneBlue
class node_monitor,node_commands,node_image_load,node_boot_run toneAmber
class node_network,node_device_drivers,node_usb_mass toneMint
class node_disk,node_filesystems,node_persistent_store toneRose
class node_display,node_external_api,node_power,node_application toneIndigo
```

## Components

### Platform startup

- [Architecture startup](https://github.com/rockchip-linux/u-boot/tree/next-dev/arch): `arch`
- [CPU initialization](https://github.com/rockchip-linux/u-boot/tree/next-dev/arch): `arch`
- [Board initialization](https://github.com/rockchip-linux/u-boot/tree/next-dev/board): `board`

### Monitor and boot

- [Command monitor](https://github.com/rockchip-linux/u-boot/blob/next-dev/common/main.c): `common/main.c`
- [Monitor commands](https://github.com/rockchip-linux/u-boot/tree/next-dev/cmd): `cmd`
- [Image loading](https://github.com/rockchip-linux/u-boot/tree/next-dev/common): `common`
- [Image handoff](https://github.com/rockchip-linux/u-boot/tree/next-dev/arch): `arch`

### Devices and transport

- [Network stack](https://github.com/rockchip-linux/u-boot/tree/next-dev/net): `net`
- [Device drivers](https://github.com/rockchip-linux/u-boot/tree/next-dev/drivers): `drivers`
- [USB mass storage](https://github.com/rockchip-linux/u-boot/blob/next-dev/drivers/usb/gadget/f_mass_storage.c): `drivers/usb/gadget/f_mass_storage.c`

### Storage and filesystems

- [Disk partitions](https://github.com/rockchip-linux/u-boot/tree/next-dev/disk): `disk`
- [Filesystems](https://github.com/rockchip-linux/u-boot/tree/next-dev/fs): `fs`
- [Persistent storage](https://github.com/rockchip-linux/u-boot/blob/next-dev/api/api_storage.c): `api/api_storage.c`

### Display and APIs

- [Display subsystem](https://github.com/rockchip-linux/u-boot/blob/next-dev/drivers/video/drm/rockchip_vop2.c): `drivers/video/drm/rockchip_vop2.c`
- [External application API](https://github.com/rockchip-linux/u-boot/tree/next-dev/api): `api`

### Other components

- **Power-on**
- **Loaded application**

## Connections

- Power-on → Architecture startup: starts (evidence: `README`)
- Architecture startup → CPU initialization: initializes (evidence: `README`)
- CPU initialization → Board initialization: continues startup (evidence: `README`)
- Board initialization → Command monitor: enters monitor
- Command monitor → Monitor commands: dispatches commands
- Monitor commands → Image loading: loads image
- Image loading → Image handoff: hands off
- Image handoff → Loaded application: runs image (evidence: `README`)
- Monitor commands → Network stack: network boot (evidence: `README`)
- Monitor commands → Disk partitions: storage boot (evidence: `README`)
- Monitor commands → Filesystems: storage boot
