简体   繁体   English

为 Beaglebone Black linux 4.14-ti 启用设备树覆盖

[英]Enable Device Tree Overlay for Beaglebone Black linux 4.14-ti

I have a problem with Devicetree overlay.我有 Devicetree 覆盖的问题。 My overlay file is here;我的覆盖文件在这里;

/{
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    
/* Identification */
part_number = "GPIO_Overlays";

/* Version */
version = "00A0";

exclusive-use =
"P9.31",
"P9.17",
"P9.29",
"P9.18",
"P9.28",
"P9.27",
"P9.30",
"P9.24",
"P9.26",
"P9.20";
/* To be Continue */
/*
 * Free up the pins used by the cape from the pinmux helpers.
 */
fragment@0{
    target = <&ocp>;
    __overlay__{
        P9_31_pinmux { status = "disabled"; };
        P9_17_pinmux { status = "disabled"; };
        P9_29_pinmux { status = "disabled"; };
        P9_18_pinmux { status = "disabled"; };
        P9_28_pinmux { status = "disabled"; };
        P9_27_pinmux { status = "disabled"; };
        P9_30_pinmux { status = "disabled"; };
        P9_24_pinmux { status = "disabled"; };
        P9_26_pinmux { status = "disabled"; };
        P9_20_pinmux { status = "disabled"; };
    };
};

/*
* Free up the gpios used by the cape-universal gpio helpers.
*/
fragment@1 {
    target = <&ocp>;
    __overlay__{
        cape-universal { status = "disabled"; };
    };
};

/*
* Setting up to gpio pins.
*/
fragment@2{
    target = <&am33xx_pinmux>;
    __overlay__{
        GPIO_Overlays: GPIO_Overlays{
            pinctrl-single,pins = <

            0x190 0x37      /* Input_PullUp | Mode 7 */
            0x15C 0x37      /* Input_PullUp | Mode 7 */
            0x194 0x37      /* Input_PullUp | Mode 7 */
            0x158 0x17      /* Output_PullUp | Mode 7 */
            0x19C 0x37      /* Input_PullUp | Mode 7 */
            0x1a4 0x37      /* Input_PullUp | Mode 7 */
            0x198 0x17      /* Output_PullUp | Mode 7 */
            0x184 0x17      /* Output_PullUp | Mode 7 */
            0x180 0x17      /* Output_PullUp | Mode 7 */
            0x178 0x17      /* Output_PullUp | Mode 7 */ 
            /* BONE_P9_20 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) */

            >;
        };
    };
};

fragment@3{
    target = <&ocp>;
        __overlay__{
            GPIO{
                compatible = "gpio-keys";
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <&GPIO_Overlays>;
            };
    };
};};

Then I add this .dts file to lib/firmware .然后我将此 .dts 文件添加到lib/firmware I have compiled this .dts file.我已经编译了这个 .dts 文件。 The output is .dtbo file .输出是.dtbo file

My compile method is here;我的编译方法在这里;

dtc -O dtb -o /lib/firmware/GPIO_Overlays-00A0.dtbo -b 0 -@ /lib/firmware/GPIO_Overlays-00A0.dts

When I reboot the BBB, These pins are reverting to their old state.当我重新启动 BBB 时,这些引脚恢复到原来的状态。

What is the worng?什么是wearg? I couldn't solve this problem.我无法解决这个问题。 Can anyone help me?谁能帮我?

Note: I use the linux-4.14-rt and debian 9.5.注意:我使用的是 linux-4.14-rt 和 debian 9.5。

EDIT: When I reboot the BBB, I get this error.编辑:当我重新启动 BBB 时,出现此错误。

[ 0.717426] pinctrl-single 44e10800.pinmux: pin PIN13 already requested by ocp:helper; [0.717426] pinctrl-single 44e10800.pinmux:ocp:helper 已经请求了 pin13; cannot claim for ocp:P8_11_pinmux不能申请 ocp:P8_11_pinmux

[ 0.728435] pinctrl-single 44e10800.pinmux: pin-13 (ocp:P8_11_pinmux) status -22 [0.728435] pinctrl-single 44e10800.pinmux: pin-13 (ocp:P8_11_pinmux) 状态-22

[ 0.736399] pinctrl-single 44e10800.pinmux: could not request pin 13 (PIN13) from group pinmux_P8_11_default_pin on device pinctrl-single [0.736399] pinctrl-single 44e10800.pinmux:无法从设备 pinctrl-single 上的 pinmux_P8_11_default_pin 组请求 pin 13 (PIN13)

[ 0.750487] bone-pinmux-helper ocp:P8_11_pinmux: Error applying setting, reverse things back [0.750487]bone-pinmux-helper ocp:P8_11_pinmux:应用设置出错,将事情反转回来

See here: https://github.com/beagleboard/BeagleBoard-DeviceTrees请参见此处: https : //github.com/beagleboard/BeagleBoard-DeviceTrees

There you can see how they produce specific .dts files and then you can rebuild their entire .dts file archive into a few of your changed favorites.在那里您可以看到他们如何生成特定的 .dts 文件,然后您可以将他们的整个 .dts 文件存档重建到一些您changed收藏夹中。

Also, I think to build after cloning, one would just type make in the dir.另外,我认为要在克隆后构建,只需在目录中输入 make 即可。

So:所以:

  1. git clone https://github.com/beagleboard/BeagleBoard-DeviceTrees git 克隆https://github.com/beagleboard/BeagleBoard-DeviceTrees
  2. cd BeagleBoard-DeviceTrees cd BeagleBoard-DeviceTrees
  3. look around in src/arm and src/arm/overlayssrc/armsrc/arm/overlays环顾四周
  4. change up what you think may need changing and then...改变你认为可能需要改变的东西,然后……
  5. make制作

That may be a cure to you worries.这可能会治愈你的后顾之忧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM