# U-BOOT ```bash! git clone https://github.com/stanley-666/u-boot.git ``` ```bash! sudo apt-get update sudo apt-get install -y \ build-essential bison flex swig python3-dev \ libssl-dev libgnutls28-dev \ libncurses5-dev device-tree-compiler \ pkg-config libyaml-dev ``` ## 檔案結構 ``` u-boot/ ├── arch └── riscv └── cpu ├── board/ │ └── digilent <vendor> │ └──genesys2/ │ ├── Makefile │ │── Kconfig │ └── genesys2.c <-- 這裡放你的 board_init / dram_init ├── configs/ │ └── genesys2_defconfig ├── include/ │ └── configs/ │ └── genesys2.h <-- 這裡放你的 CONFIG_SYS_TEXT_BASE、DDR addr 等 ``` ## 編譯過程 可以換最新的rvv compiler來編譯u-boot 產生u-boot.bin, dtb ```bash! make CROSS_COMPILE=riscv64-linux-gnu- genesys2_defconfig make CROSS_COMPILE=riscv64-linux-gnu- -j$(nproc) ``` ## Reference https://ithelp.ithome.com.tw/articles/10343682