summaryrefslogtreecommitdiffstats
path: root/docs/README.booting.microblaze.md
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-02-26 23:12:20 -0700
committerMark Hatle <mark.hatle@amd.com>2023-04-10 09:03:22 -0700
commit757705bb7d825f9b05ccc25e5dcef4de35316b17 (patch)
treee1cac167d1a8bf968cfd21e597ed8e3f2123f4fc /docs/README.booting.microblaze.md
parenta7e29ded2e51ee48dcafd07e365e1b93c63a3a74 (diff)
downloadmeta-xilinx-757705bb7d825f9b05ccc25e5dcef4de35316b17.tar.gz
docs: Add README for booting instructions for all devices
Add README for booting instructions for all devices with supported boot mediums. Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'docs/README.booting.microblaze.md')
-rw-r--r--docs/README.booting.microblaze.md170
1 files changed, 170 insertions, 0 deletions
diff --git a/docs/README.booting.microblaze.md b/docs/README.booting.microblaze.md
new file mode 100644
index 00000000..1ffcc3c8
--- /dev/null
+++ b/docs/README.booting.microblaze.md
@@ -0,0 +1,170 @@
1# Booting OS Images on MicroBlaze target boards
2
3Booting OS images on MicroBlaze target boards can be done using JTAG and QSPI boot modes.
4
5* [Setting Up the Target](#setting-up-the-target)
6* [Booting from JTAG](#booting-from-jtag)
7 * [Loading Bitstream using XSCT](#loading-bitstream-using-xsct)
8 * [Loading U-boot using XSCT](#loading-u-boot-using-xsct)
9 * [Loading Kernel, Device tree, Root Filesystem and U-boot boot script](#loading-kernel-device-tree-root-filesystem-and-u-boot-boot-script)
10 * [Using XSCT](#using-xsct)
11 * [Using TFTP](#using-tftp)
12
13## Setting Up the Target
14
15> **Note:** For microblaze-generic machine configuration file KCU105 evaluation
16> board is used as reference.
17
181. Connect a USB cable between the USB-JTAG, USB-UART connector on the target
19 and the USB port on the host machine.
202. Connect 12V power to the KCU105 6-Pin power supply to J15 and turn on the board
21 power with the SW1 switch.
223. Default UART terminal (serial port) settings is Speed `115200`, Data `8 bit`,
23 Parity `None`, Stop bits ` 1 bit` and Flow control `None`.
244. Set the board to JTAG and other boot modes by setting the boot mode switch by
25 referring to board user guide. For KCU105 board below is the configuration
26 boot mode settings (SW15).
27
28> **Note:** Switch OFF = 1 = High; ON = 0 = Low
29
30| Boot Mode | Mode Pins M[2:0] |
31|------------|------------------|
32| JTAG | 101 |
33| QSPI | 001 |
34
35## Booting from JTAG
36
37This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and
38the associated JTAG device drivers. This also requires access to the JTAG interface
39on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG
40modules.
41
421. Source the Vivado or Vitis tools `settings.sh` scripts.
432. Power on the board, Open the XSCT console in the Vitis IDE by clicking the
44 XSCT button. Alternatively, you can also open the XSCT console by selecting
45 Xilinx -> XSCT Console.
46```
47$ xsct
48```
493. In the XSCT console, connect to the target over JTAG using the connect command.
50 Optionally user can use `-url` to specify the local/remote hw_server. The
51 connect command returns the channel ID of the connection.
52```
53xsct% connect
54```
554. The targets command lists the available targets and allows you to select a
56 target using its ID. The targets are assigned IDs as they are discovered on
57 the JTAG chain, so the IDs can change from session to session.
58```
59xsct% targets
60```
61
62> **Note:** For non-interactive usage such as scripting, you can use the `-filter`
63 option to select a target instead of selecting the target using its ID.
64
65### Loading Bitstream using XSCT
66
67* Download the bitstream for the target using XSCT with the `fpga` command. Microblaze
68bitstream will be located in the `${DEPLOY_DIR_IMAGE}` directory. Optionally user
69can use `fpga -no-revision-check` to skip FPGA silicon revision.
70
71```
72xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/system-${MACHINE}.bit
73xsct% after 2000
74xsct% targets -set -nocase -filter {name =~ "microblaze*#0"}
75xsct% catch {stop}
76xsct% after 1000
77```
78### Loading U-boot using XSCT
79
801. Download `u-boot.elf` to the target CPU using XSCT. Microblaze u-boot.elf will be
81located in the `${DEPLOY_DIR_IMAGE}` directory. Before u-boot.elf is loaded suspend
82the execution of active target using `stop` command.
83```
84xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf
85```
862. After loading u-boot.elf resume the execution of active target using the `con`
87command in XSCT shell.
88```
89xsct% con
90```
913. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
92```
93...
94Hit any key to stop autoboot: 0
95U-Boot>
96```
97
98### Loading Kernel, Device tree, Root Filesystem and U-boot boot script
99
100Load the images into the target DDR/MIG load address i.e.,
101`DDR base address + <image_offset>`. MicroBlaze U-boot boot script(boot.scr)
102load address is calculated as `DDR base address + DDR Size - 0xe00000`
103
104Below example uses base DDR address as 0x80000000 and DDR size as 0x80000000
105which matches in vivado address editor.
106
107| Image Type | Base DDR Address | Image Offset | Load Address in DDR |
108|--------------------|------------------|--------------|---------------------|
109| Kernel | 0x80000000 | 0x0 | 0x80000000 |
110| Device Tree | 0x80000000 | 0x1e00000 | 0x81e00000 |
111| Rootfs | 0x80000000 | 0x2e00000 | 0x82e00000 |
112| U-boot boot script | 0x80000000 | 0xe00000 | 0xff200000 |
113
114> **Note:**
115> 1. `<target-image>` refers to core-image-minimal or petalinux-image-minimal
116> 2. For pxeboot boot create a symlink for `<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot`
117> as shown `$ ln -sf ${DEPLOY_DIR_IMAGE}/<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot ${DEPLOY_DIR_IMAGE}/rootfs.cpio.gz.u-boot`
118> to ensure the INITRD name in pxeboot.cfg matches with image name.
119> 3. Whilst it is possible to load the images via JTAG this connection is slow and
120this process can take a long time to execute (more than 10 minutes). If your
121system has ethernet it is recommended that you use TFTP to load these images
122using U-Boot.
123
124#### Using XSCT
125
1261. Suspend the execution of active target using `stop` command in XSCT.
127```
128xsct% stop
129```
1302. Using the `dow` command to load the images into the target DDR/MIG
131load address.
132```
133xsct% dow -data ${DEPLOY_DIR_IMAGE}/linux.bin.ub 0x80000000
134xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x81e00000
135xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x82e00000
136xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0xff200000
137```
138
139#### Using TFTP
140
1411. Configure the `ipaddr` and `serverip` of the U-Boot environment.
142```
143U-Boot> set serverip <server ip>
144U-Boot> set ipaddr <board ip>
145```
1462. Load the images to DDR address. Make sure images are copied to tftp directory.
147```
148U-Boot> tftpboot 0x80000000 ${TFTPDIR}/linux.bin.ub
149U-Boot> tftpboot 0x81e00000 ${TFTPDIR}/system.dtb
150U-Boot> tftpboot 0x82e00000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot
151U-Boot> tftpboot 0xff200000 ${TFTPDIR}/boot.scr
152```
153
154### Booting Linux
155
156Once the images are loaded continue the execution.
157
1581. After loading images resume the execution of active target using the `con`
159command in XSCT shell, Skip step 1 for if you have used TFTP to load images.
160```
161xsct% con
162```
1632. Terminate xsct shell.
164```
165xsct% exit
166```
1673. In the target Serial Terminal, from U-Boot prompt run `boot` command.
168```
169U-Boot> boot
170```