summaryrefslogtreecommitdiffstats
path: root/docs/README.booting.storage.md
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-02-26 23:12:20 -0700
committerMark Hatle <mark.hatle@amd.com>2023-02-28 08:42:28 -0600
commitfa7d089a2020ad56c50394d2b35018ff97f52589 (patch)
tree1f2b2c4fa4b9b4d5e93a16275aedfe3bc18da1bd /docs/README.booting.storage.md
parent9e1cd5cbe90929bbbd9d72106fc7d5bab17111b5 (diff)
downloadmeta-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/README.booting.storage.md')
-rw-r--r--docs/README.booting.storage.md118
1 files changed, 118 insertions, 0 deletions
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```