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