From 0724baeaaf11454a5a92ff3428e1b4286beee97f Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Thu, 12 Dec 2024 01:07:02 +0200 Subject: [PATCH] Enable AMPAK AP6330 WiFi and Bluetooth Enable AMPAK AP6330 that combines Broadcom Wifi (BCM4330) and Bluetooth 4.0 (BCM40183) chips for sun9i devices such as Merrii A80 Optimus and Cubieboard 4. Signed-off-by: Leon Anavi --- conf/machine/cubieboard4.conf | 3 +++ conf/machine/include/hardware/ap6330.inc | 5 +++++ conf/machine/merrii-a80-optimus.conf | 3 +++ .../linux-firmware/linux-firmware_%.bbappend | 12 ++++++++++++ recipes-kernel/linux/linux-mainline/sun9i/defconfig | 2 +- 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 conf/machine/include/hardware/ap6330.inc diff --git a/conf/machine/cubieboard4.conf b/conf/machine/cubieboard4.conf index ac9559e..c0958b6 100644 --- a/conf/machine/cubieboard4.conf +++ b/conf/machine/cubieboard4.conf @@ -3,6 +3,9 @@ #@DESCRIPTION: Machine configuration for the cubieboard4, based on allwinner A80 CPU http://cubieboard.org/ require conf/machine/include/sun9i.inc +require conf/machine/include/hardware/ap6330.inc + +MACHINE_FEATURES:append = " bluetooth wifi" KERNEL_IMAGETYPE = "zImage" diff --git a/conf/machine/include/hardware/ap6330.inc b/conf/machine/include/hardware/ap6330.inc new file mode 100644 index 0000000..7ef7e28 --- /dev/null +++ b/conf/machine/include/hardware/ap6330.inc @@ -0,0 +1,5 @@ +# Include for boards with AMPAK AP6330 Wifi / Bluetooth module +# https://linux-sunxi.org/Wifi#Ampak + +MACHINE_EXTRA_RRECOMMENDS:append = " kernel-module-brcmfmac" +MACHINE_EXTRA_RDEPENDS:append = " linux-firmware-bcm4330" diff --git a/conf/machine/merrii-a80-optimus.conf b/conf/machine/merrii-a80-optimus.conf index b7fa263..e8317da 100644 --- a/conf/machine/merrii-a80-optimus.conf +++ b/conf/machine/merrii-a80-optimus.conf @@ -3,6 +3,9 @@ #@DESCRIPTION: Machine configuration for the Merrii A80 Optimus, based on Allwinner A80 CPU https://linux-sunxi.org/Merrii_A80_Optimus_Board require conf/machine/include/sun9i.inc +require conf/machine/include/hardware/ap6330.inc + +MACHINE_FEATURES:append = " bluetooth wifi" KERNEL_IMAGETYPE = "zImage" diff --git a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend index 6818912..90b7e90 100644 --- a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend +++ b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend @@ -11,3 +11,15 @@ do_install:append:sunxi() { ln -sf -r ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.xunlong,orangepi-zero-plus2-h3.txt ln -sf -r ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.friendlyarm,nanopi-neo-plus2.txt } + +do_install:append:cubieboard4() { + ln -sf -r ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.cubietech,a80-cubieboard4.bin +} + +do_install:append:merrii-a80-optimus() { + ln -sf -r ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.merrii,a80-optimus.bin +} + +do_install:append:sun9i() { + ln -sf -r ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.Prowise-PT301.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.txt +} diff --git a/recipes-kernel/linux/linux-mainline/sun9i/defconfig b/recipes-kernel/linux/linux-mainline/sun9i/defconfig index cfb637f..0c8dea6 100644 --- a/recipes-kernel/linux/linux-mainline/sun9i/defconfig +++ b/recipes-kernel/linux/linux-mainline/sun9i/defconfig @@ -897,7 +897,7 @@ CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" # CONFIG_MAC80211_MESSAGE_TRACING is not set # CONFIG_MAC80211_DEBUG_MENU is not set CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_RFKILL is not set +CONFIG_RFKILL=y # CONFIG_NET_9P is not set # CONFIG_CAIF is not set # CONFIG_CEPH_LIB is not set