Compiling the u-boot

Follow the steps below to compile the u-boot for VisionFive.

  1. Locate to your desired directory to store the u-boot files. For example, the home directory.
    Example:
    cd ~ # home directory
  2. Download the source code for u-boot compilation.
    git clone https://github.com/starfive-tech/u-boot
  3. Switch to the code branch by executing the following command:
    cd u-boot
    git checkout -b JH7100_upstream origin/JH7100_upstream
    git pull
  4. Type the following to compile u-boot under the u-boot directory.
    make <Configuration_File> ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
    make u-boot.bin u-boot.dtb ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
    Tip:

    Configuration_File:

    • For VisionFive, the file is starfive_jh7100_visionfive_smode_defconfig.
    • For Starlight, the file is starfive_jh7100_starlight_smode_defconfig.
    Result:

    There will be these 2 files generated after compilation inside the u-boot directory: u-boot.bin and u-boot.dtb. compiling_u-boot_step4_output_1109.jpg Figure - Example Output

    Tip: Both u-boot.dtb and u-boot.bin will be used later for OpenSBI compilation.