在Debian 9.5内核4.14-ti上为BeagleBone Black启用设备树覆盖

时间:2019-01-06 15:36:52

标签: embedded-linux beagleboneblack u-boot device-tree

我有一个使用BeagleBone Black rev CDebian 9.5 2018-10-07 4GB SD IOT4.14.x-ti内核上运行的项目。我已经对其进行了设置,使其使用am335x-boneblack.dtb,并且试图启用自定义叠加层,该叠加层声明了PRUSS的一些引脚。

问题在于,DTB和覆盖图似乎都在启动时正确加载,但是覆盖图更改似乎根本没有应用。

我想使用的引脚在am335x-bone-common-universal-pins.dtsi的pinmuxes中定义,但是似乎没有被任何外设实际使用。

在4.14中禁用了海角管理器,因此无法使用它来加载叠加层。

代码/输出

/boot/uEnv.txt的相关部分

dtb=am335x-boneblack.dtb
dtb_overlay=/lib/firmware/AM335X-PRU-STOPWATCH.dtbo
disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
disable_uboot_overlay_adc=1
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
enable_uboot_cape_universal=0

AM335X-PRU-STOPWATCH.dtso编译为/lib/firmware/AM335X-PRU-STOPWATCH.dtbo

/dts-v1/;
/plugin/;
/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part-number = "AM335X-PRU-STOPWATCH";
    version = "00A0";
    exclusive-use = "P8.11", "P8.15", "P8.28", "P8.29";
    fragment@0 {
        target = <&pruss>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&pinmux_P8_11_pruout_pin>;
            pinctrl-1 = <&pinmux_P8_15_pruin_pin>;
            pinctrl-2 = <&pinmux_P8_28_pruout_pin>;
            pinctrl-3 = <&pinmux_P8_29_pruin_pin>;
            status = "okay";
        };
    };
};

/opt/scripts/tools/version.sh输出

eeprom:[A335BNLT00C04816BBBK05FF]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-10-07]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.09-00002-g0b54a51
eee]:[location: dd MBR]
kernel:[4.14.79-ti-r87]
nodejs:[v6.14.4]
device-tree-override:[dtb=am335x-boneblack.dtb]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_emmc=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[disable_uboot_overlay_adc=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-
00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=0]
uboot_overlay_options:[dtb_overlay=/lib/firmware/AM335X-PRU-STOPWATCH.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.4.20180928.0-0rcnee0~stretch+20180928]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.3-git20181005.0-0rcnee0~stretch+20181005]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev us
ers systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk
 weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait
coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[    0.985371] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[    0.986573] gpio-of-helper ocp:cape-universal: ready

预期结果

在模式5中将P8_11固定为pr1_pru0_pru_r30_15

在模式6中将P8_15固定为pr1_pru0_pru_r31_15

在模式6中将P8_28固定为pr1_pru1_pru_r31_13

在模式5中将P8_29固定为pr1_pru1_pru_r30_12

为了在pru0pru1代码中使用它们。

实际结果

别针具有默认模式。

2 个答案:

答案 0 :(得分:1)

要应用引导覆盖,必须使用dtc-@编译设备树。不幸的是Debian并未设置该标志。我打开了一个报告https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910727。也许您想发送电子邮件至910727@bugs.debian.org,以确认是否需要此功能。

在解决此问题之前,您必须编译自己的设备树:

您似乎没有使用主线U-Boot。在主线U型引导中,可以通过fdt命令应用覆盖。 Debian flash-kernel软件包允许将必要的命令放入/etc/flash-kernel/preboot.d/中的文件中。

答案 1 :(得分:0)

我最终找到了问题的根本原因。如果您在/boot/uEnv.txt中指定了任何自定义dtb,则会禁用默认dtb(事实证明是am335x-boneblack-uboot-univ.dtb)和下面在同一文件中指定的所有设置的加载,包括rproc / uio PRU,自定义和emmc /视频/音频叠加层(如果要使用它们)。回想起来,这似乎很合理。解决方案是仅删除dtb=name

debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=1] ...
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb ...
loading /boot/dtbs/4.14.79-ti-r87/am335x-boneblack-uboot-univ.dtb ...
172977 bytes read in 77 ms (2.1 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: uboot loading of [/lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]...
uboot_overlays: uboot loading of [/lib/firmware/BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
uboot_overlays: uboot loading of [/lib/firmware/BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]...
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo ...
3513 bytes read in 232 ms (14.6 KiB/s)
uboot_overlays: [dtb_overlay=/lib/firmware/AM335X-PRU-STOPWATCH.dtbo] ...
uboot_overlays: loading /lib/firmware/AM335X-PRU-STOPWATCH.dtbo ...