README 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ================================================================================
  2. Useful notes on bulding and using of U-Boot on ARC HS Development Kit (AKA HSDK)
  3. ================================================================================
  4. BOARD OVERVIEW
  5. The DesignWare ARC HS Development Kit is a ready-to-use platform for rapid
  6. software development on the ARC HS3x family of processors.
  7. For more information please visit:
  8. https://www.synopsys.com/dw/ipdir.php?ds=arc-hs-development-kit
  9. User guide is availalble here:
  10. https://github.com/foss-for-synopsys-dwc-arc-processors/ARC-Development-Systems-Forum/wiki/docs/ARC_HSDK_User_Guide.pdf
  11. It has the following features useful for U-Boot:
  12. * On-board 2-channel FTDI TTL-to-USB converter
  13. - The first channel is used for serial debug port (which makes it possible
  14. to use a serial connection on pretty much any host machine be it
  15. Windows, Linux or Mac).
  16. On Linux machine typucally FTDI serial port would be /dev/ttyUSB0.
  17. There's no HW flow-control and baud-rate is 115200.
  18. - The second channel is used for built-in Digilent USB JTAG probe.
  19. That means no extra hardware is required to access ARC core from a
  20. debugger on development host. Both proprietary MetaWare debugger and
  21. open source OpenOCD + GDB client are supported.
  22. - Also with help of this FTDI chip it is possible to reset entire
  23. board with help of a special `rff-ftdi-reset` utility, see:
  24. https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset
  25. * Micro SD-card slot
  26. - U-Boot expects to see the very first partition on the card formatted as
  27. FAT file-system and uses it for keeping its environment in `uboot.env`
  28. file. Note uboot.env is not just a text file but it is auto-generated
  29. file created by U-Boot on invocation of `saveenv` command.
  30. It contains a checksum which makes this saved environment invalid in
  31. case of maual modification.
  32. - There might be more useful files on that first FAT partition like
  33. Linux kernl image in form of uImage (with or without built-in
  34. initramfs), device tree blob (.dtb) etc.
  35. - Except FAT partition there might be others following the first FAT one
  36. like Ext file-system with rootfs etc.
  37. * 1 Gb Ethernet socket
  38. - U-Boot might get payload from TFTP server. This might be uImage, rootfs
  39. image and anything else.
  40. * 2 MiB of SPI-flash
  41. - SPI-flahs is used as a storage for image of an application auto-executed
  42. by bootROM on power-on. Typically U-Boot gets programmed there but
  43. there might be other uses. But note bootROM expects to find a special
  44. header preceeding application image itself so before flashing anything
  45. make sure required image is prepended. In case of U-Boot this is done
  46. by invocation of `headerize-hsdk.py` with `make bsp-generate` command.
  47. BUILDING U-BOOT
  48. 1. Configure U-Boot:
  49. ------------------------->8----------------------
  50. make hsdk_defconfig
  51. ------------------------->8----------------------
  52. 2. To build Elf file (for example to be used with host debugger via JTAG
  53. connection to the target board):
  54. ------------------------->8----------------------
  55. make mdbtrick
  56. ------------------------->8----------------------
  57. This will produce `u-boot` Elf file.
  58. 3. To build artifacts required for U-Boot update in n-board SPI-flash:
  59. ------------------------->8----------------------
  60. make bsp-generate
  61. ------------------------->8----------------------
  62. This will produce `u-boot.head` and `u-boot-update.scr` which should
  63. be put on the first FAT partition of micro SD-card to be inserted in the
  64. HSDK board.
  65. Note that Python3 script is used for generation of a header, thus
  66. to get that done it's required to have Python3 with "pyelftools" installed.
  67. "pyelftools" could be installed with help of "pip" even w/o root rights:
  68. ------------------------->8----------------------
  69. python3 -m pip install --user pyelftools
  70. ------------------------->8----------------------
  71. EXECUTING U-BOOT
  72. 1. The HSDK board is supposed to auto-start U-Boot image stored in on-board
  73. SPI-flash on power-on. For that make sure DIP-switches in the corner of
  74. the board are in their default positions: BIM in 1:off, 2:on state
  75. while both BMC and BCS should be in 1:on, 2:on state.
  76. 2. Though it is possible to load U-Boot as a simple Elf file via JTAG right
  77. in DDR and start it from the debugger.
  78. 2.1. In case of proprietary MetaWare debugger run:
  79. ------------------------->8----------------------
  80. mdb -digilent -run -cl u-boot
  81. ------------------------->8----------------------
  82. UPDATION U-BOOT IMAGE IN ON-BOARD SPI-FLASH
  83. 1. Create `u-boot.head` and `u-boot-update.scr` as discribed above with
  84. `make bsp-generate` command.
  85. 2. Copy `u-boot.head` and `u-boot-update.scr` to the first FAT partition
  86. of micro SD-card.
  87. 3. Connect USB cable from the HSDK board to the developemnt host and
  88. fire-up serial terminal.
  89. 3. Insert prepared micro SD-card in the HSDK board, press reset button
  90. and stop auto-execution of existing `bootcmd` pressing any key in serial
  91. terminal and enter the following command:
  92. ------------------------->8----------------------
  93. mmc rescan && fatload mmc 0:1 ${loadaddr} u-boot-update.scr && source ${loadaddr}
  94. ------------------------->8----------------------
  95. Wait before you see "u-boot update: OK" message.
  96. 4. Press RESET button and enjoy updated U-Boot version.