Installing Yocto to the SOM Internal Storage¶
Introduction¶
The VAR-SOM-AM62 can boot from an SD card or from internal storage.
The Variscite VAR-SOM-AM62 comes with eMMC, which holds U-Boot, the kernel image and the ext4 root file system.
eMMC structure¶
The eMMC has the following structure:
| Offset Address | Offset (MiB) |
Size
|
Partition
|
Description
|
|---|---|---|---|---|
| 0x0 | 0 | 1 MiB | Reserved | Reserved |
| 0x100000 |
1 MiB
|
40 MiB | Boot | Boot partition containing U-Boot images |
| 0x2B00000 | 43 MiB | 1 MiB | U-Boot Env | Reserved for U-Boot environment. |
| 0x2C00000 | 44 MiB | Rest of eMMC |
rootfs
|
An ext4 partition containing the root file system (including Linux image and the device tree blobs under /boot |
For example, an 16 GiB eMMC has the following layout:
root@am62x-var-som:~# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14.69 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe3dbe120
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 83967 81920 40M c W95 FAT32 (LBA)
/dev/mmcblk0p2 90112 30777343 30687232 14.6G 83 Linux
Installing the Yocto binaries¶
If you followed the Create a Recovery SD card steps, the Yocto binaries and the flashing scripts will be included in your SD card.
The flashing scripts are easy-to-use example scripts for flashing images into NAND flash / eMMC.
There is also a section below describing how to flash the images manually.
Images Locations¶
The following is the directory structure of the SD card, which includes the installation scripts and files for installation:
/usr/bin/install_yocto.sh
/usr/bin/echos.sh
/opt/images/Yocto/
/opt/images/Yocto/boot
/opt/images/Yocto/boot/u-boot.img
/opt/images/Yocto/boot/tiboot3.bin
/opt/images/Yocto/boot/tispl.bin
/opt/images/Yocto/boot/uEnv.txt
/opt/images/Yocto/rootfs.tar.zst
Prepare the images for flashing to eMMC¶
If you followed the Create a Recovery SD card steps, the Yocto binaries and the flashing scripts are already included in the SD card.
If you wish to add them manually, you can follow these steps to manually copy the mentioned yocto-built binaries to the SD card. The following steps assume the SD card is mounted on /media/rootfs:
Setup environment variables:
Make directory for Yocto images:
Copy the images:
U-Boot:
$ sudo cp ${YOCTO_IMGS_PATH}/tiboot3.bin ${P2_MOUNT_DIR}/opt/images/Yocto/boot/tiboot3.bin
$ sudo cp ${YOCTO_IMGS_PATH}/tispl.bin ${P2_MOUNT_DIR}/opt/images/Yocto/boot/
$ sudo cp ${YOCTO_IMGS_PATH}/u-boot.img ${P2_MOUNT_DIR}/opt/images/Yocto/boot/
$ sudo cp ${YOCTO_IMGS_PATH}/uEnv.txt ${P2_MOUNT_DIR}/opt/images/Yocto/boot/
Filesystem:
$ sudo cp ${YOCTO_IMGS_PATH}/var-default-image-am62x-var-som.tar.zst ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.tar.zst
Flashing eMMC using scripts¶
The flashing scripts are located on the SD card at /usr/bin/:
Flashing eMMC manually¶
Flashing the eMMC requires several steps including partitioning, file system formatting and image extraction.
Varsicite recommends using the provided scripts to perform this task. To flash it manually, you may review Variscite's example script: https://github.com/varigit/meta-variscite-sdk-ti/blob/scarthgap_11.00.09.04_var01/scripts/variscite/am6_install_yocto.sh