Android 13 Software Integration Guide for the Sona IF573 and Sterling LWBx+ radios

Overview

This document explains the steps required to integrate an Ezurio Sona IF573, LWB5, or LWB5+ module into a device running Android 13.

Integrating Wi-Fi and Bluetooth into specific Android platforms can be challenging and may require platform specific changes. If the following information is confusing or does not provide the expected results, please visit https://www.ezurio.com/resources/support for further assistance.

Ezurio has integrated these radios with an available commercial development kit. Each required change to the AOSP will be shown here. Your system may be different and so these modifications may need further adjustments on your system.

Be sure to review the Software Integration Guide for your selected radio:

Preliminary expectations

Familiarity with Android Open Source Project (AOSP)

We recommend you have built your development system initially prior to adding support from this document.

Ezurio Source

Source for support of Ezurio radios can be obtained via git repo or source tar packaging. This document will explain both methods but we recommend git access when possible.

The radio driver is provided via backports in order to support multiple kernel versions, the WPA supplicant with Ezurio specific changes, and radio firmware.

Git repo access

backports repo

firmware repo

supplicant repo

Source via tar packages

from: https://github.com/LairdCP/Sterling-LWB-and-LWB5-Release-Packages/releases

Obtain each of these packages:

  • backports package (backports-laird-.tar.bz2,
  • radio firmware for you specific radio and interface: ie
    • laird-if573--firmware-.tar.bz2
  • the supplicant package for Android 13:
    • android-13-summit-supplicant-src-LRD-REL-A13-.tar.gz

Placement of code and firmware in AOSP

Note: If your manifest has an existing wpa_supplicant package, you will need to remove it from the manifest and existing checkout before you can use the Ezurio Android Supplicant.

If using git repos to access the source, place the following in your manifest file (in this example, the release is ‘11.171.0.24’. Use the appropriate release version if different:

<!--Ezurio radio support -->
<remote  name="Ezurio-release"
       fetch="ssh://git@github.com/lairdCP/" />

<project path="external/wpa_supplicant_8" name="android_supplicant" groups="pdk" remote="Ezurio-release" revision="LRD-REL-A13-11.171.0.24" />
<project path="vendor/ezurio/backport" name="backports" remote="Ezurio-release" revision="LRD-REL-11.171.0.24" />
<project path="vendor/ezurio/firmware" name="radio_firmware" remote="Ezurio-release" revision="LRD-REL-11.171.0.24" />

After adding the above, a repo sync from your AOSP root directory should correctly place the three source repos in your build tree.

If placing the packages directly

Create a directory “ezurio” in the vendor directory of your AOSP’s root directory. Use tar to expand each package in that directory. For backports, create a symlink named backport which points to the newly expanded backports directory. Examples:

(after sourcing your build/envsetup file)

$ croot
$ mkdir vendor/ezurio
$ cp <your download location>/laird-*-firmware-*.tar.bz2 .
$ cp <your download location>/backports-laird-*.tar.bz2 .
$ tar xf laird-lwb*-firmware-*.tar.bz2
$ tar xf backports-laird-*.tar.bz2
$ ln -sf laird-backport-x.x.x.x/ backport

Compiling Backports

The backports driver package must be configured for the desired radio and then compiled against the proper Android Linux kernel for your project using the same compiler used for the remainder of the AOSP. The simplest way to accomplish this is to have the Android make system do the compilation. For our AOSP, we edited kernel.mk in the ./device/<company name>/common/build directory

diff --git a/common/build/kernel.mk b/common/build/kernel.mk
index cbed65ef..2efccc6d 100644
--- a/common/build/kernel.mk
+++ b/common/build/kernel.mk
@@ -207,6 +207,17 @@ KERNEL_DTB: $(KERNEL_CONFIG) $(TARGET_KERNEL_SRC) | $(KERNEL_OUT)
        $(hide) echo "Building $(KERNEL_ARCH) $(KERNEL_VERSION) device trees ... "
        $(hide) $(kernel_build_shell_env) $(MAKE) $(kernel_build_make_env) syncconfig
        $(hide) $(kernel_build_shell_env) $(MAKE) $(kernel_build_make_env) dtbs
+       $(hide) echo "building LWB/LWB5 module drivers"
+       $(hide) $(kernel_build_shell_env) $(MAKE) $(kernel_build_make_env) -C $(realpath vendor/ezurio/backport) KLIB_BUILD=$(realpath $(KERNEL_OUT)) defconfig-lwb6_nbt
+       $(hide) $(kernel_build_shell_env) $(MAKE) $(kernel_build_make_env) -C $(realpath vendor/ezurio/backport) KLIB_BUILD=$(realpath $(KERNEL_OUT))

The first invocation of make will configure the for appropriate defconfig you specify. The second will actually create the device driver modules.

The following drivers will be created

  • compat.ko
  • cfg80211.ko
  • brcmutil.ko
  • brcmfmac.ko

Kernel defconfig

ensure your kernel is built for using modules:

CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y

ensure the default cfg80211 is built as a module for the kernel (this version of cfg80211 will be replaced with the one created via backports)

CONFIG_CFG80211=m

init.rc additions

Choose the appropriate 2 digit regulatory domain for the ‘regdomain’ parameter. Example is FCC

insmod vendor/lib/modules/rfkill.ko
insmod vendor/lib/modules/compat.ko
insmod vendor/lib/modules/cfg80211.ko
insmod vendor/lib/modules/brcmutil.ko
insmod vendor/lib/modules/brcmfmac.ko regdomain="US"

BoardConfig.mk

BOARD_WLAN_DEVICE                := bcmdhd
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
BOARD_WPA_HOSTAPD_PRIVATE_LIB    := lib_driver_cmd_bcmdhd
BOARD_HAVE_BLUETOOTH             := true
BOARD_HAVE_BLUETOOTH_BCM         := true

SharedBoardConfig.mk

BOARD_VENDOR_KERNEL_MODULES += \
    vendor/ezurio/backport/backport/compat/compat.ko \
    vendor/ezurio/backport/backport/net/wireless/cfg80211.ko \
    vendor/ezurio/backport/backport/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko \
    vendor/ezurio/backport/backport/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko

Your device.mk

Add bluetooth options to product_packages

PRODUCT_PACKAGES += \
    bt_vendor.conf \
    libbt-vendor

Firmware

Each of the LWB family’s firmware files contains several different firmware files, each of which needs to be added to the PRODUCT_COPY_FILES entry. Here is an example showing all the possible firmware files. You should only include the files from your firmware package.

add the appropriate firmware files for your radio to the device.mk file: (use the symlink name)

(modify the interface as necessary):

LWB+ files

PRODUCT_COPY_FILES += \
  vendor/laird/firmware/laird-lwbplus-firmware/lib/firmware/brcm/BCM4343A2.hcd:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/BCM4343A2.hcd \
  vendor/laird/firmware/laird-lwbplus-firmware/lib/firmware/brcm/brcmfmac43439-sdio.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac43439-sdio.bin \
  vendor/laird/firmware/laird-lwbplus-firmware/lib/firmware/brcm/brcmfmac43439-sdio.txt:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac43439-sdio.txt \
  vendor/laird/firmware/laird-lwbplus-firmware/lib/firmware/brcm/brcmfmac43439-sdio.clm_blob:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac43439-sdio.clm_blob \

LWB5+ files

PRODUCT_COPY_FILES += \
  vendor/laird/firmware/laird-lwb5plus-sdio-div-firmware/lib/firmware/brcm/brcmfmac4373-sdio.txt:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac4373-sdio.txt \
  vendor/laird/firmware/laird-lwb5plus-sdio-div-firmware/lib/firmware/brcm/brcmfmac4373-sdio.clm_blob:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac4373-sdio.clm_blob \
  vendor/laird/firmware/laird-lwb5plus-sdio-div-firmware/lib/firmware/brcm/brcmfmac4373-sdio.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac4373-sdio.bin \
  vendor/laird/firmware/laird-lwb5plus-sdio-div-firmware/lib/firmware/brcm/BCM4373A0.hcd:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/BCM4373A0.hcd \

Sona IF573 files

PRODUCT_COPY_FILES += \
  vendor/laird/firmware/laird-if573-pcie-firmware/lib/firmware/cypress/cyfmac55572-pcie.clm_blob:$(TARGET_COPY_OUT_VENDOR)/firmware/cypress/cyfmac55572-pcie.clm_blob \
  vendor/laird/firmware/laird-if573-pcie-firmware/lib/firmware/cypress/cyfmac55572-pcie.trxse:$(TARGET_COPY_OUT_VENDOR)/firmware/cypress/cyfmac55572-pcie.trxse \
  vendor/laird/firmware/laird-if573-pcie-firmware/lib/firmware/cypress/cyfmac55572-pcie.txt:$(TARGET_COPY_OUT_VENDOR)/firmware/cypress/cyfmac55572-pcie.txt \
  vendor/laird/firmware/laird-if573-pcie-firmware/lib/firmware/brcm/CYW55560A1.hcd:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/CYW55560A1.hcd

Kernel changes/additions

for SDIO interface: - Disable 1.8Volts in the SDIO node in device tree. Example:

&usdhc2 {
	assigned-clocks = <&clk IMX8MP_CLK_USDHC2>;
	assigned-clock-rates = <400000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
	vmmc-supply = <&reg_usdhc2_vmmc>;
	bus-width = <4>;
	status = "okay";
	no-1-8-v;
};