xref: /openbmc/u-boot/board/synopsys/emsdp/README (revision 6f443330)
1*adc9b09aSAlexey Brodkin================================================================================
2*adc9b09aSAlexey BrodkinUseful notes on bulding and using of U-Boot on
3*adc9b09aSAlexey BrodkinARC EM Software Development Platform (AKA EMSDP)
4*adc9b09aSAlexey Brodkin================================================================================
5*adc9b09aSAlexey Brodkin
6*adc9b09aSAlexey Brodkin   BOARD OVERVIEW
7*adc9b09aSAlexey Brodkin
8*adc9b09aSAlexey Brodkin   The DesignWare ARC EM Software Development Platform is FPGA-bases platform
9*adc9b09aSAlexey Brodkin   for rapid software development on the ARC EM family of processors.
10*adc9b09aSAlexey Brodkin
11*adc9b09aSAlexey Brodkin   Since this board is based on FPGA it's possible to load and use different
12*adc9b09aSAlexey Brodkin   versions of ARC EM CPUs. U-Boot is built to be run on the simplest
13*adc9b09aSAlexey Brodkin   possible configuration which means the same one binary will work on more
14*adc9b09aSAlexey Brodkin   advanced configurations as well.
15*adc9b09aSAlexey Brodkin
16*adc9b09aSAlexey Brodkin   The board has the following features useful for U-Boot:
17*adc9b09aSAlexey Brodkin    * On-board 2-channel FTDI TTL-to-USB converter
18*adc9b09aSAlexey Brodkin      - The first channel is used for serial debug port (which makes it possible
19*adc9b09aSAlexey Brodkin        to use a serial connection on pretty much any host machine be it
20*adc9b09aSAlexey Brodkin        Windows, Linux or Mac).
21*adc9b09aSAlexey Brodkin        On Linux machine typucally FTDI serial port would be /dev/ttyUSB0.
22*adc9b09aSAlexey Brodkin        There's no HW flow-control and baud-rate is 115200.
23*adc9b09aSAlexey Brodkin
24*adc9b09aSAlexey Brodkin      - The second channel is used for built-in Digilent USB JTAG probe.
25*adc9b09aSAlexey Brodkin        That means no extra hardware is required to access ARC core from a
26*adc9b09aSAlexey Brodkin        debugger on development host. Both proprietary MetaWare debugger and
27*adc9b09aSAlexey Brodkin        open source OpenOCD + GDB client are supported.
28*adc9b09aSAlexey Brodkin
29*adc9b09aSAlexey Brodkin      - Also with help of this FTDI chip it is possible to reset entire
30*adc9b09aSAlexey Brodkin        board with help of a special `rff-ftdi-reset` utility, see:
31*adc9b09aSAlexey Brodkin        https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset
32*adc9b09aSAlexey Brodkin
33*adc9b09aSAlexey Brodkin    * Micro SD-card slot
34*adc9b09aSAlexey Brodkin      - U-Boot expects to see the very first partition on the card formatted as
35*adc9b09aSAlexey Brodkin        FAT file-system and uses it for keeping its environment in `uboot.env`
36*adc9b09aSAlexey Brodkin        file. Note uboot.env is not just a text file but it is auto-generated
37*adc9b09aSAlexey Brodkin        file created by U-Boot on invocation of `saveenv` command.
38*adc9b09aSAlexey Brodkin        It contains a checksum which makes this saved environment invalid in
39*adc9b09aSAlexey Brodkin        case of maual modification.
40*adc9b09aSAlexey Brodkin
41*adc9b09aSAlexey Brodkin      - There might be more useful files on that first FAT partition like
42*adc9b09aSAlexey Brodkin        user applications, data files etc.
43*adc9b09aSAlexey Brodkin
44*adc9b09aSAlexey Brodkin    * 256 KiB of "ROM"
45*adc9b09aSAlexey Brodkin      - This so-called "ROM" is a part of FPGA image and even though it
46*adc9b09aSAlexey Brodkin        might be unlocked for writes its initial content will be restored
47*adc9b09aSAlexey Brodkin        on the next power-on.
48*adc9b09aSAlexey Brodkin
49*adc9b09aSAlexey Brodkin
50*adc9b09aSAlexey Brodkin   BUILDING U-BOOT
51*adc9b09aSAlexey Brodkin
52*adc9b09aSAlexey Brodkin   1. Configure U-Boot:
53*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
54*adc9b09aSAlexey Brodkin      make emsdp_defconfig
55*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
56*adc9b09aSAlexey Brodkin
57*adc9b09aSAlexey Brodkin   2. To build Elf file (for example to be used with host debugger via JTAG
58*adc9b09aSAlexey Brodkin      connection to the target board):
59*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
60*adc9b09aSAlexey Brodkin      make mdbtrick
61*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
62*adc9b09aSAlexey Brodkin
63*adc9b09aSAlexey Brodkin      This will produce `u-boot` Elf file.
64*adc9b09aSAlexey Brodkin
65*adc9b09aSAlexey Brodkin   3. To build binary image to be put in "ROM":
66*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
67*adc9b09aSAlexey Brodkin      make u-boot.bin
68*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
69*adc9b09aSAlexey Brodkin
70*adc9b09aSAlexey Brodkin
71*adc9b09aSAlexey Brodkin   EXECUTING U-BOOT
72*adc9b09aSAlexey Brodkin
73*adc9b09aSAlexey Brodkin   1. The EMSDP board is supposed to auto-start U-Boot image stored in ROM on
74*adc9b09aSAlexey Brodkin      power-on. For that make sure VCCIO DIP-switches are all in "off" state.
75*adc9b09aSAlexey Brodkin
76*adc9b09aSAlexey Brodkin   2. Though it is possible to load U-Boot as a simple Elf file via JTAG right
77*adc9b09aSAlexey Brodkin      in "ROM" and start it from the debugger. One important note here we first
78*adc9b09aSAlexey Brodkin      need to enable writes into "ROM" by writing 1 to 0xf0001000.
79*adc9b09aSAlexey Brodkin
80*adc9b09aSAlexey Brodkin      2.1. In case of proprietary MetaWare debugger run:
81*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
82*adc9b09aSAlexey Brodkin      mdb -dll=opxdarc.so -OK -preloadexec="eval *(int*)0xf0001000=0" u-boot
83*adc9b09aSAlexey Brodkin      ------------------------->8----------------------
84