diff options
Diffstat (limited to 'docs/README.booting.zynqmp.md')
-rw-r--r-- | docs/README.booting.zynqmp.md | 224 |
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 | ||
37 | This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and | 42 | This boot flow requires the use of the AMD Xilinx tools, specifically XSDB and |
38 | the associated JTAG device drivers. This also requires access to the JTAG interface | 43 | the associated JTAG device drivers. This also requires access to the JTAG interface |
39 | on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG | 44 | on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG |
40 | modules. | 45 | modules. |
41 | 46 | ||
42 | 1. Source the Vivado or Vitis tools `settings.sh` scripts. | 47 | ### Sourcing the XSDB tools |
43 | 2. 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 | 49 | Source the Vivado or Vitis tools `settings.sh` scripts. |
45 | Xilinx -> XSCT Console. | 50 | |
51 | ### Deploying the images to target | ||
52 | |||
53 | Deploying 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 | |||
61 | 1. 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 | 66 | 2. Script will be generated under ${DEPLOY_DIR_IMAGE}/boot-jtag.tcl |
67 | 3. Execute this script using xsdb tool as shown below. | ||
48 | ``` | 68 | ``` |
49 | 3. 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 | |||
74 | 1. Power on the board, Launch the XSDB shell from command line as shown below. | ||
75 | ``` | ||
76 | $ xsdb | ||
77 | ``` | ||
78 | 2. 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 | ``` |
53 | xsct% connect | 82 | xsdb% connect |
54 | ``` | 83 | ``` |
55 | 4. The targets command lists the available targets and allows you to select a | 84 | 3. 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 | ``` |
59 | xsct% targets | 88 | xsdb% 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 | ||
67 | 1. Download the boot images for the target using XSCT with the `fpga` and `dow` | 96 | 1. 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 | ||
74 | 2. Program the bitstream or skip this step if you are loading from u-boot or linux. | 103 | 2. Program the bitstream or skip this step if you are loading from u-boot or linux. |
75 | ``` | 104 | ``` |
76 | xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit | 105 | xsdb% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit |
77 | ``` | 106 | ``` |
78 | 3. By default, JTAG security gates are enabled. Disable the security gates for | 107 | 3. 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 | ``` |
81 | xsct% targets -set -nocase -filter {name =~ "*PSU*"} | 110 | xsdb% targets -set -nocase -filter {name =~ "*PSU*"} |
82 | xsct% mask_write 0xFFCA0038 0x1C0 0x1C0 | 111 | xsdb% mask_write 0xFFCA0038 0x1C0 0x1C0 |
83 | ``` | 112 | ``` |
84 | 3. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU | 113 | 3. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU |
85 | firmware. | 114 | firmware. |
86 | ``` | 115 | ``` |
87 | xsct% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"} | 116 | xsdb% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"} |
88 | xsct% catch {stop} | 117 | xsdb% catch {stop} |
89 | xsct% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf | 118 | xsdb% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf |
90 | xsct% con | 119 | xsdb% con |
91 | ``` | 120 | ``` |
92 | 5. Reset APU Cortex-A53 Core 0 to load and execute FSBL, This step is important, | 121 | 5. 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 | ``` |
98 | xsct% targets -set -nocase -filter {name =~ "*A53*#0"} | 127 | xsdb% targets -set -nocase -filter {name =~ "*A53*#0"} |
99 | xsct% rst -processor -clear-registers | 128 | xsdb% rst -processor -clear-registers |
100 | ``` | 129 | ``` |
101 | 6. Download and run FSBL from APU Cortex-A53 Core 0 | 130 | 6. Download and run FSBL from APU Cortex-A53 Core 0 |
102 | ``` | 131 | ``` |
103 | xsct% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf | 132 | xsdb% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf |
104 | xsct% con | 133 | xsdb% con |
105 | ``` | 134 | ``` |
106 | 7. Now download TF-A, U-boot.elf and Device tree to APU and execute. | 135 | 7. 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 | ``` |
108 | xsct% stop | 140 | xsdb% stop |
109 | xsct% dow ${DEPLOY_DIR_IMAGE}/bl31.elf | 141 | xsdb% dow ${DEPLOY_DIR_IMAGE}/bl31.elf |
110 | xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf | 142 | xsdb% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf |
111 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 | 143 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 |
112 | xsct% con | 144 | xsdb% con |
113 | ``` | 145 | ``` |
114 | 146 | ||
115 | 8. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. | 147 | 8. 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 | |||
119 | U-Boot> | 151 | U-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 | ||
124 | Load the images into the target DDR/PL DRR load address i.e., | 156 | Load 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 | ||
127 | Below example uses base DDR address as 0x0 which matches in vivado address editor. | 159 | Below example uses base DDR address as 0x0 which matches in vivado address editor. |
128 | 160 | ||
161 | 1. **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 | ||
170 | 2. **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 | ||
150 | 1. Suspend the execution of active target using `stop` command in XSCT. | 199 | 1. Suspend the execution of active target using `stop` command in XSDB. |
151 | ``` | 200 | ``` |
152 | xsct% stop | 201 | xsdb% stop |
153 | ``` | 202 | ``` |
154 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load | 203 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load |
155 | address. | 204 | address. |
156 | ``` | ||
157 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000 | ||
158 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 | ||
159 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000 | ||
160 | xsct% 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 | ||
165 | 1. Configure the `ipaddr` and `serverip` of the U-Boot environment. | 215 | * Xen XSDB |
166 | ``` | 216 | ``` |
167 | Versal> set serverip <server ip> | 217 | xsdb% targets -set -nocase -filter {name =~ "*A53*#0"} |
168 | Versal> 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 | |||
227 | 1. Setup TFTP directory on host machine and copy the images to your TFTP directory | ||
228 | so that you can load them from U-Boot. | ||
229 | 2. Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
169 | ``` | 230 | ``` |
170 | 2. Load the images to DDR address. Make sure images are copied to tftp directory. | 231 | ZynqMP> set serverip <host-server-ip-address> |
232 | ZynqMP> set ipaddr <board-ip-address> | ||
171 | ``` | 233 | ``` |
172 | U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image | 234 | 3. Load the images to DDR address. |
173 | U-Boot> tftpboot 0x100000 ${TFTPDIR}/system.dtb | ||
174 | U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot | ||
175 | U-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 | ||
180 | Once the images are loaded continue the execution. | 257 | Once the images are loaded continue the execution. |
181 | 258 | ||
182 | 1. After loading images resume the execution of active target using the `con` | 259 | 1. After loading images resume the execution of active target using the `con` |
183 | command in XSCT shell, Skip step 1 for if you have used TFTP to load images. | 260 | command in XSDB shell, Skip step 1 for if you have used TFTP to load images. |
184 | ``` | 261 | ``` |
185 | xsct% con | 262 | xsdb% con |
186 | ``` | 263 | ``` |
187 | 2. Terminate xsct shell. | 264 | 2. Terminate xsdb shell. |
188 | ``` | 265 | ``` |
189 | xsct% exit | 266 | xsdb% exit |
190 | ``` | 267 | ``` |
191 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. | 268 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. |
269 | |||
270 | * Linux boot | ||
192 | ``` | 271 | ``` |
193 | U-Boot> boot | 272 | U-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 | ||
198 | 1. Load the SD card into the ZCU102 board in the J100 SD slot. | 294 | 1. Load the SD card into the ZCU102 board in the J100 SD slot. |
@@ -204,9 +300,9 @@ U-Boot> boot | |||
204 | 300 | ||
205 | 1. To boot ZCU012 board in QSPI boot mode, Power on the ZCU102 board and boot | 301 | 1. 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. |
209 | 2. Follow Flash boot instructions [README](README.booting.flash.md) for more details. | 305 | 2. Follow Flash boot instructions [README](README.booting.flash.md) for more details. |
210 | 3. After flashing the images, turn off the power switch on the board, and change | 306 | 3. 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). |