编译U-Boot
执行以下步骤,为昉·星光 2编译U-Boot:
- 
        将U-Boot文件保存到您的目标目录下,如主目录(home directory)下:
        
cd ~ # home directory
 - 
        下载源代码,以编译U-Boot:
        
git clone https://github.com/starfive-tech/u-boot.git
 - 
        执行以下命令,切换到代码分支:
        
cd u-boot git checkout -b JH7110_VisionFive2_devel origin/JH7110_VisionFive2_devel git pull
 - 
        执行以下命令,在U-Boot目录下编译U-Boot:
        
make <Configuration_File> ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
提示:<Configuration_File>:在昉·星光 2上,该文件为starfive_visionfive2_defconfig。
结果:编译完成后,在u-boot目录下将生成以下三个文件:
- u-boot.bin
 - arch/riscv/dts/starfive_visionfive2.dtb
 - spl/u-boot-spl.bin
 
图 1. 示例输出 - u-boot.bin 
          图 2. 示例输出 - visionfive2.dtb 
          图 3. 示例输出 - u-boot-boot.bin 
提示:- starfive_visionfive2.dtb和u-boot.bin都将用于稍后的OpenSBI编译。
 - u-boot-spl.bin将用于稍后创建SPL文件。
 
 
