您的当前位置:首页RK平台Realtek WiFi驱动移植说明

RK平台Realtek WiFi驱动移植说明

2021-03-01 来源:乌哈旅游
福州瑞芯微电子有限公司密级状态:绝密()秘密()内部(√)公开()

RK平台RealtekWiFi驱动移植说明

(系统产品一部)

文件状态:[]正在修改[√]正式发布当前版本:作者:V1.0胡卫国2015-03-13完成日期:审核:完成日期:福州瑞芯微电子有限公司

FuzhouRockchipsSemiconductorCo.,Ltd

(版本所有,翻版必究)

福州瑞芯微电子有限公司版本历史

版本号V1.0作者胡卫国修改日期2015-03-13初始版本修改说明备注福州瑞芯微电子有限公司目录

1REALTEK驱动基本情况说明........................................................................................................................22WIFI驱动移植..................................................................................................................................................32.1WIFI驱动入口函数.....................................................................................................................................32.2电源控制及SDIO识别操作......................................................................................................................42.3MAKEFILE配置修改...................................................................................................................................52.4使用自定义WIFIMAC地址....................................................................................................................63BT固件更新......................................................................................................................................................71福州瑞芯微电子有限公司1Realtek驱动基本情况说明Realtek系列WiFiBT芯片,如RTL8188EU,RTL8189ES,RTL8723系列,驱动移植包都是类似的目录结构,驱动代码目录结构也类似。以RTL8188EUS_RTL8189ES_linux_v4.1.8_9499.20131104.zip为例解压之后里面包含文档、驱动源码包、androidreference代码等内容,具体如下:Android部分RK一般都已经移植好集成到SDK中,由于Realtek驱动更新比较频繁,所以客户最常遇到的事情就是更新WiFi驱动。2福州瑞芯微电子有限公司2WiFi驱动移植可对比SDKKernel中已经移植好的驱动与Realtek的驱动进行合并。驱动在以下目录drivers/net/wireless/rockchip_wlan/drivers/net/wireless/针对kernel3.10版本针对kernel3.0版本2.1wifi驱动入口函数

Realtek提供的驱动入口函数为:module_init(rtw_drv_entry);module_exit(rtw_drv_halt);在以下文件中:os_dep\\linux\\sdio_intf.c针对sdio接口wifios_dep\\linux\ntf.c针对usb接口wifiRK平台做了稍微修改,主要是为了增加RK版本信息打印及wifigpio电源控制,启动sdio识别。统一将入口函数由原来的:rtw_drv_entry与rtw_drv_halt,修改成了rockchip_wifi_init_module与rockchip_wifi_exit_module针对3.0版本kernelrockchip_wifi_init_module_rtkwifi与rockchip_wifi_exit_module_rtkwifi针对3.10版本kernel并加了如下版本信息打印(以RTL8723BSVQ0Kernel3.0为例):introckchip_wifi_init_module(void){printk(\"=======================================================\\n\");printk(\"====LaunchingWi-Fidriver!(PoweredbyRockchip)====\\n\");printk(\"=======================================================\\n\");printk(\"Realtek8723BSSDIOWiFidriver(PoweredbyRockchip,Ver%s)init.\\n\RTL8723BS_DRV_VERSION);returnrtw_drv_entry();}3福州瑞芯微电子有限公司voidrockchip_wifi_exit_module(void){printk(\"=======================================================\\n\");printk(\"====DislaunchingWi-Fidriver!(PoweredbyRockchip)====\\n\");printk(\"=======================================================\\n\");rtw_drv_halt();}Android4.2平台编译成ko,入口函数如下:module_init(rockchip_wifi_init_module);module_exit(rockchip_wifi_exit_module);Android4.4kernel3.0平台Buildin到kernle中,入口函数如下EXPORT_SYMBOL(rockchip_wifi_init_module);EXPORT_SYMBOL(rockchip_wifi_exit_module);Android4.4kernel3.10平台Buildin到kernle中,入口函数如下EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);Android5.0kernel3.10平台#ifdefCONFIG_RTL8723BS_VQ0EXPORT_SYMBOL(rockchip_wifi_init_module_rtkwifi);EXPORT_SYMBOL(rockchip_wifi_exit_module_rtkwifi);#elsemodule_init(rockchip_wifi_init_module_rtkwifi);module_exit(rockchip_wifi_exit_module_rtkwifi);#endif2.2电源控制及sdio识别操作

Kernel3.10版本introckchip_wifi_init_module_rtkwifi(void){printk(\"\\n\");4福州瑞芯微电子有限公司printk(\"=======================================================\\n\");printk(\"====LaunchingWi-Fidriver!(PoweredbyRockchip)====\\n\");printk(\"=======================================================\\n\");printk(\"Realtek8723BSVQ0SDIOWiFidriver(PoweredbyRockchip,Ver%s)init.\\n\RTL8723BS_DRV_VERSION);rockchip_wifi_power(1);returnrtw_drv_entry();}电源控制及sdio识别操作的函数实现在:net/rfkill/rfkill-wlan.cKernel3.0版本电源控制与sdio识别函数有些不一样,具体如下:intrk29sdk_wifi_power(inton);intrk29sdk_wifi_set_carddetect(intval);电源控制及sdio识别操作的函数实现在:arch/arm/plat-rk/rk-sdmmc-wifi.c//使能wifi电源rockchip_wifi_set_carddetect(1);//通知sdio进行识别sdio卡操作,只针对SDIOWiFi2.3Makefile配置修改

在3.10版本kernel中防止出现编译warningEXTRA_CFLAGS+=-O1修改成EXTRA_CFLAGS+=-O1-Wframe-larger-than=1200选择RK平台将CONFIG_PLATFORM_I386_PC=y修改成CONFIG_PLATFORM_I386_PC=n将CONFIG_PLATFORM_ARM_RK3188=n修改成CONFIG_PLATFORM_ARM_RK3188=y5福州瑞芯微电子有限公司CONFIG_PLATFORM_ARM_RK3188其实控制以下驱动中需要打开的关键宏:CONFIG_PLATFORM_ANDROIDCONFIG_IOCTL_CFG80211RTW_USE_CFG80211_STA_EVENTCONFIG_CONCURRENT_MODECONFIG_P2P_IPS休眠唤醒配置说明如果发现连接AP时wifi休眠功耗大,可按如下配置CONFIG_WOWLAN=nCONFIG_GPIO_WAKEUP=nCONFIG_RTW_SDIO_PM_KEEP_POWER=y2.4使用自定义WiFiMAC地址

一般wifi模块自带硬件MAC地址,默认使用此地址。也可修改成自定义的MAC地址,通过PC工具写MAC地址到flash中,然后再在驱动中读取并使用此MAC地址,修改如下:在文件core\\rtw_ieee80211.c中,通过以下函数来读取flash中的MAC地址:针对3.10版本kernelexternintrockchip_wifi_mac_addr(unsignedchar*buf);针对3.0版本kernelintrk29sdk_wifi_mac_addr(unsignedchar*buf)6福州瑞芯微电子有限公司3BT固件更新如果是rtl8723系统wifibt二合一芯片,更新了wifi驱动后,一般需要同时更新btfirmware。firmware在realtek提供的驱动移植包以下目录hardware\\realtek\\bt\\firmware。对应移植到RK平台目录如下在SDK源码目录:安装到机器中目录device/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723au/rtl87Android4.2,4.423a_fw:system/etc/firmware/rtl8723a_fwdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723au/rtl8723a_config:system/etc/firmware/rtl8723a_configrtl8723auvendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723au/rtl8723a_fw:system/etc/firmware/rtl8723a_fwAndroid5.0vendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723au/rtl8723a_config:system/etc/firmware/rtl8723a_configdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bu/rtl87Android4.2,4.423b_fw:system/etc/firmware/rtl8723b_fwdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bu/rtl8723bu_config:system/etc/firmware/rtl8723bu_configrtl8723buvendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bu/rtl8723b_fw:system/etc/firmware/rtl8723b_fwAndroid5.0vendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bu/rtl8723bu_config:system/etc/firmware/rtl8723bu_configdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723as/rtl87Android4.2,rtl8723as4.4device/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723as/rtl8723a_fw:system/etc/firmware/rtlbt/rtlbt_fw7福州瑞芯微电子有限公司23a_config:system/etc/firmware/rtlbt/rtlbt_configvendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723as/rtl8723a_fw:system/etc/firmware/rtlbt/rtlbt_fwAndroid5.0vendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723as/rtl8723a_config:system/etc/firmware/rtlbt/rtlbt_configdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs/rtl87Android4.2,4.423b_fw:system/etc/firmware/rtlbt/rtlbt_fwdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs/rtl8723b_config.internal:system/etc/firmware/rtlbt/rtlbt_configrtl8723bsvendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs/rtl8723b_fw:system/etc/firmware/rtl8723bs_fwAndroid5.0vendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs/rtl8723b_config:system/etc/firmware/rtl8723bs_configdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs/rtl87Android4.2,4.423b_fw:system/etc/firmware/rtlbt/rtlbt_fwdevice/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs/rtl8723b_config.internal:system/etc/firmware/rtlbt/rtlbt_configrtl8723bs-vq0vendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs_vq0/rtl8723b_fw:system/etc/firmware/rtl8723bs_VQ0_fwAndroid5.0vendor/rockchip/common/bluetooth/realtek/bt/firmware/rtl8723bs_vq0/rtl8723b_VQ0_config:system/etc/firmware/rtl8723bs_VQ0_config8福州瑞芯微电子有限公司_______________9

因篇幅问题不能全部显示,请点此查看更多更全内容