This topic shows how to create a device tree for your custom hardware.
Before you begin, it’s important you have read Device tree files and overlays and you know about the pin multiplexing explained in Pin multiplexing (IOMUX).
1. Generate a basic device tree with Digi Smart IOmux
Digi Smart IOmux is a graphical tool to help you select and configure the interfaces and pads of the ConnectCore MP25 that you will need in your carrier board. This tool can generate an initial device tree to later work upon.
Refer to Digi ConnectCore Smart IOmux for instructions to create a design based on the ConnectCore MP25, select the interfaces your device needs, and generate a basic device tree.
2. Create the device tree file in the kernel source code
Device trees live in the Linux kernel source code. This example uses the methods described at Methods.
-
Go to your Digi Embedded Yocto project and source the environment:
$ source dey-setup-environment
-
Open a devshell to the
linux-dey
recipe:$ bitbake -c devshell linux-dey
A new terminal opens directly in the folder where the recipe’s source code is.
-
Create your device tree file, for instance:
$ touch arch/arm64/boot/dts/digi/your-platform.dts
-
Fill in the new file with the basic device tree contents produced by Digi ConnectCore Smart IOmux.
-
Add the new device tree file to the Makefile file with a line like this:
arch/arm64/boot/dts/digi/Makefiledtb-y += your-platform.dtb
-
Exit the devshell
$ exit
For the moment, the changes are temporary and will be lost if you run tasks such as clean
orfetch
on the recipe.
3. Build the device tree
-
Add the new device tree to your project’s
conf/local.conf
:conf/local.confSTM32MP_KERNEL_DEVICETREE:ccmp25-dvk += "your-platform.dtb"
-
Run the
compile
task and all that follow on the kernel recipe, with:$ bitbake -C compile linux-dey
This builds your device tree and leaves it in the image deploy directory at
tmp/deploy/images/ccmp25-dvk/your-platform.dtb
.
4. Test the new device tree
See Deploy kernel and/or device tree for instructions on how to quickly transfer and test your device tree on your target platform.
5. Make your changes permanent
-
Follow the instructions at Save your changes, to create patches out of your temporary changes.
-
Refer to Make permanent changes for information on how to move the patches to your layer and instruct the recipe to always apply them.