Want to port wifi driver to imx28evk.

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

Want to port wifi driver to imx28evk.

Jump to solution
9,929 Views
pt
Senior Contributor I

Hi,

I have IMX28EVK . I need to connect a wifi module based on marvell sd 8787(sdio wifi module driver) .

I have linux bsp for imx28 and wfi driver sd8787. Do I have to edit wifi driver files to work with imx28evk?

Do I have to edit any files of bsp source ? Please help me.

thanks

pt

Labels (3)
1 Solution
5,672 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello, Pt A R

   Please see following advice for your porting WIFI to I.MX28 system!

>> Do I have to edit wifi driver files to work with imx28evk?

Yes,  you must compile SD8787 driver with cross-compiler that released with i.mx28 linux BSP(LTIB), In order to debug wifi conveniently, you had better compile wifi driver to be module(.ko file), Then use command line to load SD8787 driver.

# insmod sd8787.ko "here is firmware"

Note: except for driver for 8787, you should also have firmware give by marvell, I recommand you contact marvell or distrabutor and get corresonding documents about SD8787 linux porting.

In addition, you also need to check if SD pins for WIFI have been iomuxed in BSP file, if not, add them ,please!

>> Debuging wifi in linux system

Let me introduce some tools for wifi debuging in linux.

(1)iwconfig

(2)wpa_supplicant

(3)wpa_cli

configuration file is : wpa_supplicant.conf

On how to debug wifi by using above tools on linux platform, you can get much more information from internet, so please search them and learn how to use them.

Regards,

Weidong

View solution in original post

35 Replies
4,940 Views
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. i.MX Community ) to get it visible for active members.

For details please see general advice Where to post a Discussion? (https://community.freescale.com/docs/DOC-99909 )

Thank you for using Freescale Community.

5,673 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello, Pt A R

   Please see following advice for your porting WIFI to I.MX28 system!

>> Do I have to edit wifi driver files to work with imx28evk?

Yes,  you must compile SD8787 driver with cross-compiler that released with i.mx28 linux BSP(LTIB), In order to debug wifi conveniently, you had better compile wifi driver to be module(.ko file), Then use command line to load SD8787 driver.

# insmod sd8787.ko "here is firmware"

Note: except for driver for 8787, you should also have firmware give by marvell, I recommand you contact marvell or distrabutor and get corresonding documents about SD8787 linux porting.

In addition, you also need to check if SD pins for WIFI have been iomuxed in BSP file, if not, add them ,please!

>> Debuging wifi in linux system

Let me introduce some tools for wifi debuging in linux.

(1)iwconfig

(2)wpa_supplicant

(3)wpa_cli

configuration file is : wpa_supplicant.conf

On how to debug wifi by using above tools on linux platform, you can get much more information from internet, so please search them and learn how to use them.

Regards,

Weidong

4,940 Views
pt
Senior Contributor I

hello

Thank you Mr.Weidong for the support. I will follow the instructions.

weidong.sun

0 Kudos
Reply
4,940 Views
pt
Senior Contributor I

weidong.sun

done the following ...         

a) Copy firmware image sd8787_uapsta.bin | ... to

    /system/etc/firmware/mrvl/ directory, create the directory if it doesn't exist.

  b) Install WLAN driver,

    For example, to install SD8787 driver,

  insmod mlan.ko

  insmod sd8787.ko

but not recognizing wifi module.please help.

in which file should i edit to make sd pin iomuxed?

0 Kudos
Reply
4,940 Views
pt
Senior Contributor I

Hi weidong.sun,freescale-admin,alejandrolozano,jimmychan,JiangJustin

     Evaluation-kit : MCIMXEVK

     Linux             :2.6.35 version

     Wifi driver      :MARVELL SD8787

     I have the linux-2.6.35 kernel image(build from the L2.6.35_1.1.0_130130_source  customized for imx28). I want to install the marvell sd8787 driver to enable my wifi module.I have the following sources...

 

     Wifi driver source available:

     1. mlan.ko and sd8787.ko (supports linux2.6.32)

     2. imx53-wifi driver source[ didn't use the config file imx53. I have just used the fwImage (sd8787_uapsta.bin),wlan_src file from that source.]

          a) which conatins sd8787_uapsta.bin file

          b)sd8787/wlan_src - marvell wifi driver source.[have built the mlan.ko and sd8xxx.ko using the source  ]


Successfully booting from sd card and logged in as root( freescale login: root).

root@freescale

As per the readme file available with the 2nd source( imx53-wifi driver source ), I have created a directory for the marvell wifi driver( /system/etc/firmware/mrvl/)

and copied the sd8787_uapsta.bin file to it. and then did the following

1.insmod mlan.ko

2.insmod sd8xxx.ko [drv_mode=3] [fw_name=mrvl/sd8787_uapsta.bin]

Thus I installed wlan driver. But wifi module is not recognizing.

Doubts:

I have got the wlan source and sd8787_uapsta.bin file from i.MX53_SD8787_src_Release-1.0 . Are these files are general for imx processors or the sd8787 source is different for each processor? Then where should I have to edit to customize the sd8787 source for imx28? Please help me.

alejandrolozano please check this issue and help me.

0 Kudos
Reply
4,940 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt A R

I think you can check that smth like sd8787_probe is called in

codes, you need to add init function for sd8787 device in arch/arm/mach-mx28/device.c.

Also one needs to add device for "sd8787_sdio". You can reference all the

other modules init function in device.c how the device is added, such as below.

static void __init mx28_init_pxp(void)

{

  struct platform_device *pdev;

  pdev = mxs_get_device("mxs-pxp", 0);

  if (pdev == NULL || IS_ERR(pdev))

  return;

  pdev->resource = pxp_resource;

  pdev->num_resources = ARRAY_SIZE(pxp_resource);

  mxs_add_device(pdev, 3);

}

Best regards

chip

4,941 Views
pt
Senior Contributor I

Hi igorpadykov ,

     Thanks  igorpadykov.

 

     Please check this log. This is what I get when I connect the wifi module.

     message log:

     mmc1: new high speed SDIO card at address 0001

     Enter: mlan_register

     Enter: wlan_disable_host_int

     Enter: wlan_sdio_disable_host_int_mask

     Leave: wlan_sdio_disable_host_int_mask

     Leave: wlan_disable_host_int

     SDIO FUNC1 IO port: 0x10000

     Enter: wlan_init_lock_list

     Leave: wlan_init_lock_list

     Enter: wlan_init_timer

     Leave: wlan_init_timer

     Leave: mlan_register

    request_firmware() failed, error code = 0xfffffffe

     Firmware Init Failed

     Enter: mlan_unregister

     Enter: wlan_free_timer

     Leave: wlan_free_timer

     Enter: wlan_free_lock_list

     Leave: wlan_free_lock_list

     Leave: mlan_unregister

     woal_add_card failed

     wlan_sdio: probe of mmc1:0001:1 failed with error -1

regards

pt

0 Kudos
Reply
4,940 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

On iMX28 EVK, to support this 8787 wifi card, in kernel, the followed feature should be built as module. And the firmware should be put to "\lib\firmware\mrvl\sd8787_uapsta.bin"

Kernel config menuconfig

-*- Networking support  -->

    -*- Wireless -->

        <M> cfg80211 - wireless configuration API

$ insmod cfg80211.ko

$ insmod mlan.ko

$ insmod sd8xxx.ko drv_mode=1

$ ifconfig mlan0 up


4,940 Views
pt
Senior Contributor I

Hi

Thanks Qiang_FSL.

I am getting this error while using the following command :

#iwconfig mlan0 essid <ap-ssid>

Enter: wlan_is_network_compatible

wlan_is_network_compatible() FAILED: index=0 wpa_ie=0x0 wpa2_ie=0x30 WEP=d WPA=d WPA2=d EncMode=0x0 privacy=0x1

Error for wireless request "Set ESSID" (8B1A) :

SET failed on device mlan0 ; Bad address.

Regards

Pt.

0 Kudos
Reply
4,940 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For example, my wireless AP SSID is "testap", there is no WEP or WPA password, then I can use the followed command to link the AP:

$ iwconfig mlan0 essid testap

0 Kudos
Reply
4,940 Views
pt
Senior Contributor I

Qiang_FSL

my wireless ap is airtel123. I have used  the command -

iwconfig mlan0 essid airtel123

but it says "BAD ADDRESS"

wlan_is_network_compatible() FAILED: index=0 wpa_ie=0x0 wpa2_ie=0x30 WEP=d WPA=d WPA2=d EncMode=0x0 privacy=0x1

Leave: wlan_is_network_compatible

Leave: wlan_find_ssid_in_list

Can not find ssid airtel123

Leave: wlan_find_bss

Leave: wlan_bss_ioctl_find_bss

Leave: wlan_bss_ioctl

Leave: mlan_sta_ioctl

Leave: mlan_ioctl

Error for wireless request "Set ESSID" (8B1A) :

    SET failed on device mlan0 ; Bad address.

0 Kudos
Reply
4,940 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

If you run iwconfig, what will you see?

I haven't get this issue, I used the L2.6.35_1.1.0_ER_iMX28 BSP, the wifi driver version is "SD-UAPSTA-BT-FM-8787-LINUX2632-PXA920-14 57 5 p86-M2614130 p47_AX-GPL". It works fine.

0 Kudos
Reply
4,940 Views
pt
Senior Contributor I


Hi Qiang_FSL, igorpadykov


$ insmod cfg80211.ko throws an error:-


root@freescale /home/user$ insmod cfg80211.ko

cfg80211: disagrees about version of symbol wireless_send_event

cfg80211: Unknown symbol wireless_send_event (err -22)

insmod: can't insert 'cfg80211.ko': Invalid argument


0 Kudos
Reply
4,940 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

That means your kernel and the cfg80211.ko module are not built from the same kernel config. Please update the kernel and cfg80211.ko together.

0 Kudos
Reply
4,940 Views
pt
Senior Contributor I

Hi Qiang_FSL

The cfg80211.ko module have built in the same ltib.

we write the file system to sd card using this command

./mk_mx28_sd /dev/sdb

Then use the insmod cfg80211.ko command to install the module.

This is the message log which I get

root@freescale /home/user$ insmod cfg80211.ko

cfg80211: disagrees about version of symbol skb_copy_bits

cfg80211: Unknown symbol skb_copy_bits (err -22)

cfg80211: disagrees about version of symbol rfkill_unregister

cfg80211: Unknown symbol rfkill_unregister (err -22)

cfg80211: disagrees about version of symbol skb_put

cfg80211: Unknown symbol skb_put (err -22)

cfg80211: disagrees about version of symbol consume_skb

cfg80211: Unknown symbol consume_skb (err -22)

cfg80211: disagrees about version of symbol rfkill_blocked

cfg80211: Unknown symbol rfkill_blocked (err -22)

cfg80211: disagrees about version of symbol rfkill_destroy

cfg80211: Unknown symbol rfkill_destroy (err -22)

cfg80211: disagrees about version of symbol genlmsg_multicast_allns

cfg80211: Unknown symbol genlmsg_multicast_allns (err -22)

cfg80211: disagrees about version of symbol pskb_expand_head

cfg80211: Unknown symbol pskb_expand_head (err -22)

cfg80211: disagrees about version of symbol kfree_skb

cfg80211: Unknown symbol kfree_skb (err -22)

cfg80211: disagrees about version of symbol netlink_broadcast

cfg80211: Unknown symbol netlink_broadcast (err -22)

cfg80211: disagrees about version of symbol __alloc_skb

cfg80211: Unknown symbol __alloc_skb (err -22)

cfg80211: disagrees about version of symbol rfkill_resume_polling

cfg80211: Unknown symbol rfkill_resume_polling (err -22)

cfg80211: disagrees about version of symbol kobject_uevent_env

cfg80211: Unknown symbol kobject_uevent_env (err -22)

cfg80211: disagrees about version of symbol __dev_get_by_index

cfg80211: Unknown symbol __dev_get_by_index (err -22)

cfg80211: disagrees about version of symbol skb_pull

cfg80211: Unknown symbol skb_pull (err -22)

cfg80211: disagrees about version of symbol genl_register_family_with_ops

cfg80211: Unknown symbol genl_register_family_with_ops (err -22)

cfg80211: disagrees about version of symbol rfkill_pause_polling

cfg80211: Unknown symbol rfkill_pause_polling (err -22)

cfg80211: disagrees about version of symbol netlink_unicast

cfg80211: Unknown symbol netlink_unicast (err -22)

cfg80211: disagrees about version of symbol dev_get_by_index

cfg80211: Unknown symbol dev_get_by_index (err -22)

cfg80211: disagrees about version of symbol dev_close

cfg80211: Unknown symbol dev_close (err -22)

cfg80211: disagrees about version of symbol skb_push

cfg80211: Unknown symbol skb_push (err -22)

cfg80211: disagrees about version of symbol wireless_send_event

cfg80211: Unknown symbol wireless_send_event (err -22)

cfg80211: disagrees about version of symbol nla_put

cfg80211: Unknown symbol nla_put (err -22)

cfg80211: disagrees about version of symbol rfkill_set_hw_state

cfg80211: Unknown symbol rfkill_set_hw_state (err -22)

cfg80211: disagrees about version of symbol ethtool_op_get_link

cfg80211: Unknown symbol ethtool_op_get_link (err -22)

cfg80211: disagrees about version of symbol rfkill_alloc

cfg80211: Unknown symbol rfkill_alloc (err -22)

cfg80211: disagrees about version of symbol dev_alloc_skb

cfg80211: Unknown symbol dev_alloc_skb (err -22)

cfg80211: disagrees about version of symbol __pskb_pull_tail

cfg80211: Unknown symbol __pskb_pull_tail (err -22)

cfg80211: disagrees about version of symbol skb_trim

cfg80211: Unknown symbol skb_trim (err -22)

cfg80211: disagrees about version of symbol rfkill_register

cfg80211: Unknown symbol rfkill_register (err -22)

cfg80211: disagrees about version of symbol dev_change_net_namespace

cfg80211: Unknown symbol dev_change_net_namespace (err -22)

cfg80211: disagrees about version of symbol rfkill_set_sw_state

cfg80211: Unknown symbol rfkill_set_sw_state (err -22)

insmod: can't insert 'cfg80211.ko': Invalid argument

0 Kudos
Reply
4,940 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

In your kernel ".config" file, you should make sure the followed wireless config:

CONFIG_WIRELESS=y

CONFIG_WIRELESS_EXT=y

CONFIG_WEXT_CORE=y

CONFIG_WEXT_PROC=y

CONFIG_WEXT_SPY=y

CONFIG_WEXT_PRIV=y

CONFIG_CFG80211=m

# CONFIG_NL80211_TESTMODE is not set

# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set

# CONFIG_CFG80211_REG_DEBUG is not set

CONFIG_CFG80211_DEFAULT_PS=y

# CONFIG_CFG80211_DEBUGFS is not set

# CONFIG_CFG80211_INTERNAL_REGDB is not set

CONFIG_CFG80211_WEXT=y

CONFIG_WIRELESS_EXT_SYSFS=y

CONFIG_LIB80211=y

# CONFIG_LIB80211_DEBUG is not set

# CONFIG_MAC80211 is not set

4,940 Views
pt
Senior Contributor I

Hi Qiang_FSL


in my kernel  .config file ,

/* wireless configuration */

     CONFIG_CFG80211_DEBUGFS =y

     CONFIG_LIB80211 is not set

     CONFIG_MAC80211=m

except these three other configs are same as in your reply


Now I alter the config to ...

     CONFIG_CFG80211_DEBUGFS is not set

     CONFIG_LIB80211 =y

     CONFIG_MAC80211 is not set


This time also I am getting the error as:


root@freescale /home/user$ insmod cfg80211.ko

cfg80211: disagrees about version of symbol wireless_send_event

cfg80211: Unknown symbol wireless_send_event (err -22)

insmod: can't insert 'cfg80211.ko': Invalid argument




0 Kudos
Reply
4,940 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

In kernel config menu, Device Drivers -> Network device support -> Wireless LAN, please make sure AR600x driver is enabled.

<M>   Atheros AR600x support (non mac80211)

Maybe you can attach your ".config" here.

4,926 Views
pt
Senior Contributor I

Hi Qiang_FSL


dmesg output, .config file are attached here.

Qiang_FSL can you please check it?


Regards

pt



0 Kudos
Reply
4,926 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Compared your config file, I havne't enabled "CONFIG_LIB80211=m".

By the way, I think you can try with WiressAP which has no password first. For iwconfig, as I know the password parameters should be in hex format, not the text you set in AP.

0 Kudos
Reply