Hi ,
I am working on Realtek wifi driver bring up realtek rtl8822bu bring upon imx8mp phytec phyboard pollux platform.
phytec module name :phyCORE-i.MX 8M Plus
Wifi driver module name to integrate and port to the android kernel :Realtek Wifi USB rtl8822bu module
I have followed the below steps for Porting the realdriver to android :
1) Downloaded and extracted the android release source code package and synced the repo
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=${PATH}:~/bin
$ source ~/imx-android-11.0.0_1.2.1/imx_android_setup.sh
2) Did a complete build of the android after repo syncing by the following steps :
export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-
gnu/bin/aarch64-linux-gnu-
source build/envsetup.sh
lunch 72
./imx-make.sh -j16
3) Cloned the Realtek Wifi USB driver from the below git repo :
https://github.com/ulli-kroll/rtl8822bu
Cloned the folder in drivers/net/wireless/realtek and compiled successfully .
4) Inserted the comfig CONFIG_RTL8822BU=M in the below file in the path :
device/nxp/imx8m/phyboard_pollux/android_addition_defconfig
5) Added the output .ko file path in the BoardConfig.mk file in the below path :
android_build/device/nxp/imx8m/phyboard_pollux/BoardConfig.mk
+ BOARD_WLAN_DEVICE := bcmdhd
+ WPA_SUPPLICANT_VERSION := VER_0_8_X
+ BOARD_WPA_SUPPLICANT_DRIVER := NL80211
+ BOARD_HOSTAPD_DRIVER := NL80211
+ BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+ BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+ WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/brcmfmac/parameters/alternative_fw_path"
+ BOARD_VENDOR_KERNEL_MODULES += \
+ $(KERNEL_OUT)/drivers/net/wireless/realtek/rtl8822bu/rtl8822bu.ko #added
6) Added the output .ko file path in the BoardConfig.mk file in the below path :
device/nxp/imx8m/phyboard_pollux/SharedBoardConfig.mk
+ $(KERNEL_OUT)/drivers/net/wireless/realtek/rtl8822bu/rtl8822bu.ko \ #added
7) Added the firmware in the below path and inserted the path of the firmware inserted in the phyboardpollux.mk file .THis line is inserted in the below file in the path :device/nxp/imx8m/phyboard_pollux/phyboard_pollux.mk
+device/nxp/imx8m/phyboard_pollux/lib/firmware/rtlwifi/rtl8822bufw.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/rtlwifi/rtl8822bufw.bin #added
9)After booting and connecting to HDMI ,I switched on Wifi and it turned back off automatically and captured the logs .There was a issue in the HAL layer while communicating from the java framework side.
367 E WifiHAL : Failed to register set Hal preInit; result = -95
07-21 12:00:38.474 367 367 E WifiHAL : wifi_hal_preInit failed
WifiHAL : Failed to register set hal start response; result = -95
07-21 12:00:39.124 367 367 E WifiHAL : wifi_start_hal failed
WifiHAL path:hardware/broadcom/wlan/bcmdhd/
I am attaching the logs hereby.Please help and guide for the same