diff options
Diffstat (limited to 'docs/README.booting.versal.md')
-rw-r--r-- | docs/README.booting.versal.md | 195 |
1 files changed, 144 insertions, 51 deletions
diff --git a/docs/README.booting.versal.md b/docs/README.booting.versal.md index afdeba2b..25738784 100644 --- a/docs/README.booting.versal.md +++ b/docs/README.booting.versal.md | |||
@@ -5,10 +5,15 @@ 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.bin using XSCT](#loading-bootbin-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.bin using XSDB](#loading-bootbin-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 | ||
@@ -37,37 +42,61 @@ modes. | |||
37 | 42 | ||
38 | ## Booting from JTAG | 43 | ## Booting from JTAG |
39 | 44 | ||
40 | This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and | 45 | This boot flow requires the use of the AMD Xilinx tools, specifically XSDB and |
41 | the associated JTAG device drivers. This also requires access to the JTAG interface | 46 | the associated JTAG device drivers. This also requires access to the JTAG interface |
42 | on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG | 47 | on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG |
43 | modules. | 48 | modules. |
44 | 49 | ||
45 | 1. Source the Vivado or Vitis tools `settings.sh` scripts. | 50 | ### Sourcing the XSDB tools |
46 | 2. Power on the board, Open the XSCT console in the Vitis IDE by clicking the | 51 | |
47 | XSCT button. Alternatively, you can also open the XSCT console by selecting | 52 | Source the Vivado or Vitis tools `settings.sh` scripts. |
48 | Xilinx -> XSCT Console. | 53 | |
54 | ### Deploying the images to target | ||
55 | |||
56 | Deploying the images can be done in two methods. | ||
57 | |||
58 | #### Using devtool boot-jtag script | ||
59 | |||
60 | > **Note:** For Xen boot flow boot-jtag script doesn't include loading xen, kernel | ||
61 | > and root filesystem, This step needs to be done manually as mentioned in XSDB | ||
62 | > or TFTP method below. | ||
63 | |||
64 | 1. Run devtool command to generate the boot-jtag.tcl script. | ||
65 | ``` | ||
66 | $ devtool boot-jtag --help | ||
67 | $ devtool boot-jtag --image core-image-minimal --hw_server TCP:<hostname/ip-addr>:3121 | ||
68 | ``` | ||
69 | 2. Script will be generated under ${DEPLOY_DIR_IMAGE}/boot-jtag.tcl | ||
70 | 3. Execute this script using xsdb tool as shown below. | ||
49 | ``` | 71 | ``` |
50 | $ xsct | 72 | $ xsdb <absolute-path-to-deploy-dir-image>/boot-jtag.tcl |
51 | ``` | 73 | ``` |
52 | 3. In the XSCT console, connect to the target over JTAG using the connect command. | 74 | |
75 | #### Manually executing xsdb commands | ||
76 | |||
77 | 1. Power on the board, Launch the XSDB shell from command line as shown below. | ||
78 | ``` | ||
79 | $ xsdb | ||
80 | ``` | ||
81 | 2. In the XSDB console, connect to the target over JTAG using the connect command. | ||
53 | Optionally user can use `-url` to specify the local/remote hw_server. The | 82 | Optionally user can use `-url` to specify the local/remote hw_server. The |
54 | connect command returns the channel ID of the connection. | 83 | connect command returns the channel ID of the connection. |
55 | ``` | 84 | ``` |
56 | xsct% connect | 85 | xsdb% connect |
57 | ``` | 86 | ``` |
58 | 4. The targets command lists the available targets and allows you to select a | 87 | 3. The targets command lists the available targets and allows you to select a |
59 | target using its ID. The targets are assigned IDs as they are discovered on | 88 | target using its ID. The targets are assigned IDs as they are discovered on |
60 | the JTAG chain, so the IDs can change from session to session. | 89 | the JTAG chain, so the IDs can change from session to session. |
61 | ``` | 90 | ``` |
62 | xsct% targets | 91 | xsdb% targets |
63 | ``` | 92 | ``` |
64 | 93 | ||
65 | > **Note:** For non-interactive usage such as scripting, you can use the `-filter` | 94 | > **Note:** For non-interactive usage such as scripting, you can use the `-filter` |
66 | option to select a target instead of selecting the target using its ID. | 95 | option to select a target instead of selecting the target using its ID. |
67 | 96 | ||
68 | ### Loading boot.bin using XSCT | 97 | ##### Loading boot.bin using XSDB |
69 | 98 | ||
70 | 1. Download the boot.bin for the target using XSCT with the `device program` command. | 99 | 1. Download the boot.bin for the target using XSDB with the `device program` command. |
71 | Versal boot.bin will be located in the `${DEPLOY_DIR_IMAGE}` directory. Default | 100 | Versal boot.bin will be located in the `${DEPLOY_DIR_IMAGE}` directory. Default |
72 | boot.bin consists of boot pdi, plm.elf, psm.elf, bl31.elf, u-boot.elf and | 101 | boot.bin consists of boot pdi, plm.elf, psm.elf, bl31.elf, u-boot.elf and |
73 | system.dtb. This boot.bin is generated using bootgen tool by passing a .bif file. | 102 | system.dtb. This boot.bin is generated using bootgen tool by passing a .bif file. |
@@ -76,15 +105,15 @@ system.dtb. This boot.bin is generated using bootgen tool by passing a .bif file | |||
76 | > u-boot and kernel. | 105 | > u-boot and kernel. |
77 | 106 | ||
78 | ``` | 107 | ``` |
79 | xsct% targets -set -nocase -filter {name =~ "*PMC*"} | 108 | xsdb% targets -set -nocase -filter {name =~ "*PMC*"} |
80 | xsct% device program ${DEPLOY_DIR_IMAGE}/boot.bin | 109 | xsdb% device program ${DEPLOY_DIR_IMAGE}/boot.bin |
81 | xsct% targets -set -nocase -filter {name =~ "*A72*#0"} | 110 | xsdb% targets -set -nocase -filter {name =~ "*A72*#0"} |
82 | xsct% stop | 111 | xsdb% stop |
83 | ``` | 112 | ``` |
84 | 2. After loading boot.bin resume the execution of active target using the `con` | 113 | 2. After loading boot.bin resume the execution of active target using the `con` |
85 | command in XSCT shell. | 114 | command in XSDB shell. |
86 | ``` | 115 | ``` |
87 | xsct% con | 116 | xsdb% con |
88 | ``` | 117 | ``` |
89 | 3. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. | 118 | 3. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. |
90 | ``` | 119 | ``` |
@@ -93,20 +122,38 @@ Hit any key to stop autoboot: 0 | |||
93 | U-Boot> | 122 | U-Boot> |
94 | ``` | 123 | ``` |
95 | 124 | ||
96 | ### Loading Kernel, Root Filesystem and U-boot boot script | 125 | ##### Loading Kernel, Root Filesystem and U-boot boot script |
97 | 126 | ||
98 | Load the images into the target DDR/PL DRR load address i.e., | 127 | Load the images into the target DDR/PL DRR load address i.e., |
99 | `DDR base address + <image_offset>`. | 128 | `DDR base address + <image_offset>`. |
100 | 129 | ||
101 | Below example uses base DDR address as 0x0 which matches in vivado address editor. | 130 | Below example uses base DDR address as 0x0 which matches in vivado address editor. |
102 | 131 | ||
132 | 1. **Linux** | ||
133 | |||
103 | | Image Type | Base DDR Address | Image Offset | Load Address in DDR | | 134 | | Image Type | Base DDR Address | Image Offset | Load Address in DDR | |
104 | |--------------------|------------------|--------------|---------------------| | 135 | |--------------------|------------------|--------------|---------------------| |
105 | | Kernel | 0x0 | 0x200000 | 0x200000 | | 136 | | Linux Kernel | 0x0 | 0x200000 | 0x200000 | |
106 | | Device Tree | 0x0 | 0x1000 | 0x1000 | | 137 | | Device Tree Blob | 0x0 | 0x1000 | 0x1000 | |
107 | | Rootfs | 0x0 | 0x4000000 | 0x4000000 | | 138 | | Rootfs | 0x0 | 0x4000000 | 0x4000000 | |
108 | | U-boot boot script | 0x0 | 0x20000000 | 0x20000000 | | 139 | | U-boot boot script | 0x0 | 0x20000000 | 0x20000000 | |
109 | 140 | ||
141 | 2. **Xen** | ||
142 | |||
143 | > **Note:** Xen, Rootfs and Device Tree image offset is calculated as shown below. | ||
144 | > * `Xen Rootfs = Base DDR Address + Linux Kernel Image Offset(0xE00000) + Size of Linux Kernel Image` | ||
145 | > * `Xen Kernel = Base DDR Address + Xen Rootfs Image Offset (Ex: 0x2600000) + Size of Xen Rootfs` | ||
146 | > * `Device Tree Blob = Base DDR Address + Xen Kernel Image Offset (Ex: 0xBA00000) + Size of Device Tree Blob` | ||
147 | |||
148 | | Image Type | Base DDR Address | Image Offset | Load Address in DDR | | ||
149 | |--------------------|------------------|--------------|---------------------| | ||
150 | | Linux Kernel | 0x0 | 0xE00000 | 0xE00000 | | ||
151 | | Xen Rootfs | 0x0 | 0x2600000 | 0x2600000 | | ||
152 | | Xen Kernel | 0x0 | 0xBA00000 | 0xBA00000 | | ||
153 | | Device Tree Blob | 0x0 | 0xC000000 | 0xC000000 | | ||
154 | | U-boot boot script | 0x0 | 0x20000000 | 0x20000000 | | ||
155 | |||
156 | |||
110 | > **Note:** | 157 | > **Note:** |
111 | > 1. `<target-image>` refers to core-image-minimal or petalinux-image-minimal | 158 | > 1. `<target-image>` refers to core-image-minimal or petalinux-image-minimal |
112 | > 2. For pxeboot boot create a symlink for `<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot` | 159 | > 2. For pxeboot boot create a symlink for `<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot` |
@@ -119,55 +166,101 @@ using U-Boot. | |||
119 | > 4. If common ${DEPLOY_DIR_IMAGE}/system.dtb is used by u-boot and kernel, this | 166 | > 4. If common ${DEPLOY_DIR_IMAGE}/system.dtb is used by u-boot and kernel, this |
120 | > is already part of boot.bin we can skip loading dtb, else load kernel dtb. | 167 | > is already part of boot.bin we can skip loading dtb, else load kernel dtb. |
121 | 168 | ||
122 | #### Using XSCT | 169 | ###### Using XSDB |
123 | 170 | ||
124 | 1. Suspend the execution of active target using `stop` command in XSCT. | 171 | 1. Suspend the execution of active target using `stop` command in XSDB. |
125 | ``` | 172 | ``` |
126 | xsct% stop | 173 | xsdb% stop |
127 | ``` | 174 | ``` |
128 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load | 175 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load |
129 | address. | 176 | address. |
130 | ``` | ||
131 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000 | ||
132 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x1000 | ||
133 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000 | ||
134 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000 | ||
135 | xsct% targets -set -nocase -filter {name =~ "*A72*#0"} | ||
136 | ``` | ||
137 | 177 | ||
138 | #### Using TFTP | 178 | * Linux XSDB |
179 | ``` | ||
180 | xsdb% targets -set -nocase -filter {name =~ "*A72*#0"} | ||
181 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000 | ||
182 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x1000 | ||
183 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000 | ||
184 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000 | ||
185 | ``` | ||
186 | |||
187 | * Xen XSDB | ||
188 | ``` | ||
189 | xsdb% targets -set -nocase -filter {name =~ "*A72*#0"} | ||
190 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/Image 0xE00000 | ||
191 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz 0x2600000 | ||
192 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/xen 0xBA00000 | ||
193 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0xC000000 | ||
194 | xsdb% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000 | ||
195 | ``` | ||
196 | |||
197 | ###### Using TFTP | ||
139 | 198 | ||
140 | 1. Configure the `ipaddr` and `serverip` of the U-Boot environment. | 199 | 1. Setup TFTP directory on host machine and copy the images to your TFTP directory |
200 | so that you can load them from U-Boot. | ||
201 | 2. Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
141 | ``` | 202 | ``` |
142 | Versal> set serverip <server ip> | 203 | Versal> set serverip <server ip> |
143 | Versal> set ipaddr <board ip> | 204 | Versal> set ipaddr <board ip> |
144 | ``` | 205 | ``` |
145 | 2. Load the images to DDR address. Make sure images are copied to tftp directory. | 206 | 3. Load the images to DDR address. |
146 | ``` | ||
147 | U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image | ||
148 | U-Boot> tftpboot 0x1000 ${TFTPDIR}/system.dtb | ||
149 | U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot | ||
150 | U-Boot> tftpboot 0x20000000 ${TFTPDIR}/boot.scr | ||
151 | 207 | ||
152 | ``` | 208 | * Linux TFTP |
153 | ### Booting Linux | 209 | ``` |
210 | U-Boot> tftpboot 0x200000 Image | ||
211 | U-Boot> tftpboot 0x1000 system.dtb | ||
212 | U-Boot> tftpboot 0x4000000 core-image-minimal-${MACHINE}.cpio.gz.u-boot | ||
213 | U-Boot> tftpboot 0x20000000 boot.scr | ||
214 | ``` | ||
215 | |||
216 | * Xen TFTP | ||
217 | ``` | ||
218 | U-Boot> tftpboot 0xE00000 Image | ||
219 | U-Boot> setenv kernel_size 0x$filesize | ||
220 | U-Boot> tftpboot 0x2600000 core-image-minimal-${MACHINE}.cpio.gz | ||
221 | U-Boot> setenv ramdisk_size 0x$filesize | ||
222 | U-Boot> tftpboot 0xBA00000 xen | ||
223 | U-Boot> tftpboot 0xC000000 system.dtb | ||
224 | U-Boot> tftpboot 0x20000000 boot.scr | ||
225 | ``` | ||
226 | |||
227 | ##### Booting Linux | ||
154 | 228 | ||
155 | Once the images are loaded continue the execution. | 229 | Once the images are loaded continue the execution. |
156 | 230 | ||
157 | 1. After loading images resume the execution of active target using the `con` | 231 | 1. After loading images resume the execution of active target using the `con` |
158 | command in XSCT shell, Skip step 1 for if you have used TFTP to load images. | 232 | command in XSDB shell, Skip step 1 for if you have used TFTP to load images. |
159 | ``` | 233 | ``` |
160 | xsct% con | 234 | xsdb% con |
161 | ``` | 235 | ``` |
162 | 2. Terminate xsct shell. | 236 | 2. Terminate xsdb shell. |
163 | ``` | 237 | ``` |
164 | xsct% exit | 238 | xsdb% exit |
165 | ``` | 239 | ``` |
166 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. | 240 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. |
241 | |||
242 | * Linux boot | ||
167 | ``` | 243 | ``` |
168 | U-Boot> boot | 244 | U-Boot> boot |
169 | ``` | 245 | ``` |
170 | 246 | ||
247 | * XEN JTAG boot | ||
248 | |||
249 | * XSDB | ||
250 | > **Note:** You need to calculate the Kernel(kernel_size) and ramdisk(ramdisk_size) | ||
251 | > image size manually from `${DEPLOY_DIR_IMAGE}` directory. For example if your | ||
252 | > kernel size is 24269312 bytes you need to convert to hex 0x1725200 and use it. | ||
253 | ``` | ||
254 | U-Boot> setenv kernel_size <filesize> | ||
255 | U-Boot> setenv ramdisk_size <filesize> | ||
256 | U-Boot> boot | ||
257 | ``` | ||
258 | |||
259 | * TFTP | ||
260 | ``` | ||
261 | U-Boot> boot | ||
262 | ``` | ||
263 | |||
171 | ## Booting from SD | 264 | ## Booting from SD |
172 | 265 | ||
173 | 1. Load the SD card into the VCK190 board in the J302 SD slot. | 266 | 1. Load the SD card into the VCK190 board in the J302 SD slot. |
@@ -181,9 +274,9 @@ U-Boot> boot | |||
181 | card (part number: X_EBM-01, REV_A01). | 274 | card (part number: X_EBM-01, REV_A01). |
182 | 2. With the card powered off, install the QSPI daughter card. | 275 | 2. With the card powered off, install the QSPI daughter card. |
183 | 3. Power on the VCK190 board and boot using JTAG or SD boot mode, to ensure that | 276 | 3. Power on the VCK190 board and boot using JTAG or SD boot mode, to ensure that |
184 | U-Boot is running and also have boot.bin copied to DDR location using XSCT | 277 | U-Boot is running and also have boot.bin copied to DDR location using XSDB |
185 | `dow` or `tftpboot` or `fatload` command. | 278 | `dow` or `tftpboot` or `fatload` command. |
186 | 4. Follow Flash boot instructions [README](README.booting.flash.md) for more details. | 279 | 4. Follow Flash boot instructions [README](README.booting.flash.md) for more details. |
187 | 5. After flashing the images, turn off the power switch on the board, and change | 280 | 5. After flashing the images, turn off the power switch on the board, and change |
188 | the SW1 boot mode pin settings to QSPI boot mode (1-ON, 2-OFF, 3-ON, 4-ON) by | 281 | the SW1 boot mode pin settings to QSPI boot mode (1-ON, 2-OFF, 3-ON, 4-ON) by |
189 | setting the SW1. Refer [Setting Up the Target](#setting-up-the-target). \ No newline at end of file | 282 | setting the SW1. Refer [Setting Up the Target](#setting-up-the-target). |