Building wifi driver for arm64 and installing to target device

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

Building wifi driver for arm64 and installing to target device

Jump to solution
2,313 Views
ccastro
Contributor II

Hi,

I am attempting to build and load a wifi driver for arm64. The target device is an IMX8 quadmax using advantech's rom7720 dev kit. The target is running 4.14.98 sumo and using Yocto BSP 2.5. I am using a Ubuntu (18.04) virtual machine as my build environment with all the necessary tools/toolchains installed.

The wifi module is CMP9620 by California Eastern Laboratories (link to product page here https://www.cel.com/product/cmp9620/)

I have been following the steps from the following post: https://community.nxp.com/t5/Wireless-Connectivity/Wifi-Driver-Build-for-Generic-ARM64/m-p/1598321

Christine provided two text files showing the steps for both building the Linux Source Kernel and for building the Driver.

I was able to successfully follow the steps to build the Linux Kernel (for $ARCH = ARM64 and $CROSS_COMPILE = aarch64-poky-linux-) using Christine's guide. I did not have any errors following these steps for building linux kernel.

Next I followed Christine's guide for building the wifi driver. I was able to successfully generate the mlan.ko and moal.ko files for the driver, I did not have any errors in this step either.

My question is, now that I have built the kernel and built the driver, what are the actual steps to install on the target device? This is my first time building a driver, so I am unsure of this process. The driver files provided by the manufacturer contains steps to do this, but it was written for a raspberry pi and I am unclear which steps are relevant for me or not. I will post the steps document included with the manufacturer provided driver files.

The basic steps in the driver guide provided by the manufacturer are as follows:
* Install git and build tools
* Clone Linux kernel / acquire source
* Build Linux image and dtbs
* Build mlan.ko and moal.ko
* Move kernel, drivers, firmware into place on target system


To the best of my knowledge, I have accomplished steps 1-4. In Christine's guide it did not explicitly mention building the DTBS but within my linux-source/arch/arm64/boot/dts I have many directories with vendor names and there are .DTB files within. So I assume that DTBS step is completed as well? If that is not the case then I could use some clarification on that part.

Can anyone help provide steps to install the necessary output files onto my target system?

Thank you

0 Kudos
Reply
1 Solution
2,138 Views
cdoumenc
NXP Employee
NXP Employee

Regarding linux kernel image and device tree (dts), since they are specific to Advantech sw package and Advantech ROM-7720 board hardware, I think it is better to check with Advantech support (docs on their wiki or online support).

linux-build.txt file is provided by Advantech. "overlays" isn't related to NXP system.
Which symbolic links are you speaking of ?
If you use a flash drive, I think "cp" is enough to transfer files to your host. No need of scp which is needed to transfer files between two machines over a network (ex : ethernet, wlan, etc...)
For NXP part, as your file linux-build.txt explains, here are the files you need to push to your target (2 driver files mlan.ko and one fw file .bin) :

Driver: copy the built mlan.ko and moal.ko to your target

Firmware: copy fw bin file (ex : pcieuart9098_combo_v1.bin) to your target, usually /lib/firmware/nxp/ directory

View solution in original post

7 Replies
2,235 Views
cdoumenc
NXP Employee
NXP Employee

Hi,
I see you are using an old Linux version 4.14.98 which will cause many limitations when used together with CMP9620 and recent up-to-date drivers.
Is it possible for you to switch to a more recent one ("Yocto 3.0  (Kernel 5.4.70)" for instance as I see in "Software Resource" ROM-7720 - ESS-WIKI (advantech.com.tw)
 link from your devkit page ROM-7720 - Advantech) ?

"Can anyone help provide steps to install the necessary output files onto my target system?"
Since you are using an Ubuntu VM, I suppose you can use "scp" (Secure copy protocol - Wikipedia) to push .ko files on your target, as the following example :
$ scp ~/temp/mlan.ko root@192.168.1.2:~/
I hope it answers your question.

2,206 Views
ccastro
Contributor II

Thank you for your reply. I did notice Yocto 3.0 is supported so that is an option I can try if I am unable to proceed with my current route.

Could you clarify something for me? Are the only files I need to push to my target system the .ko files? This is really the point I'm hung up on. When building the source kernel, I ended up with an Image and Image.gz file as well as a DTS directory (within linux-source/arch/arm64/boot). Is there anything I need to do with the Image or DTS directory? I'm just not certain what files from the process are required on the target system and where they need to be placed.

The reason I ask is because I found the following instructions in the linux-build.txt file provided with the driver:

"Then, move your built kernel and dtbs into place for use on the device. On the RPi:

```
cd ../../..linux
sudo cp /boot/kernel7.img /boot/kernel7-backup.img
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/kernel7.img
```

Install system modules:

```
sudo make ARCH=arm INSTALL_MOD_PATH=/ modules_install
```

Copy mlan.ko and moal.ko into a useable space on the target system build:"

I do not have a directory within DTS called overlays as the instructions above suggest. I attempted to copy all the generated build files to a flash drive so that I could get the files on the target system, but I was met with an error about copying symbolic links. I supposed this is where the scp command comes in. The directions for placing the .ko files on the target seems simple enough but I was unsure if those were the only files I needed. Can you confirm or clarify?

I have attached a screenshot of the files that were generated from building the kernel and driver.

Thank you

0 Kudos
Reply
2,139 Views
cdoumenc
NXP Employee
NXP Employee

Regarding linux kernel image and device tree (dts), since they are specific to Advantech sw package and Advantech ROM-7720 board hardware, I think it is better to check with Advantech support (docs on their wiki or online support).

linux-build.txt file is provided by Advantech. "overlays" isn't related to NXP system.
Which symbolic links are you speaking of ?
If you use a flash drive, I think "cp" is enough to transfer files to your host. No need of scp which is needed to transfer files between two machines over a network (ex : ethernet, wlan, etc...)
For NXP part, as your file linux-build.txt explains, here are the files you need to push to your target (2 driver files mlan.ko and one fw file .bin) :

Driver: copy the built mlan.ko and moal.ko to your target

Firmware: copy fw bin file (ex : pcieuart9098_combo_v1.bin) to your target, usually /lib/firmware/nxp/ directory

2,133 Views
ccastro
Contributor II

Thank you for your responses. I realize now that many of my questions are better directed to Advantech so I have reached out to them as suggested.

I am relatively new and inexperienced in embedded Linux and building kernels/drivers so I apologize if some of my questions don't make sense.

Thank you for your instructions for the driver files. I was able to use SCP as you suggested to copy over the .KO and firmware .BIN files to my target device.

0 Kudos
Reply
2,106 Views
cdoumenc
NXP Employee
NXP Employee

Don't worry, all questions are valid to build experience. We all have been beginners one day...
We learn from each others on various topics.
And embedded world is quite complex.

0 Kudos
Reply
2,212 Views
ccastro
Contributor II

Also do you know if it's possible to upgrade from yocto 2.5 straight to 3.0 or do I have to upgrade to each intermediate version--2.6 then 2.7 then 2.8 etc until 3.0?

0 Kudos
Reply
2,147 Views
cdoumenc
NXP Employee
NXP Employee

I think you should ask Advantech since they are offering these 2 versions on their wiki