RISC-V をFPGAで動かすにあたり必要な fpga-zynq リポジトリは、毎回Linuxをブートするにあたり以下のようなコマンドを入力してブートしている。
fatload mmc 0 0x3000000 uImage fatload mmc 0 0x2A00000 devicetree.dtb fatload mmc 0 0x1000000 uramdisk.image.gz bootm 0x3000000 0x1000000 0x2A00000
しかし、これを毎回入力するのは面倒くさいし、よく見ると最初の立ち上がり時にエラーが出ている。これはどうにかして消せないだろうか?
Unknown command 'load' -try 'help'

一応Xilinxのフォーラムには上がっているが、意味が分からない。
"Copying Linux from SD to RAM... RFS in ext4" のメッセージのあたりから、u-boot-xlnx/include/configs/zynq-common.h のあたりだと思うのだが、"load"コマンドというのがどこにも書いていないので困っている。
"sdboot=if mmcinfo; then " \
"run uenvboot; " \
"echo Copying Linux from SD to RAM... && " \
"fatload mmc 0 ${kernel_load_address} ${kernel_image} && " \
"fatload mmc 0 ${devicetree_load_address} ${devicetree_image} && " \
"fatload mmc 0 ${ramdisk_load_address} ${ramdisk_image} && " \
"bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}; " \
"fi\0" \
一応LinuxとU-Bootをリコンパイルしてみたが、変わらずだ。
fpga-zynq のリポジトリでは、 make arm-linux でLinuxとU-Bootを生成することができる。
- common/Makefrag
arm-linux: arm-uboot # must first build uboot because we need tools
# compile kernel
git submodule update --init $(arm_linux_dir)
# no make clean included here since one copy of linux should work on all boards
cd $(arm_linux_dir) && make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- xilinx_zynq_defconfig
cd $(arm_linux_dir) && make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- -j$(JOBS)
# convert zImage to uImage
cd $(arm_linux_dir) && export PATH=$(uboot_dir)/tools:$$PATH && make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- UIMAGE_LOADADDR=0x8000 uImage
mkdir -p $(output_delivery)
cp $(arm_linux_dir)/arch/arm/boot/uImage $(output_delivery)/
arm-uboot:
# compile board-compatible u-boot
git submodule update --init $(uboot_dir)
# copy relevant configuration files
if [ -a soft_config/boards.cfg ] ; \
then \
cp soft_config/boards.cfg $(uboot_dir)/ ; \
fi;
cp soft_config/zynq_$(UBOOT_CONFIG).h $(uboot_dir)/include/configs/
# actually build
cd $(uboot_dir) && make CROSS_COMPILE=arm-xilinx-linux-gnueabi- zynq_$(UBOOT_CONFIG)_config
cd $(uboot_dir) && make CROSS_COMPILE=arm-xilinx-linux-gnueabi- -j$(JOBS)
mkdir -p $(soft_build_dir)
cp $(uboot_dir)/u-boot $(soft_build_dir)/u-boot.elf
再生成してSDカードに書き込んでみたが、やはり相変わらずだ...
2018/02/07追記。u-boot-xlnxのリビジョンを最新にすると正常ブートできるようになった。
cd common/u-boot-xlnx/ git checkout xilinx-v2017.4 cd ../../zedboard emacs ../common/Makefrag
@@ -131,7 +131,7 @@ arm-linux: arm-uboot # must first build uboot because we need tools arm-uboot: # compile board-compatible u-boot - git submodule update --init $(uboot_dir) + # git submodule update --init $(uboot_dir) # copy relevant configuration files if [ -a soft_config/boards.cfg ] ; \ then \
これでmakeを実行する。
make arm-uboot make fpga-images-zedboard/boot.bin
これでイメージファイルをSDカードに書き込むと、正常ブートした。
