summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/README.booting.flash.md133
-rw-r--r--docs/README.booting.microblaze.md170
-rw-r--r--docs/README.booting.storage.md118
-rw-r--r--docs/README.booting.versal.md189
-rw-r--r--docs/README.booting.zynq.md186
-rw-r--r--docs/README.booting.zynqmp.md212
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
3Booting 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
101. 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).
142. 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
26This section demonstrates the booting OS images from QSPI boot mode. For this,
27you 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
311. 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
422. 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```
733. Set the U-boot boot script variables to match the flash partition offsets in
74 local.conf
75```
76QSPI_KERNEL_OFFSET = "0x1E40000"
77QSPI_KERNEL_SIZE = "0x2040000"
78QSPI_RAMDISK_OFFSET = "0x4000000"
79QSPI_RAMDISK_SIZE = "0x4000000"
80```
814. Build the images and make sure images are copied to tftp directory.
825. Once images are built, to ensure taget is booted using JTAG or SD boot modes.
836. Also have boot.bin copied to DDR location using XSCT `dow` or `tftpboot` or
84 `fatload` command.
857. 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
89U-Boot> sf probe 0 0 0
90
91# Erase the boot partition
92U-Boot> sf erase 0x0 0x1E00000
93
94# Copy the boot.bin to DDR location using tftpboot
95U-Boot> tftpboot 0x10000000 ${TFTPDIR}/boot.bin
96
97# Write boot.bin file image to flash partition
98U-Boot> sf write 0x10000000 0x0 ${filesize}
99
100# Erase the bootenv partition for env storage (saveenv).
101U-Boot> sf erase 0x1E00000 0x1E40000
102
103# Erase the kernel partition
104U-Boot> sf erase 0x1E40000 0x2040000
105
106# Copy the Image file to DDR location using tftpboot
107U-Boot> tftpboot 0x10000000 ${TFTPDIR}/Image
108
109# Write kernel image to flash partition
110U-Boot> sf write 0x10000000 0x1E40000 ${filesize}
111
112# Erase the bootscr partition
113U-Boot> sf erase 0x3E80000 0x1800000
114
115# Copy the boot.scr file to DDR location using tftpboot
116U-Boot> tftpboot 0x10000000 ${TFTPDIR}/boot.scr
117
118# Write boot.scr file to flash partition
119U-Boot> sf write 0x10000000 0x3E80000 ${filesize}
120
121# Erase the rootfs partition
122U-Boot> sf erase 0x4000000 0x4000000
123
124# Copy the rootfs.cpio.gz.u-boot file to DDR location using tftpboot
125U-Boot> tftpboot 0x10000000 ${TFTPDIR}/rootfs.cpio.gz.u-boot
126
127# Write rootfs image to flash partition
128U-Boot> sf write 0x10000000 0x4000000 ${filesize}
129```
1308. After flashing the images, turn off the board and change the boot mode pin
131 settings to QSPI boot mode.
1329. 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
3Booting 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
181. Connect a USB cable between the USB-JTAG, USB-UART connector on the target
19 and the USB port on the host machine.
202. Connect 12V power to the KCU105 6-Pin power supply to J15 and turn on the board
21 power with the SW1 switch.
223. Default UART terminal (serial port) settings is Speed `115200`, Data `8 bit`,
23 Parity `None`, Stop bits ` 1 bit` and Flow control `None`.
244. 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
37This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and
38the associated JTAG device drivers. This also requires access to the JTAG interface
39on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG
40modules.
41
421. Source the Vivado or Vitis tools `settings.sh` scripts.
432. 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```
493. 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```
53xsct% connect
54```
554. 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```
59xsct% 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
68bitstream will be located in the `${DEPLOY_DIR_IMAGE}` directory. Optionally user
69can use `fpga -no-revision-check` to skip FPGA silicon revision.
70
71```
72xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/system-${MACHINE}.bit
73xsct% after 2000
74xsct% targets -set -nocase -filter {name =~ "microblaze*#0"}
75xsct% catch {stop}
76xsct% after 1000
77```
78### Loading U-boot using XSCT
79
801. Download `u-boot.elf` to the target CPU using XSCT. Microblaze u-boot.elf will be
81located in the `${DEPLOY_DIR_IMAGE}` directory. Before u-boot.elf is loaded suspend
82the execution of active target using `stop` command.
83```
84xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf
85```
862. After loading u-boot.elf resume the execution of active target using the `con`
87command in XSCT shell.
88```
89xsct% con
90```
913. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
92```
93...
94Hit any key to stop autoboot: 0
95U-Boot>
96```
97
98### Loading Kernel, Device tree, Root Filesystem and U-boot boot script
99
100Load the images into the target DDR/MIG load address i.e.,
101`DDR base address + <image_offset>`. MicroBlaze U-boot boot script(boot.scr)
102load address is calculated as `DDR base address + DDR Size - 0xe00000`
103
104Below example uses base DDR address as 0x80000000 and DDR size as 0x80000000
105which 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
120this process can take a long time to execute (more than 10 minutes). If your
121system has ethernet it is recommended that you use TFTP to load these images
122using U-Boot.
123
124#### Using XSCT
125
1261. Suspend the execution of active target using `stop` command in XSCT.
127```
128xsct% stop
129```
1302. Using the `dow` command to load the images into the target DDR/MIG
131load address.
132```
133xsct% dow -data ${DEPLOY_DIR_IMAGE}/linux.bin.ub 0x80000000
134xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x81e00000
135xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x82e00000
136xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0xff200000
137```
138
139#### Using TFTP
140
1411. Configure the `ipaddr` and `serverip` of the U-Boot environment.
142```
143U-Boot> set serverip <server ip>
144U-Boot> set ipaddr <board ip>
145```
1462. Load the images to DDR address. Make sure images are copied to tftp directory.
147```
148U-Boot> tftpboot 0x80000000 ${TFTPDIR}/linux.bin.ub
149U-Boot> tftpboot 0x81e00000 ${TFTPDIR}/system.dtb
150U-Boot> tftpboot 0x82e00000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot
151U-Boot> tftpboot 0xff200000 ${TFTPDIR}/boot.scr
152```
153
154### Booting Linux
155
156Once the images are loaded continue the execution.
157
1581. After loading images resume the execution of active target using the `con`
159command in XSCT shell, Skip step 1 for if you have used TFTP to load images.
160```
161xsct% con
162```
1632. Terminate xsct shell.
164```
165xsct% exit
166```
1673. In the target Serial Terminal, from U-Boot prompt run `boot` command.
168```
169U-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
3Booting 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
13Setup the card with the first partition formatted as FAT16/32. If you intend to
14boot with the root filesystem located on the SD card, also create a second
15partition formatted as EXT4.
16
17It is recommended that the first partition be at least 512MB in size, however
18this value will depend on whether using a ramdisk for the root filesystem and
19how large the ramdisk is.
20
21This section describes how to manually prepare and populate an SD card image.
22There are automation tools in OpenEmbedded that can generate disk images already
23formatted and prepared such that they can be written directly to a disk. Refer
24to the Yocto Project Manual for more details:
25https://docs.yoctoproject.org/4.1.2/singleindex.html#creating-partitioned-images-using-wic
26
27## Writing image to SD or eMMC device
28
29There are two ways to write the images to SD card or eMMC device.
30
311. 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>.
332. 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
38Write 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
471. 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```
532. Mount the FAT32 and EXT4 partition.
54```
55$ sudo mount -L boot /mnt/boot; sudo mount -L root /mnt/rootfs`
56```
573. 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```
704. 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```
765. 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
84On Zynq, ZynqMP and Versal devices supports secondary boot medium such as USB or
85SATA external storage devices. This means target soc primary boot medium should
86be 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
901. 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```
962. Mount the FAT32 and EXT4 partition.
97```
98$ sudo mount -L root /mnt/rootfs`
99```
1003. 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```
1064. Unmount the USB or SATA device.
107```
108$ umount /mnt/rootfs
109```
1105. Boot from JATG or SD/eMMC or QSPI/NOR/NAND boot modes and halt at u-boot.
1116. Set U-boot bootargs for USB or SATA rootfs and boot from run secondary boot
112 from USB or SATA device
113```
114U-Boot> setenv sata_root 'setenv bootargs ${bootargs} root=/dev/sd<X>1 rw rootfstype=ext4 rootwait'
115U-Boot> setenv sataboot 'run sata_root; run default_bootcmd'
116U-Boot> saveenv
117U-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
3Booting OS images on Versal boards can be done using JTAG, SD, eMMC and QSPI boot
4modes.
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
201. 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.
222. Connect 12V power to the VCK190 6-Pin Molex connector and turn on the board
23 power with the SW13 switch.
243. Default UART terminal (serial port) settings is Speed `115200`, Data `8 bit`,
25 Parity `None`, Stop bits ` 1 bit` and Flow control `None`.
264. 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
40This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and
41the associated JTAG device drivers. This also requires access to the JTAG interface
42on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG
43modules.
44
451. Source the Vivado or Vitis tools `settings.sh` scripts.
462. 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```
523. 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```
56xsct% connect
57```
584. 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```
62xsct% 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
701. Download the boot.bin for the target using XSCT with the `device program` command.
71Versal boot.bin will be located in the `${DEPLOY_DIR_IMAGE}` directory. Default
72boot.bin consists of boot pdi, plm.elf, psm.elf, bl31.elf, u-boot.elf and
73system.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```
79xsct% targets -set -nocase -filter {name =~ "*PMC*"}
80xsct% device program ${DEPLOY_DIR_IMAGE}/boot.bin
81xsct% targets -set -nocase -filter {name =~ "*A72*#0"}
82xsct% stop
83```
842. After loading boot.bin resume the execution of active target using the `con`
85command in XSCT shell.
86```
87xsct% con
88```
893. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
90```
91...
92Hit any key to stop autoboot: 0
93U-Boot>
94```
95
96### Loading Kernel, Root Filesystem and U-boot boot script
97
98Load the images into the target DDR/PL DRR load address i.e.,
99`DDR base address + <image_offset>`.
100
101Below 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
116this process can take a long time to execute (more than 10 minutes). If your
117system has ethernet it is recommended that you use TFTP to load these images
118using 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
1241. Suspend the execution of active target using `stop` command in XSCT.
125```
126xsct% stop
127```
1282. Using the `dow` command to load the images into the target DDR/PL DDR load
129 address.
130```
131xsct% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000
132xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x1000
133xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000
134xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
135xsct% targets -set -nocase -filter {name =~ "*A72*#0"}
136```
137
138#### Using TFTP
139
1401. Configure the `ipaddr` and `serverip` of the U-Boot environment.
141```
142Versal> set serverip <server ip>
143Versal> set ipaddr <board ip>
144```
1452. Load the images to DDR address. Make sure images are copied to tftp directory.
146```
147U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image
148U-Boot> tftpboot 0x1000 ${TFTPDIR}/system.dtb
149U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot
150U-Boot> tftpboot 0x20000000 ${TFTPDIR}/boot.scr
151
152```
153### Booting Linux
154
155Once the images are loaded continue the execution.
156
1571. After loading images resume the execution of active target using the `con`
158command in XSCT shell, Skip step 1 for if you have used TFTP to load images.
159```
160xsct% con
161```
1622. Terminate xsct shell.
163```
164xsct% exit
165```
1663. In the target Serial Terminal, from U-Boot prompt run `boot` command.
167```
168U-Boot> boot
169```
170
171## Booting from SD
172
1731. Load the SD card into the VCK190 board in the J302 SD slot.
1742. 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).
1763. Follow SD boot instructions [README](README.booting.storage.md) for more details.
177
178## Booting from QSPI
179
1801. To boot VCK190 board in QSPI boot mode, you need to connect a QSPI daughter
181 card (part number: X_EBM-01, REV_A01).
1822. With the card powered off, install the QSPI daughter card.
1833. 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.
1864. Follow Flash boot instructions [README](README.booting.flash.md) for more details.
1875. 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
3Booting OS images on Zynq boards can be done using JTAG, SD, eMMC, QSPI and NAND
4boot modes.
5
6* [Setting Up the Target](#setting-up-the-target)
7
8## Setting Up the Target
91. 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.
112. Connect a micro USB cable from the ZC702 board USB UART port (J17) to the USB
12 port on the host machine.
133. Default UART terminal(serial port) settings is Speed `115200`, Data `8 bit`,
14 Parity `None`, Stop bits ` 1 bit` and Flow control `None`.
154. 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
30This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and
31the associated JTAG device drivers. This also requires access to the JTAG interface
32on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG
33modules.
34
351. Source the Vivado or Vitis tools `settings.sh` scripts.
362. 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```
423. 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```
46xsct% connect
47```
484. 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```
52xsct% 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
601. 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
672. Program the bitstream or skip this step if you are loading from u-boot or linux.
68```
69xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit
70```
713. Select APU Cortex-A9 Core 0 to load and execute FSBL.
72```
73xsct% targets -set -nocase -filter {name =~ "arm*#0"}
74xsct% catch {stop}
75```
765. Download and run FSBL from APU Cortex-A9 Core 0
77```
78xsct% dow ${DEPLOY_DIR_IMAGE}/zynq_fsbl.elf
79xsct% con
80```
817. Now download U-boot.elf and Device tree to APU and execute.
82```
83xsct% stop
84xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf
85xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
86xsct% con
87```
88
898. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
90```
91...
92Hit any key to stop autoboot: 0
93U-Boot>
94```
95
96### Loading Kernel, Root Filesystem and U-boot boot script
97
98Load the images into the target DDR load address i.e.,
99`DDR base address + <image_offset>`.
100
101Below 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
116this process can take a long time to execute (more than 10 minutes). If your
117system has ethernet it is recommended that you use TFTP to load these images
118using 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
1241. Suspend the execution of active target using `stop` command in XSCT.
125```
126xsct% stop
127```
1282. Using the `dow` command to load the images into the target DDR/PL DDR load
129 address.
130```
131xsct% dow -data ${DEPLOY_DIR_IMAGE}/uImage 0x200000
132xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
133xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000
134xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x3000000
135```
136
137#### Using TFTP
138
1391. Configure the `ipaddr` and `serverip` of the U-Boot environment.
140```
141Versal> set serverip <server ip>
142Versal> set ipaddr <board ip>
143```
1442. Load the images to DDR address. Make sure images are copied to tftp directory.
145```
146U-Boot> tftpboot 0x200000 ${TFTPDIR}/uImage
147U-Boot> tftpboot 0x100000 ${TFTPDIR}/system.dtb
148U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot
149U-Boot> tftpboot 0x3000000 ${TFTPDIR}/boot.scr
150
151```
152### Booting Linux
153
154Once the images are loaded continue the execution.
155
1561. After loading images resume the execution of active target using the `con`
157command in XSCT shell, Skip step 1 for if you have used TFTP to load images.
158```
159xsct% con
160```
1612. Terminate xsct shell.
162```
163xsct% exit
164```
1653. In the target Serial Terminal, from U-Boot prompt run `boot` command.
166```
167U-Boot> boot
168```
169
170## Booting from SD
171
1721. Load the SD card into the ZC702 board in the SD slot.
1732. 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).
1753. Follow SD boot instructions [README](README.booting.storage.md) for more details.
176
177## Booting from QSPI
178
1791. 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.
1832. Follow Flash boot instructions [README](README.booting.flash.md) for more details.
1843. 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
3Booting OS images on ZynqMP boards can be done using JTAG, SD, eMMC, QSPI and
4NAND 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
161. 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.
182. Connect a micro USB cable from the ZCU102 board USB UART port (J83) to the USB
19 port on the host machine.
203. Default UART terminal(serial port) settings is Speed `115200`, Data `8 bit`,
21 Parity `None`, Stop bits ` 1 bit` and Flow control `None`.
224. 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
37This boot flow requires the use of the AMD Xilinx tools, specifically XSCT and
38the associated JTAG device drivers. This also requires access to the JTAG interface
39on the board, a number of AMD Xilinx and third-party boards come with on-board JTAG
40modules.
41
421. Source the Vivado or Vitis tools `settings.sh` scripts.
432. 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```
493. 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```
53xsct% connect
54```
554. 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```
59xsct% 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
671. 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
742. Program the bitstream or skip this step if you are loading from u-boot or linux.
75```
76xsct% fpga -no-revision-check ${DEPLOY_DIR_IMAGE}/download.bit
77```
783. 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```
81xsct% targets -set -nocase -filter {name =~ "*PSU*"}
82xsct% mask_write 0xFFCA0038 0x1C0 0x1C0
83```
843. Verify if the PMU MB target is listed under the PMU device. Now, load the PMU
85 firmware.
86```
87xsct% targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}
88xsct% catch {stop}
89xsct% dow ${DEPLOY_DIR_IMAGE}/pmufw.elf
90xsct% con
91```
925. 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```
98xsct% targets -set -nocase -filter {name =~ "*A53*#0"}
99xsct% rst -processor -clear-registers
100```
1016. Download and run FSBL from APU Cortex-A53 Core 0
102```
103xsct% dow ${DEPLOY_DIR_IMAGE}/zynqmp_fsbl.elf
104xsct% con
105```
1067. Now download TF-A, U-boot.elf and Device tree to APU and execute.
107```
108xsct% stop
109xsct% dow ${DEPLOY_DIR_IMAGE}/bl31.elf
110xsct% dow ${DEPLOY_DIR_IMAGE}/u-boot.elf
111xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
112xsct% con
113```
114
1158. In the target Serial Terminal, press any key to stop the U-Boot auto-boot.
116```
117...
118Hit any key to stop autoboot: 0
119U-Boot>
120```
121
122### Loading Kernel, Root Filesystem and U-boot boot script
123
124Load the images into the target DDR/PL DRR load address i.e.,
125`DDR base address + <image_offset>`.
126
127Below 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
142this process can take a long time to execute (more than 10 minutes). If your
143system has ethernet it is recommended that you use TFTP to load these images
144using 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
1501. Suspend the execution of active target using `stop` command in XSCT.
151```
152xsct% stop
153```
1542. Using the `dow` command to load the images into the target DDR/PL DDR load
155 address.
156```
157xsct% dow -data ${DEPLOY_DIR_IMAGE}/Image 0x200000
158xsct% dow -data ${DEPLOY_DIR_IMAGE}/system.dtb 0x100000
159xsct% dow -data ${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.cpio.gz.u-boot 0x4000000
160xsct% dow -data ${DEPLOY_DIR_IMAGE}/boot.scr 0x20000000
161```
162
163#### Using TFTP
164
1651. Configure the `ipaddr` and `serverip` of the U-Boot environment.
166```
167Versal> set serverip <server ip>
168Versal> set ipaddr <board ip>
169```
1702. Load the images to DDR address. Make sure images are copied to tftp directory.
171```
172U-Boot> tftpboot 0x200000 ${TFTPDIR}/Image
173U-Boot> tftpboot 0x100000 ${TFTPDIR}/system.dtb
174U-Boot> tftpboot 0x4000000 ${TFTPDIR}/core-image-minimal-${MACHINE}.cpio.gz.u-boot
175U-Boot> tftpboot 0x20000000 ${TFTPDIR}/boot.scr
176
177```
178### Booting Linux
179
180Once the images are loaded continue the execution.
181
1821. After loading images resume the execution of active target using the `con`
183command in XSCT shell, Skip step 1 for if you have used TFTP to load images.
184```
185xsct% con
186```
1872. Terminate xsct shell.
188```
189xsct% exit
190```
1913. In the target Serial Terminal, from U-Boot prompt run `boot` command.
192```
193U-Boot> boot
194```
195
196## Booting from SD
197
1981. Load the SD card into the ZCU102 board in the J100 SD slot.
1992. 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).
2013. Follow SD boot instructions [README](README.booting.storage.md) for more details.
202
203## Booting from QSPI
204
2051. 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.
2092. Follow Flash boot instructions [README](README.booting.flash.md) for more details.
2103. After flashing the images, turn off the power switch on the board, and change
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