Overview

This document explains the steps required to integrate an Ezurio Sona NX611 module into a device running Android versions 14-16.

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/BSP of that kit 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 Tutorials for this radio:

Preliminary expectations

  • We recommend you have 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.

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

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.

Example to remove the existing project:

<remove-project path="external/wpa_supplicant_8" name="aosp_platform_external_wpa_supplicant_8" remote="imx-android" revision="refs/tags/android-16.0.0_1.0.0" />

Place the following in your manifest file (in this example, the radio stack release is ‘13.98.0.12’. Use the appropriate radio stack release version if different:

<!--Ezurio radio support -->

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

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

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

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 nx611 module drivers"
+       $(hide) $(kernel_build_shell_env) $(MAKE) $(kernel_build_make_env) -C $(realpath vendor/ezurio/backport/backport) KLIB_BUILD=$(realpath $(KERNEL_OUT)) defconfig-sona_611
+       $(hide) $(kernel_build_shell_env) $(MAKE) $(kernel_build_make_env) -C $(realpath vendor/ezurio/backport/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
  • mlan.ko
  • moal.ko
  • btnxpuart.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

insmod vendor/lib/modules/rfkill.ko
insmod vendor/lib/modules/compat.ko
insmod vendor/lib/modules/cfg80211.ko
insmod vendor/lib/modules/moal.ko mod_para=nxp/wifi_prod_params.conf

BoardConfig.mk

BOARD_HAVE_BLUETOOTH         := true
WPA_SUPPLICANT_VERSION       := VER_0_8_X
BOARD_WPA_SUPPLICANT_DRIVER  := NL80211
BOARD_HOSTAPD_DRIVER         := NL80211

SharedBoardConfig.mk

Note: The pwrseq_simple.ko driver may already be included by your configuration. Only add it here if it is not already included.

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/summit/mwifiex/mxm_wifiex/wlan_src/mlan.ko \
    vendor/ezurio/backport/backport/drivers/net/wireless/summit/mwifiex/mxm_wifiex/wlan_src/moal.ko \
    $(KERNEL_OUT)/drivers/mmc/core/pwrseq_simple.ko

Firmware

Your device.mk

PRODUCT_COPY_FILES += \                                                         
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/sd_w61x_v1.bin.se:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/sd_w61x_v1.bin.se \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/sduart_nw61x_v1.bin.se:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/sd_w61x_v1.bin.se \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/uartspi_n61x_v1.bin.se:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/uartspi_n61x_v1.bin.se \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/sduart_nw61x_v1.bin.se:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/sduart_nw61x_v1.bin.se \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/rgpower_WW.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/rgpower_WW.bin \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/rgpower_US.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/rgpower_US.bin \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/wifi_prod_params.conf:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/wifi_prod_params.conf \
  vendor/ezurio/firmware/summit-nx61x-firmware/lib/firmware/nxp/wifi_prod_serdev_params.conf:$(TARGET_COPY_OUT_VENDOR)/firmware/nxp/wifi_prod_serdev_params.conf

Kernel device tree changes/additions

Hardware handshaking is required on the Bluetooth UART. Check if the UART port in use is configured with CTS/RTS handshaking enabled. The UART interface on the M.2 slot is uart1 (ttymxc0) on the iMX8MP EVK that we use. The iMX8MP EVK device tree enables handshaking by default on uart1 with:

 &uart1 {
         pinctrl-names = “default”;
         …
         fsl,uart-has-ctsrts;
         status = “okay”;
 };

for SERDEV usage (assuming kernel 4.14 or later)

 &uart1 {
         …
         bluetooth {
                 compatible = "nxp,88w8987-bt";
                 fw-init-baudrate = <3000000>;
         };
         …
 };

Driver loading

Ensure the correct parameters are loaded for the moal.ko driver. In Early.init.cfg, add these lines:

insmod vendor/lib/modules/rfkill.ko
insmod vendor/lib/modules/compat.ko
insmod vendor/lib/modules/cfg80211.ko
insmod vendor/lib/modules/mlan.ko
insmod vendor/lib/modules/moal.ko mod_para=nxp/wifi_prod_params.conf
# support insmod xx.ko; setprop xx xx; modeprobe
modprobe