我现在正在努力调整 yocto 发行版以在基于 imx8mm-evk 的定制硬件上运行。我主要是更改 linux devicetree 以适应新的主板需求,一切都很好,但是当我在 devicetree 中通过 UART 节点添加蓝牙时:
&uart1 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
assigned-clocks = <&clk IMX8MM_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
fsl,uart-has-rtscts;
status = "okay";
bluetooth {
compatible = "brcm,bcm43438-bt";
shutdown-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
host-wakeup-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
device-wakeup-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
clocks = <&osc_32k>;
max-speed = <4000000>;
clock-names = "extclk";
};
};
系统开始表现异常。首先,它只是整个系统挂在蓝牙初始化上,我找不到任何原因。但是,当我使用 BT_HCIUART 作为模块编译内核时,它开始在 hci_uart_bcm 初始化周围随机挂起(大约 40% 的情况下它会挂起,其他 60% 的情况下它会正常启动),如下所示:
[ OK ] Started Rule-based Manager for Device Events and Files.
[ OK ] Finished Coldplug All udev Devices.
[ OK ] Finished Create Volatile Files and Directories.
Starting Start Psplash Boot Screen...
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Started Start Psplash Boot Screen.
[ OK ] Started Start psplash-syst…progress communication helper.
[ OK ] Finished Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Initialization.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target System Time Set.
[ OK ] Reached target System Time Synchronized.
[ OK ] Started Daily rotation of log files.
[ OK ] Reached target Timers.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ 7.313814] caam 30900000.crypto: device ID = 0x0a16040100000000 (Era 9)
[ 7.322605] caam-snvs 30370000.caam-snvs: violation handlers armed - non-secure state
[ 7.324000] caam 30900000.crypto: job rings = 2, qi = 0
[ OK ] Listening on dropbear.socket.
[ 7.340581] CAN device driver interface
[ 7.348931] Bluetooth: HCI UART driver ver 2.3
[ 7.355484] Bluetooth: HCI UART protocol H4 registered
[ 7.362211] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[ 7.370252] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[ OK ] Listening on GPS (Global P…ioning System) Daemon Sockets.
[ 7.389583] Bluetooth: HCI UART protocol Broadcom registered
Starting Weston[ 7.404251] mcp251x spi1.0 can0: MCP2515 successfully initialized
socket.
Starting Console System Startup Logging...
[ OK ] Listening on Weston socket.
[ OK ] Finished Console System Startup Logging.
[ 7.488047] imx-sdma 302b0000.dma-controller: firmware found.
[ 7.488151] imx-sdma 302c0000.dma-controller: firmware found
之后我开始调查,发现如果我在启动期间将 hci_uart 模块列入黑名单并在出现用户提示后插入它,它将正常工作。
问题是:如何使 linux 在完全启动后加载此模块而不插入奇怪的依赖项(我可以使某些模块在启动时真正晚于 hci_uart,但这只是丑陋的)或者如何找出挂起的真正原因?