Beaglebone black编辑默认的am335x-boneblack.dts设备树

时间:2015-08-17 14:03:52

标签: kernel debian linux-device-driver beagleboneblack device-tree

我需要在BBB上修改pinmuxing的默认配置。为此,我试图在重新编译内核之前修改am335x-boneblack.dts。但那个文件非常尴尬。我只找到有关叠加的信息,但我需要将其设为默认值而不是叠加。

这是我用来定义带有覆盖DT的TOR I / O的pinmuxing:

    pinctrl_test: pinctrl_test_0_pins {
    pinctrl-single,pins = <
        0x078 0x07 /* P9_12 OUTPUT | MODE7 | PULLDOWN */
        0x048 0x07 /* P9_14 OUTPUT | MODE7 | PULLDOWN */
        0x040 0x07 /* P9_15 OUTPUT | MODE7 | PULLDOWN */
        0x04c 0x07 /* P9_16 OUTPUT | MODE7 | PULLDOWN */
        0x15c 0x07 /* P9_17 OUTPUT | MODE7 | PULLDOWN */
        0x158 0x07 /* P9_18 OUTPUT | MODE7 | PULLDOWN */
        0x044 0x07 /* P9_23 OUTPUT | MODE7 | PULLDOWN */
        0x1ac 0x07 /* P9_25 OUTPUT | MODE7 | PULLDOWN */


        0x030 0x27 /* P8_12 INPUT | MODE7 | PULLDOWN */
        0x024 0x27 /* P8_13 INPUT | MODE7 | PULLDOWN */
        0x028 0x27 /* P8_14 INPUT | MODE7 | PULLDOWN */
        0x03c 0x27 /* P8_15 INPUT | MODE7 | PULLDOWN */
        0x038 0x27 /* P8_16 INPUT | MODE7 | PULLDOWN */
        0x02c 0x27 /* P8_17 INPUT | MODE7 | PULLDOWN */
        0x08c 0x27 /* P8_18 INPUT | MODE7 | PULLDOWN */
        0x020 0x27 /* P8_19 INPUT | MODE7 | PULLDOWN */
    >;
};

编辑TOR I / O,ANA的主DT和寄存器引脚的正确语法是什么?之后的目的是开发驱动程序以便能够高速读取/写入(使用寄存器)不同的输入/输出。

感谢。

1 个答案:

答案 0 :(得分:0)

我试着写一个am335x-boneblack.dts,删除了与HDMI相关的所有内容,将include修改为am335x-bone-common-no-capemgr.dtsi:

/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;

#include "am33xx.dtsi"
#include "am335x-bone-common-no-capemgr.dtsi"

/ {
    model = "TI AM335x BeagleBone Black";
    compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
};

&ldo3_reg {
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <1800000>;
    regulator-always-on;
};

&mmc1 {
    vmmc-supply = <&vmmcsd_fixed>;
};

&mmc2 {
    vmmc-supply = <&vmmcsd_fixed>;
    pinctrl-names = "default";
    pinctrl-0 = <&emmc_pins>;
    bus-width = <8>;
    status = "okay";
};

&am33xx_pinmux {

    tor_output_pins: tor_output_pins {
        pinctrl-single,pins = <
            0x078 0x07 /* P9_12 OUTPUT | MODE7 | PULLDOWN */
            0x048 0x07 /* P9_14 OUTPUT | MODE7 | PULLDOWN */
            0x040 0x07 /* P9_15 OUTPUT | MODE7 | PULLDOWN */
            0x04c 0x07 /* P9_16 OUTPUT | MODE7 | PULLDOWN */
            0x15c 0x07 /* P9_17 OUTPUT | MODE7 | PULLDOWN */
            0x158 0x07 /* P9_18 OUTPUT | MODE7 | PULLDOWN */
            0x044 0x07 /* P9_23 OUTPUT | MODE7 | PULLDOWN */
            0x1ac 0x07 /* P9_25 OUTPUT | MODE7 | PULLDOWN */
        >;
    };

    tor_input: tor_input {
        pinctrl-single,pins = <
            0x030 0x27 /* P8_12 INPUT | MODE7 | PULLDOWN */
            0x024 0x27 /* P8_13 INPUT | MODE7 | PULLDOWN */
            0x028 0x27 /* P8_14 INPUT | MODE7 | PULLDOWN */
            0x03c 0x27 /* P8_15 INPUT | MODE7 | PULLDOWN */
            0x038 0x27 /* P8_16 INPUT | MODE7 | PULLDOWN */
            0x02c 0x27 /* P8_17 INPUT | MODE7 | PULLDOWN */
            0x08c 0x27 /* P8_18 INPUT | MODE7 | PULLDOWN */
            0x020 0x27 /* P8_19 INPUT | MODE7 | PULLDOWN */
        >;
    }; 

};

&ocp{
    torout: torout  {
        pinctrl-names = "default";
        pinctrl-0 = <&tor_output_pins>;
        status = "okay";
    };

    torin: torin    {
        pinctrl-names = "default";
        pinctrl-0 = <&tor_input_pins>;
        status = "okay";
    };
};

使用TFTP从uboot启动:

tftpboot 0x80F80000 am335x-bone-custom.dtb
tftpboot 0x80007FC0 uImage-BBB

然后查看引脚配置:

root@arm:~# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins|grep 95c
pin 87 (44e1095c.0) 00000062 pinctrl-single

应输出:

pin 87 (44e1095c.0) 00000007 pinctrl-single

为什么更改没有生效?我错过了什么吗?