Hi,
I have some info about “H96 max W2” (s905w2 based) devices. They use L8800D-SHCY module, which is based on AIC8800.
The reported SDIO device IDs:
CoreELEC:~ # cat /sys/bus/sdio/devices/mmc2\:524f\:1/uevent
DRIVER=aicwf_sdio
OF_NAME=wifi
OF_FULLNAME=/soc/sdio@fe088000/wifi@1
OF_COMPATIBLE_0=brcm,bcm4329-fmac
OF_COMPATIBLE_N=1
SDIO_CLASS=07
SDIO_ID=5449:0145
MODALIAS=sdio:c07v5449d0145
Note, that “brcm,bcm4329-fmac” specified on the DT node is also specified in the original android DT. It doesn’t seem to cause problems with loading the proper driver if present.
I managed to get the radio working using the modules from: aic8800/src/SDIO/driver_fw/driver/aic8800 at main · radxa-pkg/aic8800 · GitHub
The firmware also should be used from the same repository. The following files are needed: aic8800/src/SDIO/driver_fw/fw/aic8800 at main · radxa-pkg/aic8800 · GitHub
The package.mk I used for building is:
# SPDX-License-Identifier: GPL-2.0-or-later
# Downloadlocation:
# https://github.com/radxa-pkg/aic8800/
PKG_NAME="aic8800-sdio"
PKG_VERSION="bf2b14e8357f65e6fa84da2905ea5c0756c7791c"
PKG_SHA256="2623b85b977d7792d0bc765d4a47d32028bd328756bca2b3f75536366389be62"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/radxa-pkg/aic8800"
PKG_URL="https://github.com/radxa-pkg/aic8800/archive/${PKG_VERSION}.tar.gz"
PKG_LONGDESC="AIC8800 SDIO WiFi and Bluetooth drivers"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="${LINUX_DEPENDS}"
PKG_TOOLCHAIN="manual"
PKG_IS_KERNEL_PKG="yes"
make_target() {
cd ${PKG_BUILD}/src/SDIO/driver_fw/driver/aic8800
KBUILD_NOPEDANTIC=1 kernel_make V=1 CC=${CC} -C $(kernel_path) M=$(pwd)
}
makeinstall_target() {
mkdir -p ${INSTALL}/$(get_full_module_dir)/${PKG_NAME}
cp ${PKG_BUILD}/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic8800_bsp.ko ${INSTALL}/$(get_full_module_dir)/${PKG_NAME}
cp ${PKG_BUILD}/src/SDIO/driver_fw/driver/aic8800/aic8800_btlpm/aic8800_btlpm.ko ${INSTALL}/$(get_full_module_dir)/${PKG_NAME}
cp ${PKG_BUILD}/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aic8800_fdrv.ko ${INSTALL}/$(get_full_module_dir)/${PKG_NAME}
mkdir -p ${INSTALL}/$(get_full_firmware_dir)/aic8800D80
cp ${PKG_BUILD}/src/SDIO/driver_fw/fw/aic8800/* ${INSTALL}/$(get_full_firmware_dir)/aic8800D80/
}
The aic8800D80 directory name is not the most fortunate, I just typed it in that way because originally I based on the debian package builder configuration for the module, which used only the firmware for aic8800D80. I suggest changing it both in the package.mk, and the patch below.
1st patch:
diff --git a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/Makefile b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/Makefile
index 8701cdc..71685f0 100644
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/Makefile
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/Makefile
@@ -1,7 +1,7 @@
CONFIG_SDIO_SUPPORT := y
CONFIG_SDIO_PWRCTRL := y
-CONFIG_AIC_FW_PATH = "/vendor/etc/firmware"
-#CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800"
+#CONFIG_AIC_FW_PATH = "/vendor/etc/firmware"
+CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800D80"
export CONFIG_AIC_FW_PATH
ccflags-y += -DCONFIG_AIC_FW_PATH=\"$(CONFIG_AIC_FW_PATH)\"
2nd patch:
diff --git a/src/SDIO/driver_fw/driver/aic8800/Makefile b/src/SDIO/driver_fw/driver/aic8800/Makefile
--- a/src/SDIO/driver_fw/driver/aic8800/Makefile
+++ b/src/SDIO/driver_fw/driver/aic8800/Makefile
@@ -11,57 +11,12 @@ obj-$(CONFIG_AIC_WLAN_SUPPORT) += aic8800_bsp/
CONFIG_PLATFORM_ROCKCHIP = n
CONFIG_PLATFORM_ROCKCHIP2 = n
CONFIG_PLATFORM_ALLWINNER = n
-CONFIG_PLATFORM_AMLOGIC = n
-CONFIG_PLATFORM_UBUNTU = y
+export CONFIG_PLATFORM_AMLOGIC = y
+export CONFIG_PLATFORM_UBUNTU = n
MAKEFLAGS +=-j$(shell nproc)
-ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
-#KDIR = /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
-#ARCH = arm
-#CROSS_COMPILE = /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
-KDIR = /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
-ARCH = arm
-CROSS_COMPILE = /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
-#KDIR = /home/yaya/E/Rockchip/3399/rk3399-android-10/kernel
-#ARCH = arm64
-#CROSS_COMPILE = /home/yaya/E/Rockchip/3399/rk3399-android-10/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
-ccflags-y += -DANDROID_PLATFORM
-ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP
-endif
-
-ifeq ($(CONFIG_PLATFORM_ROCKCHIP2), y)
-ARCH = arm64
-KDIR = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
-CROSS_COMPILE = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
-ccflags-y += -DANDROID_PLATFORM
-ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP2
-endif
-
-
-ifeq ($(CONFIG_PLATFORM_ALLWINNER), y)
-KDIR = /home/yaya/E/Allwinner/R818/R818/AndroidQ/lichee/kernel/linux-4.9
-ARCH = arm64
-CROSS_COMPILE = /home/yaya/E/Allwinner/R818/R818/AndroidQ/lichee/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
-ccflags-y += -DANDROID_PLATFORM
-endif
-
-ifeq ($(CONFIG_PLATFORM_AMLOGIC), y)
-ccflags-y += -DANDROID_PLATFORM
-ARCH = arm
-CROSS_COMPILE = /home/yaya/D/Workspace/CyberQuantum/JinHaoYue/amls905x3/SDK/20191101-0tt-asop/android9.0/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-
-KDIR = /home/yaya/D/Workspace/CyberQuantum/JinHaoYue/amls905x3/SDK/20191101-0tt-asop/android9.0/out/target/product/u202/obj/KERNEL_OBJ/
-
-endif
-
-ifeq ($(CONFIG_PLATFORM_UBUNTU), y)
-KDIR = /lib/modules/$(shell uname -r)/build
-PWD = $(shell pwd)
-KVER = $(shell uname -r)
-MODDESTDIR = /lib/modules/$(KVER)/kernel/drivers/net/wireless/aic8800
-ARCH = x86_64
-CROSS_COMPILE =
-endif
+ccflags-y += -DANDROID_PLATFORM
all: modules
modules:
make -C $(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
3rd patch:
diff --git a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aicsdio.c b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aicsdio.c
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aicsdio.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aicsdio.c
@@ -39,7 +39,7 @@ static int aicbsp_bus_index = -1;
#include <linux/amlogic/aml_gpio_consumer.h>
extern void sdio_reinit(void);
extern void extern_wifi_set_enable(int is_on);
-extern void set_power_control_lock(int lock);
+//extern void set_power_control_lock(int lock);
#endif//for AML
@@ -486,7 +486,7 @@ static int aicbsp_platform_power_on(void)
extern_wifi_set_enable(1);
mdelay(200);
sdio_reinit();
- set_power_control_lock(1);
+ //set_power_control_lock(1);
#endif
#ifdef CONFIG_PLATFORM_ROCKCHIP2
The Bluetooth part of the chip is connected via UART on fe078000.serial, aka. /dev/ttyS1 (when using s4_s905w2_2g), probably in “H4” HCI mode. The power control, wake and interrupt pins, and also the 32k clock pin in the s4_s905w2_2g device tree seem to match the original device tree.
The kernel Bluetooth HCI part can be bound to the device using:
hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep
And after that and unlocking the rfkill, it works properly (at least with the aic8800 drivers loaded).