summaryrefslogtreecommitdiffstats
path: root/docs/README.booting.zynqmp.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-02-28 08:42:28 -0600
commitfa7d089a2020ad56c50394d2b35018ff97f52589 (patch)
tree1f2b2c4fa4b9b4d5e93a16275aedfe3bc18da1bd /docs/README.booting.zynqmp.md
parent9e1cd5cbe90929bbbd9d72106fc7d5bab17111b5 (diff)
downloadmeta-xilinx-fa7d089a2020ad56c50394d2b35018ff97f52589.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.zynqmp.md')
-rw-r--r--docs/README.booting.zynqmp.md212
1 files changed, 212 insertions, 0 deletions
diff --git a/docs/README.booting.zynqmp.md b/docs/README.booting.zynqmp.md
new file mode 100644
index 00000000..c8f8aa21
--- /dev/null
+++ b/docs/README.booting.zynqmp.md
@@ -0,0 +1,212 @@
1# Booting OS Images on ZynqMP target boards
2
3Booting OS images on ZynqMP boards can be done using JTAG, SD, eMMC, QSPI and
4NAND boot modes.
5
6* [Setting Up the Target](#setting-up-the-target)
7* [Booting from JTAG](#booting-from-jtag)
8 * [Loading boot components using XSCT](#loading-boot-components-using-xsct)
9 * [Loading Kernel, Root Filesystem and U-boot boot script](#loading-kernel-root-filesystem-and-u-boot-boot-script)
10 * [Using XSCT](#using-xsct)
11 * [Using TFTP](#using-tftp)
12* [Booting from SD](#booting-from-sd)
13* [Booting from QSPI](#booting-from-qspi)
14
15## Setting Up the Target
161. Connect a USB cable between the CP2180 USB-to-Quad-UART bridge USB Micro-B on
17 the target and the USB port on the host machine.
182. Connect a micro USB cable from the ZCU102 board USB UART port (J83) to the USB
19 port on the host machine.
203. Default UART terminal(serial port) settings is Speed `115200`, Data `8 bit`,
21 Parity `None`, Stop bits ` 1 bit` and Flow control `None`.
224. Set the board to JTAG and other boot mode by setting the boot mode switch by
23 referring to board user guide. For zynqmp-generic machine configuration
24 file zcu102 evaluation board is used as reference and below is the
25 configuration boot mode settings (SW6).
26
27> **Note:** Switch OFF = 1 = High; ON = 0 = Low
28
29| Boot Mode | Mode Pins [3:0] | Mode SW6 [3:0] | Comments |
30|-----------|-----------------|-------------------|---------------------------|
31| JTAG | 0000 | ON, ON, ON, ON | PS JTAG |
32| QSPI | 0010 | ON, ON, OFF, ON | QSPI 32-bit addressing |
33| SD | 1110 | OFF, OFF, OFF, ON | SD 3.0 with level shifter |
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 boot components using XSCT
66
671. Download the boot images for the target using XSCT with the `fpga` and `dow`
68 command. ZyqnMP boot images will be located in the `${DEPLOY_DIR_IMAGE}`
69 directory.
70
71> **Note:** In yocto by default, ${DEPLOY_DIR_IMAGE}/system.dtb is used for both
72> u-boot and kernel.
73
742. Program the bitstream or skip this step if you are loading from u-boot or linux.
75```
76xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit
77```
783. By default, JTAG security gates are enabled. Disable the security gates for
79 DAP, PL TAP, and PMU (this makes the PMU MB target visible to the debugger).
80```
81xsct% targets -set -nocase -filter {name =~ "*PSU*"}
82xsct% mask_write 0xFFCA0038 0x1C0 0x1C0
83```
843. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU
85 firmware.
86```
87xsct% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}
88xsct% catch {stop}
89xsct% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf
90xsct% con
91```
925. Reset APU Cortex-A53 Core 0 to load and execute FSBL, This step is important,
93 because when the ZynqMP boots up in JTAG boot mode, all the APU and RPU cores
94 are held in reset. You must clear the resets on each core before performing
95 debugging on these cores. You can use the `rst` command in XSCT to clear the
96 resets.
97```
98xsct% targets -set -nocase -filter {name =~ "*A53*#0"}
99xsct% rst -processor -clear-registers
100```
1016. Download and run FSBL from APU Cortex-A53 Core 0
102```
103xsct% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf
104xsct% con
105```
1067. Now download TF-A, U-boot.elf and Device tree to APU and execute.
107```
108xsct% stop
109xsct% dow ${DEPLOY_DIR_IMAGE}/bl31.elf
110xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf
111xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
112xsct% con
113```
114
1158. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
116```
117...
118Hit any key to stop autoboot: 0
119U-Boot>
120```
121
122### Loading Kernel, Root Filesystem and U-boot boot script
123
124Load the images into the target DDR/PL DRR load address i.e.,
125`DDR base address + <image_offset>`.
126
127Below example uses base DDR address as 0x0 which matches in vivado address editor.
128
129| Image Type | Base DDR Address | Image Offset | Load Address in DDR |
130|--------------------|------------------|--------------|---------------------|
131| Kernel | 0x0 | 0x200000 | 0x200000 |
132| Device Tree | 0x0 | 0x1000 | 0x1000 |
133| Rootfs | 0x0 | 0x04000000 | 0x4000000 |
134| U-boot boot script | 0x0 | 0x20000000 | 0x20000000 |
135
136> **Note:**
137> 1. `<target-image>` refers to core-image-minimal or petalinux-image-minimal
138> 2. For pxeboot boot create a symlink for `<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot`
139> as shown `$ ln -sf ${DEPLOY_DIR_IMAGE}/<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot ${DEPLOY_DIR_IMAGE}/rootfs.cpio.gz.u-boot`
140> to ensure the INITRD name in pxeboot.cfg matches with image name.
141> 3. Whilst it is possible to load the images via JTAG this connection is slow and
142this process can take a long time to execute (more than 10 minutes). If your
143system has ethernet it is recommended that you use TFTP to load these images
144using U-Boot.
145> 4. If common ${DEPLOY_DIR_IMAGE}/system.dtb is used by u-boot and kernel, this
146> is already part of boot.bin we can skip loading dtb, else load kernel dtb.
147
148#### Using XSCT
149
1501. Suspend the execution of active target using `stop` command in XSCT.
151```
152xsct% stop
153```
1542. Using the `dow` command to load the images into the target DDR/PL DDR load
155 address.
156```
157xsct% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000
158xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
159xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000
160xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
161```
162
163#### Using TFTP
164
1651. Configure the `ipaddr` and `serverip` of the U-Boot environment.
166```
167Versal> set serverip <server ip>
168Versal> set ipaddr <board ip>
169```
1702. Load the images to DDR address. Make sure images are copied to tftp directory.
171```
172U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image
173U-Boot> tftpboot 0x100000 ${TFTPDIR}/system.dtb
174U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot
175U-Boot> tftpboot 0x20000000 ${TFTPDIR}/boot.scr
176
177```
178### Booting Linux
179
180Once the images are loaded continue the execution.
181
1821. After loading images resume the execution of active target using the `con`
183command in XSCT shell, Skip step 1 for if you have used TFTP to load images.
184```
185xsct% con
186```
1872. Terminate xsct shell.
188```
189xsct% exit
190```
1913. In the target Serial Terminal, from U-Boot prompt run `boot` command.
192```
193U-Boot> boot
194```
195
196## Booting from SD
197
1981. Load the SD card into the ZCU102 board in the J100 SD slot.
1992. Configure the ZCU102 board to boot in SD-Boot mode (1-ON, 2-OFF, 3-OFF, 4-OFF)
200 by setting the SW6. Refer [Setting Up the Target](#setting-up-the-target).
2013. Follow SD boot instructions [README](README.booting.storage.md) for more details.
202
203## Booting from QSPI
204
2051. To boot ZCU012 board in QSPI boot mode, Power on the ZCU102 board and boot
206 using JTAG or SD boot mode, to ensure that U-Boot is running and also have
207 boot.bin copied to DDR location using XSCT `dow` or `tftpboot` or `fatload`
208 command.
2092. Follow Flash boot instructions [README](README.booting.flash.md) for more details.
2103. After flashing the images, turn off the power switch on the board, and change
211 the SW6 boot mode pin settings to QSPI boot mode (1-ON, 2-ON, 3-OFF, 4-ON) by
212 setting the SW6. Refer [Setting Up the Target](#setting-up-the-target). \ No newline at end of file