一、WiFi模组介绍
本次推荐的6221A-SRC 模块(基于瑞昱 RTL8821CS 方案)具备以下核心优势:
二、RTL8821C WIFI调试
2.1 驱动准备与路径配置
2.2 Makefile 配置
2.3 设备树(DTS)配置
wireless-wlan {
compatible = "wlan-platdata";
pinctrl-names = "default";
pinctrl-0 = <&wifi_host_wake_irq>;
wifi_chip_type = "rtl8821cs";
WIFI,host_wake_irq = <&gpio1 RK_PD6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
wireless-wlan {
wifi_host_wake_irq: wifi-host-wake-irq {
rockchip,pins = <1 RK_PD6 RK_FUNC_GPIO &pcfg_pull_down>;
};
};
2.4 Kconfig 与 Makefile 添加编译项
if BCMDHD
source "drivers/net/wireless/rockchip_wlan/rkwifi/Kconfig"
+ source "drivers/net/wireless/rockchip_wlan/rtl8821cs/Kconfig"
endif
source "drivers/net/wireless/rockchip_wlan/cywdhd/Kconfig"
source "drivers/net/wireless/rockchip_wlan/infineon/Kconfig"
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_BCMDHD) += rkwifi/
obj-$(CONFIG_CYW_BCMDHD) += cywdhd/
obj-$(CONFIG_INFINEON_DHD) += infineon/
+ obj-$(CONFIG_RTL8821CS) += rtl8821cs/
2.5 内核编译与驱动加载
生成 KO 文件,拷贝到开发板;
2.6 联网测试
nmcli dev wifi connect "Talowe-2.4G-0" password "Talowe888" ifname wlan0
udhcpc -i wlan0
三、RTL8821C 蓝牙调试
3.1 蓝牙驱动配置
3.2 蓝牙设备树配置
wireless-bluetooth {
compatible = "bluetooth-platdata";
uart_rts_gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>;
pinctrl-names = "default", "rts_gpio";
pinctrl-0 = <&uart9m2_rtsn>;
pinctrl-1 = <&uart9_gpios>;
BT,power_gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>; // BT_REG_ON
BT,wake_host_irq = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>; // BT_WAKE_HOST
status = "okay";
};
wireless-bluetooth {
uart9_gpios: uart9-gpios {
rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
3.3 蓝牙驱动编译配置
config RTL_8821_UART_BT
tristate "RTL_8821_uart_bt driver"
help
RTL Bluetooth HCI uart driver.
This driver is required if you want to use RTL Bluetooth
with URAT interface.
Say Y here to compile support for RTL Bluetooth urat devices
into the kernel or say M to compile it as module (btrtluart).
obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o
obj-$(CONFIG_BT_HCIRSI) += btrsi.o
+ obj-$(CONFIG_RTL_8821_UART_BT) += bluetooth_uart_driver/
四、固件加载与节点验证
.在内核的配置中勾选对应的驱动进行编译,路径:Networking support > Bluetooth subsystem support > Bluetooth device drivers
总结
阅读全文
1512