Wifi Driver Build for Generic ARM64

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wifi Driver Build for Generic ARM64

Jump to solution
5,541 Views
danishv
Contributor I

I was trying to build wifi driver for 88W9098 chipset on Generic arm platform. I build platform BSP build environment and was trying to make driver build. Am getting below eroe while build.

My concren is is there any where firmware binaries mentioned in Makefile? Where should be libraries present at time of build. I have both binaries and wifi driver source in home folder.

make build
make -C /home/asadmin/poky/build/tmp/work/qemuarm64-poky-linux/linux-yocto/5.14.21+gitAUTOINC+f9e349e174_9d5572038e-r0/linux-qemuarm64-standard-build M=/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src ARCH=arm64 CROSS_COMPILE=/home/asadmin/poky/build/tmp/work/cortexa57-poky-linux/libidn2/2.3.2-r0/recipe-sysroot-native/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/aarch64-poky-linux- modules
make[1]: Entering directory '/home/asadmin/poky/build/tmp/work/qemuarm64-poky-linux/linux-yocto/5.14.21+gitAUTOINC+f9e349e174_9d5572038e-r0/linux-qemuarm64-standard-build'
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_shim.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_init.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_txrx.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_misc.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_cfp.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_module.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_wmm.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sdio.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_pcie.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11n_aggr.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11n_rxreorder.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11n.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11ac.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11ax.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11d.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_11h.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_meas.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_scan.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sta_ioctl.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sta_rx.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sta_tx.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sta_event.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sta_cmd.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_sta_cmdresp.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_join.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_uap_ioctl.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan/mlan_uap_txrx.o
  LD [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlan.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.o
/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c: In function 'woal_send_fw_dump_complete_event':
/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c:900:13: warning: unused variable 'cfg80211_wext' [-Wunused-variable]
  900 |         int cfg80211_wext = priv->phandle->params.cfg80211_wext;
      |             ^~~~~~~~~~~~~
/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c: In function 'woal_send_disconnect_to_system':
/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c:8867:13: warning: unused variable 'cfg80211_wext' [-Wunused-variable]
8867 |         int cfg80211_wext = priv->phandle->params.cfg80211_wext;
      |             ^~~~~~~~~~~~~
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_ioctl.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_init.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_uap.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_proc.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_debug.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.o
  CC [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_pcie.o
  LD [M]  /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.o
  MODPOST /home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/Module.symvers
ERROR: modpost: "sdio_writeb" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "sdio_readb" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "sdio_writesb" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "sdio_enable_func" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "sdio_claim_irq" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "mmc_hw_reset" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "sdio_get_host_pm_caps" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "mmc_wait_for_req" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "mmc_set_data_timeout" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
ERROR: modpost: "sdio_readsb" [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/moal.ko] undefined!
WARNING: modpost: suppressed 10 unresolved symbol warnings because there were too many)
/home/asadmin/poky/build/tmp/work-shared/qemuarm64/kernel-source/scripts/Makefile.modpost:150: recipe for target '/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/Module.symvers' failed
make[3]: *** [/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/Module.symvers] Error 1
make[3]: *** Deleting file '/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src/Module.symvers'
/home/asadmin/poky/build/tmp/work-shared/qemuarm64/kernel-source/Makefile:1773: recipe for target 'modules' failed
make[2]: *** [modules] Error 2
/home/asadmin/poky/build/tmp/work-shared/qemuarm64/kernel-source/Makefile:220: recipe for target '__sub-make' failed
make[1]: *** [__sub-make] Error 2
make[1]: Leaving directory '/home/asadmin/poky/build/tmp/work/qemuarm64-poky-linux/linux-

yocto/5.14.21+gitAUTOINC+f9e349e174_9d5572038e-r0/linux-qemuarm64-standard-build'
Makefile:586: recipe for target 'default' failed
make: *** [default] Error 2

0 Kudos
1 Solution
5,487 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI,@danishv

I think your steps are correct just make sure you have built Linux Kernel Image before start to build Wi-Fi Driver.

Attachment is my steps of building Wi-Fi Driver.

You can see that there is Image under ~/linux-source-code/lf-5.15.5-1.0.0/linux-imx/arch/arm64/boot/.

We need this kernel Image for building Wi-Fi Driver.

About how to build kernel Image, I also do a build test for your reference.

 

Best regards,

Christine.

View solution in original post

0 Kudos
15 Replies
5,518 Views
danishv
Contributor I

Hi @Christine_Li 

I have exported KERNALDIR 

This my KERNALDIR after yocto build

export KERNLDIR=/home/asadmin/poky/build/tmp/work/qemuarm64-poky-linux/linux-yocto/5.14.21+gitAUTOINC+f9e349e174_9d5572038e-r0/linux-qemuarm64-standard-build/

 

btw I don't have access to this document UM11479 ​88Q9098/88W9098 Linux Yocto Integration User Guide – User manual​  can you please attach this here

Thanks

Danish

0 Kudos
5,513 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI,@Vallanchira Danish (Customer)​ ,

Are you using module of 88W9098? If yes, please ask the module partner for this file.

If not, please signed NDA with NXP and provide me the NDA number to verify, then apply secures files access according to attached guidance because this file is secure files. I am not allowed to attached it as attachment.

Sorry for causing any inconvenience.​

But for the special steps of cross compiling driver of Wi-Fi, I can write here for your reference:

===

Cross compile the driver and utilities for Wi-Fi
• Go to the directory PCIE-UAPSTA-UART-BT-9098-U16-X86--MXM4X17166_V0V1-
GPL/wlan_src


$ cd PCIE-UAPSTA-UART-BT-9098-U16-X86--MXM4X17166_V0V1-GPL/wlan_src/


• Modify the Makefile to change the kernel build directory
$ vim Makefile
Comment out the CC variable in the Makefile
#CC= $(CROSS_COMPILE)gcc -I$(COMPATDIR)


• Change the KERNELDIR
<absolute-path>/imx-yocto-bsp/<build dir>/tmp/work/imx8qmmekpoky-
linux/linux-imx/<linux-kernel-version>-r0/build/

• Build the driver package

$ make clean

$ make build

The compiled driver modules reside in PCIE-UAPSTA-UART-BT-9098-U16-X86--
MXM4X17166_V0V1-GPL/bin_wlan directory. The firmware binary resides in the PCIEWLAN-
UART-BT-9098-U16-X86-17.68.0.p190-17.26.0.p190-MXM4X17166_V0V1-GPL/
FwImage directory.

===

And please check your export command to make sure the spelling is correct, because I saw your command is :

export KERNLDIR=/home/asadmin/poky/build/tmp/work/qemuarm64-poky-linux/linux-yocto/5.14.21+gitAUTOINC+f9e349e174_9d5572038e-r0/linux-qemuarm64-standard-build/

should be:

export KERNELDIR=/home/asadmin/poky/build/tmp/work/qemuarm64-poky-linux/linux-yocto/5.14.21+gitAUTOINC+f9e349e174_9d5572038e-r0/linux-qemuarm64-standard-build/

 

Best regards,

Christine.

0 Kudos
5,505 Views
danishv
Contributor I

Hi Cristine,

Am not able to find the directory which you mentioned,

Please see below steps which am follwing from NXP document UM11675

Step 1: Down load NXP Wifi Driver source --> git clone http://github.com/nxp-imx/mwifiex.git

Step 2: Download firmware binares --> git clone https://github.com/NXP/imx-firmware.git

Step 3: Yocto build for  generic ARM64 platforms, first set up the toolchain for the generic
ARM64 platform.

Step 4: Driver build

export KERNELDIR=/absolute path to kernel build directory/

cd < driver source wlan_src directory >

/home/asadmin/nxpwifi/mwifiex/mxm_wifiex/wlan_src

Edit Makefile --> Kernal directory and cross compiler path

make Clean

make build

Kindly let me know if below steps are valid or not

Thanks

 

 

 

 

0 Kudos
5,488 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI,@danishv

I think your steps are correct just make sure you have built Linux Kernel Image before start to build Wi-Fi Driver.

Attachment is my steps of building Wi-Fi Driver.

You can see that there is Image under ~/linux-source-code/lf-5.15.5-1.0.0/linux-imx/arch/arm64/boot/.

We need this kernel Image for building Wi-Fi Driver.

About how to build kernel Image, I also do a build test for your reference.

 

Best regards,

Christine.

0 Kudos
5,464 Views
danishv
Contributor I
Hi,
Can you please explain how
source /opt/fsl-imx-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux
can set I dont have this directory
0 Kudos
5,453 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI,@danishv

source  /opt/fsl-imx-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux

is

$ source <toolchain installed directory>/environment-setup-<toolchain script>.

As shown in our doc:UM11675,Page 11, part 6.1 Step 4.

 /opt/fsl-imx-xwayland/5.15-kirkstone/ is my toolchain installed directory.

To create this directory, please follow UM11675 Part 6.1 i.MX 8M evaluation platform with Yocto.

But this is our i.MX product's toolchain, because I build it based on i.MX8MQ.

Based you are using generic Arm64 platform, please refer to your platform BSP build environment setup guide for the steps and procedure as mentioned in Part 6.2 in doc UM11675.

Once the toolchain installation and setup are complete, follow my steps to build Wi-Fi driver.

To emphasize again, please check your <absolute path to kernel build directory> and make sure you have Kernel Image, then export this directory to make build Wi-Fi Driver.

 

Best regards,

Christine.

0 Kudos
5,428 Views
danishv
Contributor I

Hi @Christine_Li 

I manged to build driver. kindly confrim below the final driver files ot is it somthing else ?

danishv_0-1676568734953.png

 

0 Kudos
5,409 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @danishv 

Congratulations!

Yes, the mlan.ko and moal.ko  are Wi-Fi driver.

These files are same as mine.

 

Best regards,

Christine.

0 Kudos
5,403 Views
danishv
Contributor I

hi @Christine_Li 

Thanks for confirmation , the firmware binares can i use from if-5.10y_2.0.0 or somthing else as host machine isrunning with kernal version 5.4.0

0 Kudos
5,397 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI,@danishv,

I think it's ok, just make sure the FW name is correct.

For 88W9098,WiFi and Bluetooth combo FW seems like: pcieuart9098_combo_v1.bin or sdiouart9098_combo_v1.bin.

And push the FW bin and wifi_mod_para.conf  to /lib/firmware/nxp/ before load driver.

By the way, if the driver building issue is resolved, please create a new case for other new issues because it is not good to track issue root cause and will be confused if we talk all issues in one case.

Best regards,

Christine.

0 Kudos
2,195 Views
Wobaffet
Senior Contributor I

Hello Christine,

You've mentioned 

And push the FW bin and wifi_mod_para.conf  to /lib/firmware/nxp/ before load driver.

How can we accomplish this process on our custom board. We've cross compiled the drivers but we for our custom board we can't transfer these files via ssh etc. Our custom board has only USB host feature, we flash our images built with yocto with serial download mode and test out our changes. So I think we need to add the generated driver binaries to our build. How can we do this task? Or do you have any other suggestion?

Thanks!

Best Regards. 

0 Kudos
2,173 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Wobaffet 

This is an old thread, and has been closed almost a year ago.

Can you please help to create a new thread to discuss your new issue?

Thanks for your understanding and your corporation.

 

Best regards,

Christine.

0 Kudos
5,481 Views
danishv
Contributor I

Hi Christine,

Thanks for the attachment its really helpful, one quick que can I follow same step for generic arm platform ? not imx architecture I can see the linux repo are for imx processors still this vaild for generic arm processor ? 

Thanks,

Danish

0 Kudos
5,473 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI, @danishv 

For generic arm platform, I suggest you to download their real Linux kernel source code and finish building kernel Image before building Wi-Fi driver. I.MX is also working on arm platform(as  my logs, it's arm64 ) based on Linux OS, so the building method should be similar, please have a try followed my steps. 

After building kernel image, the steps of building Wi-Fi Driver is same.

Best regards,

Christine.

0 Kudos
5,527 Views
Christine_Li
NXP TechSupport
NXP TechSupport

HI,@Vallanchira Danish (Customer)​ ,

Thanks for being interested in NXP products.

From the given logs, it looks like you didn't export the KERNELDIR before build the driver.

Please refer to UM11479 ​88Q9098/88W9098 Linux Yocto Integration User Guide – User manual​ (especially page 13,part 3.2.2 Cross compile the driver and utilities for Wi-Fi )for cross compile 88W9098 drivers.

Need to prepare related Kernel build image before build Wi-Fi Driver and modify the Makefile of wlan_src to change the kernel build directory.

About how to build kernel image, if you are using NXP's i.MX series, please refer to:

i.MX Porting Guide especially in Chapter 2 Porting Kernel.

If you are using your own host platform, please firstly build Kernel and modify Makefile of wlan_src to change the kernel build directory.

 

Best regards,

Christine.

0 Kudos