readme.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. SiFive HiFive Unmatched
  2. =======================
  3. This file describes how to use the pre-defined Buildroot
  4. configuration for the SiFive HiFive Unmatched board.
  5. Further information about the HiFive Unmatched board can be found
  6. at https://www.sifive.com/boards/hifive-unmatched
  7. Building
  8. ========
  9. Configure Buildroot using the default board configuration:
  10. $ make hifive_unmatched_defconfig
  11. Customise the build as necessary:
  12. $ make menuconfig
  13. Start the build:
  14. $ make
  15. Result of the build
  16. ===================
  17. Once the build has finished you will have the following files:
  18. output/images/
  19. +-- boot.scr
  20. +-- fw_dynamic.bin
  21. +-- fw_dynamic.elf
  22. +-- fw_jump.bin
  23. +-- fw_jump.elf
  24. +-- hifive-unmatched-a00.dtb
  25. +-- Image
  26. +-- rootfs.cpio
  27. +-- rootfs.ext2
  28. +-- rootfs.ext4
  29. +-- rootfs.tar
  30. +-- sdcard.img
  31. +-- u-boot.bin
  32. +-- u-boot.itb
  33. +-- u-boot-spl.bin
  34. Creating a bootable SD card with genimage
  35. =========================================
  36. By default Buildroot builds a SD card image for you. All you need to do
  37. is dd the image to your SD card, which can be done with the following
  38. command on your development host:
  39. $ sudo dd if=output/images/sdcard.img of=/dev/sdb bs=4096
  40. The above example command assumes the SD card is accessed via a USB card
  41. reader and shows up as /dev/sdb on the host. Adjust it accordingly per
  42. your actual setup.
  43. Booting the SD card on the board
  44. ================================
  45. Make sure that the all DIP switches are set to the off position for
  46. default boot mode (MSEL mode = 1011), insert the SD card and power
  47. up the board.
  48. Connect the USB cable and open minicom (/dev/ttyUSB1, 115200, 8N1).
  49. See the 'SiFive HiFive Unmatched Getting Started Guide' for
  50. more details (https://www.sifive.com/documentation).
  51. You will get a warning reported by fdisk when you examine the SD card.
  52. This is because the genimage_sdcard.cfg file doesn't specify the SD card
  53. size (as people will naturally have different sized cards), so the
  54. secondary GPT header is placed after the rootfs rather than at the end
  55. of the disk where it is expected to be.
  56. You will see something like this at boot time:
  57. [ 0.989458] mmc0: host does not support reading read-only switch, assuming write-enable
  58. [ 0.996772] mmc0: new SDHC card on SPI
  59. [ 1.001634] mmcblk0: mmc0:0000 SD8GB 7.28 GiB
  60. [ 1.038079] GPT:Primary header thinks Alt. header is not at the end of the disk.
  61. [ 1.044759] GPT:52389 != 15264767
  62. [ 1.048051] GPT:Alternate GPT header not at the end of the disk.
  63. [ 1.054015] GPT:52389 != 15264767
  64. [ 1.057323] GPT: Use GNU Parted to correct GPT errors.
  65. [ 1.062479] mmcblk0: p1 p2 p3
  66. Testing under QEMU
  67. ==================
  68. The SD card image can be tested using QEMU:
  69. $ qemu-system-riscv64 -M sifive_u,msel=11 -smp 5 -m 8G \
  70. -display none -serial stdio -nic user \
  71. -bios output/images/u-boot-spl.bin \
  72. -drive file=output/images/sdcard.img,if=sd