4.0 RTL8723DU驱动(wifi+蓝牙)

文章目录

写在前面

公司使用px30 + rtl8723du驱动来使能蓝牙和wifi功能,目前蓝牙需要厂家提供固件,调通再更新。记录一下wifi移植的时候一个奇怪的现象:rtl8723du wifi 断电重启正常,但是reboot软重启,wifi不正常。具体表现为ifconfig 看不到wlan的信息,使用ifconfig wlan0 up 显示 找不到节点,将调试构成记录一下。

wifi驱动涉及代码

目录内容
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd系统接口
net/rfkill/rfkill-wlan.c设备驱动
drivers/net/wireless/rockchip_wlan/rtl8723du厂家驱动

wifi驱动设备树修改

wireless-wlan {
    compatible = "wlan-platdata";//和rfkill-wlan.c电源驱动匹配
    wifi_chip_type = "8723du";//用它来判断使用哪个硬件模块,加载对应的wifi驱动,配置。
    keep_wifi_power_on;//打开后表示开机过程后就直接上电,并且一直保持上电状态,后续的电源操作会失效。
                       //有些WiFi模组可能是WiFi和BT共用电源,这时需要一直保持上电状态
    WIFI,poweren_gpio = <&gpio1 RK_PC0 GPIO_ACTIVE_HIGH>; //电源口,有复位功能
    status = "okay";
};

wifi驱动修改px30_linux_defconfig

CONFIG_RTL8723DU=y

wifi驱动修改Kconfig

vi drivers/net/wireless/rockchip_wlan/Kconfig
source "drivers/net/wireless/rockchip_wlan/rtl8723du/Kconfig"

wifi驱动修改Makefile

vi drivers/net/wireless/rockchip_wlan/Makefile
obj-$(CONFIG_RTL8723DU) += rtl8723du/

wifi驱动遇到问题

第一次烧写之后 ,重启识别不到wifi设备,多次测试发现,断电重启,wifi正常,但是reboot重启,wifi就不能正常,具体表现为ifconfig 看不到wlan的信息,怀疑有时候这个驱动的引脚拉高拉低的 操作有点问题,复位一下WIFI_PWR_EN_H 这个引脚,目前有两种解决方法

1 内核里面就是给这个函数加一下延时

int rockchip_wifi_power(int on)
{
	struct rfkill_wlan_data *mrfkill = g_rfkill;
    struct rksdmmc_gpio *poweron, *reset;
    struct regulator *ldo = NULL;
    int power = 0;
    bool toggle = false;
    //txr 20220421 okay
    msleep(100);
    LOG("%s: %d\n", __func__, on);
	if (!on && primary_sdio_host)
		mmc_pwrseq_power_off(primary_sdio_host);
<span class="token keyword">if</span> <span class="token punctuation">(</span>mrfkill <span class="token operator">==</span> <span class="token constant">NULL</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">LOG</span><span class="token punctuation">(</span><span class="token string">"%s: rfkill-wlan driver has not Successful initialized\n"</span><span class="token punctuation">,</span> <span class="token constant">__func__</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

2 在启动脚本里手动重启

vi /etc/init/rcS
#在脚本末尾加一下就行 0xFF250000  这个得是原理图电源叫对应的寄存器地址
io -4 -w 0xFF250000 0x00010000
io -4 -w 0xFF250000 0x00000000
io -4 -w 0xFF250000 0x00010000
            </div><div data-report-view="{&quot;mod&quot;:&quot;1585297308_001&quot;,&quot;spm&quot;:&quot;1001.2101.3001.6548&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_34799243/article/details/124508574&quot;,&quot;extend1&quot;:&quot;pc&quot;,&quot;ab&quot;:&quot;new&quot;}"><div></div></div>
            <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/markdown_views-22a2fefd3b.css" rel="stylesheet">
            <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/style-4f8fbf9108.css" rel="stylesheet">
    </div>
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值