From 992691c2bca395d41159c7e63c6dda0832a32e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20K=C3=A4stner?= Date: Fri, 21 Mar 2025 00:39:11 +0100 Subject: [PATCH] ap6212: enable bluetooth support --- conf/machine/include/hardware/ap6212a.inc | 6 ++- .../armbian-firmware/armbian-firmware_git.bb | 37 +++++++++++++++++++ .../sunxi-kmeta/features/ap6212/ap6212.scc | 5 +++ .../features/bluetooth/bluetooth-hciuart.cfg | 9 +++++ .../features/bluetooth/bluetooth-hciuart.scc | 3 ++ .../features/wifi/broadcom-sdio.cfg | 7 ++++ .../sunxi-kmeta/features/wifi/wifi-sdio.scc | 5 +++ 7 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 recipes-kernel/armbian-firmware/armbian-firmware_git.bb create mode 100644 recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/ap6212/ap6212.scc create mode 100644 recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.cfg create mode 100644 recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.scc create mode 100644 recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/broadcom-sdio.cfg create mode 100644 recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/wifi-sdio.scc diff --git a/conf/machine/include/hardware/ap6212a.inc b/conf/machine/include/hardware/ap6212a.inc index e8f4dcd..1c9eba1 100644 --- a/conf/machine/include/hardware/ap6212a.inc +++ b/conf/machine/include/hardware/ap6212a.inc @@ -1,7 +1,9 @@ # Include for boards with AMPAK 6212A Wifi / Bluetooth module # https://linux-sunxi.org/Wifi#Ampak -MACHINE_EXTRA_RRECOMMENDS:append = " kernel-module-brcmfmac" -MACHINE_EXTRA_RDEPENDS:append = " linux-firmware-bcm43430" +MACHINE_EXTRA_RRECOMMENDS:append = " kernel-module-brcmfmac kernel-module-hci-uart" +MACHINE_EXTRA_RDEPENDS:append = " linux-firmware-bcm43430 armbian-firmware-ap6212" MACHINE_FEATURES:append = " bluetooth wifi" + +KERNEL_FEATURES:append = "features/ap6212/ap6212.scc" diff --git a/recipes-kernel/armbian-firmware/armbian-firmware_git.bb b/recipes-kernel/armbian-firmware/armbian-firmware_git.bb new file mode 100644 index 0000000..ca36687 --- /dev/null +++ b/recipes-kernel/armbian-firmware/armbian-firmware_git.bb @@ -0,0 +1,37 @@ +SUMMARY = "Armbian Firmware" +DESCRIPTION = "Collection of firmware files necessary for Armbian supported hardware devices to work correctly with the Linux kernel" +LICENSE = "CLOSED" + +PV = "1.0+git" +SRC_URI = "git://github.com/armbian/firmware.git;protocol=https;branch=master" +SRCREV = "4050e02da2dce2b74c97101f7964ecfb962f5aec" + +S = "${WORKDIR}/git" + +inherit allarch + +do_compile[noexec] = "1" + +do_install() { + # ap6212 (bluetooth firmware only, wifi firmware is provided by linux-firmware-bcm43430) + install -d "${D}${nonarch_base_libdir}/firmware/ap6212" + install -m 0644 "${S}/ap6212/bcm43438a1.hcd" "${D}${nonarch_base_libdir}/firmware/ap6212/" + install -d "${D}${nonarch_base_libdir}/firmware/brcm" + ln -sf ../ap6212/bcm43438a1.hcd "${D}${nonarch_base_libdir}/firmware/brcm/BCM43430A1.hcd" +} + +PACKAGES =+ " \ + ${PN}-ap6212 \ +" + +FILES:${PN}-ap6212 = " \ + ${nonarch_base_libdir}/firmware/ap6212/* \ + ${nonarch_base_libdir}/firmware/brcm/BCM43430A1.hcd \ +" + + +# Make armbian-firmware depend on all of the split-out packages. +python populate_packages:prepend () { + firmware_pkgs = oe.utils.packages_filter_out_system(d) + d.appendVar('RRECOMMENDS:armbian-firmware', ' ' + ' '.join(firmware_pkgs)) +} diff --git a/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/ap6212/ap6212.scc b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/ap6212/ap6212.scc new file mode 100644 index 0000000..f3b773b --- /dev/null +++ b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/ap6212/ap6212.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "AMPAK 6212(A) Wifi / Bluetooth module support" + +include features/bluetooth/bluetooth-hciuart.scc +include features/wifi/wifi-sdio.scc diff --git a/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.cfg b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.cfg new file mode 100644 index 0000000..1d1a3f7 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.cfg @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: MIT + +# Dependencies +CONFIG_SERIAL_DEV_BUS=y +CONFIG_SERIAL_DEV_CTRL_TTYPORT=y + +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_SERDEV=y +CONFIG_BT_HCIUART_BCM=y diff --git a/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.scc b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.scc new file mode 100644 index 0000000..44516bd --- /dev/null +++ b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/bluetooth/bluetooth-hciuart.scc @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +kconf hardware bluetooth-hciuart.cfg diff --git a/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/broadcom-sdio.cfg b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/broadcom-sdio.cfg new file mode 100644 index 0000000..744c4e3 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/broadcom-sdio.cfg @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +CONFIG_WLAN_VENDOR_BROADCOM=y + +# brcm80211 +CONFIG_BRCMUTIL=m +CONFIG_BRCMFMAC=m +CONFIG_BRCMFMAC_SDIO=y diff --git a/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/wifi-sdio.scc b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/wifi-sdio.scc new file mode 100644 index 0000000..412382e --- /dev/null +++ b/recipes-kernel/linux/linux-mainline/sunxi-kmeta/features/wifi/wifi-sdio.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable SDIO WiFi Drivers" +define KFEATURE_COMPATIBILITY board + +kconf hardware broadcom-sdio.cfg