summaryrefslogtreecommitdiffstats
path: root/docs/README.booting.zynqmp.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/README.booting.zynqmp.md')
-rw-r--r--docs/README.booting.zynqmp.md224
1 files changed, 160 insertions, 64 deletions
diff --git a/docs/README.booting.zynqmp.md b/docs/README.booting.zynqmp.md
index c8f8aa21..44e6f2b7 100644
--- a/docs/README.booting.zynqmp.md
+++ b/docs/README.booting.zynqmp.md
@@ -5,10 +5,15 @@ NAND boot modes.
5 5
6* [Setting Up the Target](#setting-up-the-target) 6* [Setting Up the Target](#setting-up-the-target)
7* [Booting from JTAG](#booting-from-jtag) 7* [Booting from JTAG](#booting-from-jtag)
8 * [Loading boot components using XSCT](#loading-boot-components-using-xsct) 8 * [Sourcing the XSDB tools](#sourcing-the-xsdb-tools)
9 * [Loading Kernel, Root Filesystem and U-boot boot script](#loading-kernel-root-filesystem-and-u-boot-boot-script) 9 * [Deploying the images to target](#deploying-the-images-to-target)
10 * [Using XSCT](#using-xsct) 10 * [Using devtool boot-jtag script](#using-devtool-boot-jtag-script)
11 * [Using TFTP](#using-tftp) 11 * [Manually executing xsdb commands](#manually-executing-xsdb-commands)
12 * [Loading boot components using XSDB](#loading-boot-components-using-xsdb)
13 * [Loading Kernel, Root Filesystem and U-boot boot script](#loading-kernel-root-filesystem-and-u-boot-boot-script)
14 * [Using XSDB](#using-xsdb)
15 * [Using TFTP](#using-tftp)
16 * [Booting Linux](#booting-linux)
12* [Booting from SD](#booting-from-sd) 17* [Booting from SD](#booting-from-sd)
13* [Booting from QSPI](#booting-from-qspi) 18* [Booting from QSPI](#booting-from-qspi)
14 19
@@ -34,37 +39,61 @@ NAND boot modes.
34 39
35## Booting from JTAG 40## Booting from JTAG
36 41
37This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and 42This boot flow requires the use of the AMD Xilinx tools, specifically XSDB and
38the associated JTAG device drivers. This also requires access to the JTAG interface 43the 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 44on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG
40modules. 45modules.
41 46
421. Source the Vivado or Vitis tools `settings.sh` scripts. 47### Sourcing the XSDB tools
432. Power on the board, Open the XSCT console in the Vitis IDE by clicking the 48
44 XSCT button. Alternatively, you can also open the XSCT console by selecting 49Source the Vivado or Vitis tools `settings.sh` scripts.
45 Xilinx -> XSCT Console. 50
51### Deploying the images to target
52
53Deploying the images can be done in two methods.
54
55#### Using devtool boot-jtag script
56
57> **Note:** For Xen boot flow boot-jtag script doesn't include loading xen, kernel
58> and root filesystem, This step needs to be done manually as mentioned in XSDB
59> or TFTP method below.
60
611. Run devtool command to generate the boot-jtag.tcl script.
62```
63$ devtool boot-jtag --help
64$ devtool boot-jtag --image core-image-minimal --hw_server TCP:<hostname/ip-addr>:3121
46``` 65```
47$ xsct 662. Script will be generated under ${DEPLOY_DIR_IMAGE}/boot-jtag.tcl
673. Execute this script using xsdb tool as shown below.
48``` 68```
493. In the XSCT console, connect to the target over JTAG using the connect command. 69$ xsdb <absolute-path-to-deploy-dir-image>/boot-jtag.tcl
70```
71
72#### Manually executing xsdb commands
73
741. Power on the board, Launch the XSDB shell from command line as shown below.
75```
76$ xsdb
77```
782. In the XSDB 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 79 Optionally user can use `-url` to specify the local/remote hw_server. The
51 connect command returns the channel ID of the connection. 80 connect command returns the channel ID of the connection.
52``` 81```
53xsct% connect 82xsdb% connect
54``` 83```
554. The targets command lists the available targets and allows you to select a 843. 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 85 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. 86 the JTAG chain, so the IDs can change from session to session.
58``` 87```
59xsct% targets 88xsdb% targets
60``` 89```
61 90
62> **Note:** For non-interactive usage such as scripting, you can use the `-filter` 91> **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. 92 option to select a target instead of selecting the target using its ID.
64 93
65### Loading boot components using XSCT 94##### Loading boot components using XSDB
66 95
671. Download the boot images for the target using XSCT with the `fpga` and `dow` 961. Download the boot images for the target using XSDB with the `fpga` and `dow`
68 command. ZyqnMP boot images will be located in the `${DEPLOY_DIR_IMAGE}` 97 command. ZyqnMP boot images will be located in the `${DEPLOY_DIR_IMAGE}`
69 directory. 98 directory.
70 99
@@ -73,43 +102,46 @@ xsct% targets
73 102
742. Program the bitstream or skip this step if you are loading from u-boot or linux. 1032. Program the bitstream or skip this step if you are loading from u-boot or linux.
75``` 104```
76xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit 105xsdb% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit
77``` 106```
783. By default, JTAG security gates are enabled. Disable the security gates for 1073. 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). 108 DAP, PL TAP, and PMU (this makes the PMU MB target visible to the debugger).
80``` 109```
81xsct% targets -set -nocase -filter {name =~ "*PSU*"} 110xsdb% targets -set -nocase -filter {name =~ "*PSU*"}
82xsct% mask_write 0xFFCA0038 0x1C0 0x1C0 111xsdb% mask_write 0xFFCA0038 0x1C0 0x1C0
83``` 112```
843. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU 1133. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU
85 firmware. 114 firmware.
86``` 115```
87xsct% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"} 116xsdb% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}
88xsct% catch {stop} 117xsdb% catch {stop}
89xsct% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf 118xsdb% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf
90xsct% con 119xsdb% con
91``` 120```
925. Reset APU Cortex-A53 Core 0 to load and execute FSBL, This step is important, 1215. 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 122 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 123 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 124 debugging on these cores. You can use the `rst` command in XSDB to clear the
96 resets. 125 resets.
97``` 126```
98xsct% targets -set -nocase -filter {name =~ "*A53*#0"} 127xsdb% targets -set -nocase -filter {name =~ "*A53*#0"}
99xsct% rst -processor -clear-registers 128xsdb% rst -processor -clear-registers
100``` 129```
1016. Download and run FSBL from APU Cortex-A53 Core 0 1306. Download and run FSBL from APU Cortex-A53 Core 0
102``` 131```
103xsct% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf 132xsdb% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf
104xsct% con 133xsdb% con
105``` 134```
1067. Now download TF-A, U-boot.elf and Device tree to APU and execute. 1357. Now download TF-A, U-boot.elf and Device tree blob to APU and execute.
136
137> **Note:** For Xen boot system.dtb load address will vary, see below table.
138
107``` 139```
108xsct% stop 140xsdb% stop
109xsct% dow ${DEPLOY_DIR_IMAGE}/bl31.elf 141xsdb% dow ${DEPLOY_DIR_IMAGE}/bl31.elf
110xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf 142xsdb% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf
111xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 143xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
112xsct% con 144xsdb% con
113``` 145```
114 146
1158. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. 1478. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
@@ -119,20 +151,37 @@ Hit any key to stop autoboot: 0
119U-Boot> 151U-Boot>
120``` 152```
121 153
122### Loading Kernel, Root Filesystem and U-boot boot script 154##### Loading Kernel, Root Filesystem and U-boot boot script
123 155
124Load the images into the target DDR/PL DRR load address i.e., 156Load the images into the target DDR/PL DRR load address i.e.,
125`DDR base address + <image_offset>`. 157`DDR base address + <image_offset>`.
126 158
127Below example uses base DDR address as 0x0 which matches in vivado address editor. 159Below example uses base DDR address as 0x0 which matches in vivado address editor.
128 160
1611. **Linux**
162
129| Image Type | Base DDR Address | Image Offset | Load Address in DDR | 163| Image Type | Base DDR Address | Image Offset | Load Address in DDR |
130|--------------------|------------------|--------------|---------------------| 164|--------------------|------------------|--------------|---------------------|
131| Kernel | 0x0 | 0x200000 | 0x200000 | 165| Linux Kernel | 0x0 | 0x200000 | 0x200000 |
132| Device Tree | 0x0 | 0x1000 | 0x1000 | 166| Device Tree Blob | 0x0 | 0x100000 | 0x100000 |
133| Rootfs | 0x0 | 0x04000000 | 0x4000000 | 167| Rootfs | 0x0 | 0x04000000 | 0x4000000 |
134| U-boot boot script | 0x0 | 0x20000000 | 0x20000000 | 168| U-boot boot script | 0x0 | 0x20000000 | 0x20000000 |
135 169
1702. **Xen**
171
172> **Note:** Xen, Rootfs and Device Tree image offset is calculated as shown below.
173> * `Xen Rootfs = Base DDR Address + Linux Kernel Image Offset(0xE00000) + Size of Linux Kernel Image`
174> * `Xen Kernel = Base DDR Address + Xen Rootfs Image Offset (Ex: 0x2600000) + Size of Xen Rootfs`
175> * `Device Tree Blob = Base DDR Address + Xen Kernel Image Offset (Ex: 0xBA00000) + Size of Device Tree Blob`
176
177| Image Type | Base DDR Address | Image Offset | Load Address in DDR |
178|--------------------|------------------|--------------|---------------------|
179| Linux Kernel | 0x0 | 0xE00000 | 0xE00000 |
180| Xen Rootfs | 0x0 | 0x2600000 | 0x2600000 |
181| Xen Kernel | 0x0 | 0xBA00000 | 0xBA00000 |
182| Device Tree Blob | 0x0 | 0xC000000 | 0xC000000 |
183| U-boot boot script | 0x0 | 0x20000000 | 0x20000000 |
184
136> **Note:** 185> **Note:**
137> 1. `<target-image>` refers to core-image-minimal or petalinux-image-minimal 186> 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` 187> 2. For pxeboot boot create a symlink for `<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot`
@@ -145,54 +194,101 @@ using U-Boot.
145> 4. If common ${DEPLOY_DIR_IMAGE}/system.dtb is used by u-boot and kernel, this 194> 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. 195> is already part of boot.bin we can skip loading dtb, else load kernel dtb.
147 196
148#### Using XSCT 197###### Using XSDB
149 198
1501. Suspend the execution of active target using `stop` command in XSCT. 1991. Suspend the execution of active target using `stop` command in XSDB.
151``` 200```
152xsct% stop 201xsdb% stop
153``` 202```
1542. Using the `dow` command to load the images into the target DDR/PL DDR load 2032. Using the `dow` command to load the images into the target DDR/PL DDR load
155 address. 204 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 205
163#### Using TFTP 206 * Linux XSDB
207 ```
208 xsdb% targets -set -nocase -filter {name =~ "*A53*#0"}
209 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000
210 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
211 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000
212 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
213 ```
164 214
1651. Configure the `ipaddr` and `serverip` of the U-Boot environment. 215 * Xen XSDB
166``` 216 ```
167Versal> set serverip <server ip> 217 xsdb% targets -set -nocase -filter {name =~ "*A53*#0"}
168Versal> set ipaddr <board ip> 218 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/Image 0xE00000
219 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz 0x2600000
220 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/xen 0xBA00000
221 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0xC000000
222 xsdb% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
223 ```
224
225###### Using TFTP
226
2271. Setup TFTP directory on host machine and copy the images to your TFTP directory
228 so that you can load them from U-Boot.
2292. Configure the `ipaddr` and `serverip` of the U-Boot environment.
169``` 230```
1702. Load the images to DDR address. Make sure images are copied to tftp directory. 231ZynqMP> set serverip <host-server-ip-address>
232ZynqMP> set ipaddr <board-ip-address>
171``` 233```
172U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image 2343. Load the images to DDR address.
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 235
177``` 236 * Linux TFTP
178### Booting Linux 237 ```
238 U-Boot> tftpboot 0x200000 Image
239 U-Boot> tftpboot 0x100000 system.dtb
240 U-Boot> tftpboot 0x4000000 core-image-minimal-${MACHINE}.cpio.gz.u-boot
241 U-Boot> tftpboot 0x20000000 boot.scr
242 ```
243
244 * Xen TFTP
245 ```
246 U-Boot> tftpboot 0xE00000 Image
247 U-Boot> setenv kernel_size 0x$filesize
248 U-Boot> tftpboot 0x2600000 core-image-minimal-${MACHINE}.cpio.gz
249 U-Boot> setenv ramdisk_size 0x$filesize
250 U-Boot> tftpboot 0xBA00000 xen
251 U-Boot> tftpboot 0xC000000 system.dtb
252 U-Boot> tftpboot 0x20000000 boot.scr
253 ```
254
255##### Booting Linux
179 256
180Once the images are loaded continue the execution. 257Once the images are loaded continue the execution.
181 258
1821. After loading images resume the execution of active target using the `con` 2591. 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. 260command in XSDB shell, Skip step 1 for if you have used TFTP to load images.
184``` 261```
185xsct% con 262xsdb% con
186``` 263```
1872. Terminate xsct shell. 2642. Terminate xsdb shell.
188``` 265```
189xsct% exit 266xsdb% exit
190``` 267```
1913. In the target Serial Terminal, from U-Boot prompt run `boot` command. 2683. In the target Serial Terminal, from U-Boot prompt run `boot` command.
269
270* Linux boot
192``` 271```
193U-Boot> boot 272U-Boot> boot
194``` 273```
195 274
275* XEN JTAG boot
276
277 * XSDB
278 > **Note:** You need to calculate the Kernel(kernel_size) and ramdisk(ramdisk_size)
279 > image size manually from `${DEPLOY_DIR_IMAGE}` directory. For example if your
280 > kernel size is 24269312 bytes you need to convert to hex 0x1725200 and use it.
281 ```
282 U-Boot> setenv kernel_size <filesize>
283 U-Boot> setenv ramdisk_size <filesize>
284 U-Boot> boot
285 ```
286
287 * TFTP
288 ```
289 U-Boot> boot
290 ```
291
196## Booting from SD 292## Booting from SD
197 293
1981. Load the SD card into the ZCU102 board in the J100 SD slot. 2941. Load the SD card into the ZCU102 board in the J100 SD slot.
@@ -204,9 +300,9 @@ U-Boot> boot
204 300
2051. To boot ZCU012 board in QSPI boot mode, Power on the ZCU102 board and boot 3011. 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 302 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` 303 boot.bin copied to DDR location using XSDB `dow` or `tftpboot` or `fatload`
208 command. 304 command.
2092. Follow Flash boot instructions [README](README.booting.flash.md) for more details. 3052. 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 3063. 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 307 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 308 setting the SW6. Refer [Setting Up the Target](#setting-up-the-target).