wl18xx and iMX6

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

wl18xx and iMX6

Jump to solution
67,813 Views
tselmeci
Contributor IV

Hello!

We've got an Engicam iCoreM6D module which is equipped with iMX6Dual@800 MHz. Engicam has provided a linux-3.0.35 kernel, which is patched to run on this module. This kernel is obviously based on the original 3.0.35 released by Freescale for the iMX6 processors. Furthermore, we have a custom 'baseboard' in which the processor module fits. This board has a TI WL1835 wlan chip which is wired to SD2, since it has an SDIO communication interface. My task is to bring the wlan up.

3.0.35 doesn't contain any driver for WL18xx, but later kernels do. If I chose a newer kernel, even a version which is supported by Freescale in Yocto (3.10?), I'd still have to add support for iCoreM6D module before the kernel would run normally. This is what I want to avoid.

Instead, I've found the 'backports' package having a wl12xx/wl18xx driver. I could successfully compile it against my 3.0.35 kernel, but further work must be done before the wlan chip begins working. I've added 'struct platform_device' and other structures, and the driver really gets inited, but I'm far away from the finish. Now I have to make the wl18xx driver somehow use the kernel's MMC/SDHC functions to communicate with the chip. There are function pointers to be filled (struct wl1271_if_operations), the driver just calls these functions that are doing the SDIO magic behind the scenes. Currently I'm a bit lost how to make the SD2 enter SDIO mode, what to do with the WLAN IRQ (wired to a GPIO) etc. Does anybody have experience with this? Can anybody help me pushing iMX6's SDHC#2 into SDIO mode?

Is there anywhere on the net a driver for wl18xx for 3.0.35?

Thanks, regards,

Labels (2)
Tags (5)
1 Solution
42,557 Views
tselmeci
Contributor IV

I've successfully managed to bring WL1835 up on our custom board with linux-3.0.35.

The wl18xx driver from 'backports' was used. Fortunately (almost) nothing has to be done with the SDIO/SDHC subsystem of linux - the subsystem is capable of automatically negotiating with the card and entering the correct operation mode.

So:

- apply correct pin muxing on the SDHC device the wl18xx is wired to;

- setup the SDHC device correctly (card detect GPIO, write protect GPIO, quirks etc);

- create and fill a 'struct wl12xx_platform_data' structure - don't forget about the IRQ line wl18xx is about to use;

- call 'wl12xx_set_platform_data(...)' on the structure mentioned above;

- compile wl18xx.ko, wlcore.ko and wlcore_sdio.ko from 'backports';

- perform wl18xx chip init. This includes multiple 0 --> 1 --> 0 transients on the WLAN_EN pin with quite long (e.g. 70ms) delays between transients;

Finally, the SDIO subsystem of linux-3.0.35 can't handle CCCR ver 3 in default case, so apply this small patch:

https://gitorious.org/gcx/staging/commit/b8a9e53ab5b24fd10014c2eb6a5c63fe67810621

If everything is alright the machine will automatically find the SDIO device and print some message in the kernel log.

View solution in original post

18 Replies
42,557 Views
sailfish009
Contributor III

Hi,

i wonder that whether bluetooth 4.0 (bluetooth low energy) stack works or not.

0 Kudos
42,557 Views
tselmeci
Contributor IV

I haven't tested it yet...

42,558 Views
tselmeci
Contributor IV

I've successfully managed to bring WL1835 up on our custom board with linux-3.0.35.

The wl18xx driver from 'backports' was used. Fortunately (almost) nothing has to be done with the SDIO/SDHC subsystem of linux - the subsystem is capable of automatically negotiating with the card and entering the correct operation mode.

So:

- apply correct pin muxing on the SDHC device the wl18xx is wired to;

- setup the SDHC device correctly (card detect GPIO, write protect GPIO, quirks etc);

- create and fill a 'struct wl12xx_platform_data' structure - don't forget about the IRQ line wl18xx is about to use;

- call 'wl12xx_set_platform_data(...)' on the structure mentioned above;

- compile wl18xx.ko, wlcore.ko and wlcore_sdio.ko from 'backports';

- perform wl18xx chip init. This includes multiple 0 --> 1 --> 0 transients on the WLAN_EN pin with quite long (e.g. 70ms) delays between transients;

Finally, the SDIO subsystem of linux-3.0.35 can't handle CCCR ver 3 in default case, so apply this small patch:

https://gitorious.org/gcx/staging/commit/b8a9e53ab5b24fd10014c2eb6a5c63fe67810621

If everything is alright the machine will automatically find the SDIO device and print some message in the kernel log.

42,557 Views
tomo
Contributor II

Hi Tamas,

I have a plan to porting the wl18xx driver to the kernel 3.0.35.

But I can't find driver source code from 'backports'.

Could you please tell me concretely where is the source code?

Best regards,

tomo

0 Kudos
42,558 Views
tselmeci
Contributor IV
42,557 Views
tomo
Contributor II

Thank you very much!

By the way, what version did you use?

Best regards,

tomo

0 Kudos
42,557 Views
tselmeci
Contributor IV

3.17.1-1

0 Kudos
42,558 Views
tomo
Contributor II

Hi Tamas,

I ported the wl18xx driver to the kernel 3.0.35 successfully.

I used backports-4.0.1-1 version.

This driver is running on Android ICS.

Thank you for your help!

Best regards,

tomo

0 Kudos
42,558 Views
fredwang
Contributor I

Hi Tamas,

What's your host OS? Android or Linux (which distribution)? Thanks.

if perform wl18xx chip init. This includes multiple 0 --> 1 --> 0, will not detect new SDIO card.

0 Kudos
42,558 Views
tselmeci
Contributor IV

It's a custom Linux OS based on the kernel mentioned above in my first post.

0 Kudos
42,558 Views
fredwang
Contributor I

Hi Tamas,

Thank you very much for your confirmation.

I am porting TI wl1837mod WiFi module into Android, based on iMX6 too.

Re: Support TI wl1837mod Wi-Fi module in Android 4.3_1.1.0 Kernel 3.0.35

I met below write timeout issue when uploading uploading fw chunk.

[ 2104.996568] wlcore: chunk 9 addr 0x80900000 len 60496

[ 2105.001731] wlcore: starting firmware upload

[ 2105.006099] wlcore: fw_data_len 60496 chunk_size 16384

[ 2105.011487] wlcore: mem_start 80900000 mem_size 00014000

[ 2105.016915] wlcore: reg_start 00810000 reg_size 0000BFFF

[ 2105.022410] wlcore: mem2_start 00000000 mem2_size 00000000

[ 2105.028005] wlcore: mem3_start 00000000 mem3_size 00000000

[ 2105.062275] wlcore: uploading fw chunk 0xdc9d8ee4 to 0x80900000

[ 2110.495519] wl1271_sdio mmc0:0001:2: sdio write failed (-110)

[ 2110.518502] wlcore: ERROR firmware boot failed despite 3 retries

Do you have any suggestion about that? Thanks again.

0 Kudos
42,558 Views
tselmeci
Contributor IV

Hello!

I'm sorry to say, but is was several months ago (in November 2014) so I can't recall now all the details. My blocking issue was the CCCR in linux kernel. After patching that I believe the firmware download wasn't an issue.

0 Kudos
42,558 Views
fredwang
Contributor I

Hi Tamas,

Thank you very much. Yes, I met CCCR issue too, please help to look at my patch, is that ok to only add version 3.00 tags?

Index: include/linux/mmc/sdio.h

===================================================================

--- include/linux/mmc/sdio.h (revision xxx)

+++ include/linux/mmc/sdio.h (working copy)

@@ -72,11 +72,13 @@

#define  SDIO_CCCR_REV_1_00    0       /* CCCR/FBR Version 1.00 */

#define  SDIO_CCCR_REV_1_10    1       /* CCCR/FBR Version 1.10 */

#define  SDIO_CCCR_REV_1_20    2       /* CCCR/FBR Version 1.20 */

+#define  SDIO_CCCR_REV_3_00    3       /* CCCR/FBR Version 3.00 */

#define  SDIO_SDIO_REV_1_00    0       /* SDIO Spec Version 1.00 */

#define  SDIO_SDIO_REV_1_10    1       /* SDIO Spec Version 1.10 */

#define  SDIO_SDIO_REV_1_20    2       /* SDIO Spec Version 1.20 */

#define  SDIO_SDIO_REV_2_00    3       /* SDIO Spec Version 2.00 */

+#define  SDIO_SDIO_REV_3_00    4       /* SDIO Spec Version 3.00 */

#define SDIO_CCCR_SD           0x01

Index: drivers/mmc/core/sdio.c

===================================================================

--- drivers/mmc/core/sdio.c  (revision xxx)

+++ drivers/mmc/core/sdio.c  (working copy)

@@ -115,7 +115,7 @@

        cccr_vsn = data & 0x0f;

-       if (cccr_vsn > SDIO_CCCR_REV_1_20) {

+       if (cccr_vsn > SDIO_CCCR_REV_3_00) {

                printk(KERN_ERR "%s: unrecognised CCCR structure version %d\n",

                        mmc_hostname(card->host), cccr_vsn);

                return -EINVAL;

0 Kudos
42,558 Views
RobbieJiang
Contributor IV

Hi Tamas,

Thanks for your useful information!

Also I'm working on binging up WL1801mod on MX6Q/LTIB-3.0.35 platform.

Could you please share more information about the "backports driver" of wl18xx?

Where can I get it?

Or could you please send a copy to me?

Thanks!

Robbie

0 Kudos
42,558 Views
ivannikolaenko
Contributor IV

Hi Robbie!

You can use this guide https://community.freescale.com/message/532388#532388. It helps me so much!

0 Kudos
42,558 Views
ivannikolaenko
Contributor IV

Hi Tamas!

Could You provide more details about each item? 

Thank you.

0 Kudos
42,558 Views
igorpadykov
NXP Employee
NXP Employee

Hi Tamas

I think link below (wilink8 (wl1835mod) patches for imx6SL with 3.10.17 kernel)

may be helpful

wilink8: bluetooth configuration for creating kim node - WiLink™ WiFi + Bluetooth Forum - Wireless C...

Best regards

igor

42,558 Views
tselmeci
Contributor IV

Thanks for the link. Unfortunately 3.10 is already device-tree based, while 3.0.35 isn't, so the patch is not usable.

0 Kudos