Review custom MACHINE configuration - ArrowElectronics/arrow-soc-workshops GitHub Wiki
The MACHINE configuration file includes the following
- custom MACHINE name
- u-boot build configuration selection
- SD card image definition
- extlinux.conf boot configuration
Open the file my_yocto_project/poky/meta-my-custom-soc-board/conf/machine/my-custom-soc-board.conf in the default editor, gedit.
KMACHINE = "my-custom-soc-board" defines the MACHINE name. This is the MACHINE name that will be referenced in build/conf/local.conf.
UBOOT_CONFIG ??= "my-custom-soc-board" selects the u-boot build configuration. This is defined in the u-boot-socfpga-common.inc file in the recipes-bsp/u-boot sub-directory.
Yocto creates a complete SD card image file for the user. The image is created with FAT, binary and Linux EXT4 partition types. The partitions are specified by the following lines in the my-custom-soc-board.conf file and the contents of the sdimage-cyclone5-arria5.wks wic kickstart file.
WKS_FILE ?= "sdimage-cyclone5-arria5.wks"
IMAGE_FSTYPES +="wic"
The partition specifics are listed in the sdimage-cyclone5-arria5.wks file which is located in the wic sub-directory. The contents are listed below
# short-description: Create an SD card image for the Cyclone 5 and Arria 5 SoCs
# long-description: Create an SD card image for the Cyclone 5 and Arria 5 SoCs.
# Boot files are located in the first vfat partition and u-Boot is located in
# the second partition. The Linux rootfs is located in the third partition
part --source bootimg-partition --ondisk mmcblk -fstype=vfat --label boot --active --align 4 --size 16
part --source rawcopy --sourceparams="file=u-boot-with-spl.sfp" --ondisk mmcblk --system-id=a2 --align 4
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4
The following lines in the my-custom-soc-board.conf file define the contents of the FAT partition.
IMAGE_BOOT_FILES ?= "
${FPGA_CONFIG}
${KERNEL_DEVICETREE}
${KERNEL_IMAGETYPE}
extlinux.conf;extlinux/extlinux.conf
A snapshot of the partition contents is shown below.
Name | Description |
---|---|
extlinux sub-directory containing the extlinux.conf file | u-boot boot configuration file |
socfpga_cyclone5_my_custom_soc_board.dtb | Linux flattened devicetree file |
soc_system.rbf | FPGA configuration Raw Binary File |
zImage | Linux kernel |
u-boot can be configured to use the EXTLINUX boot methodology. Yocto automatically creates an extlinux.conf bootloader configuration file. This configuration file provides u-boot with the names and locations of the files needed to boot Linux. For more information examine the section titled "Boot Configuration Files" in the u-boot README.distro file
extlinux.conf is created by Yocto based on the following portion of the my-custom-soc-board.conf file utilizing the uboot-extlinux-config.bbclass
UBOOT_EXTLINUX ?= "1"
UBOOT_EXTLINUX_LABELS ?= "default"
UBOOT_EXTLINUX_DEFAULT_LABEL ?= "my custom soc board"
UBOOT_EXTLINUX_FDT_default ?= "../socfpga_cyclone5_my_custom_soc_board.dtb"
UBOOT_EXTLINUX_ROOT_default ?= "root=/dev/mmcblk0p3"
UBOOT_EXTLINUX_MENU_DESCRIPTION_default ?= "my custom soc board"
UBOOT_EXTLINUX_KERNEL_IMAGE_default ?= "../${KERNEL_IMAGETYPE}"
UBOOT_EXTLINUX_FDTDIR_default ?= "../"
UBOOT_EXTLINUX_KERNEL_ARGS_default ?= "rootwait rw earlycon"
This is a listing of the resultant extlinux.conf configuration file Yocto will create for the custom board
#Generic Distro Configuration file generated by OpenEmbedded
LABEL my custom soc board
KERNEL ../zImage
FDT ../socfpga_cyclone5_my_custom_soc_board.dtb
APPEND root=/dev/mmcblk0p3 rootwait rw earlycon console=${console},${baudrate}