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/README.booting.storage.md | |
| 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/README.booting.storage.md')
| -rw-r--r-- | docs/README.booting.storage.md | 118 |
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 | |||
| 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 | ``` | ||
