I am trying to add a device tree overlay file in yocto for the raspberry pi. I have read this answer however there are still some things I am not understanding.
- I have created a workspace using dev-tool
workspace/sources/linux-raspberrypi/ - The answer above says place the dts file in
${TOPDIR}/workspace/sources/linux-raspberrypi/, however on my system this folder just contains sub folders containing dst and dsti files. It also contains a sub folder calledoverlays/this seems a better place to me? - The answer above also says you should add you dts file to the Makefile however I am unsure what to add the file. In
dts/overlays/Makefilethere is just a list of dtbo files, no dts files e.g.
# Overlays for the Raspberry Pi platform
dtb-$(CONFIG_ARCH_BCM2835) += overlay_map.dtb hat_map.dtb
dtbo-$(CONFIG_ARCH_BCM2835) += \
act-led.dtbo \
adafruit-st7735r.dtbo \
...
wm8960-soundcard.dtbo
targets += dtbs dtbs_install
targets += $(dtbo-y)
always-y := $(dtbo-y)
clean-files := *.dtbo
so how do I add my dts file? I have been using dtc -@ -Hepapr -I dts -O dtb -o myOverlayFile.dtbo myOverlayFile.dts when manually compiling my dts files so was expecting something similar.
- The answer above talks about adding to
KERNEL_DEVICETREEinconf/machine/custom-machine.conf(is it literally "custom-machine" or doe it need to matchMACHINEvariable) however when I look atbitbake -e linux-raspberrypi | grep "KERNEL_DEVICETREE"It also shows what looks like what is an interesting variableRPI_KERNEL_DEVICETREE_OVERLAY, should the dts file be added to this variable inconf/machine/custom-machine.confas well or instead ofKERNEL_DEVICETREE?
Version info
$ bitbake --version
BitBake Build Tool Core version 2.9.1
$ bitbake -e | grep '^DISTRO_VERSION\|^DISTRO_CODENAME='
DISTRO_CODENAME="styhead"
DISTRO_VERSION="5.1.2"