1.8.2. BSP Machine Configuration Example

As mentioned earlier in this section, the existence of a machine configuration file is what makes a layer a BSP layer as compared to a general or kernel layer.

Machine configuration files exist in the bsp_layer/conf/machine/ directory of the layer:

     bsp_layer/conf/machine/machine.conf
            

For example, the machine configuration file for the BeagleBone and BeagleBone Black development boards is located in the container layer poky/meta-yocto-bsp/conf/machine and is named beaglebone-yocto.conf:

     #@TYPE: Machine
     #@NAME: Beaglebone-yocto machine
     #@DESCRIPTION: Reference machine configuration for http://beagleboard.org/bone and http://beagleboard.org/black boards

     PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
     XSERVER ?= "xserver-xorg \
                xf86-video-modesetting \
                "

     MACHINE_EXTRA_RRECOMMENDS = "kernel-modules kernel-devicetree"

     EXTRA_IMAGEDEPENDS += "u-boot"

     DEFAULTTUNE ?= "cortexa8hf-neon"
     include conf/machine/include/tune-cortexa8.inc

     IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
     EXTRA_IMAGECMD_jffs2 = "-lnp "
     WKS_FILE ?= "beaglebone-yocto.wks"
     IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
     do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"

     SERIAL_CONSOLES = "115200;ttyO0"

     PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
     PREFERRED_VERSION_linux-yocto ?= "4.12%"

     KERNEL_IMAGETYPE = "zImage"
     KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
     KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"

     SPL_BINARY = "MLO"
     UBOOT_SUFFIX = "img"
     UBOOT_MACHINE = "am335x_boneblack_config"
     UBOOT_ENTRYPOINT = "0x80008000"
     UBOOT_LOADADDRESS = "0x80008000"

     MACHINE_FEATURES = "usbgadget usbhost vfat alsa"

     IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO"
            

The variables used to configure the machine define machine-specific properties. For example, machine-dependent packages, machine tunings, the type of kernel to build, and U-Boot configurations.

The following list provides some explanation for the statements found in the example reference machine configuration file for the BeagleBone development boards. Realize that much more can be defined as part of a machines configuration file. In general, you can learn about related variables that this example does not have by locating the variables in the "Yocto Project Variables Glossary" in the Yocto Project Reference Manual.