首页 > 解决方案 > 内核 linux-ti-staging-5.10 上带有 Yocto-Linux (dunfell) 的 BBB 上没有可用的 /dev/uio* 设备

问题描述

我按照本指南使用 UIO 启动并运行了我的 BBB 的 PRU。我最近将我的 Yocto 项目从“rocko”分支更新为“dunfell”,现在在 5.10.41 版本中使用 TI 内核 linux-ti-staging。我修改了设备树以启用 UIO 驱动程序(不确定是否正确),从我的反编译的 .dtb 文件中截取的与 PRU 相关的内容如下所示:

(...)
                target-module@300000 {
                    compatible = "ti,sysc-pruss", "ti,sysc";
                    reg = <0x326000 0x4 0x326004 0x4>;
                    reg-names = "rev", "sysc";
                    ti,sysc-mask = <0x30>;
                    ti,sysc-midle = <0x0 0x1 0x2>;
                    ti,sysc-sidle = <0x0 0x1 0x2>;
                    clocks = <0x46 0x0 0x0>;
                    clock-names = "fck";
                    resets = <0x47 0x1>;
                    reset-names = "rstctrl";
                    #address-cells = <0x1>;
                    #size-cells = <0x1>;
                    ranges = <0x0 0x300000 0x80000>;
                    status = "okay";
                    phandle = <0xdb>;

                    pruss@0 {
                        compatible = "ti,am3356-pruss";
                        reg = <0x0 0x80000>;
                        #address-cells = <0x1>;
                        #size-cells = <0x1>;
                        ranges;
                        status = "okay";
                        phandle = <0xdc>;

                        memories@0 {
                            reg = <0x0 0x2000 0x2000 0x2000 0x10000 0x3000>;
                            reg-names = "dram0", "dram1", "shrdram2";
                            phandle = <0xdd>;
                        };

                        cfg@26000 {
                            compatible = "ti,pruss-cfg", "syscon";
                            reg = <0x26000 0x2000>;
                            #address-cells = <0x1>;
                            #size-cells = <0x1>;
                            ranges = <0x0 0x26000 0x2000>;
                            phandle = <0xde>;

                            clocks {
                                #address-cells = <0x1>;
                                #size-cells = <0x0>;

                                iepclk-mux@30 {
                                    reg = <0x30>;
                                    #clock-cells = <0x0>;
                                    clocks = <0x13 0x48>;
                                    phandle = <0x4a>;
                                };
                            };
                        };

                        serial@28000 {
                            compatible = "ti,pruss-uart";
                            reg = <0x28000 0x38>;
                            clocks = <0x10>;
                            interrupt-parent = <0x49>;
                            status = "disabled";
                            phandle = <0xdf>;
                        };

                        iep@2e000 {
                            compatible = "ti,am3356-icss-iep";
                            reg = <0x2e000 0x31c>;
                            clocks = <0x4a>;
                            phandle = <0xe0>;
                        };

                        ecap@30000 {
                            compatible = "ti,pruss-ecap";
                            reg = <0x30000 0x60>;
                            phandle = <0xe1>;
                        };

                        mii-rt@32000 {
                            compatible = "ti,pruss-mii", "syscon";
                            reg = <0x32000 0x58>;
                            phandle = <0xe2>;
                        };

                        interrupt-controller@20000 {
                            compatible = "ti,pruss-intc";
                            reg = <0x20000 0x2000>;
                            interrupts = <0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b>;
                            interrupt-names = "host_intr0", "host_intr1", "host_intr2", "host_intr3", "host_intr4", "host_intr5", "host_intr6", "host_intr7";
                            interrupt-controller;
                            #interrupt-cells = <0x3>;
                            status = "okay";
                            phandle = <0x49>;
                        };

                        pru@34000 {
                            compatible = "ti,am3356-pru";
                            reg = <0x34000 0x2000 0x22000 0x400 0x22400 0x100>;
                            reg-names = "iram", "control", "debug";
                            firmware-name = "am335x-pru0-fw";
                            status = "okay";
                            phandle = <0xe3>;
                        };

                        pru@38000 {
                            compatible = "ti,am3356-pru";
                            reg = <0x38000 0x2000 0x24000 0x400 0x24400 0x100>;
                            reg-names = "iram", "control", "debug";
                            firmware-name = "am335x-pru1-fw";
                            status = "okay";
                            phandle = <0xe4>;
                        };

                        mdio@32400 {
                            compatible = "ti,davinci_mdio";
                            reg = <0x32400 0x90>;
                            clocks = <0x12>;
                            clock-names = "fck";
                            bus_freq = <0xf4240>;
                            #address-cells = <0x1>;
                            #size-cells = <0x0>;
                            status = "okay";
                            phandle = <0xe5>;
                        };
                    };
                };
            };
        };
(...)

映像启动并且 uio 内核模块似乎已加载:

root@beaglebone:~# lsmod
Module                  Size  Used by
nfc                    81920  0
bluetooth             397312  8
ecdh_generic           16384  1 bluetooth
ecc                    36864  1 ecdh_generic
uio_pruss              16384  0
uio                    20480  1 uio_pruss
icss_iep               24576  0
irq_pruss_intc         16384  0
omap_aes_driver        24576  0
omap_crypto            16384  1 omap_aes_driver
libaes                 16384  2 omap_aes_driver,bluetooth
omap_sham              28672  0
pruss                  16384  0
crypto_engine          16384  2 omap_aes_driver,omap_sham
ti_emif_sram           16384  0
musb_dsps              20480  0
musb_hdrc             110592  1 musb_dsps
udc_core               28672  1 musb_hdrc
usbcore               241664  1 musb_hdrc
phy_am335x             16384  2
phy_generic            16384  1 phy_am335x
usb_common             16384  5 phy_am335x,udc_core,musb_hdrc,musb_dsps,usbcore
rtc_omap               20480  1
omap_wdt               16384  0
phy_am335x_control     16384  1 phy_am335x
at24                   20480  0
root@beaglebone:~# 

但是 uio 设备不存在:

root@beaglebone:~# ls /dev/u*
/dev/ubi_ctrl  /dev/urandom
root@beaglebone:~# 

由于我发现内核的 defconfig 中仍然存在 uio 内核配置参数,我怀疑 UIO 支持仍然是可能的。我已经搜索了很长时间并尝试了无数方法,但没有一个能让我更接近 /dev/uio* 设备。

任何想法从哪里开始搜索?

标签: linuxlinux-kernelyoctobeagleboneblackdevice-tree

解决方案


推荐阅读