; wifi_chip_type = ""; //rtl8821cu WIFI,vbat_gpio = <&gpio0 RK_P._rk平台rtl8821cu调试">
当前位置:   article > 正文

RK3568-B2-ANDROID11-WIFI-RTL8821CU_rk平台rtl8821cu调试

rk平台rtl8821cu调试

 原理图

上图为USB-WiFi

  1. \rk3568\kernel\arch\arm64\boot\dts\rockchip\rk3568-evb.dtsi
  2. wireless_wlan: wireless-wlan {
  3. compatible = "wlan-platdata";
  4. rockchip,grf = <&grf>;
  5. wifi_chip_type = ""; //rtl8821cu
  6. WIFI,vbat_gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>; //电源引脚
  7. status = "okay";
  8. };

第一步,配置WIFI,vbat_gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>;

可以看到WIFI模块有供电了

第二步,串口输入lsusb

第三步 路径:kernel\arch\arm64\boot\dts\rockchip\rk3568-evb1-ddr4-v10.dtsi

删除sdio-pwrseq,sdmmc1/2和wireless_bluetooth

第四步 移植驱动

1.修改成 “rtl8821cu” 放在路径:\rk3568\kernel\drivers\net\wireless\rockchip_wlan

 2.路径:.kernel\drivers\net\wireless\rockchip_wlan\Makefile

  1. obj-$(CONFIG_RTL8821CS) += rtl8821cs/
  2. +obj-$(CONFIG_RTL8821CU) += rtl8821cu/
  3. obj-$(CONFIG_RTL8822BS) += rtl8822bs/

3.路径:.kernel\drivers\net\wireless\rockchip_wlan\Kconfig

  1. source "drivers/net/wireless/rockchip_wlan/rtl8821cs/Kconfig"
  2. +source "drivers/net/wireless/rockchip_wlan/rtl8821cu/Kconfig"
  3. source "drivers/net/wireless/rockchip_wlan/rtl8822bs/Kconfig"

4.路径:.kernel\arch\arm64\configs\rockchip_defconfig

  1. CONFIG_RTC_DRV_HYM8563=y
  2. +CONFIG_BT_RTKBTUSB=y
  3. +CONFIG_RTL8821CU=m

 5.路径:\kernel\drivers\net\wireless\rockchip_wlan\rtl8821cu\Makefile

 

 

 

 

 

  1. ########################## Android ###########################
  2. # CONFIG_RTW_ANDROID - 0: no Android, 4/5/6/7/8/9/10/11 : Android version
  3. CONFIG_RTW_ANDROID = 11
  4. ifeq ($(shell test $(CONFIG_RTW_ANDROID) -gt 0; echo $$?), 0)
  5. EXTRA_CFLAGS += -DCONFIG_RTW_ANDROID=$(CONFIG_RTW_ANDROID)
  6. endif
  7. ########################## Debug ###########################
  8. CONFIG_RTW_DEBUG = y
  9. # default log level is _DRV_INFO_ = 4,
  10. # please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
  11. CONFIG_RTW_LOG_LEVEL = 2
  12. # enable /proc/net/rtlxxxx/ debug interfaces
  13. CONFIG_PROC_DEBUG = y
  14. ######################## Wake On Lan ##########################
  15. CONFIG_WOWLAN = y
  16. #bit3: ARP enable, bit2: deauth, bit1: unicast, bit0: magic pkt.
  17. CONFIG_WAKEUP_TYPE = 0xf
  18. CONFIG_WOW_LPS_MODE = default
  19. #bit0: disBBRF off, #bit1: Wireless remote controller (WRC)
  20. CONFIG_SUSPEND_TYPE = 0
  21. CONFIG_WOW_STA_MIX = n
  22. CONFIG_GPIO_WAKEUP = y
  23. ##### Platform Related #######################
  24. CONFIG_PLATFORM_I386_PC = n
  25. CONFIG_PLATFORM_ANDROID_X86 = n
  26. CONFIG_PLATFORM_ANDROID_INTEL_X86 = n
  27. CONFIG_PLATFORM_JB_X86 = n
  28. CONFIG_PLATFORM_ARM_S3C2K4 = n
  29. CONFIG_PLATFORM_ARM_PXA2XX = n
  30. CONFIG_PLATFORM_ARM_S3C6K4 = n
  31. CONFIG_PLATFORM_MIPS_RMI = n
  32. CONFIG_PLATFORM_RTD2880B = n
  33. CONFIG_PLATFORM_MIPS_AR9132 = n
  34. CONFIG_PLATFORM_RTK_DMP = n
  35. CONFIG_PLATFORM_MIPS_PLM = n
  36. CONFIG_PLATFORM_MSTAR389 = n
  37. CONFIG_PLATFORM_MT53XX = n
  38. CONFIG_PLATFORM_ARM_MX51_241H = n
  39. CONFIG_PLATFORM_FS_MX61 = n
  40. CONFIG_PLATFORM_ACTIONS_ATJ227X = n
  41. CONFIG_PLATFORM_TEGRA3_CARDHU = n
  42. CONFIG_PLATFORM_TEGRA4_DALMORE = n
  43. CONFIG_PLATFORM_ARM_TCC8900 = n
  44. CONFIG_PLATFORM_ARM_TCC8920 = n
  45. CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
  46. CONFIG_PLATFORM_ARM_TCC8930_JB42 = n
  47. CONFIG_PLATFORM_ARM_RK2818 = n
  48. CONFIG_PLATFORM_ARM_RK3066 = n
  49. CONFIG_PLATFORM_ARM_RK3188 = y
  50. CONFIG_PLATFORM_ARM_URBETTER = n
  51. #EFUSE_MAP_PATH
  52. USER_EFUSE_MAP_PATH ?=
  53. ifneq ($(USER_EFUSE_MAP_PATH),)
  54. EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"$(USER_EFUSE_MAP_PATH)\"
  55. else ifeq ($(MODULE_NAME), 8189es)
  56. EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_8189e.map\"
  57. else ifeq ($(MODULE_NAME), 8723bs)
  58. EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_8723bs.map\"
  59. else
  60. EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/vendor/etc/firmware/wifi_efuse_$(MODULE_NAME).map\"
  61. endif
  62. ifeq ($(CONFIG_PLATFORM_ARM_RK3188), y)
  63. EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS
  64. # default setting for Android 4.1, 4.2, 4.3, 4.4
  65. EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
  66. EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
  67. EXTRA_CFLAGS += -DCONFIG_RESUME_IN_WORKQUEUE
  68. # default setting for Power control
  69. #EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
  70. ifeq ($(CONFIG_SDIO_HCI), y)
  71. EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN
  72. endif
  73. # default setting for Special function
  74. ARCH := arm
  75. CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
  76. KSRC := /home/android_sdk/Rockchip/Rk3188/kernel
  77. MODULE_NAME := 8821cu
  78. endif

第五步:添加设备ID

路径:frameworks\opt\net\wifi\libwifi_hal\rk_wifi_ctrl.cpp

  1. static wifi_device supported_wifi_devices[] = {
  2. {"RTL8812AU", "0bda:8812"},
  3. {"RTL8821CS", "024c:c821"},
  4. + {"RTL8821CU", "0bda:c820"},
  5. {"RTL8822CU", "0bda:c82c"},
  6. ......
  7. }

第六步:添加模块加载的宏定义

路径:.frameworks\opt\net\wifi\libwifi_hal\wifi_hal_common.cpp

  1. #define RTL8821CS_DRIVER_MODULE_PATH WIFI_MODULE_PATH"8821cs.ko"
  2. +#define RTL8821CU_DRIVER_MODULE_PATH WIFI_MODULE_PATH"8821cu.ko"
  3. #define RTL8822CU_DRIVER_MODULE_PATH WIFI_MODULE_PATH"8822cu.ko"
  4. #define RTL8821CS_DRIVER_MODULE_NAME "8821cs"
  5. +#define RTL8821CU_DRIVER_MODULE_NAME "8821cu"
  6. #define RTL8822CU_DRIVER_MODULE_NAME "8822cu"
  7. wifi_ko_file_name module_list[] =
  8. {"RTL8821CS", RTL8821CS_DRIVER_MODULE_NAME, RTL8821CS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
  9. + {"RTL8821CU", RTL8821CU_DRIVER_MODULE_NAME, RTL8821CU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
  10. {"RTL8822CU", RTL8822CU_DRIVER_MODULE_NAME, RTL8822CU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},

第七步:修改加载设备节点

路径:hardware\realtek\rtkbt\vendor\etc\bluetooth\rtkbt.conf

  1. #Indicate USB or UART driver bluetooth
  2. +BtDeviceNode=/dev/rtkbt_dev
  3. +#BtDeviceNode=?/dev/ttyS1:H5

第八步:本机蓝牙设备名称:(默认为rk3566,更改为rk3568:)

路径:device\rockchip\rk356x\bluetooth\bdroid_buildcfg.h

  1. + //#define BTM_DEF_LOCAL_NAME "rk3566"
  2. + #define BTM_DEF_LOCAL_NAME "rk3568"

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/192569
推荐阅读
相关标签
  

闽ICP备14008679号