How to enable wl1271 driver in latest ltib ?

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

How to enable wl1271 driver in latest ltib ?

Jump to solution
5,999 Views
jimtremblay
Contributor II

Hi,

     is there anybody that can help me to enable wl1271 driver found in latest linux bsp package (L2.6.35_10.12.01)? I have been able to compile wl1271 sdio driver in kernel module, but when I try to "modprobe wl1271_sdio", I receive many errors from unkown symbol and some disagrees about version:

wl1271: Unknown symbol ieee80211_connection_loss (err 0)

wl1271: disagrees about version of symbol skb_put

wl1271: Unknown symbol skb_put (err -22)

wl1271: disagrees about version of symbol consume_skb

wl1271: Unknown symbol consume_skb (err -22)

wl1271: disagrees about version of symbol skb_dequeue

wl1271: Unknown symbol skb_dequeue (err -22)

wl1271: Unknown symbol ieee80211_free_hw (err 0)

wl1271: Unknown symbol ieee80211_probereq_get (err 0)

wl1271: Unknown symbol ieee80211_alloc_hw (err 0)

wl1271: Unknown symbol ieee80211_nullfunc_get (err 0)

wl1271: Unknown symbol ieee80211_pspoll_get (err 0)

wl1271: Unknown symbol ieee80211_register_hw (err 0)

wl1271: Unknown symbol ieee80211_get_hdrlen_from_skb (err 0)

wl1271: disagrees about version of symbol __alloc_skb

wl1271: Unknown symbol __alloc_skb (err -22)

wl1271: disagrees about version of symbol skb_queue_tail

wl1271: Unknown symbol skb_queue_tail (err -22)

wl1271: Unknown symbol ieee80211_queue_delayed_work (err 0)

wl1271: disagrees about version of symbol skb_pull

wl1271: Unknown symbol skb_pull (err -22)

wl1271: disagrees about version of symbol skb_push

wl1271: Unknown symbol skb_push (err -22)

wl1271: Unknown symbol ieee80211_rx (err 0)

wl1271: Unknown symbol ieee80211_wake_queues (err 0)

wl1271: Unknown symbol ieee80211_tx_status (err 0)

wl1271: Unknown symbol ieee80211_stop_queues (err 0)

wl1271: disagrees about version of symbol skb_trim

wl1271: Unknown symbol skb_trim (err -22)

wl1271: Unknown symbol ieee80211_scan_completed (err 0)

wl1271: Unknown symbol ieee80211_channel_to_frequency (err 0)

wl1271: Unknown symbol ieee80211_unregister_hw (err 0)

wl1271: Unknown symbol ieee80211_beacon_get_tim (err 0)

wl1271: Unknown symbol ieee80211_hdrlen (err 0)

wl1271: Unknown symbol ieee80211_cqm_rssi_notify (err 0)

wl1271: Unknown symbol ieee80211_frequency_to_channel (err 0)

wl1271: Unknown symbol ieee80211_queue_work (err 0)

wl1271: disagrees about version of symbol skb_queue_head

wl1271: Unknown symbol skb_queue_head (err -22)

modprobe: failed to load module wl1271 (/lib/modules/2.6.35.3-571-gcca29a0/kernel/drivers/net/wireless/wl12xx/wl1271.ko): Invalid argument

I presume ieee80211 is missing, but I don't see how to compile and integrate into kernel or loadable module.

Thanks in advance

Jim


Labels (2)
1 Solution
1,912 Views
jimtremblay
Contributor II

Hi Dave,

            I have successfully compiled wl1271_sdio module by doing some modifications to the code:

In ltib/rpm/BUILD/linux/drivers/net/wireless/wl12xx/wl1271_sdio.c

1- Change <plat/gpio.h> to <asm/gpio.h>

2- Do not make the same mistake as me: This module (Murata or any others) CAN'T WORK in standard sd slot without modifications. Yes you can use all the SDIO signals from your card connector, but you will need to connect WLAN_IRQ of module to one of your GPIO. I have use GPIO0_23 on i.MX28EVK. I have connected a Murata module to SDIO signals from SD card slot 1.

3- Change RX71_WL1271_IRQ_GPIO from 42 to 23 if you have choose the same IO as me. If not, you can calculate it easily. Example: 42 = 42 / 32 = 1 and 42 % 32 = 10 then it is equal to GPIO1_10. To use GPIO0_23, disable FlexCAN when you configure the kernel.

4- Change call position of function set_irq_type in wl1271_probe function before calling request_irq instead of after. For my part, it was necessary to not enter irq service routine before reaching end of probe function and have the time to initialize the ieee80211 work queue.

In ltib/rpm/BUILD/linux/arch/arm/mach-mx28/mx28evk_pins.c

1- Change all fields .voltage from static struct pin_desc mx28evk_ssp1_pins to PAD_1_8V instead of PAD_3_3V.

2- Add an entry to static struct pin_desc mx28evk_ssp1_pins for WLAN_IRQ. Example:

{ .name = "WLAN_IRQ",

  .id = PINID_GPMI_RDY3,     //GPIO0_23

  .fun = PIN_GPIO,

  .strength = PAD_4MA,

  .voltage = PAD_1_8V,

  .output = 0,               // set pin in input

}


In ltib/rpm/BUILD/linux/drivers/mmc/host/mxs-mmc.c

Add support of 1.8V to mxs_mmc_probe. Add MMC_VDD_165_195 to the line mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;


In ltib/rpm/BUILD/linux/arch/arm/plat-mxs/include/mach/entry-macro.S

There is a bug in irq management of all gpios of port 0. Right after macro disable_fiq, change macro like this:

    .macro    get_irqnr_and_base, irqnr, irqstat, base, tmp

    ldr \base, =g_icoll_base

    ldr \base, [\base]

    ldr \irqnr, [\base, #0x70]

    cmp \irqnr, #0x7F

    bne 2f

    ldr \tmp, [\base, #0xD0]

    tst \tmp, #0x80000000

    moveqs \irqnr, #0

2:

    .endm


Do not forget to copy wl1271-fw.bin and wl1271-nvs.bin files in in your rootfs at /lib/firmware/. You can find these files in linux-firmware git repository in ti-connectivity folder.


To activate your SSP1 port instead of GPMI:

1- Execute ./ltib -m config in the root of your ltib installation.

2- In Package List, from this line noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait ip=none gpmi, change gpmi for ssp1 if you boot from the SD card0 like me.


If you have problems, I can help you.


Jim

View solution in original post

11 Replies
1,912 Views
jimtremblay
Contributor II

Is there anyone available that can help me?

Thank you

Jim

0 Kudos
1,912 Views
davee
Contributor III

Have you got anywhere with this? I'm building for 2.6.35 for the i.mx28

I'm just trying to build it and coming up against plat/gpio.h no such file or directory?

Can you point me in the right direction?

0 Kudos
1,913 Views
jimtremblay
Contributor II

Hi Dave,

            I have successfully compiled wl1271_sdio module by doing some modifications to the code:

In ltib/rpm/BUILD/linux/drivers/net/wireless/wl12xx/wl1271_sdio.c

1- Change <plat/gpio.h> to <asm/gpio.h>

2- Do not make the same mistake as me: This module (Murata or any others) CAN'T WORK in standard sd slot without modifications. Yes you can use all the SDIO signals from your card connector, but you will need to connect WLAN_IRQ of module to one of your GPIO. I have use GPIO0_23 on i.MX28EVK. I have connected a Murata module to SDIO signals from SD card slot 1.

3- Change RX71_WL1271_IRQ_GPIO from 42 to 23 if you have choose the same IO as me. If not, you can calculate it easily. Example: 42 = 42 / 32 = 1 and 42 % 32 = 10 then it is equal to GPIO1_10. To use GPIO0_23, disable FlexCAN when you configure the kernel.

4- Change call position of function set_irq_type in wl1271_probe function before calling request_irq instead of after. For my part, it was necessary to not enter irq service routine before reaching end of probe function and have the time to initialize the ieee80211 work queue.

In ltib/rpm/BUILD/linux/arch/arm/mach-mx28/mx28evk_pins.c

1- Change all fields .voltage from static struct pin_desc mx28evk_ssp1_pins to PAD_1_8V instead of PAD_3_3V.

2- Add an entry to static struct pin_desc mx28evk_ssp1_pins for WLAN_IRQ. Example:

{ .name = "WLAN_IRQ",

  .id = PINID_GPMI_RDY3,     //GPIO0_23

  .fun = PIN_GPIO,

  .strength = PAD_4MA,

  .voltage = PAD_1_8V,

  .output = 0,               // set pin in input

}


In ltib/rpm/BUILD/linux/drivers/mmc/host/mxs-mmc.c

Add support of 1.8V to mxs_mmc_probe. Add MMC_VDD_165_195 to the line mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;


In ltib/rpm/BUILD/linux/arch/arm/plat-mxs/include/mach/entry-macro.S

There is a bug in irq management of all gpios of port 0. Right after macro disable_fiq, change macro like this:

    .macro    get_irqnr_and_base, irqnr, irqstat, base, tmp

    ldr \base, =g_icoll_base

    ldr \base, [\base]

    ldr \irqnr, [\base, #0x70]

    cmp \irqnr, #0x7F

    bne 2f

    ldr \tmp, [\base, #0xD0]

    tst \tmp, #0x80000000

    moveqs \irqnr, #0

2:

    .endm


Do not forget to copy wl1271-fw.bin and wl1271-nvs.bin files in in your rootfs at /lib/firmware/. You can find these files in linux-firmware git repository in ti-connectivity folder.


To activate your SSP1 port instead of GPMI:

1- Execute ./ltib -m config in the root of your ltib installation.

2- In Package List, from this line noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait ip=none gpmi, change gpmi for ssp1 if you boot from the SD card0 like me.


If you have problems, I can help you.


Jim

1,912 Views
Colin_MTData
Contributor III

Hello Jim,

   I'm trying to do the same as you, I wonder if you can suggest where I go from here. I am trying to get the Murata WiFi/Bluetooth  (LBEE5ZSTNC == wl1271)  working under ltib (L2.6.35_10.12.01)   (linux kernel 2.6.35.3-571) on a platform that is very close to the iMX28 evk from freescale.

I have implemented your suggestions as to

1) the include reference

2 & 3) the WLAN_IRQ  (mine is on GPIO 1.18)

4) Swap the order of set_irq_type in wl1271_probe call and call to request_irq .   You don't say whether this applies to  wl1271.c or wl1271_sdio.c so I've done both.

5) Fixed the pin definitions in imx28evk_pins.c (and added the IRQ pin)

6) Adjusted ltib/rpm/BUILD/linux/drivers/mmc/host/mxs-mmc.c  to allow for 1.65 to 1.9 v range.

7) Adjustred ltib/rpm/BUILD/linux/arch/arm/plat-mxs/include/mach/entry-macro.S (although my irq is not in bank 0)

8) Copied the firmware to the target

9) Adjusted the kernel boot parameters: noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait ip=none ssp1

This last one is interesting as I can't find anything in rpm/BUILS/linux-2.6.35.3  or in imx-bootlets that looks for either 'gpmi' or 'ssp1' on the kernel parameters.

In any case, when booted the code doesn't seem to recognise the ssp1.  If I build wl1271 as a module it is not automatically loaded.  If I load it with modprobe it loads without errors but there is no new device seen by ifconfig or iwconfig.  If I build it into the kernel there are no errors but also no device. (cfg80211 and mac80211 are built into the kernel).

Here's some of the log (I can show more it it's relevent):

HTLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLC

PowerPrep start initialize power...

Battery Voltage = 0.24V

No battery or bad battery detected!!!.Disabling battery voltage measurements.

LLLLCApr 29 201412:02:52

init_clock() after, FRAC 0x92925A52

memory type is 166MHz mDDR running at 166MHz

                                            Wait for ddr ready 1

change_cpu_freq() start change cpu freq

get_sdram_size() mDDR: row 0000000D, column 0000000A, cs 00000001, size=04000000

ddr2 base @ 0x40000000, size 0x04000000

LLLLLLLFLCLLJUncompressing Linux... done, booting the kernel.

Linux version 2.6.35.3-571-gcca29a0-svn73422 (cmoloney@Virtual1) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #95 PREEMPT Thu May 1 17:39:13 EST 2014

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

CPU: VIVT data cache, VIVT instruction cache

Machine: MTData 6050 Series

Memory policy: ECC disabled, Data cache writeback

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256

Kernel command line: noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait ip=192.168.1.28 ssp1

PID hash table entries: 256 (order: -2, 1024 bytes)

. . .

cpuidle: using governor menu

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

mxs-mmc: MXS SSP Controller MMC Interface driver

mxs-mmc mxs-mmc.0: mmc0: MXS SSP MMC DMAIRQ 82 ERRIRQ 96

__mxs_reset_block(f0012000): timeout when resetting

__mxs_reset_block(f0012000): timeout when resetting

__mxs_reset_block(f0012000): timeout when resetting

__mxs_reset_block(f0012000): timeout when resetting

__mxs_reset_block(f0012000): timeout when resetting

mxs-mmc mxs-mmc.1: mmc1: MXS SSP MMC DMAIRQ 83 ERRIRQ 97

dcp dcp.0: DCP crypto enabled.!

. . .

mxs-rtc mxs-rtc.0: setting system clock to 1970-01-01 00:00:06 UTC (6)

mmc0: new high speed SD card at address aaaa

mmcblk0: mmc0:aaaa SU02G 1.84 GiB

mmcblk0:

p1 p2 p3

eth0: Freescale FEC PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=0:00, irq=-1)

. . .

After this, there are no further references to either mmc or ssp.

I assume I'm missing something fundamental about getting the system to look for and recognise a device on ssp1. Is there an sdio module I should load (and why didn't it load automatically)? Any idea where to look next?

Also, this system has been working fine up until now, on slightly different hardware, with a real SD card in ssp1. It would find and create /dev/mmcblk1 and read and write the SD card ok. Should I be doing something to disable the mmcblk1 device?

Colin

0 Kudos
1,912 Views
francescoluccon
Contributor I

Hi Coloney,

have you already checked out if the slow_clk @ 32.768 Hz is correctly enabled? This setup has to be done before mxs-mmc probing...also you have to assure that wlan_en is high before mxs_mmc linux driver startup.

Francesco

0 Kudos
1,911 Views
Colin_MTData
Contributor III

Hi  Francesco (or Jim)


After getting the device recognised, the next step is to initialise it.  I got the firmware files from the reference in wl12xx - Linux Wireless and put them in /lib/firmware.  (although some sources seem to suggest /lib/firmware/ti-connectivity )

The command iwconfig seems to operate on the wlan0 device (but some features are not available)

The "ifconfig wlan0 up" fails as the wl1271-nvs.bin seems to be the wrong size.  The web page suggests that this needs to be built specifically for my machine with a 'calibrate' utility.

The reference in wl12xx - Linux Wireless is to the latest ti wl21xx drivers and my packages from Freescale for the iMX28 with kernel 2.6.35 are much older. 

I wanted to build the TI utilities to get the calibrate utility but the package refers to and/or needs files in the linux tree that aren't in my older kernel tree.

I also had a go at fitting the new ti drivers into the old tree but there are just too many dependencies on newer files for me to get that working.

Do you have any idea how to get the wl1271 up and running on the old 2.6.35 kernel?     Do I need to build the calibrato?  If so, how?     Can I just get the .bin files from somewhere? Especially the wl1271-nvcs.bin?

Can I get an old ti-utils package that would build under the old tree from Freescale?

Colin


0 Kudos
1,912 Views
francescoluccon
Contributor I

Hi Moloney,

this period I was busy of work too, that's the reason I didn't reply to you as soon as you expected.

I still got several issues about tiwi wlan0 startup, at the moment after appling the wlan patches provided by linux-wlan community I just can scan wireless networks without reaching the connection.

Surely you need the calibrator, cross-compiled for arm and installed into your root-fs for generating the nvs file needed for wl1271. In this site you can get all the instructions for what you need:

http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process

0 Kudos
1,912 Views
Colin_MTData
Contributor III

Hi Francesco,

Sorry I have replied earlier, I’ve been busy on other work.

Yes, your advice was exactly what was needed. The 32kHz clock was on but the enable wasn’t on at the time the device was probed. Turning it on earlier fixed the issue of recognising the device.

Thanks very much.

Colin Moloney.

0 Kudos
1,912 Views
davee
Contributor III

Thanks Jim that is most helpful.

0 Kudos
1,912 Views
francescoluccon
Contributor I

I'm involved to porting the wl1271 device (Tiwi-Ble LSR research) to my custom i.mx287 board, using ssp2 instead of ssp1. I've successfully configured the wl1271 setup using ssp bus 0, but with ssp.2 the device is not probed correctly within mmc linux subsystem (on linux kernel 2.6.35.3), as you can see below with mmc debug prints:

mmc1: starting CMD55 arg 00000000 flags 000000f5

mxs-mmc mxs-mmc.2: MMC request

mxs-mmc mxs-mmc.2: MMC command:

mxs-mmc mxs-mmc.2: Command error 0xffffff92

mxs-mmc mxs-mmc.2: response: 0 0 0 0 errors: 4294967186

mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000

mmc1: starting CMD55 arg 00000000 flags 000000f5

mxs-mmc mxs-mmc.2: MMC request

mxs-mmc mxs-mmc.2: MMC command:

mxs-mmc mxs-mmc.2: Command error 0xffffff92

mxs-mmc mxs-mmc.2: response: 0 0 0 0 errors: 4294967186

mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000

mmc1: starting CMD55 arg 00000000 flags 000000f5

mxs-mmc mxs-mmc.2: MMC request

mxs-mmc mxs-mmc.2: MMC command:

mxs-mmc mxs-mmc.2: Command error 0xffffff92

mxs-mmc mxs-mmc.2: response: 0 0 0 0 errors: 4294967186

mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000

mmc1: starting CMD55 arg 00000000 flags 000000f5

mxs-mmc mxs-mmc.2: MMC request

mxs-mmc mxs-mmc.2: MMC command:

mxs-mmc mxs-mmc.2: Command error 0xffffff92

mxs-mmc mxs-mmc.2: response: 0 0 0 0 errors: 4294967186

mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000

mmc1: starting CMD1 arg 00000000 flags 000000e1

mxs-mmc mxs-mmc.2: MMC request

mxs-mmc mxs-mmc.2: MMC command:

mxs-mmc mxs-mmc.2: Command error 0xffffff92

mxs-mmc mxs-mmc.2: response: 0 0 0 0 errors: 4294967186

mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000

mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

mxs-mmc mxs-mmc.2: MMC set ios:

mxs-mmc mxs-mmc.2: MMC bus_width 0

How can I solve this ssp2-mmc configuration problem?

0 Kudos
1,912 Views
jimtremblay
Contributor II

Ok, I've found the problem of unkown symbol. I have integrate cfg80211 and mac80211 in kernel instead of module and leave wl1271_sdio in module. Now, I can "modprobe wl1271_sdio" without problem, but when I enable the card with "ifconfig wlan0 up", I've got many read errors. I have changed my pins to 1.8V for SSP1 for the wl1271 and I have enable some debug print in wl1271_sdio driver. I can see in dmesg that I can boot the wl1271 properly by sending the firmware, but after booting the chip, I've got many read timeout errors (at second).

Do you have some ideas about the problem?

Jim