diff options
| author | Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> | 2023-02-26 23:12:20 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-02-28 08:42:28 -0600 |
| commit | fa7d089a2020ad56c50394d2b35018ff97f52589 (patch) | |
| tree | 1f2b2c4fa4b9b4d5e93a16275aedfe3bc18da1bd /docs | |
| parent | 9e1cd5cbe90929bbbd9d72106fc7d5bab17111b5 (diff) | |
| download | meta-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')
| -rw-r--r-- | docs/README.booting.flash.md | 133 | ||||
| -rw-r--r-- | docs/README.booting.microblaze.md | 170 | ||||
| -rw-r--r-- | docs/README.booting.storage.md | 118 | ||||
| -rw-r--r-- | docs/README.booting.versal.md | 189 | ||||
| -rw-r--r-- | docs/README.booting.zynq.md | 186 | ||||
| -rw-r--r-- | docs/README.booting.zynqmp.md | 212 |
6 files changed, 1008 insertions, 0 deletions
diff --git a/docs/README.booting.flash.md b/docs/README.booting.flash.md new file mode 100644 index 00000000..3bc39882 --- /dev/null +++ b/docs/README.booting.flash.md | |||
| @@ -0,0 +1,133 @@ | |||
| 1 | # Booting OS Images from Flash Device | ||
| 2 | |||
| 3 | Booting OS Images from flash devices such as QSPI/NOR/NAND/OSPI. | ||
| 4 | |||
| 5 | * [U-boot boot scripts configurations](#u-boot-boot-scripts-configurations) | ||
| 6 | * [Booting from QSPI or NOR or OSPI](#booting-from-qspi-or-nor-or-ospi) | ||
| 7 | |||
| 8 | ## U-boot boot scripts configurations | ||
| 9 | |||
| 10 | 1. In QSPI/OSPI/NAND boot modes the boot.scr partition offset is fixed for all the | ||
| 11 | platforms by default in u-boot, and you can change by updating | ||
| 12 | CONFIG_BOOT_SCRIPT_OFFSET in u-boot config. Default boot script size is | ||
| 13 | 512KB(script_size_f=0x80000). | ||
| 14 | 2. Below table describes boot.scr partition offset and load address for all the | ||
| 15 | platforms. | ||
| 16 | |||
| 17 | | Device | Partition Offset address for boot.scr | Load address of boot.scr in DDR | | ||
| 18 | |------------|---------------------------------------|----------------------------------------| | ||
| 19 | | MicroBlaze | 0x1F00000 | DDR base address + DDR Size - 0xe00000 | | ||
| 20 | | Zynq-7000 | 0xFC0000 | DDR base address + 0x3000000 | | ||
| 21 | | ZynqMP | 0x3E80000 | DDR base address + 0x20000000 | | ||
| 22 | | Versal | 0x7F80000 | DDR base address + 0x20000000 | | ||
| 23 | |||
| 24 | ## Booting from QSPI or NOR or OSPI | ||
| 25 | |||
| 26 | This section demonstrates the booting OS images from QSPI boot mode. For this, | ||
| 27 | you need to make sure you have QSPI interface on board or a QSPI daughter card. | ||
| 28 | |||
| 29 | > **Note:** Instructions are same for QSPI or NOR and OSPI flash. | ||
| 30 | |||
| 31 | 1. For example we'll assume QSPI flash size is 128MB and default CONFIG_BOOT_SCRIPT_OFFSET | ||
| 32 | defined in u-boot. | ||
| 33 | |||
| 34 | | Flash Partition Name | Partition Offset | Partition Size | | ||
| 35 | |----------------------|------------------|----------------| | ||
| 36 | | boot.bin | 0x0 | 30MB | | ||
| 37 | | bootenv | 0x1E00000 | 256Kb | | ||
| 38 | | kernel | 0x1E40000 | 33MB | | ||
| 39 | | bootscr | 0x3E80000 | 1.5MB | | ||
| 40 | | rootfs | 0x4000000 | 64MB | | ||
| 41 | |||
| 42 | 2. Create a flash partition device-tree nodes depending on your flash size. ex: | ||
| 43 | ``` | ||
| 44 | &qspi { | ||
| 45 | #address-cells = <1>; | ||
| 46 | #size-cells = <0>; | ||
| 47 | flash0: flash@0 { | ||
| 48 | spi-tx-bus-width=<4>; | ||
| 49 | spi-rx-bus-width=<4>; | ||
| 50 | partition@0 { | ||
| 51 | label = "boot"; | ||
| 52 | reg = <0x00000000 0x01e00000>; | ||
| 53 | }; | ||
| 54 | partition@1 { | ||
| 55 | label = "bootenv"; | ||
| 56 | reg = <0x01e00000 0x00040000>; | ||
| 57 | }; | ||
| 58 | partition@2 { | ||
| 59 | label = "kernel"; | ||
| 60 | reg = <0x01e40000 0x02040000>; | ||
| 61 | }; | ||
| 62 | partition@3 { | ||
| 63 | label = "bootscr"; | ||
| 64 | reg = <0x03e80000 0x01800000>; | ||
| 65 | }; | ||
| 66 | partition@4 { | ||
| 67 | label = "rootfs"; | ||
| 68 | reg = <0x04000000 0x04000000>; | ||
| 69 | }; | ||
| 70 | }; | ||
| 71 | }; | ||
| 72 | ``` | ||
| 73 | 3. Set the U-boot boot script variables to match the flash partition offsets in | ||
| 74 | local.conf | ||
| 75 | ``` | ||
| 76 | QSPI_KERNEL_OFFSET = "0x1E40000" | ||
| 77 | QSPI_KERNEL_SIZE = "0x2040000" | ||
| 78 | QSPI_RAMDISK_OFFSET = "0x4000000" | ||
| 79 | QSPI_RAMDISK_SIZE = "0x4000000" | ||
| 80 | ``` | ||
| 81 | 4. Build the images and make sure images are copied to tftp directory. | ||
| 82 | 5. Once images are built, to ensure taget is booted using JTAG or SD boot modes. | ||
| 83 | 6. Also have boot.bin copied to DDR location using XSCT `dow` or `tftpboot` or | ||
| 84 | `fatload` command. | ||
| 85 | 7. Halt at U-Boot then run the following commands to flash the images on the | ||
| 86 | QSPI flash. | ||
| 87 | ``` | ||
| 88 | # check QSPI is available or not | ||
| 89 | U-Boot> sf probe 0 0 0 | ||
| 90 | |||
| 91 | # Erase the boot partition | ||
| 92 | U-Boot> sf erase 0x0 0x1E00000 | ||
| 93 | |||
| 94 | # Copy the boot.bin to DDR location using tftpboot | ||
| 95 | U-Boot> tftpboot 0x10000000 ${TFTPDIR}/boot.bin | ||
| 96 | |||
| 97 | # Write boot.bin file image to flash partition | ||
| 98 | U-Boot> sf write 0x10000000 0x0 ${filesize} | ||
| 99 | |||
| 100 | # Erase the bootenv partition for env storage (saveenv). | ||
| 101 | U-Boot> sf erase 0x1E00000 0x1E40000 | ||
| 102 | |||
| 103 | # Erase the kernel partition | ||
| 104 | U-Boot> sf erase 0x1E40000 0x2040000 | ||
| 105 | |||
| 106 | # Copy the Image file to DDR location using tftpboot | ||
| 107 | U-Boot> tftpboot 0x10000000 ${TFTPDIR}/Image | ||
| 108 | |||
| 109 | # Write kernel image to flash partition | ||
| 110 | U-Boot> sf write 0x10000000 0x1E40000 ${filesize} | ||
| 111 | |||
| 112 | # Erase the bootscr partition | ||
| 113 | U-Boot> sf erase 0x3E80000 0x1800000 | ||
| 114 | |||
| 115 | # Copy the boot.scr file to DDR location using tftpboot | ||
| 116 | U-Boot> tftpboot 0x10000000 ${TFTPDIR}/boot.scr | ||
| 117 | |||
| 118 | # Write boot.scr file to flash partition | ||
| 119 | U-Boot> sf write 0x10000000 0x3E80000 ${filesize} | ||
| 120 | |||
| 121 | # Erase the rootfs partition | ||
| 122 | U-Boot> sf erase 0x4000000 0x4000000 | ||
| 123 | |||
| 124 | # Copy the rootfs.cpio.gz.u-boot file to DDR location using tftpboot | ||
| 125 | U-Boot> tftpboot 0x10000000 ${TFTPDIR}/rootfs.cpio.gz.u-boot | ||
| 126 | |||
| 127 | # Write rootfs image to flash partition | ||
| 128 | U-Boot> sf write 0x10000000 0x4000000 ${filesize} | ||
| 129 | ``` | ||
| 130 | 8. After flashing the images, turn off the board and change the boot mode pin | ||
| 131 | settings to QSPI boot mode. | ||
| 132 | 9. Power cycle the board. The board now boots up using the images in the QSPI | ||
| 133 | flash. | ||
diff --git a/docs/README.booting.microblaze.md b/docs/README.booting.microblaze.md new file mode 100644 index 00000000..1ffcc3c8 --- /dev/null +++ b/docs/README.booting.microblaze.md | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | # Booting OS Images on MicroBlaze target boards | ||
| 2 | |||
| 3 | Booting OS images on MicroBlaze target boards can be done using JTAG and QSPI boot modes. | ||
| 4 | |||
| 5 | * [Setting Up the Target](#setting-up-the-target) | ||
| 6 | * [Booting from JTAG](#booting-from-jtag) | ||
| 7 | * [Loading Bitstream using XSCT](#loading-bitstream-using-xsct) | ||
| 8 | * [Loading U-boot using XSCT](#loading-u-boot-using-xsct) | ||
| 9 | * [Loading Kernel, Device tree, Root Filesystem and U-boot boot script](#loading-kernel-device-tree-root-filesystem-and-u-boot-boot-script) | ||
| 10 | * [Using XSCT](#using-xsct) | ||
| 11 | * [Using TFTP](#using-tftp) | ||
| 12 | |||
| 13 | ## Setting Up the Target | ||
| 14 | |||
| 15 | > **Note:** For microblaze-generic machine configuration file KCU105 evaluation | ||
| 16 | > board is used as reference. | ||
| 17 | |||
| 18 | 1. Connect a USB cable between the USB-JTAG, USB-UART connector on the target | ||
| 19 | and the USB port on the host machine. | ||
| 20 | 2. Connect 12V power to the KCU105 6-Pin power supply to J15 and turn on the board | ||
| 21 | power with the SW1 switch. | ||
| 22 | 3. Default UART terminal (serial port) settings is Speed `115200`, Data `8 bit`, | ||
| 23 | Parity `None`, Stop bits ` 1 bit` and Flow control `None`. | ||
| 24 | 4. Set the board to JTAG and other boot modes by setting the boot mode switch by | ||
| 25 | referring to board user guide. For KCU105 board below is the configuration | ||
| 26 | boot mode settings (SW15). | ||
| 27 | |||
| 28 | > **Note:** Switch OFF = 1 = High; ON = 0 = Low | ||
| 29 | |||
| 30 | | Boot Mode | Mode Pins M[2:0] | | ||
| 31 | |------------|------------------| | ||
| 32 | | JTAG | 101 | | ||
| 33 | | QSPI | 001 | | ||
| 34 | |||
| 35 | ## Booting from JTAG | ||
| 36 | |||
| 37 | This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and | ||
| 38 | 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 | ||
| 40 | modules. | ||
| 41 | |||
| 42 | 1. Source the Vivado or Vitis tools `settings.sh` scripts. | ||
| 43 | 2. 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 | ``` | ||
| 49 | 3. 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 | ``` | ||
| 53 | xsct% connect | ||
| 54 | ``` | ||
| 55 | 4. 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 | ``` | ||
| 59 | xsct% 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 Bitstream using XSCT | ||
| 66 | |||
| 67 | * Download the bitstream for the target using XSCT with the `fpga` command. Microblaze | ||
| 68 | bitstream will be located in the `${DEPLOY_DIR_IMAGE}` directory. Optionally user | ||
| 69 | can use `fpga -no-revision-check` to skip FPGA silicon revision. | ||
| 70 | |||
| 71 | ``` | ||
| 72 | xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/system-${MACHINE}.bit | ||
| 73 | xsct% after 2000 | ||
| 74 | xsct% targets -set -nocase -filter {name =~ "microblaze*#0"} | ||
| 75 | xsct% catch {stop} | ||
| 76 | xsct% after 1000 | ||
| 77 | ``` | ||
| 78 | ### Loading U-boot using XSCT | ||
| 79 | |||
| 80 | 1. Download `u-boot.elf` to the target CPU using XSCT. Microblaze u-boot.elf will be | ||
| 81 | located in the `${DEPLOY_DIR_IMAGE}` directory. Before u-boot.elf is loaded suspend | ||
| 82 | the execution of active target using `stop` command. | ||
| 83 | ``` | ||
| 84 | xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf | ||
| 85 | ``` | ||
| 86 | 2. After loading u-boot.elf resume the execution of active target using the `con` | ||
| 87 | command in XSCT shell. | ||
| 88 | ``` | ||
| 89 | xsct% con | ||
| 90 | ``` | ||
| 91 | 3. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. | ||
| 92 | ``` | ||
| 93 | ... | ||
| 94 | Hit any key to stop autoboot: 0 | ||
| 95 | U-Boot> | ||
| 96 | ``` | ||
| 97 | |||
| 98 | ### Loading Kernel, Device tree, Root Filesystem and U-boot boot script | ||
| 99 | |||
| 100 | Load the images into the target DDR/MIG load address i.e., | ||
| 101 | `DDR base address + <image_offset>`. MicroBlaze U-boot boot script(boot.scr) | ||
| 102 | load address is calculated as `DDR base address + DDR Size - 0xe00000` | ||
| 103 | |||
| 104 | Below example uses base DDR address as 0x80000000 and DDR size as 0x80000000 | ||
| 105 | which matches in vivado address editor. | ||
| 106 | |||
| 107 | | Image Type | Base DDR Address | Image Offset | Load Address in DDR | | ||
| 108 | |--------------------|------------------|--------------|---------------------| | ||
| 109 | | Kernel | 0x80000000 | 0x0 | 0x80000000 | | ||
| 110 | | Device Tree | 0x80000000 | 0x1e00000 | 0x81e00000 | | ||
| 111 | | Rootfs | 0x80000000 | 0x2e00000 | 0x82e00000 | | ||
| 112 | | U-boot boot script | 0x80000000 | 0xe00000 | 0xff200000 | | ||
| 113 | |||
| 114 | > **Note:** | ||
| 115 | > 1. `<target-image>` refers to core-image-minimal or petalinux-image-minimal | ||
| 116 | > 2. For pxeboot boot create a symlink for `<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot` | ||
| 117 | > as shown `$ ln -sf ${DEPLOY_DIR_IMAGE}/<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot ${DEPLOY_DIR_IMAGE}/rootfs.cpio.gz.u-boot` | ||
| 118 | > to ensure the INITRD name in pxeboot.cfg matches with image name. | ||
| 119 | > 3. Whilst it is possible to load the images via JTAG this connection is slow and | ||
| 120 | this process can take a long time to execute (more than 10 minutes). If your | ||
| 121 | system has ethernet it is recommended that you use TFTP to load these images | ||
| 122 | using U-Boot. | ||
| 123 | |||
| 124 | #### Using XSCT | ||
| 125 | |||
| 126 | 1. Suspend the execution of active target using `stop` command in XSCT. | ||
| 127 | ``` | ||
| 128 | xsct% stop | ||
| 129 | ``` | ||
| 130 | 2. Using the `dow` command to load the images into the target DDR/MIG | ||
| 131 | load address. | ||
| 132 | ``` | ||
| 133 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/linux.bin.ub 0x80000000 | ||
| 134 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x81e00000 | ||
| 135 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x82e00000 | ||
| 136 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0xff200000 | ||
| 137 | ``` | ||
| 138 | |||
| 139 | #### Using TFTP | ||
| 140 | |||
| 141 | 1. Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
| 142 | ``` | ||
| 143 | U-Boot> set serverip <server ip> | ||
| 144 | U-Boot> set ipaddr <board ip> | ||
| 145 | ``` | ||
| 146 | 2. Load the images to DDR address. Make sure images are copied to tftp directory. | ||
| 147 | ``` | ||
| 148 | U-Boot> tftpboot 0x80000000 ${TFTPDIR}/linux.bin.ub | ||
| 149 | U-Boot> tftpboot 0x81e00000 ${TFTPDIR}/system.dtb | ||
| 150 | U-Boot> tftpboot 0x82e00000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot | ||
| 151 | U-Boot> tftpboot 0xff200000 ${TFTPDIR}/boot.scr | ||
| 152 | ``` | ||
| 153 | |||
| 154 | ### Booting Linux | ||
| 155 | |||
| 156 | Once the images are loaded continue the execution. | ||
| 157 | |||
| 158 | 1. After loading images resume the execution of active target using the `con` | ||
| 159 | command in XSCT shell, Skip step 1 for if you have used TFTP to load images. | ||
| 160 | ``` | ||
| 161 | xsct% con | ||
| 162 | ``` | ||
| 163 | 2. Terminate xsct shell. | ||
| 164 | ``` | ||
| 165 | xsct% exit | ||
| 166 | ``` | ||
| 167 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. | ||
| 168 | ``` | ||
| 169 | U-Boot> boot | ||
| 170 | ``` | ||
diff --git a/docs/README.booting.storage.md b/docs/README.booting.storage.md new file mode 100644 index 00000000..4d33600d --- /dev/null +++ b/docs/README.booting.storage.md | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | # Booting OS Images from Storage Device | ||
| 2 | |||
| 3 | Booting OS Images from storage devices such as SD Card, eMMC, USB and SATA devices. | ||
| 4 | |||
| 5 | * [Booting from SD or eMMC](#booting-from-sd-or-emmc) | ||
| 6 | * [Writing wic image to SD or eMMC device](#writing-image-to-sd-or-emmc-device) | ||
| 7 | * [Using Wic file](#using-wic-file) | ||
| 8 | * [Using Yocto images](#using-yocto-images) | ||
| 9 | * [Secondary boot from USB or SATA device](#secondary-boot-from-usb-or-sata-device) | ||
| 10 | |||
| 11 | ## Booting from SD or eMMC | ||
| 12 | |||
| 13 | Setup the card with the first partition formatted as FAT16/32. If you intend to | ||
| 14 | boot with the root filesystem located on the SD card, also create a second | ||
| 15 | partition formatted as EXT4. | ||
| 16 | |||
| 17 | It is recommended that the first partition be at least 512MB in size, however | ||
| 18 | this value will depend on whether using a ramdisk for the root filesystem and | ||
| 19 | how large the ramdisk is. | ||
| 20 | |||
| 21 | This section describes how to manually prepare and populate an SD card image. | ||
| 22 | There are automation tools in OpenEmbedded that can generate disk images already | ||
| 23 | formatted and prepared such that they can be written directly to a disk. Refer | ||
| 24 | to the Yocto Project Manual for more details: | ||
| 25 | https://docs.yoctoproject.org/4.1.2/singleindex.html#creating-partitioned-images-using-wic | ||
| 26 | |||
| 27 | ## Writing image to SD or eMMC device | ||
| 28 | |||
| 29 | There are two ways to write the images to SD card or eMMC device. | ||
| 30 | |||
| 31 | 1. Find the device name of SD or eMMC device and make sure it is unmounted. In | ||
| 32 | this example we'll assume it is /dev/mmcblk<devnum><partnum>. | ||
| 33 | 2. To write image to eMMC device make sure you need to boot Linux from JTAG or | ||
| 34 | SD or QSPI first, then copy the wic image to `<target_rootfs>/tmp` directory. | ||
| 35 | |||
| 36 | ### Using Wic file | ||
| 37 | |||
| 38 | Write wic image file to the SD card or eMMC device. | ||
| 39 | ``` | ||
| 40 | $ sudo dd if=xilinx-default-sd-${DATETIME}-sda.direct of=/dev/mmcblk<devnum> bs=4M | ||
| 41 | ``` | ||
| 42 | |||
| 43 | ### Using Yocto images | ||
| 44 | |||
| 45 | > **Note:** Use actual files to copy and don't use symlink files. | ||
| 46 | |||
| 47 | 1. Create a FAT32 and EXT4 partition on SD card or eMMC device. | ||
| 48 | ``` | ||
| 49 | $ sudo parted -s /dev/mmcblk<devnum> mklabel gpt mkpart primary fat32 1MiB 512MiB mkpart ext4 512MiB 8GiB name 1 boot name 2 root | ||
| 50 | $ sudo mkfs.fat -n boot /dev/mmcblk<devnum>1 && sudo mkfs.ext4 -L root /dev/mmcblk<devnum>2 | ||
| 51 | $ sudo lsblk /dev/mmcblk<devnum> -o NAME,FSTYPE,LABEL,PARTLABEL | ||
| 52 | ``` | ||
| 53 | 2. Mount the FAT32 and EXT4 partition. | ||
| 54 | ``` | ||
| 55 | $ sudo mount -L boot /mnt/boot; sudo mount -L root /mnt/rootfs` | ||
| 56 | ``` | ||
| 57 | 3. Copy the boot images to the SD card or eMMC device FAT32 partition. | ||
| 58 | * boot.bin | ||
| 59 | * boot.scr | ||
| 60 | * Image or uImage (For Zynq7000 only) | ||
| 61 | * system.dtb | ||
| 62 | * rootfs.cpio.gz.u-boot (If using a ramdisk) | ||
| 63 | ``` | ||
| 64 | $ cp ${DEPLOY_DIR_IMAGE}/boot.bin /mnt/boot/boot.bin | ||
| 65 | $ cp ${DEPLOY_DIR_IMAGE}/boot.scr /mnt/boot/boot.scr | ||
| 66 | $ cp ${DEPLOY_DIR_IMAGE}/Image /mnt/boot/Image | ||
| 67 | $ cp ${DEPLOY_DIR_IMAGE}/system.dtb /mnt/boot/system.dtb | ||
| 68 | $ cp ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot /mnt/boot/rootfs.cpio.gz.u-boot | ||
| 69 | ``` | ||
| 70 | 4. Extract `core-image-minimal-${MACHINE}-${DATETIME}.rootfs.tar.gz` file content to the SD | ||
| 71 | card or eMMC device EXT4 partition. | ||
| 72 | ``` | ||
| 73 | $ sudo tar -xf ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}-${DATETIME}.rootfs.tar.gz -C /mnt/rootfs | ||
| 74 | $ sync | ||
| 75 | ``` | ||
| 76 | 5. Unmount the SD Card or eMMC device and boot from SD or eMMC boot modes. | ||
| 77 | ``` | ||
| 78 | $ umount /mnt/boot | ||
| 79 | $ umount /mnt/rootfs | ||
| 80 | ``` | ||
| 81 | |||
| 82 | ## Secondary boot from USB or SATA device | ||
| 83 | |||
| 84 | On Zynq, ZynqMP and Versal devices supports secondary boot medium such as USB or | ||
| 85 | SATA external storage devices. This means target soc primary boot medium should | ||
| 86 | be either JATG or SD/eMMC or QSPI/NOR/NAND boot modes. | ||
| 87 | |||
| 88 | > **Note:** Use actual files to copy and don't use symlink files. | ||
| 89 | |||
| 90 | 1. Create a FAT32 and EXT4 partition on SD card or eMMC device. | ||
| 91 | ``` | ||
| 92 | $ sudo parted -s /dev/sd<X> mklabel gpt mkpart primary mkpart ext4 512MiB 8GiB name 1 root | ||
| 93 | $ sudo sudo mkfs.ext4 -L root /dev/sd<X>1 | ||
| 94 | $ sudo lsblk /dev/sd<X> -o NAME,FSTYPE,LABEL,PARTLABEL | ||
| 95 | ``` | ||
| 96 | 2. Mount the FAT32 and EXT4 partition. | ||
| 97 | ``` | ||
| 98 | $ sudo mount -L root /mnt/rootfs` | ||
| 99 | ``` | ||
| 100 | 3. Extract `core-image-minimal-${MACHINE}-${DATETIME}.rootfs.tar.gz` file content | ||
| 101 | to the USB or SATA device EXT4 partition. | ||
| 102 | ``` | ||
| 103 | $ sudo tar -xf ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}-${DATETIME}.rootfs.tar.gz -C /mnt/rootfs | ||
| 104 | $ sync | ||
| 105 | ``` | ||
| 106 | 4. Unmount the USB or SATA device. | ||
| 107 | ``` | ||
| 108 | $ umount /mnt/rootfs | ||
| 109 | ``` | ||
| 110 | 5. Boot from JATG or SD/eMMC or QSPI/NOR/NAND boot modes and halt at u-boot. | ||
| 111 | 6. Set U-boot bootargs for USB or SATA rootfs and boot from run secondary boot | ||
| 112 | from USB or SATA device | ||
| 113 | ``` | ||
| 114 | U-Boot> setenv sata_root 'setenv bootargs ${bootargs} root=/dev/sd<X>1 rw rootfstype=ext4 rootwait' | ||
| 115 | U-Boot> setenv sataboot 'run sata_root; run default_bootcmd' | ||
| 116 | U-Boot> saveenv | ||
| 117 | U-Boot> run sataboot | ||
| 118 | ``` | ||
diff --git a/docs/README.booting.versal.md b/docs/README.booting.versal.md new file mode 100644 index 00000000..afdeba2b --- /dev/null +++ b/docs/README.booting.versal.md | |||
| @@ -0,0 +1,189 @@ | |||
| 1 | # Booting OS Images on Versal target boards | ||
| 2 | |||
| 3 | Booting OS images on Versal boards can be done using JTAG, SD, eMMC and QSPI boot | ||
| 4 | modes. | ||
| 5 | |||
| 6 | * [Setting Up the Target](#setting-up-the-target) | ||
| 7 | * [Booting from JTAG](#booting-from-jtag) | ||
| 8 | * [Loading boot.bin using XSCT](#loading-bootbin-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 | ||
| 16 | |||
| 17 | > **Note:** For versal-generic machine configuration file VCK190 evaluation | ||
| 18 | > board is used as reference. | ||
| 19 | |||
| 20 | 1. Connect a USB cable between the FTDI FT4232HL U20 USB-to-Quad-UART bridge USB | ||
| 21 | Type-C connector on the target and the USB port on the host machine. | ||
| 22 | 2. Connect 12V power to the VCK190 6-Pin Molex connector and turn on the board | ||
| 23 | power with the SW13 switch. | ||
| 24 | 3. Default UART terminal (serial port) settings is Speed `115200`, Data `8 bit`, | ||
| 25 | Parity `None`, Stop bits ` 1 bit` and Flow control `None`. | ||
| 26 | 4. Set the board to JTAG and other boot modes by setting the boot mode switch by | ||
| 27 | referring to board user guide. For VCK190 board Below is the configuration | ||
| 28 | boot mode settings (SW1). | ||
| 29 | |||
| 30 | > **Note:** Switch OFF = 1 = High; ON = 0 = Low | ||
| 31 | |||
| 32 | | Boot Mode | Mode Pins [3:0] | Mode SW1 [4:1] | Comments | | ||
| 33 | |-----------|-----------------|-------------------|---------------------------------------------------| | ||
| 34 | | JTAG | 0000 | ON, ON, ON, ON | Supported with or without boot module attached | | ||
| 35 | | QSPI | 0010 | ON, ON, OFF, ON | Supported only with boot module X-EBM-01 attached | | ||
| 36 | | SD | 1110 | OFF, OFF, OFF, ON | Supported with or without boot module attached | | ||
| 37 | |||
| 38 | ## Booting from JTAG | ||
| 39 | |||
| 40 | This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and | ||
| 41 | 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 | ||
| 43 | modules. | ||
| 44 | |||
| 45 | 1. Source the Vivado or Vitis tools `settings.sh` scripts. | ||
| 46 | 2. Power on the board, Open the XSCT console in the Vitis IDE by clicking the | ||
| 47 | XSCT button. Alternatively, you can also open the XSCT console by selecting | ||
| 48 | Xilinx -> XSCT Console. | ||
| 49 | ``` | ||
| 50 | $ xsct | ||
| 51 | ``` | ||
| 52 | 3. In the XSCT 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 | ||
| 54 | connect command returns the channel ID of the connection. | ||
| 55 | ``` | ||
| 56 | xsct% connect | ||
| 57 | ``` | ||
| 58 | 4. 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 | ||
| 60 | the JTAG chain, so the IDs can change from session to session. | ||
| 61 | ``` | ||
| 62 | xsct% targets | ||
| 63 | ``` | ||
| 64 | |||
| 65 | > **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. | ||
| 67 | |||
| 68 | ### Loading boot.bin using XSCT | ||
| 69 | |||
| 70 | 1. Download the boot.bin for the target using XSCT with the `device program` command. | ||
| 71 | 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 | ||
| 73 | system.dtb. This boot.bin is generated using bootgen tool by passing a .bif file. | ||
| 74 | |||
| 75 | > **Note:** In yocto by default, ${DEPLOY_DIR_IMAGE}/system.dtb is used for both | ||
| 76 | > u-boot and kernel. | ||
| 77 | |||
| 78 | ``` | ||
| 79 | xsct% targets -set -nocase -filter {name =~ "*PMC*"} | ||
| 80 | xsct% device program ${DEPLOY_DIR_IMAGE}/boot.bin | ||
| 81 | xsct% targets -set -nocase -filter {name =~ "*A72*#0"} | ||
| 82 | xsct% stop | ||
| 83 | ``` | ||
| 84 | 2. After loading boot.bin resume the execution of active target using the `con` | ||
| 85 | command in XSCT shell. | ||
| 86 | ``` | ||
| 87 | xsct% con | ||
| 88 | ``` | ||
| 89 | 3. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. | ||
| 90 | ``` | ||
| 91 | ... | ||
| 92 | Hit any key to stop autoboot: 0 | ||
| 93 | U-Boot> | ||
| 94 | ``` | ||
| 95 | |||
| 96 | ### Loading Kernel, Root Filesystem and U-boot boot script | ||
| 97 | |||
| 98 | Load the images into the target DDR/PL DRR load address i.e., | ||
| 99 | `DDR base address + <image_offset>`. | ||
| 100 | |||
| 101 | Below example uses base DDR address as 0x0 which matches in vivado address editor. | ||
| 102 | |||
| 103 | | Image Type | Base DDR Address | Image Offset | Load Address in DDR | | ||
| 104 | |--------------------|------------------|--------------|---------------------| | ||
| 105 | | Kernel | 0x0 | 0x200000 | 0x200000 | | ||
| 106 | | Device Tree | 0x0 | 0x1000 | 0x1000 | | ||
| 107 | | Rootfs | 0x0 | 0x4000000 | 0x4000000 | | ||
| 108 | | U-boot boot script | 0x0 | 0x20000000 | 0x20000000 | | ||
| 109 | |||
| 110 | > **Note:** | ||
| 111 | > 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` | ||
| 113 | > as shown `$ ln -sf ${DEPLOY_DIR_IMAGE}/<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot ${DEPLOY_DIR_IMAGE}/rootfs.cpio.gz.u-boot` | ||
| 114 | > to ensure the INITRD name in pxeboot.cfg matches with image name. | ||
| 115 | > 3. Whilst it is possible to load the images via JTAG this connection is slow and | ||
| 116 | this process can take a long time to execute (more than 10 minutes). If your | ||
| 117 | system has ethernet it is recommended that you use TFTP to load these images | ||
| 118 | using U-Boot. | ||
| 119 | > 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. | ||
| 121 | |||
| 122 | #### Using XSCT | ||
| 123 | |||
| 124 | 1. Suspend the execution of active target using `stop` command in XSCT. | ||
| 125 | ``` | ||
| 126 | xsct% stop | ||
| 127 | ``` | ||
| 128 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load | ||
| 129 | 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 | |||
| 138 | #### Using TFTP | ||
| 139 | |||
| 140 | 1. Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
| 141 | ``` | ||
| 142 | Versal> set serverip <server ip> | ||
| 143 | Versal> set ipaddr <board ip> | ||
| 144 | ``` | ||
| 145 | 2. Load the images to DDR address. Make sure images are copied to tftp directory. | ||
| 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 | |||
| 152 | ``` | ||
| 153 | ### Booting Linux | ||
| 154 | |||
| 155 | Once the images are loaded continue the execution. | ||
| 156 | |||
| 157 | 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. | ||
| 159 | ``` | ||
| 160 | xsct% con | ||
| 161 | ``` | ||
| 162 | 2. Terminate xsct shell. | ||
| 163 | ``` | ||
| 164 | xsct% exit | ||
| 165 | ``` | ||
| 166 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. | ||
| 167 | ``` | ||
| 168 | U-Boot> boot | ||
| 169 | ``` | ||
| 170 | |||
| 171 | ## Booting from SD | ||
| 172 | |||
| 173 | 1. Load the SD card into the VCK190 board in the J302 SD slot. | ||
| 174 | 2. Configure the VCK190 board to boot in SD-Boot mode (1-ON, 2-OFF, 3-OFF, 4-OFF) | ||
| 175 | by setting the SW1. Refer [Setting Up the Target](#setting-up-the-target). | ||
| 176 | 3. Follow SD boot instructions [README](README.booting.storage.md) for more details. | ||
| 177 | |||
| 178 | ## Booting from QSPI | ||
| 179 | |||
| 180 | 1. To boot VCK190 board in QSPI boot mode, you need to connect a QSPI daughter | ||
| 181 | card (part number: X_EBM-01, REV_A01). | ||
| 182 | 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 | ||
| 184 | U-Boot is running and also have boot.bin copied to DDR location using XSCT | ||
| 185 | `dow` or `tftpboot` or `fatload` command. | ||
| 186 | 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 | ||
| 188 | 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 | ||
diff --git a/docs/README.booting.zynq.md b/docs/README.booting.zynq.md new file mode 100644 index 00000000..de3fc189 --- /dev/null +++ b/docs/README.booting.zynq.md | |||
| @@ -0,0 +1,186 @@ | |||
| 1 | # Booting OS Images on Zynq target boards | ||
| 2 | |||
| 3 | Booting OS images on Zynq boards can be done using JTAG, SD, eMMC, QSPI and NAND | ||
| 4 | boot modes. | ||
| 5 | |||
| 6 | * [Setting Up the Target](#setting-up-the-target) | ||
| 7 | |||
| 8 | ## Setting Up the Target | ||
| 9 | 1. Connect a USB cable between the CP210x USB-to-UART bridge USB Mini-B on | ||
| 10 | the target and the USB port on the host machine. | ||
| 11 | 2. Connect a micro USB cable from the ZC702 board USB UART port (J17) to the USB | ||
| 12 | port on the host machine. | ||
| 13 | 3. Default UART terminal(serial port) settings is Speed `115200`, Data `8 bit`, | ||
| 14 | Parity `None`, Stop bits ` 1 bit` and Flow control `None`. | ||
| 15 | 4. Set the board to JTAG and other boot mode by setting the boot mode switch by | ||
| 16 | referring to board user guide. For zynq-generic machine configuration | ||
| 17 | file ZC702 evaluation board is used as reference and below is the | ||
| 18 | configuration boot mode settings (SW16). | ||
| 19 | |||
| 20 | > **Note:** Switch OFF = 0 = Low; ON = 1 = High | ||
| 21 | |||
| 22 | | Boot Mode | Mode Pins [0:4] | Mode SW16 [1:5] | Comments | | ||
| 23 | |-----------|-----------------|-------------------------|------------------------| | ||
| 24 | | JTAG | 00000 | OFF, OFF, OFF, OFF, OFF | PS JTAG | | ||
| 25 | | QSPI | 01000 | OFF, ON, OFF, OFF, OFF | QSPI 32-bit addressing | | ||
| 26 | | SD | 00110 | OFF, OFF, ON, ON, OFF | SD 2.0 | | ||
| 27 | |||
| 28 | ## Booting from JTAG | ||
| 29 | |||
| 30 | This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and | ||
| 31 | the associated JTAG device drivers. This also requires access to the JTAG interface | ||
| 32 | on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG | ||
| 33 | modules. | ||
| 34 | |||
| 35 | 1. Source the Vivado or Vitis tools `settings.sh` scripts. | ||
| 36 | 2. Power on the board, Open the XSCT console in the Vitis IDE by clicking the | ||
| 37 | XSCT button. Alternatively, you can also open the XSCT console by selecting | ||
| 38 | Xilinx -> XSCT Console. | ||
| 39 | ``` | ||
| 40 | $ xsct | ||
| 41 | ``` | ||
| 42 | 3. In the XSCT console, connect to the target over JTAG using the connect command. | ||
| 43 | Optionally user can use `-url` to specify the local/remote hw_server. The | ||
| 44 | connect command returns the channel ID of the connection. | ||
| 45 | ``` | ||
| 46 | xsct% connect | ||
| 47 | ``` | ||
| 48 | 4. The targets command lists the available targets and allows you to select a | ||
| 49 | target using its ID. The targets are assigned IDs as they are discovered on | ||
| 50 | the JTAG chain, so the IDs can change from session to session. | ||
| 51 | ``` | ||
| 52 | xsct% targets | ||
| 53 | ``` | ||
| 54 | |||
| 55 | > **Note:** For non-interactive usage such as scripting, you can use the `-filter` | ||
| 56 | option to select a target instead of selecting the target using its ID. | ||
| 57 | |||
| 58 | ### Loading boot components using XSCT | ||
| 59 | |||
| 60 | 1. Download the boot images for the target using XSCT with the `fpga` and `dow` | ||
| 61 | command. Zynq boot images will be located in the `${DEPLOY_DIR_IMAGE}` | ||
| 62 | directory. | ||
| 63 | |||
| 64 | > **Note:** In yocto by default, ${DEPLOY_DIR_IMAGE}/system.dtb is used for both | ||
| 65 | > u-boot and kernel. | ||
| 66 | |||
| 67 | 2. Program the bitstream or skip this step if you are loading from u-boot or linux. | ||
| 68 | ``` | ||
| 69 | xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit | ||
| 70 | ``` | ||
| 71 | 3. Select APU Cortex-A9 Core 0 to load and execute FSBL. | ||
| 72 | ``` | ||
| 73 | xsct% targets -set -nocase -filter {name =~ "arm*#0"} | ||
| 74 | xsct% catch {stop} | ||
| 75 | ``` | ||
| 76 | 5. Download and run FSBL from APU Cortex-A9 Core 0 | ||
| 77 | ``` | ||
| 78 | xsct% dow ${DEPLOY_DIR_IMAGE}/zynq_fsbl.elf | ||
| 79 | xsct% con | ||
| 80 | ``` | ||
| 81 | 7. Now download U-boot.elf and Device tree to APU and execute. | ||
| 82 | ``` | ||
| 83 | xsct% stop | ||
| 84 | xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf | ||
| 85 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 | ||
| 86 | xsct% con | ||
| 87 | ``` | ||
| 88 | |||
| 89 | 8. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. | ||
| 90 | ``` | ||
| 91 | ... | ||
| 92 | Hit any key to stop autoboot: 0 | ||
| 93 | U-Boot> | ||
| 94 | ``` | ||
| 95 | |||
| 96 | ### Loading Kernel, Root Filesystem and U-boot boot script | ||
| 97 | |||
| 98 | Load the images into the target DDR load address i.e., | ||
| 99 | `DDR base address + <image_offset>`. | ||
| 100 | |||
| 101 | Below example uses base DDR address as 0x0 which matches in vivado address editor. | ||
| 102 | |||
| 103 | | Image Type | Base DDR Address | Image Offset | Load Address in DDR | | ||
| 104 | |--------------------|------------------|---------------|---------------------| | ||
| 105 | | Kernel | 0x0 | 0x200000 | 0x200000 | | ||
| 106 | | Device Tree | 0x0 | 0x100000 | 0x100000 | | ||
| 107 | | Rootfs | 0x0 | 0x4000000 | 0x4000000 | | ||
| 108 | | U-boot boot script | 0x0 | 0x3000000 | 0x3000000 | | ||
| 109 | |||
| 110 | > **Note:** | ||
| 111 | > 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` | ||
| 113 | > as shown `$ ln -sf ${DEPLOY_DIR_IMAGE}/<target-image>-${MACHINE}-${DATETIME}.cpio.gz.u-boot ${DEPLOY_DIR_IMAGE}/rootfs.cpio.gz.u-boot` | ||
| 114 | > to ensure the INITRD name in pxeboot.cfg matches with image name. | ||
| 115 | > 3. Whilst it is possible to load the images via JTAG this connection is slow and | ||
| 116 | this process can take a long time to execute (more than 10 minutes). If your | ||
| 117 | system has ethernet it is recommended that you use TFTP to load these images | ||
| 118 | using U-Boot. | ||
| 119 | > 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. | ||
| 121 | |||
| 122 | #### Using XSCT | ||
| 123 | |||
| 124 | 1. Suspend the execution of active target using `stop` command in XSCT. | ||
| 125 | ``` | ||
| 126 | xsct% stop | ||
| 127 | ``` | ||
| 128 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load | ||
| 129 | address. | ||
| 130 | ``` | ||
| 131 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/uImage 0x200000 | ||
| 132 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 | ||
| 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 0x3000000 | ||
| 135 | ``` | ||
| 136 | |||
| 137 | #### Using TFTP | ||
| 138 | |||
| 139 | 1. Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
| 140 | ``` | ||
| 141 | Versal> set serverip <server ip> | ||
| 142 | Versal> set ipaddr <board ip> | ||
| 143 | ``` | ||
| 144 | 2. Load the images to DDR address. Make sure images are copied to tftp directory. | ||
| 145 | ``` | ||
| 146 | U-Boot> tftpboot 0x200000 ${TFTPDIR}/uImage | ||
| 147 | U-Boot> tftpboot 0x100000 ${TFTPDIR}/system.dtb | ||
| 148 | U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot | ||
| 149 | U-Boot> tftpboot 0x3000000 ${TFTPDIR}/boot.scr | ||
| 150 | |||
| 151 | ``` | ||
| 152 | ### Booting Linux | ||
| 153 | |||
| 154 | Once the images are loaded continue the execution. | ||
| 155 | |||
| 156 | 1. After loading images resume the execution of active target using the `con` | ||
| 157 | command in XSCT shell, Skip step 1 for if you have used TFTP to load images. | ||
| 158 | ``` | ||
| 159 | xsct% con | ||
| 160 | ``` | ||
| 161 | 2. Terminate xsct shell. | ||
| 162 | ``` | ||
| 163 | xsct% exit | ||
| 164 | ``` | ||
| 165 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. | ||
| 166 | ``` | ||
| 167 | U-Boot> boot | ||
| 168 | ``` | ||
| 169 | |||
| 170 | ## Booting from SD | ||
| 171 | |||
| 172 | 1. Load the SD card into the ZC702 board in the SD slot. | ||
| 173 | 2. Configure the ZC702 board to boot in SD-Boot mode (1-OFF, 2-OFF, 3-ON, 4-ON, 5-OFF) | ||
| 174 | by setting the SW6. Refer [Setting Up the Target](#setting-up-the-target). | ||
| 175 | 3. Follow SD boot instructions [README](README.booting.storage.md) for more details. | ||
| 176 | |||
| 177 | ## Booting from QSPI | ||
| 178 | |||
| 179 | 1. To boot ZC702 board in QSPI boot mode, Power on the ZCU102 board and boot | ||
| 180 | using JTAG or SD boot mode, to ensure that U-Boot is running and also have | ||
| 181 | boot.bin copied to DDR location using XSCT `dow` or `tftpboot` or `fatload` | ||
| 182 | command. | ||
| 183 | 2. Follow Flash boot instructions [README](README.booting.flash.md) for more details. | ||
| 184 | 3. After flashing the images, turn off the power switch on the board, and change | ||
| 185 | the SW16 boot mode pin settings to QSPI boot mode (1-OFF, 2-ON, 3-OFF, 4-OFF, 5-OFF) | ||
| 186 | by setting the SW16. Refer [Setting Up the Target](#setting-up-the-target). \ No newline at end of file | ||
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 | |||
| 3 | Booting OS images on ZynqMP boards can be done using JTAG, SD, eMMC, QSPI and | ||
| 4 | NAND 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 | ||
| 16 | 1. 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. | ||
| 18 | 2. Connect a micro USB cable from the ZCU102 board USB UART port (J83) to the USB | ||
| 19 | port on the host machine. | ||
| 20 | 3. Default UART terminal(serial port) settings is Speed `115200`, Data `8 bit`, | ||
| 21 | Parity `None`, Stop bits ` 1 bit` and Flow control `None`. | ||
| 22 | 4. 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 | |||
| 37 | This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and | ||
| 38 | 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 | ||
| 40 | modules. | ||
| 41 | |||
| 42 | 1. Source the Vivado or Vitis tools `settings.sh` scripts. | ||
| 43 | 2. 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 | ``` | ||
| 49 | 3. 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 | ``` | ||
| 53 | xsct% connect | ||
| 54 | ``` | ||
| 55 | 4. 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 | ``` | ||
| 59 | xsct% 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 | |||
| 67 | 1. 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 | |||
| 74 | 2. Program the bitstream or skip this step if you are loading from u-boot or linux. | ||
| 75 | ``` | ||
| 76 | xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit | ||
| 77 | ``` | ||
| 78 | 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). | ||
| 80 | ``` | ||
| 81 | xsct% targets -set -nocase -filter {name =~ "*PSU*"} | ||
| 82 | xsct% mask_write 0xFFCA0038 0x1C0 0x1C0 | ||
| 83 | ``` | ||
| 84 | 3. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU | ||
| 85 | firmware. | ||
| 86 | ``` | ||
| 87 | xsct% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"} | ||
| 88 | xsct% catch {stop} | ||
| 89 | xsct% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf | ||
| 90 | xsct% con | ||
| 91 | ``` | ||
| 92 | 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 | ||
| 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 | ``` | ||
| 98 | xsct% targets -set -nocase -filter {name =~ "*A53*#0"} | ||
| 99 | xsct% rst -processor -clear-registers | ||
| 100 | ``` | ||
| 101 | 6. Download and run FSBL from APU Cortex-A53 Core 0 | ||
| 102 | ``` | ||
| 103 | xsct% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf | ||
| 104 | xsct% con | ||
| 105 | ``` | ||
| 106 | 7. Now download TF-A, U-boot.elf and Device tree to APU and execute. | ||
| 107 | ``` | ||
| 108 | xsct% stop | ||
| 109 | xsct% dow ${DEPLOY_DIR_IMAGE}/bl31.elf | ||
| 110 | xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf | ||
| 111 | xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000 | ||
| 112 | xsct% con | ||
| 113 | ``` | ||
| 114 | |||
| 115 | 8. In the target Serial Terminal, press any key to stop the U-Boot auto-boot. | ||
| 116 | ``` | ||
| 117 | ... | ||
| 118 | Hit any key to stop autoboot: 0 | ||
| 119 | U-Boot> | ||
| 120 | ``` | ||
| 121 | |||
| 122 | ### Loading Kernel, Root Filesystem and U-boot boot script | ||
| 123 | |||
| 124 | Load the images into the target DDR/PL DRR load address i.e., | ||
| 125 | `DDR base address + <image_offset>`. | ||
| 126 | |||
| 127 | Below 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 | ||
| 142 | this process can take a long time to execute (more than 10 minutes). If your | ||
| 143 | system has ethernet it is recommended that you use TFTP to load these images | ||
| 144 | using 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 | |||
| 150 | 1. Suspend the execution of active target using `stop` command in XSCT. | ||
| 151 | ``` | ||
| 152 | xsct% stop | ||
| 153 | ``` | ||
| 154 | 2. Using the `dow` command to load the images into the target DDR/PL DDR load | ||
| 155 | 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 | |||
| 163 | #### Using TFTP | ||
| 164 | |||
| 165 | 1. Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
| 166 | ``` | ||
| 167 | Versal> set serverip <server ip> | ||
| 168 | Versal> set ipaddr <board ip> | ||
| 169 | ``` | ||
| 170 | 2. Load the images to DDR address. Make sure images are copied to tftp directory. | ||
| 171 | ``` | ||
| 172 | U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image | ||
| 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 | |||
| 177 | ``` | ||
| 178 | ### Booting Linux | ||
| 179 | |||
| 180 | Once the images are loaded continue the execution. | ||
| 181 | |||
| 182 | 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. | ||
| 184 | ``` | ||
| 185 | xsct% con | ||
| 186 | ``` | ||
| 187 | 2. Terminate xsct shell. | ||
| 188 | ``` | ||
| 189 | xsct% exit | ||
| 190 | ``` | ||
| 191 | 3. In the target Serial Terminal, from U-Boot prompt run `boot` command. | ||
| 192 | ``` | ||
| 193 | U-Boot> boot | ||
| 194 | ``` | ||
| 195 | |||
| 196 | ## Booting from SD | ||
| 197 | |||
| 198 | 1. Load the SD card into the ZCU102 board in the J100 SD slot. | ||
| 199 | 2. 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). | ||
| 201 | 3. Follow SD boot instructions [README](README.booting.storage.md) for more details. | ||
| 202 | |||
| 203 | ## Booting from QSPI | ||
| 204 | |||
| 205 | 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 | ||
| 207 | boot.bin copied to DDR location using XSCT `dow` or `tftpboot` or `fatload` | ||
| 208 | command. | ||
| 209 | 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 | ||
| 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 | ||
