Skip to content

Use case 2: same SOM as one supported by Welma, but different carrier board

In this page, we show how to adapt Welma and use a custom kernel device tree overlay. Feel free to refer to meta-demo-onboarding to get the details of the files being modified.

  • Copy Welma's machine conf to our layer: meta-demo-onboarding/conf/machine/sm2s-imx93-custom.conf

  • Adjust KERNEL_DEVICETREE to build our own device tree overlay (specific to our carrier board):

    KERNEL_DEVICETREE += "msc/imx93/overlay-custom.dtb"
    

  • Add this device tree overlay in recipes-kernel/linux/linux-imx_%.bbappend:

    FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
    SRC_URI += "file://0001-msc-sm2s-imx93-support-for-custom-board.patch"
    

This device tree overlay overlay-custom.dts is added to the source code of the kernel through a patch.

  • Modify U-Boot to select this overlay at startup: recipes-bsp/u-boot/u-boot-imx/distro-bootcmd.env:

    -fdt_overlay_opt=conf-overlay-baseboard-ep5.dtb
    +fdt_overlay_opt=conf-overlay-custom.dtb
    

  • Modify the local.conf template: conf/templates/default/local.conf.sample:

    -MACHINE ?= "sm2s-imx93-mbep5"
    +MACHINE ?= "sm2s-imx93-custom"
    

  • Build:

    export MACHINE=sm2s-imx93-custom
    bitbake demo-image-onboarding demo-image-onboarding-dev
    

  • Flash & run:

    Welma by Witekio 1.4.2 sm2s-imx93-custom ttyLP0
    sm2s-imx93-custom login: