# xilinx/u-boot-xlnx architecture

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

- Interactive diagram: https://gitdiagram.com/xilinx/u-boot-xlnx
- Repository: https://github.com/xilinx/u-boot-xlnx

## Overview

U-Boot is an embedded bootloader and hardware initialization monitor. Its principal workflow is to initialize board hardware, accept a boot or download request, load an image, and transfer control to it (including Linux, with device-tree support). The README also documents network boot, disk boot, and extensible monitor commands. The available excerpts show selected USB mass-storage, DDR-training, crypto-storage, and Binman code; these are distinct subsystems, not enough evidence to reconstruct their full runtime wiring. Links for documented but unsampled workflow stages cite the README.

Main entry points: [`boot/boot_fit.c`](https://github.com/xilinx/u-boot-xlnx/blob/master/boot/boot_fit.c) (Image loading), [`common/main.c`](https://github.com/xilinx/u-boot-xlnx/blob/master/common/main.c) (U-Boot monitor), [`board`](https://github.com/xilinx/u-boot-xlnx/tree/master/board) (Board initialization), [`cmd`](https://github.com/xilinx/u-boot-xlnx/tree/master/cmd) (Monitor commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot flow"]
  node_bootloader["U-Boot monitor<br/>[main.c]"]
  node_image_boot["Image loading<br/>[boot_fit.c]"]
  node_linux_handoff["Linux handoff"]
end

subgraph group_platform["Platform support"]
  node_board_init["Board initialization"]
  node_cpu_support["CPU support"]
  node_ddr_training["DDR training"]
end

subgraph group_io["I/O and commands"]
  node_monitor_commands["Monitor commands"]
  node_network_boot["Network boot"]
  node_storage_boot["Disk boot"]
  node_usb_command["USB mass-storage command<br/>[usb_mass_storage.c]"]
  node_usb_storage["USB storage support<br/>[usb_storage.c]"]
  node_mass_storage_gadget["Mass-storage gadget<br/>[f_mass_storage.c]"]
  node_storage_protocol["Storage protocol definitions<br/>[storage_common.c]"]
end

subgraph group_services["Supporting services"]
  node_psa_crypto["PSA crypto API<br/>[crypto.h]"]
  node_key_storage[("Persistent key storage")]
  node_binman["Image construction<br/>[control.py]"]
  node_bintools["External image tools<br/>[bintool.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_bootloader
node_bootloader -.->|"initializes hardware"| node_board_init
node_board_init -.->|"uses platform support"| node_cpu_support
node_board_init -.->|"trains memory"| node_ddr_training
node_operator -->|"uses commands"| node_monitor_commands
node_monitor_commands -.->|"requests network boot"| node_network_boot
node_monitor_commands -->|"requests disk boot"| node_storage_boot
node_network_boot -->|"loads image"| node_image_boot
node_storage_boot -->|"loads image"| node_image_boot
node_bootloader -.->|"boots image"| node_image_boot
node_image_boot -->|"hands off"| node_linux_handoff
node_usb_command -.->|"dispatches to"| node_usb_storage
node_usb_storage -.->|"transfers data"| node_mass_storage_gadget
node_mass_storage_gadget -->|"uses definitions"| node_storage_protocol
node_key_storage -->|"uses API"| node_psa_crypto
node_binman -->|"collects tools"| node_bintools

click node_bootloader "https://github.com/xilinx/u-boot-xlnx/blob/master/common/main.c"
click node_board_init "https://github.com/xilinx/u-boot-xlnx/tree/master/board"
click node_cpu_support "https://github.com/xilinx/u-boot-xlnx/tree/master/arch"
click node_ddr_training "https://github.com/xilinx/u-boot-xlnx/blob/master/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c"
click node_monitor_commands "https://github.com/xilinx/u-boot-xlnx/tree/master/cmd"
click node_network_boot "https://github.com/xilinx/u-boot-xlnx/tree/master/net"
click node_storage_boot "https://github.com/xilinx/u-boot-xlnx/tree/master/drivers"
click node_image_boot "https://github.com/xilinx/u-boot-xlnx/blob/master/boot/boot_fit.c"
click node_linux_handoff "https://github.com/xilinx/u-boot-xlnx/tree/master/boot"
click node_usb_command "https://github.com/xilinx/u-boot-xlnx/blob/master/cmd/usb_mass_storage.c"
click node_usb_storage "https://github.com/xilinx/u-boot-xlnx/blob/master/common/usb_storage.c"
click node_mass_storage_gadget "https://github.com/xilinx/u-boot-xlnx/blob/master/drivers/usb/gadget/f_mass_storage.c"
click node_storage_protocol "https://github.com/xilinx/u-boot-xlnx/blob/master/drivers/usb/gadget/storage_common.c"
click node_psa_crypto "https://github.com/xilinx/u-boot-xlnx/blob/master/lib/mbedtls/external/mbedtls/include/psa/crypto.h"
click node_key_storage "https://github.com/xilinx/u-boot-xlnx/blob/master/lib/mbedtls/external/mbedtls/library/psa_crypto_storage.c"
click node_binman "https://github.com/xilinx/u-boot-xlnx/blob/master/tools/binman/control.py"
click node_bintools "https://github.com/xilinx/u-boot-xlnx/blob/master/tools/binman/bintool.py"

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_bootloader,node_image_boot,node_linux_handoff toneBlue
class node_board_init,node_cpu_support,node_ddr_training toneAmber
class node_monitor_commands,node_network_boot,node_storage_boot,node_usb_command,node_usb_storage,node_mass_storage_gadget,node_storage_protocol toneMint
class node_psa_crypto,node_key_storage,node_binman,node_bintools toneRose
class node_operator toneIndigo
```

## Components

### Boot flow

- [U-Boot monitor](https://github.com/xilinx/u-boot-xlnx/blob/master/common/main.c): `common/main.c`
- [Image loading](https://github.com/xilinx/u-boot-xlnx/blob/master/boot/boot_fit.c): `boot/boot_fit.c`
- [Linux handoff](https://github.com/xilinx/u-boot-xlnx/tree/master/boot): `boot`

### Platform support

- [Board initialization](https://github.com/xilinx/u-boot-xlnx/tree/master/board): `board`
- [CPU support](https://github.com/xilinx/u-boot-xlnx/tree/master/arch): `arch`
- [DDR training](https://github.com/xilinx/u-boot-xlnx/blob/master/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c): `drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c`

### I/O and commands

- [Monitor commands](https://github.com/xilinx/u-boot-xlnx/tree/master/cmd): `cmd`
- [Network boot](https://github.com/xilinx/u-boot-xlnx/tree/master/net): `net`
- [Disk boot](https://github.com/xilinx/u-boot-xlnx/tree/master/drivers): `drivers`
- [USB mass-storage command](https://github.com/xilinx/u-boot-xlnx/blob/master/cmd/usb_mass_storage.c): `cmd/usb_mass_storage.c`
- [USB storage support](https://github.com/xilinx/u-boot-xlnx/blob/master/common/usb_storage.c): `common/usb_storage.c`
- [Mass-storage gadget](https://github.com/xilinx/u-boot-xlnx/blob/master/drivers/usb/gadget/f_mass_storage.c): `drivers/usb/gadget/f_mass_storage.c`
- [Storage protocol definitions](https://github.com/xilinx/u-boot-xlnx/blob/master/drivers/usb/gadget/storage_common.c): `drivers/usb/gadget/storage_common.c`

### Supporting services

- [PSA crypto API](https://github.com/xilinx/u-boot-xlnx/blob/master/lib/mbedtls/external/mbedtls/include/psa/crypto.h): `lib/mbedtls/external/mbedtls/include/psa/crypto.h`
- [Persistent key storage](https://github.com/xilinx/u-boot-xlnx/blob/master/lib/mbedtls/external/mbedtls/library/psa_crypto_storage.c): `lib/mbedtls/external/mbedtls/library/psa_crypto_storage.c`
- [Image construction](https://github.com/xilinx/u-boot-xlnx/blob/master/tools/binman/control.py): `tools/binman/control.py`
- [External image tools](https://github.com/xilinx/u-boot-xlnx/blob/master/tools/binman/bintool.py): `tools/binman/bintool.py`

### Other components

- **Operator**

## Connections

- Operator → U-Boot monitor: starts (evidence: `README`)
- U-Boot monitor → Board initialization: initializes hardware
- Board initialization → CPU support: uses platform support
- Board initialization → DDR training: trains memory
- Operator → Monitor commands: uses commands (evidence: `README`)
- Monitor commands → Network boot: requests network boot
- Monitor commands → Disk boot: requests disk boot (evidence: `README`)
- Network boot → Image loading: loads image (evidence: `README`)
- Disk boot → Image loading: loads image (evidence: `README`)
- U-Boot monitor → Image loading: boots image
- Image loading → Linux handoff: hands off (evidence: `README`)
- USB mass-storage command → USB storage support: dispatches to
- USB storage support → Mass-storage gadget: transfers data
- Mass-storage gadget → Storage protocol definitions: uses definitions (evidence: `drivers/usb/gadget/f_mass_storage.c`)
- Persistent key storage → PSA crypto API: uses API (evidence: `lib/mbedtls/external/mbedtls/library/psa_crypto_storage.c`)
- Image construction → External image tools: collects tools (evidence: `tools/binman/control.py`)
