diff options
| author | Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> | 2023-02-26 23:12:19 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-02-28 08:42:28 -0600 |
| commit | 9e1cd5cbe90929bbbd9d72106fc7d5bab17111b5 (patch) | |
| tree | 231ea8f49721d164705af71489033458aec99775 /README.booting.md | |
| parent | f1b4eae7dbd4af95c98329858aba8a7d14051262 (diff) | |
| download | meta-xilinx-9e1cd5cbe90929bbbd9d72106fc7d5bab17111b5.tar.gz | |
README.booting.md: Move boot instructions to new docs directory
Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'README.booting.md')
| -rw-r--r-- | README.booting.md | 270 |
1 files changed, 9 insertions, 261 deletions
diff --git a/README.booting.md b/README.booting.md index dc48f6b2..0f96a138 100644 --- a/README.booting.md +++ b/README.booting.md | |||
| @@ -1,266 +1,14 @@ | |||
| 1 | Booting meta-xilinx boards | 1 | # Booting OS Images onto AMD Xilinx target devices |
| 2 | ========================== | ||
| 3 | 2 | ||
| 4 | Contents | 3 | AMD Xilinx Devices support different boot modes such as JTAG, SD, eMMC, QSPI etc. |
| 5 | -------- | ||
| 6 | 4 | ||
| 7 | * [Loading via JTAG](#loading-via-jtag) | 5 | ## Booting Images with QEMU |
| 8 | * [XSDB](#xsdb) | ||
| 9 | * [Load Bitstream](#load-bitstream) | ||
| 10 | * [Load U-Boot (MicroBlaze)](#load-u-boot-microblaze) | ||
| 11 | * [Load U-Boot (Zynq)](#load-u-boot-zynq) | ||
| 12 | * [U-Boot Console](#u-boot-console) | ||
| 13 | * [Kernel, Root Filesystem and Device Tree](#kernel-root-filesystem-and-device-tree) | ||
| 14 | * [Booting via U-Boot](#booting-via-u-boot) | ||
| 15 | * [Loading via SD](#loading-via-sd) | ||
| 16 | * [Preparing SD/MMC](#preparing-sdmmc) | ||
| 17 | * [Installing U-Boot](#installing-u-boot) | ||
| 18 | * [Installing Kernel and Device Tree](#installing-kernel-and-device-tree) | ||
| 19 | * [Installing Root Filesystem](#installing-root-filesystem) | ||
| 20 | * [U-Boot Configuration File](#u-boot-configuration-file) | ||
| 21 | * [Booting](#booting) | ||
| 22 | * [Loading via TFTP](#loading-via-tftp) | ||
| 23 | * [Kernel, Root Filesystem and Device Tree](#kernel-root-filesystem-and-device-tree-1) | ||
| 24 | * [Booting via U-Boot](#booting-via-u-boot-1) | ||
| 25 | 6 | ||
| 7 | Once images are built, you can simulate the image using QEMU emulator. | ||
| 8 | ``` | ||
| 9 | $ MACHINE=<target_mahcine_name> runqemu nographic | ||
| 10 | ``` | ||
| 26 | 11 | ||
| 27 | Loading via JTAG | 12 | ## Booting Images with Hardware |
| 28 | ---------------- | ||
| 29 | This boot flow requires the use of the Xilinx tools, specifically XSDB and the | ||
| 30 | associated JTAG device drivers. This also requires access to the JTAG interface | ||
| 31 | on the board, a number of Xilinx and third-party boards come with on-board JTAG | ||
| 32 | modules. | ||
| 33 | |||
| 34 | ### XSDB | ||
| 35 | Start `xsdb` and connect. Ensure that the target chip is visible. | ||
| 36 | |||
| 37 | $ xsdb | ||
| 38 | xsdb% connect | ||
| 39 | xsdb% targets | ||
| 40 | |||
| 41 | ### Load Bitstream | ||
| 42 | **(Note: This step is only required for platforms which have a bitstream e.g. | ||
| 43 | MicroBlaze.)** | ||
| 44 | |||
| 45 | Download the bitstream for the system using XSDB with the `fpga -f` command. If | ||
| 46 | a bitstream is available from meta-xilinx is will be located in the | ||
| 47 | `deploy/images/<machine-name>/` directory. | ||
| 48 | |||
| 49 | xsdb% fpga -f download.bit | ||
| 50 | |||
| 51 | ### Load U-Boot (MicroBlaze) | ||
| 52 | Download `u-boot.elf` to the target CPU via the use of XSDB. | ||
| 53 | |||
| 54 | xsdb% targets -set -filter {name =~ "MicroBlaze*"} | ||
| 55 | xsdb% rst | ||
| 56 | xsdb% dow u-boot.elf | ||
| 57 | xsdb% con | ||
| 58 | |||
| 59 | ### Load U-Boot (Zynq) | ||
| 60 | Ensure the board is configured to boot from JTAG. The Zynq platform requires the | ||
| 61 | loading of SPL first, this can be done by loading the `u-boot-spl.bin` and | ||
| 62 | executing it at location `0x0`. `u-boot-spl.bin` is not output to the deploy | ||
| 63 | directory by default, it can be obtained from the work directory for U-Boot | ||
| 64 | (`git/spl/u-boot-spl.bin`) or can be extracted from `boot.bin` using | ||
| 65 | `dd if=boot.bin of=u-boot-spl.bin bs=1 skip=2240`. | ||
| 66 | |||
| 67 | xsdb% targets -set -filter {name =~ "ARM*#0"} | ||
| 68 | xsdb% dow -data u-boot-spl.bin 0x0 | ||
| 69 | xsdb% rwr pc 0x0 | ||
| 70 | xsdb% con | ||
| 71 | |||
| 72 | On the UART console the following should appear, indicating SPL was loaded. | ||
| 73 | |||
| 74 | U-Boot SPL 2016.01 | ||
| 75 | Trying to boot from unknown boot device | ||
| 76 | SPL: Unsupported Boot Device! | ||
| 77 | SPL: failed to boot from all boot devices | ||
| 78 | ### ERROR ### Please RESET the board ### | ||
| 79 | |||
| 80 | Once SPL has loaded U-Boot can now be loaded into memory and executed. Download | ||
| 81 | `u-boot.elf` to the target. | ||
| 82 | |||
| 83 | xsdb% stop | ||
| 84 | xsdb% dow u-boot.elf | ||
| 85 | xsdb% con | ||
| 86 | |||
| 87 | ### U-Boot Console | ||
| 88 | U-Boot will load and the console will be available on the UART interface. | ||
| 89 | |||
| 90 | ... | ||
| 91 | Hit any key to stop autoboot: 0 | ||
| 92 | U-Boot> | ||
| 93 | |||
| 94 | ### Kernel, Root Filesystem and Device Tree | ||
| 95 | Whilst it is possible to load the images via JTAG this connection is slow and | ||
| 96 | this process can take a long time to execute (more than 10 minutes). If your | ||
| 97 | system has ethernet it is recommended that you use TFTP to load these images | ||
| 98 | using U-Boot. | ||
| 99 | |||
| 100 | Once U-Boot has been loaded, pause the execution using XSDB and use the `dow` | ||
| 101 | command to load the images into the targets memory. Once the images are loaded | ||
| 102 | continue the execution and return to the U-Boot console. | ||
| 103 | |||
| 104 | MicroBlaze (kc705-microblazeel): | ||
| 105 | |||
| 106 | xsdb% stop | ||
| 107 | xsdb% dow -data linux.bin.ub 0x85000000 | ||
| 108 | xsdb% dow -data core-image-minimal-kc705-microblazeel.cpio.gz.u-boot 0x86000000 | ||
| 109 | xsdb% dow -data kc705-microblazeel.dtb 0x84000000 | ||
| 110 | xsdb% con | ||
| 111 | |||
| 112 | Zynq: | ||
| 113 | |||
| 114 | xsdb% stop | ||
| 115 | xsdb% dow -data uImage 0x2000000 | ||
| 116 | xsdb% dow -data core-image-minimal-<machine name>.cpio.gz.u-boot 0x3000000 | ||
| 117 | xsdb% dow -data <machine name>.dtb 0x2A00000 | ||
| 118 | xsdb% con | ||
| 119 | |||
| 120 | ### Booting via U-Boot | ||
| 121 | At the U-Boot console use the `bootm` command to execute the kernel. | ||
| 122 | |||
| 123 | MicroBlaze (kc705-microblazeel): | ||
| 124 | |||
| 125 | U-Boot> bootm 0x85000000 0x86000000 0x84000000 | ||
| 126 | |||
| 127 | Zynq: | ||
| 128 | |||
| 129 | U-Boot> bootm 0x2000000 0x3000000 0x2A00000 | ||
| 130 | |||
| 131 | |||
| 132 | Loading via SD | ||
| 133 | --------------------- | ||
| 134 | **(Note: This section only applies to Zynq and ZynqMP.)** | ||
| 135 | |||
| 136 | ### Preparing SD/MMC | ||
| 137 | Setup the card with the first partition formatted as FAT16. If you intend to | ||
| 138 | boot with the root filesystem located on the SD card, also create a second | ||
| 139 | partition formatted as EXT4. | ||
| 140 | |||
| 141 | It is recommended that the first partition be at least 64MB in size, however | ||
| 142 | this value will depend on whether using a ramdisk for the root filesystem and | ||
| 143 | how large the ramdisk is. | ||
| 144 | |||
| 145 | This section describes how to manually prepare and populate an SD card image. | ||
| 146 | There are automation tools in OpenEmbedded that can generate disk images already | ||
| 147 | formatted and prepared such that they can be written directly to a disk. Refer | ||
| 148 | to the Yocto Project Development Manual for more details: | ||
| 149 | http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#creating-partitioned-images | ||
| 150 | |||
| 151 | ### Installing U-Boot (Zynq) | ||
| 152 | Add the following files to the first partition: | ||
| 153 | |||
| 154 | * `boot.bin` | ||
| 155 | * `u-boot.img` | ||
| 156 | |||
| 157 | ### Installing U-Boot (ZynqMP) | ||
| 158 | Add the following files to the first partition: | ||
| 159 | |||
| 160 | * `boot.bin` | ||
| 161 | * `u-boot.bin` | ||
| 162 | |||
| 163 | ### Installing Kernel and Device Tree (Zynq) | ||
| 164 | Add the following files to the first partition: | ||
| 165 | |||
| 166 | * `uImage` | ||
| 167 | * `<machine name>.dtb` | ||
| 168 | |||
| 169 | ### Installing Kernel and Device Tree (ZynqMP) | ||
| 170 | Add the following files to the first partition: | ||
| 171 | |||
| 172 | * `Image` | ||
| 173 | * `<machine name>.dtb` | ||
| 174 | |||
| 175 | ### Install ARM Trusted Firmware (ZynqMP) | ||
| 176 | Add the following file to the first partition: | ||
| 177 | |||
| 178 | * `atf-uboot.ub` | ||
| 179 | |||
| 180 | ### Install U-boot environment file (ZynqMP) | ||
| 181 | Add the following file to the first partition: | ||
| 182 | |||
| 183 | * `uEnv.txt` | ||
| 184 | |||
| 185 | ### Installing Root Filesystem | ||
| 186 | If using a ramdisk also add the `.cpio.gz.u-boot` type of root filesystem image | ||
| 187 | to the first partition. | ||
| 188 | |||
| 189 | * `core-image-minimal-<machine name>.cpio.gz.u-boot` | ||
| 190 | |||
| 191 | If using the SD card as the root filesystem, populate the second partition with | ||
| 192 | the content of the root filesystem. To install the root filesystem extract the | ||
| 193 | corresponding tarball into the root of the second partition (the following | ||
| 194 | command assumes that the second partition is mounted at /media/root). | ||
| 195 | |||
| 196 | tar x -C /media/root -f core-image-minimal-<machine name>.tar.gz | ||
| 197 | |||
| 198 | ### U-Boot Configuration File | ||
| 199 | Also create the file `uEnv.txt` on the first partition of the SD card partition, | ||
| 200 | with the following contents. Replacing the names of files where appropriate. | ||
| 201 | |||
| 202 | kernel_image=uImage | ||
| 203 | devicetree_image=<machine name>.dtb | ||
| 204 | |||
| 205 | If using a ramdisk root filesystem setup the `ramdisk_image` variable. | ||
| 206 | |||
| 207 | ramdisk_image=core-image-minimal-<machine name>.cpio.gz.u-boot | ||
| 208 | |||
| 209 | If using the SD card as the root filesystem setup the kernel boot args, and | ||
| 210 | `uenvcmd` variable. | ||
| 211 | |||
| 212 | bootargs=root=/dev/mmcblk0p2 rw rootwait | ||
| 213 | uenvcmd=fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && bootm 0x3000000 - 0x2A00000 | ||
| 214 | |||
| 215 | ### Booting | ||
| 216 | Insert the SD card and connect UART to a terminal program and power on the | ||
| 217 | board. (For boards that have configurable boot jumper/switches ensure the board | ||
| 218 | is configured for SD). | ||
| 219 | |||
| 220 | Initially U-Boot SPL will load, which will in turn load U-Boot. U-Boot will use | ||
| 221 | the `uEnv.txt` to automatically load and execute the kernel. | ||
| 222 | |||
| 223 | |||
| 224 | Loading via TFTP | ||
| 225 | ---------------- | ||
| 226 | **(Note: This boot flow requires ethernet on the baord and a TFTP server)** | ||
| 227 | |||
| 228 | Boot your system into U-Boot, using one of boot methods (e.g. JTAG, SD, QSPI). | ||
| 229 | |||
| 230 | ### Kernel, Root Filesystem and Device Tree | ||
| 231 | Place the following images into the root of the TFTP server directory: | ||
| 232 | |||
| 233 | * `core-image-minimal-<machine name>.cpio.gz.u-boot` | ||
| 234 | * `uImage` (Zynq) or `linux.bin.ub` (MicroBlaze) | ||
| 235 | * `<machine name>.dtb` | ||
| 236 | |||
| 237 | ### Booting via U-Boot | ||
| 238 | The serial console of the target board will display the U-Boot console. | ||
| 239 | Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
| 240 | |||
| 241 | U-Boot> set serverip <server ip> | ||
| 242 | U-Boot> set ipaddr <board ip> | ||
| 243 | |||
| 244 | Using the U-Boot console; load the Kernel, root filesystem and the DTB into | ||
| 245 | memory. And then boot Linux using the `bootm` command. (Note the load addresses | ||
| 246 | will be dependant on machine used) | ||
| 247 | |||
| 248 | MicroBlaze (kc705-microblazeel): | ||
| 249 | |||
| 250 | U-Boot> tftpboot 0x85000000 linux.bin.ub | ||
| 251 | U-Boot> tftpboot 0x86000000 core-image-minimal-kc705-microblazeel.cpio.gz.u-boot | ||
| 252 | U-Boot> tftpboot 0x84000000 kc705-microblazeel.dtb | ||
| 253 | U-Boot> bootm 0x85000000 0x86000000 0x84000000 | ||
| 254 | |||
| 255 | Zynq: | ||
| 256 | |||
| 257 | U-Boot> tftpboot 0x2000000 uImage | ||
| 258 | U-Boot> tftpboot 0x3000000 core-image-minimal-<machine name>.cpio.gz.u-boot | ||
| 259 | U-Boot> tftpboot 0x2A00000 <machine name>.dtb | ||
| 260 | U-Boot> bootm 0x2000000 0x3000000 0x2A00000 | ||
| 261 | |||
| 262 | U-Boot will prepare the Kernel for boot and then it will being to execute. | ||
| 263 | |||
| 264 | ... | ||
| 265 | Starting kernel... | ||
| 266 | 13 | ||
| 14 | Follow booting instructions [README](docs) for more details. | ||
