# linux-goxceed/u-boot architecture

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

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

## Overview

U-Boot is an embedded boot loader and hardware monitor. Its principal workflow is to initialize board hardware, let an operator or boot policy select a source, load an image, and transfer control to it; the README also documents network and ATA/SCSI boot. The tree and sampled files show architecture-specific initialization, storage interfaces, USB mass storage, and a firmware API. Several runtime relationships are documented only at a high level, so those links are dashed; sampled storage and USB excerpts do not establish a complete boot pipeline.

Main entry points: [`cmd`](https://github.com/linux-goxceed/u-boot/tree/main/cmd) (Monitor Commands), [`common/main.c`](https://github.com/linux-goxceed/u-boot/blob/main/common/main.c) (Monitor Loop), [`arch/arm`](https://github.com/linux-goxceed/u-boot/tree/main/arch/arm) (Board / SoC Init), [`cmd/usb_mass_storage.c`](https://github.com/linux-goxceed/u-boot/blob/main/cmd/usb_mass_storage.c) (USB Mass Storage Command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Monitor Runtime"]
  node_monitor["Monitor Loop<br/>[main.c]"]
  node_commands["Monitor Commands"]
  node_imageboot["Image Boot"]
end

subgraph group_platform["Platform Initialization"]
  node_boardinit["Board / SoC Init"]
  node_ddrtraining["DDR Training"]
  node_clockinit["SoCFPGA Clocks"]
end

subgraph group_bootio["Boot I/O"]
  node_networkboot["Network Boot"]
  node_blockstorage["Block Storage<br/>[usb_storage.c]"]
  node_usbcommand["USB Mass Storage Command<br/>[usb_mass_storage.c]"]
  node_usbfunction["USB Gadget Storage<br/>[f_mass_storage.c]"]
  node_storagecommon["Storage Protocol Common<br/>[storage_common.c]"]
end

subgraph group_interfaces["Firmware Interfaces"]
  node_firmwareapi["Firmware API<br/>[api.c]"]
  node_api_storage["API Storage<br/>[api_storage.c]"]
end

node_operator(("Operator / Boot Policy"))
node_linux(("Linux / Loaded Program"))
node_usbhost(("USB Host"))

node_operator -.->|"invokes"| node_monitor
node_monitor -.->|"dispatches"| node_commands
node_monitor -.->|"initializes hardware"| node_boardinit
node_boardinit -.->|"may configure memory"| node_ddrtraining
node_boardinit -.->|"may configure clocks"| node_clockinit
node_commands -.->|"supports network boot"| node_networkboot
node_commands -.->|"supports disk boot"| node_blockstorage
node_commands -.->|"offers USB mass storage"| node_usbcommand
node_usbcommand -.->|"configures function"| node_usbfunction
node_usbfunction -->|"uses definitions"| node_storagecommon
node_usbhost -.->|"initiates transfer"| node_usbcommand
node_commands -.->|"selects image boot"| node_imageboot
node_imageboot -.->|"transfers control"| node_linux
node_firmwareapi -.->|"delegates storage calls"| node_api_storage

click node_monitor "https://github.com/linux-goxceed/u-boot/blob/main/common/main.c"
click node_commands "https://github.com/linux-goxceed/u-boot/tree/main/cmd"
click node_imageboot "https://github.com/linux-goxceed/u-boot/tree/main/arch/arm/lib"
click node_boardinit "https://github.com/linux-goxceed/u-boot/tree/main/arch/arm"
click node_ddrtraining "https://github.com/linux-goxceed/u-boot/blob/main/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c"
click node_clockinit "https://github.com/linux-goxceed/u-boot/blob/main/arch/arm/mach-socfpga/clock_manager_arria10.c"
click node_networkboot "https://github.com/linux-goxceed/u-boot/tree/main/net"
click node_blockstorage "https://github.com/linux-goxceed/u-boot/blob/main/common/usb_storage.c"
click node_usbcommand "https://github.com/linux-goxceed/u-boot/blob/main/cmd/usb_mass_storage.c"
click node_usbfunction "https://github.com/linux-goxceed/u-boot/blob/main/drivers/usb/gadget/f_mass_storage.c"
click node_storagecommon "https://github.com/linux-goxceed/u-boot/blob/main/drivers/usb/gadget/storage_common.c"
click node_firmwareapi "https://github.com/linux-goxceed/u-boot/blob/main/api/api.c"
click node_api_storage "https://github.com/linux-goxceed/u-boot/blob/main/api/api_storage.c"

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_monitor,node_commands,node_imageboot toneBlue
class node_boardinit,node_ddrtraining,node_clockinit toneAmber
class node_networkboot,node_blockstorage,node_usbcommand,node_usbfunction,node_storagecommon toneMint
class node_firmwareapi,node_api_storage toneRose
class node_operator,node_linux,node_usbhost toneIndigo
```

## Components

### Monitor Runtime

- [Monitor Loop](https://github.com/linux-goxceed/u-boot/blob/main/common/main.c): `common/main.c`
- [Monitor Commands](https://github.com/linux-goxceed/u-boot/tree/main/cmd): `cmd`
- [Image Boot](https://github.com/linux-goxceed/u-boot/tree/main/arch/arm/lib): `arch/arm/lib`

### Platform Initialization

- [Board / SoC Init](https://github.com/linux-goxceed/u-boot/tree/main/arch/arm): `arch/arm`
- [DDR Training](https://github.com/linux-goxceed/u-boot/blob/main/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c): `drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c`
- [SoCFPGA Clocks](https://github.com/linux-goxceed/u-boot/blob/main/arch/arm/mach-socfpga/clock_manager_arria10.c): `arch/arm/mach-socfpga/clock_manager_arria10.c`

### Boot I/O

- [Network Boot](https://github.com/linux-goxceed/u-boot/tree/main/net): `net`
- [Block Storage](https://github.com/linux-goxceed/u-boot/blob/main/common/usb_storage.c): `common/usb_storage.c`
- [USB Mass Storage Command](https://github.com/linux-goxceed/u-boot/blob/main/cmd/usb_mass_storage.c): `cmd/usb_mass_storage.c`
- [USB Gadget Storage](https://github.com/linux-goxceed/u-boot/blob/main/drivers/usb/gadget/f_mass_storage.c): `drivers/usb/gadget/f_mass_storage.c`
- [Storage Protocol Common](https://github.com/linux-goxceed/u-boot/blob/main/drivers/usb/gadget/storage_common.c): `drivers/usb/gadget/storage_common.c`

### Firmware Interfaces

- [Firmware API](https://github.com/linux-goxceed/u-boot/blob/main/api/api.c): `api/api.c`
- [API Storage](https://github.com/linux-goxceed/u-boot/blob/main/api/api_storage.c): `api/api_storage.c`

### Other components

- **Operator / Boot Policy**
- **Linux / Loaded Program**
- **USB Host**

## Connections

- Operator / Boot Policy → Monitor Loop: invokes (evidence: `README`)
- Monitor Loop → Monitor Commands: dispatches (evidence: `README`)
- Monitor Loop → Board / SoC Init: initializes hardware (evidence: `README`)
- Board / SoC Init → DDR Training: may configure memory
- Board / SoC Init → SoCFPGA Clocks: may configure clocks
- Monitor Commands → Network Boot: supports network boot (evidence: `README`)
- Monitor Commands → Block Storage: supports disk boot (evidence: `README`)
- Monitor Commands → USB Mass Storage Command: offers USB mass storage
- USB Mass Storage Command → USB Gadget Storage: configures function
- USB Gadget Storage → Storage Protocol Common: uses definitions (evidence: `drivers/usb/gadget/f_mass_storage.c`)
- USB Host → USB Mass Storage Command: initiates transfer
- Monitor Commands → Image Boot: selects image boot (evidence: `README`)
- Image Boot → Linux / Loaded Program: transfers control (evidence: `README`)
- Firmware API → API Storage: delegates storage calls
