1SiFive HiFive Unleashed 2======================= 3 4This file describes how to use the pre-defined Buildroot 5configuration for the SiFive HiFive Unleashed board. 6 7Further information about the HiFive Unleashed board can be found 8at https://www.sifive.com/boards/hifive-unleashed 9 10Building 11======== 12 13Configure Buildroot using the default board configuration: 14 15 $ make hifive_unleashed_defconfig 16 17Customise the build as necessary: 18 19 $ make menuconfig 20 21Start the build: 22 23 $ make 24 25Result of the build 26=================== 27 28Once the build has finished you will have the following files: 29 30 output/images/ 31 +-- boot.scr 32 +-- fw_dynamic.bin 33 +-- fw_dynamic.elf 34 +-- fw_jump.bin 35 +-- fw_jump.elf 36 +-- hifive-unleashed-a00.dtb 37 +-- Image 38 +-- rootfs.cpio 39 +-- rootfs.ext2 40 +-- rootfs.ext4 41 +-- rootfs.tar 42 +-- sdcard.img 43 +-- u-boot.bin 44 +-- u-boot.itb 45 +-- u-boot-spl.bin 46 47 48Creating a bootable SD card with genimage 49========================================= 50 51By default Buildroot builds a SD card image for you. All you need to do 52is dd the image to your SD card, which can be done with the following 53command on your development host: 54 55 $ sudo dd if=output/images/sdcard.img of=/dev/sdb bs=4096 56 57The above example command assumes the SD card is accessed via a USB card 58reader and shows up as /dev/sdb on the host. Adjust it accordingly per 59your actual setup. 60 61Booting the SD card on the board 62================================ 63 64Make sure that the all DIP switches are set to the off position for 65default boot mode (MSEL mode = 1011), insert the SD card and power 66up the board. 67 68Connect the USB cable and open minicom (/dev/ttyUSB1, 115200, 8N1). 69 70See the 'SiFive HiFive Unleashed Getting Started Guide' for 71more details (https://www.sifive.com/documentation). 72 73You will get a warning reported by fdisk when you examine the SD card. 74This is because the genimage_sdcard.cfg file doesn't specify the SD card 75size (as people will naturally have different sized cards), so the 76secondary GPT header is placed after the rootfs rather than at the end 77of the disk where it is expected to be. 78 79You will see something like this at boot time: 80 81[ 0.989458] mmc0: host does not support reading read-only switch, assuming write-enable 82[ 0.996772] mmc0: new SDHC card on SPI 83[ 1.001634] mmcblk0: mmc0:0000 SD8GB 7.28 GiB 84[ 1.038079] GPT:Primary header thinks Alt. header is not at the end of the disk. 85[ 1.044759] GPT:52389 != 15264767 86[ 1.048051] GPT:Alternate GPT header not at the end of the disk. 87[ 1.054015] GPT:52389 != 15264767 88[ 1.057323] GPT: Use GNU Parted to correct GPT errors. 89[ 1.062479] mmcblk0: p1 p2 p3 90 91 92Creating a bootable SPI flash with genimage 93=========================================== 94 95Adjust Buildroot configuration by: 96 97 $ make menuconfig 98 99Change "System configuration" -> "Extra arguments passed to custom scripts" 100value to "-c board/sifive/hifive-unleashed/genimage_spi-nor.cfg", save the 101configuration and build. This creates a output/images/spi-nor.img that can 102be programmed to the on-board SPI flash. 103 104Boot the board from the SD card prepared above, stop the U-Boot auto boot, 105and type the following commands to program the whole SPI flash: 106 107 => tftp 82000000 output/images/spi-nor.img 108 => sf probe 109 => sf update 82000000 0 2000000 110 111Booting the SPI flash on the board 112================================== 113 114Make sure that the all DIP switches are set to the off position for 115default boot mode (MSEL mode = 0110) to boot from SPI flash. 116