概述
起因:
客户要用。你就得配。
过程:
首先你需要和供应商拿到这份
RTL8723DU_WiFi_linux_v5.13.4-18-gda9ee5bf0_COEX20200103-3535.20210615.tar
本人是码农,产品经理给的。各种解压不提,本人较土,解压是用rar解压的。
然后你需要准备一份文档:
RealTek wifi 驱动移植说明_V1.1.pdf
这份文档在3128 sdk的rkdoc下面有提供。当然有我这个blog,你还要什么文档?
然后进RTL8723DU_WiFi_linux_v5.13.4-18-gda9ee5bf0_COEX20200103-3535.20210615WIFIRTL8723DU_WiFi_linux_v5.13.4-18-gda9ee5bf0_COEX20200103-3535.20210615driver文件夹,解压下面的一坨tar.gz,重命名其为rtl8723du,将其拷贝到3128源码目录下的kernel/drivers/net/wireless/rockchip_wlan
然后按照rk文档开始改该文件夹下(rtl8723du)的Makefile,
CONFIG_RTL8723D = y
CONFIG_PLATFORM_ANDROID_X86 = n
CONFIG_PLATFORM_ARM_RK3188 = y
找到下面这段
ifeq ($(CONFIG_PLATFORM_ARM_RK3188), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS
# default setting for Android 4.1, 4.2, 4.3, 4.4
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
# default setting for Power control
EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
ifeq ($(CONFIG_SDIO_HCI), y)
EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN
endif
# default setting for Special function
ARCH := arm
#CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
#KSRC := /home/android_sdk/Rockchip/Rk3188/kernel
CROSS_COMPILE := /media/lzywork/rk3128_nougat_mid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-
KSRC :=/media/lzywork/rk3128_nougat_mid/kernel
MODULE_NAME := 8723du
endif
改的是KSRC CROSS_COMPILE MODULE_NAME
然后修改
lzy@ztlsz-PowerEdge-T640:/media/lzywork/rk3128_nougat_mid$ git diff
kernel/drivers/net/wireless/Kconfig
diff --git a/kernel/drivers/net/wireless/Kconfig b/kernel/drivers/net/wireless/Kconfig
index 169811d..20bfdf7 100644
--- a/kernel/drivers/net/wireless/Kconfig
+++ b/kernel/drivers/net/wireless/Kconfig
@@ -53,6 +53,7 @@ source "drivers/net/wireless/rockchip_wlan/rtl8723bs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723cs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723ds/Kconfig"
+source "drivers/net/wireless/rockchip_wlan/rtl8723du/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8812au/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8189fs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8188fu/Kconfig"
lzy@ztlsz-PowerEdge-T640:/media/lzywork/rk3128_nougat_mid$ git diff
kernel/drivers/net/wireless/Makefile
diff --git a/kernel/drivers/net/wireless/Makefile b/kernel/drivers/net/wireless/Makefile
index 4334962..730cdc6 100644
--- a/kernel/drivers/net/wireless/Makefile
+++ b/kernel/drivers/net/wireless/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_RTL8723BS)
+= rockchip_wlan/rtl8723bs/
obj-$(CONFIG_RTL8723BS_VQ0)
+= rockchip_wlan/rtl8723bs-vq0/
obj-$(CONFIG_RTL8723CS)
+= rockchip_wlan/rtl8723cs/
obj-$(CONFIG_RTL8723DS)
+= rockchip_wlan/rtl8723ds/
+obj-$(CONFIG_RTL8723DU)
+= rockchip_wlan/rtl8723du/
obj-$(CONFIG_RTL8189FS)
+= rockchip_wlan/rtl8189fs/
obj-$(CONFIG_RTL8188FU)
+= rockchip_wlan/rtl8188fu/
obj-$(CONFIG_ESP8089)
+= rockchip_wlan/esp8089/
编辑内核选项文件 或者用
make menuconfig
打开8723的内核配置
总之最后结果就是kernel/.config 多了一行 CONFIG_RTL8723DU=m
此处斜眼,请看文档去开图形界面配,或者arch/arm/configs/rockchip_defconfig里面加
然后你就在kernel目录下make modules 。 OK 。。ko就出来了。但是。。。wifi此时是开不了的。
有很多原因,其中一个是.ko并不在固件中。本人并不知道kenel是如何把其他模块的把这个.ko拷贝到固件中。反正我开m以后,固件是没有这个.ko的。随便找个地方补上:
#不知道8723ko放哪拷贝 先放这里
PRODUCT_COPY_FILES +=
kernel/drivers/net/wireless/rockchip_wlan/rtl8723du/8723du.ko:$(TARGET_COPY_OUT_SYSTEM)/lib/modules/8723du.ko
如果有大佬知道怎么搞定这个,请不吝赐教。不然所有人都不懂。
然后呢,别急,还不行。
lzy@ztlsz-PowerEdge-T640:/media/lzywork/rk3128_nougat_mid$ git diff
hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c
diff --git a/hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c b/hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c
index 5810138..2e09317 100755
--- a/hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c
+++ b/hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c
@@ -76,6 +76,7 @@ static wifi_device supported_wifi_devices[] = {
{"RTL8822BS",
"024c:b822"},
{"RTL8723CS",
"024c:b703"},
{"RTL8723DS",
"024c:d723"},
+
{"RTL8723DU",
"0bda:d723"},
{"RTL8188FU",
"0bda:f179"},
{"RTL8822BU",
"0bda:b82c"},
{"RTL8189ES",
"024c:8179"},
lzy@ztlsz-PowerEdge-T640:/media/lzywork/rk3128_nougat_mid$ git diff hardware/libhardware_legacy/wifi/wifi.c
diff --git a/hardware/libhardware_legacy/wifi/wifi.c b/hardware/libhardware_legacy/wifi/wifi.c
index 04da01c..6fb94ca 100755
--- a/hardware/libhardware_legacy/wifi/wifi.c
+++ b/hardware/libhardware_legacy/wifi/wifi.c
@@ -87,6 +87,7 @@ extern int ifc_down(const char *name);
#define RTL8723BS_VQ0_DRIVER_MODULE_PATH "/system/lib/modules/8723bs-vq0.ko"
#define RTL8723CS_DRIVER_MODULE_PATH "/system/lib/modules/8723cs.ko"
#define RTL8723DS_DRIVER_MODULE_PATH "/system/lib/modules/8723ds.ko"
+#define RTL8723DU_DRIVER_MODULE_PATH "/system/lib/modules/8723du.ko"
#define RTL8188FU_DRIVER_MODULE_PATH "/system/lib/modules/8188fu.ko"
#define RTL8822BU_DRIVER_MODULE_PATH "/system/lib/modules/8822bu.ko"
#define RTL8822BS_DRIVER_MODULE_PATH "/system/lib/modules/8822bs.ko"
@@ -106,6 +107,7 @@ extern int ifc_down(const char *name);
#define RTL8188EU_DRIVER_MODULE_NAME "8188eu"
#define RTL8723BU_DRIVER_MODULE_NAME "8723bu"
#define RTL8723BS_DRIVER_MODULE_NAME "8723bs"
+#define RTL8723DU_DRIVER_MODULE_NAME "8723du"
#define RTL8723BS_VQ0_DRIVER_MODULE_NAME "8723bs_vq0"
#define RTL8188FU_DRIVER_MODULE_NAME "8188fu"
#define RTL8189ES_DRIVER_MODULE_NAME "8189es"
@@ -198,6 +200,7 @@ typedef struct _wifi_ko_file_name
wifi_ko_file_name module_list[] =
{
{"RTL8723BU", RTL8723BU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
+
{"RTL8723DU", RTL8723DU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
{"RTL8188EU", RTL8188EU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
{"RTL8192DU", RTL8192DU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
{"RTL8822BU", RTL8822BU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
lzy@ztlsz-PowerEdge-T640:/media/lzywork/rk3128_nougat_mid$ git diff kernel/include/linux/rfkill-wlan.h
diff --git a/kernel/include/linux/rfkill-wlan.h b/kernel/include/linux/rfkill-wlan.h
index 788cbd4..ba0fbf5 100755
--- a/kernel/include/linux/rfkill-wlan.h
+++ b/kernel/include/linux/rfkill-wlan.h
@@ -64,6 +64,7 @@ enum {
WIFI_RTL8723CS,
WIFI_RTL8723DS,
WIFI_RTL8723BU,
+
WIFI_RTL8723DU,
WIFI_RTL8723AU,
WIFI_RTL8189ES,
WIFI_RTL8812AU,
lzy@ztlsz-PowerEdge-T640:/media/lzywork/rk3128_nougat_mid$ git diff
kernel/net/rfkill/rfkill-wlan.c
diff --git a/kernel/net/rfkill/rfkill-wlan.c b/kernel/net/rfkill/rfkill-wlan.c
index 7ff9fd9..c91f339 100755
--- a/kernel/net/rfkill/rfkill-wlan.c
+++ b/kernel/net/rfkill/rfkill-wlan.c
@@ -143,6 +143,8 @@ int get_wifi_chip_type(void)
type = WIFI_RTL8723AU;
} else if (strcmp(wifi_chip_type_string, "rtl8723bu") == 0) {
type = WIFI_RTL8723BU;
+
} else if (strcmp(wifi_chip_type_string, "rtl8723du") == 0) {
+
type = WIFI_RTL8723DU;
} else if (strcmp(wifi_chip_type_string, "rtl8189es") == 0) {
type = WIFI_RTL8189ES;
} else if (strcmp(wifi_chip_type_string, "rtl8812au") == 0) {
然后,编译固件吧!WIFI可以用了。
如果没有这个blog,我估计还要走很多弯路[RK3399 Android7.1.2]新增wifi&bt模块:rtl8822cs驱动以及解决所遇问题_泡芙44的博客-CSDN博客_rtl8822cs手册
也可以去这里看
迅为瑞芯微3399开发板Android7-WiFi移植步骤_mucheni的博客-CSDN博客
然后呢,开始整蓝牙,蓝牙也没有如上blog那么简单。首先到
RTL8723DU_WiFi_linux_v5.13.4-18-gda9ee5bf0_COEX20200103-3535.20210615BT20210702_ANDROID_BT_DRIVER_RTL8723D_COEX_v3b3b20210702_TV_ANDROID_7.x_RTL8723D_COEX_v3b3b的下面,把
rtkbt整个文件夹拷贝到hardware realtek下面。至于原来的文件夹,请自行压缩备份。
然后修改hardware/realtek/rtkbt/code/bt/audio_a2dp_hw下面的Android.mk改成别的啥我不管。反正不能生成这个会和system下面的有冲突。
然后修改hardware/realtek/rtkbt/code/bt/main里面的Android.mk
LOCAL_MODULE := bluetooth_rtk.default
然后,修改
hardware/realtek/rtkbt/code/bt/btif/src/bluetooth.c文件末尾的
hw_module_t HAL_MODULE_INFO_SYM
.id = BT_HARDWARE_RTK_MODULE_ID,//luke fix BT_HARDWARE_MODULE_ID
再改:
hardware/realtek/rtkbt/code/bt/service/hal/bluetooth_interface.cpp里面的
// Open the Bluetooth adapter.
hw_device_t* device;
status = module->methods->open(module, BT_HARDWARE_RTK_MODULE_ID, &device);//luke fix
然后?然后你会发现编译完固件,生成的/bluetooth_rtk.default.so根本不是你想要的。查看代码,发现。。。然后做如下修改:
deleted: device/rockchip/rk312x/px3se/bluetooth_rtk.default.so
然后,souce /build/envsetup.sh
lunch 13( 这里就是我SDK特定的3128,你也别傻傻的打13,可以打回车看看自己用的啥)
mmm hardware/realtek/rkbt/code/bt/
现在生成的so才是你想要的。
然后,生成总的固件吧,8723du到此,wifi和蓝牙正常使用。
这里非常感谢
Android HAL 硬件抽象层加载过程_liujun3512159的博客-CSDN博客_android hal加载
提供的追踪分析,否则我光找LOGE("load: id=%s != hmi->id=%s", id, hmi->id);这个日志都不知道找到猴年马月去。经前面若干个固件调试,发现错误是so加载不了。所以才有了后面的改法。
最后,蓝牙成功使用。当然,mmm的方式是很不舒服的,但是,我也不知道在哪令这个模块参与编译,所以。。。只能这样了,期待大佬们给小弟答疑解惑。
最后
以上就是激动毛巾为你收集整理的RK3128适配RTL8723DU的全部内容,希望文章能够帮你解决RK3128适配RTL8723DU所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复