YOCTO : Modify Linux OS features by editing it's device tree

我只是一个虾纸丫 提交于 2019-12-11 15:03:36

问题


I am using YOCTO project SUMO release to Build Linux kernel for my embedded board.

I want to customize the features of my board. They told me to edit the device tree file.

My question is what is the path of this DT file ? And when i modify it, I must rebuild all the kernel using Bitbake ?

Thanks.


回答1:


Create the following tree in your layer meta-custom:

recipes-kernel/
└── linux
    ├── linux-at91
    │   ├── 0001-my-custom-dt.patch
    └── linux-at91_%.bbappend

In linux-at91_%.bbappend, put

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-my-custom-dt.patch"

To generate 0001-my-custom-dt.patch, you can use the following steps:

git clone https://github.com/linux4sam/linux-at91.git
cd linux-at91/
quilt new 0001-my-custom-dt.patch
quilt add arch/arm/boot/dts/at91-sama5d27_som1_ek.dts 
vim arch/arm/boot/dts/at91-sama5d27_som1_ek.dts

# modify DT

quilt refresh

You should obtain something like:

Index: linux-at91/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
===================================================================
--- linux-at91.orig/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ linux-at91/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -538,7 +538,7 @@
        compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_led_gpio_default>;
-       status = "okay"; /* Conflict with pwm0. */
+       status = "disabled"; /* Conflict with pwm0. */

        red {
            label = "red";

Finally copy patch in recipes-kernel/linux/linux-at91 and relaunch Yocto build.


Note: you could also create an entire custom device-tree by using KERNEL_DEVICETREE bitbake variable.



来源:https://stackoverflow.com/questions/57838460/yocto-modify-linux-os-features-by-editing-its-device-tree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!