2007-07-27 17:21:18     wifi prism cf card kernel configuration for BF537

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2007-07-27 17:21:18     wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42110    Hi all.

 

I designed a board, which use this prism based wifi module :  www.quatech.com/catalog/airborne_radios.php

It's a CF bus on a small 50 pin hirose connector.

 

Attached file is the schematic of how I connected the module to the blackfin :

/ARE /AWE to read/write in the card, directly connected to the 537

A12 to select between attribute mem and io mem

WLAN_CS is connected directly to /AMS3 (only the wifi module on this 1MB zone)

WLAN_IRQ is connected on PG2

/WAIT is connected directly on the BF537 /wait signal. (There is a pullup but it don't appear on the image)

WLAN_RST is connected on PG3, but don't used for now. The internal pull up in the module force the reset signal in its inactive state.

 

The connection is OK and the module works, because in u-boot I can successfully read the CIS of the card, with this command :

md.b 20301000 FF

I can see the name of the card, the version number, etc...

 

This card is a prism based, so normally it should work if I successfully configure the driver.

I followed  docs.blackfin.uclinux.org/doku.php?id=blackfin_802.11_wlan_-_orinoco_based_driver with attention, but there are some things I don't understand :

 

First, as the card is directly connected on the 537, and directly accessible on the async bus, does I need to activate the pcmcia support in Bus Option / PCCARD (pcmcia/carbus support), or it's not necessary ?

 

Next, I need to select the driver of the card. I go in Device drivers / Network device support / Wireless Lan (non hamradio)

I validate hermes chipset support, and Blackfin WLAN card support. Some options appears, to configure adresses and irq.

For adresses it's easy, I put 20301000 for attribute mem base, and 20300000 for io mem base.

 

But what I must put in CF/WLAN irq PFx no !?? I don't know what to put here because I don't understand the number. The range is 33 to 120. What need I put to use PG2 as IRQ input ?

 

Somebody can help me ?

 

Thank you very much,

Regards,

 

Cyril

wifi.jpg

TranslateQuoteReplyEditDelete

 

 

2007-08-06 15:39:28     Re: wifi prism cf card kernel configuration for BF537

Michael Hennerich (GERMANY)

Message: 42567   

 

Cyril,

 

two options either use the PCMCIA driver and select the hermes/prism CS Card Service driver or use the Blackfin workaround PCMCIA driver - not sure if we still maintain this option.

 

For your IRQ question - have a look at include/asm-blackfin/mach-bf537/irg.h you will find numbers matching your Port Pin Name.

 

-Michael

QuoteReplyEditDelete

 

 

2007-08-07 16:42:18     Re: wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42607    Hi Michael, thank you for your answer.

 

I tried to not activate pcmcia, and activate hermes module + orinoco + orinoco_wlan_blackfin.c.

My wifi module is working perfectly !

 

But this module is 802.11b only and I need to change it for a 802.11G module. But this new module doesn't have a prism 2.5 chipset, but a Marvell 8385 chipset. There is no blackfin driver for this chip, but the generic pcmcia driver exists.

 

Thus now my idea is to activate the pcmcia drivers for blackfin, have my prism based module working (with orinoco_cs this time) to be sure everythink is Ok with the pcmcia driver, and try to implement the 'Libertas' driver for my marvell 8385 based module.

 

So I modified arch/blackfin/mach-bf537/boards/generic_board.c to change the pcmcia module address for I/O and attribute mem, gpio for interrupt and card detect.

Everything is OK, but after all the module are loaded ( firmware_class.ko, pcmcia_core.ko, pcmcia.ko, bfin_cf_pcmcia.ko, hermes.ko, orinoco.ko, orinoco_cs.ko), nothing happen ! All the module are loaded OK, but eth0 don't appear, and is not available if I do ifconfig eth0 up.

Tomorrow I try to put some log because I have don't recorded them. But they tell me than pcmcia module is loaded OK, that a card is detected in the socket, and I can see orinoco module message and copyright when I load them, but no error.

 

Strange isn't it ?

TranslateQuoteReplyEditDelete

 

 

2007-08-07 17:04:56     Re: wifi prism cf card kernel configuration for BF537

Michael Hennerich (GERMANY)

Message: 42610   

 

Hi Cyril,

 

from my experience the Blackfin PCMICA works with every PRISM 2.5 802.11b card is tested with. (DLINK, Linksys, Buffalo).

 

CF Memory cards also work perfectly.

If your 802.11g card is also CF IO-Mode compliant (IO Space and Attribute Memory) I don’t see a reason why it shouldn’t work.

 

Your attempt to first make the known good working 802.11b card work first is good.

Maybe have a special look at the Card Reset.

 

And don’t forget when moving to your new card some cards are blank. And fist need to load the firmware. There are tools doing this.

 

I can assist you moving forward.

 

-Michael

QuoteReplyEditDelete

 

 

2007-08-07 17:36:45     Re: wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42613    I just seen you have writed the blackfin pcmcia driver in the source code

 

I tested on my laptop an interesting thing : I have a pcmcia wifi card with the same prism 2.5 chip. I loaded hermes, orinoco and orinoco_cs WITHOUT the card in the socket. And the module don't complain, they are loaded OK.

 

I have no experience with modules, but with this test I think that in fact, hermes, orinoco and orinoco_cs modules just register himself to the pcmcia driver, right ?

And after, when the card detect line is asserted, the pcmcia call all the probe functions of the registered drivers, right ?

 

If it's working as I say, I maybe know what it doesn't work in my case :

 

In my board, I have no CF socket, the wifi module is directly routed on the blackfin (i/o @ 20300000 and att @ 20301000), and I have no card detect line. thus I modified /mnt/disk2/blackfin/uClinux-dist/linux-2.6.x/drivers/pcmcia/bfin_cf_pcmcia.c : I deleted the card detect gpio allocation, and modified the define :

 

//#define bfin_cf_present(pfx) (gpio_get_value(pfx))

#define bfin_cf_present(pfx) 1

 

Thus when I load the pcmcia driver, it tell me that a card is detected, but hermes and orinoco are not loaded, so it can't works ?

 

In my configuration, with the cf module directly on the blackfin, and without the card detect line, what are the steps to follow to have orinoco_cs detecting the card and register an ethX in the kernel ?

 

Regards,

Cyril

 

 

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2007-08-08 04:06:26     Re: wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42637    Hi  Michael.

 

This morning I restarted all the procedure :

 

I Modified arch/blackfin/mach-bf537/boards/generic_board.c :

 

static struct resource bfin_pcmcia_cf_resources[] = {

        {

                .start = 0x20300000, /* IO PORT */

                .end = 0x20300FFF,

                .flags = IORESOURCE_MEM,

        },{

                .start = 0x20301000, /* Attribute Memeory */

                .end = 0x20301FFF,

                .flags = IORESOURCE_MEM,

        },{

                .start = IRQ_PROG_INTA,

                .end = IRQ_PROG_INTA,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        },{

                .start = IRQ_PG2,

                .end = IRQ_PG2,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        },{

                .start = 6, /* Card Detect PF6 */

                .end = 6,

                .flags = IORESOURCE_IRQ,

        },

};

 

I modified drivers/pcmcia/bfin_cf_pcmcia.c :

 

//#define CF_ATASEL_ENA         0x20311802 /* Inverts RESET */

//#define CF_ATASEL_DIS         0x20311800

 

#define CF_ATASEL_ENA   0x20301802 /* Inverts RESET */

#define CF_ATASEL_DIS   0x20301800

 

//#define bfin_cf_present(pfx) (gpio_get_value(pfx))

#define bfin_cf_present(pfx) 1

 

In this file, I commented all accesses on cd_pfx, because there is no detect line on my board.

 

The compilation is ok, and after I load kernel modules :

 

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/base/firmware_class.ko

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/pcmcia/pcmcia_core.ko

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/pcmcia/pcmcia.ko

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/pcmcia/bfin_cf_pcmcia.ko

Blackfin CompactFlash/PCMCIA Socket Driver

bfin_cf_pcmcia: on irq 34

pccard: PCMCIA card inserted into slot 0

pcmcia: registering new device pcmcia0.0

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/net/wireless/hermes.ko

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/net/wireless/orinoco.ko

root:~> insmod /lib/modules/2.6.19.3-ADI-2007R1-svn/kernel/drivers/net/wireless/orinoco_cs.ko

0.0: RequestIRQ: Resource in use <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <meta content="Kate, the KDE Advanced Text Editor" name="Generator" />

 

 

And dmesg give me :

 

[...]

Freeing unused kernel memory: 56k freed (0x114000 - 0x121000)

dma_alloc_init: dma_page @ 0x00121000 - 256 pages at 0x01f00000

Blackfin CompactFlash/PCMCIA Socket Driver

bfin_cf_pcmcia: on irq 34

bfin_cf_pcmcia: present

bfin_cf_pcmcia: Vcc 0, io_irq 0, flags 0000 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0000 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0240 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0200 csc 0080

pccard: PCMCIA card inserted into slot 0

pcmcia: registering new device pcmcia0.0

bfin_cf_pcmcia: card present

orinoco 0.15 (David Gibson <hermes@gibson.dropbear.id.au>, Pavel Roskin <proski@gnu.org>, et al)

orinoco_cs 0.15 (David Gibson <hermes@gibson.dropbear.id.au>, Pavel Roskin <proski@gnu.org>, et al)

0.0: RequestIRQ: Resource in use

 

I don't understand, the orinoco_cs try to allocate an irq the irq line ? Normaly it's the pcmcia driver which manage it, no ?

 

Regards,

Cyril

 

 

 

TranslateQuoteReplyEditDelete

 

 

2007-08-08 04:30:10     Re: wifi prism cf card kernel configuration for BF537

Michael Hennerich (GERMANY)

Message: 42640   

 

Why did you add this?

 

        },{

                .start = IRQ_PROG_INTA,

                .end = IRQ_PROG_INTA,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        },{

 

it causes this:

 

#bfin_cf_pcmcia: on irq 34

 

and finally this:

 

0.0: RequestIRQ: Resource in use

 

-Michael

 

 

 

 

 

 

QuoteReplyEditDelete

 

 

2007-08-08 05:08:56     Re: wifi prism cf card kernel configuration for BF537

Ivan Kuten (BELARUS)

Message: 42641    Cyril, correct is this way (our custom settings for Marvell CFIO WLAN module) :

 

#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)

static struct resource bfin_pcmcia_cf_resources[] = {

        {

                .start = 0x20390000, /* IO PORT */

                .end = 0x20392000,

                .flags = IORESOURCE_MEM,

        },{

                .start = 0x20391000, /* Attribute Memeory */

                .end = 0x20391FFF,

                .flags = IORESOURCE_MEM,

        },{

                .start = IRQ_PF10,

                .end = IRQ_PF10,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        },{

                .start = 7, /* Card Detect PF7 */

                .end = 7,

                .flags = IORESOURCE_IRQ,

        },

};

static struct platform_device bfin_pcmcia_cf_device = {

        .name = "bfin_cf_pcmcia",

        .id = -1,

        .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),

        .resource = bfin_pcmcia_cf_resources,

};

#endif

 

BR,

Ivan

QuoteReplyEditDelete

 

 

2007-08-08 05:10:47     Re: wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42642    I have not add this, it was in the file linux-2.6.x/arch/blackfin/mach-bf537/boards/generic_board.c.

 

You are right, this section doesn't appear in linux-2.6.x/arch/blackfin/mach-bf537/boards/stamp.c

 

I delete it and I retry

 

Regards,

Cyril

TranslateQuoteReplyEditDelete

 

 

2007-08-08 06:05:56     Re: wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42655    Thank you Ivan. I just tested with my own configuration (and for the prism chip for now) :

 

#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)

static struct resource bfin_pcmcia_cf_resources[] = {

        {

                .start = 0x20300000, /* IO PORT */

                .end = 0x20300FFF,

                .flags = IORESOURCE_MEM,

        },{

                .start = 0x20301000, /* Attribute Memeory */

                .end = 0x20301FFF,

                .flags = IORESOURCE_MEM,

        },{

                .start = IRQ_PG2,

                .end = IRQ_PG2,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        },{

                .start = 6, /* Card Detect PF6 */

                .end = 6,

                .flags = IORESOURCE_IRQ,

        },

};

 

There is no error when loading module, but nothing happen, and ethX is not available :

 

Blackfin CompactFlash/PCMCIA Socket Driver

bfin_cf_pcmcia: on irq 68

bfin_cf_pcmcia: present

bfin_cf_pcmcia: Vcc 0, io_irq 0, flags 0000 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0000 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0240 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0200 csc 0080

pccard: PCMCIA card inserted into slot 0

bfin_cf_pcmcia: card present

orinoco 0.15 (David Gibson <hermes@gibson.dropbear.id.au>, Pavel Roskin <proski@gnu.org>, et al)

orinoco_cs 0.15 (David Gibson <hermes@gibson.dropbear.id.au>, Pavel Roskin <proski@gnu.org>, et al)

 

 

 

TranslateQuoteReplyEditDelete

 

 

2007-08-08 08:16:52     Re: wifi prism cf card kernel configuration for BF537

Cyril HAENEL (FRANCE)

Message: 42658    Arghh,

 

I don't know if there was a bad contact or something like that, but now it's working...

 

After loading orinoco_cs, I have :

 

pcmcia: request for exclusive IRQ could not be fulfilled.

pcmcia: the driver needs updating to supported shared IRQ lines.

bfin_cf_pcmcia: Vcc 33, io_irq 0, flags 0200 csc 0080

bfin_cf_pcmcia: Vcc 33, io_irq 68, flags 0220 csc 0080

eth0: Hardware identity 801b:0000:0001:0000

eth0: Station identity  001f:0006:0001:0007

eth0: Firmware determined as Intersil 1.7.6

eth0: Ad-hoc demo mode supported

eth0: IEEE standard IBSS ad-hoc mode supported

eth0: WEP supported, 104-bit key

eth0: MAC address 00:90:C9:00:65:1F

eth0: Station name "Prism  I"

eth0: ready

eth0: orinoco_cs at 0.0, irq 68, io 0x20300000-0x2030003f

 

What is the 2 first line message ?

Now, I need to do same thing with the Libertas Marvell driver....

 

Regards,

Cyril

TranslateQuoteReplyEditDelete

 

 

2009-03-11 07:24:49     Re: wifi prism cf card kernel configuration for BF537

Rob Maris (GERMANY)

Message: 70765   

 

Cyril, I don't find a WAIT pin in BF537 datasheet. Does it have another name? - Rob

QuoteReplyEditDelete

 

 

2009-03-12 09:17:24     Re: wifi prism cf card kernel configuration for BF537

Rob Maris (GERMANY)

Message: 70858   

 

Cyril,

 

two options either use the PCMCIA driver and select the hermes/prism CS Card Service driver or use the Blackfin workaround PCMCIA driver - not sure if we still maintain this option.

 

For your IRQ question - have a look at include/asm-blackfin/mach-bf537/irg.h you will find numbers matching your Port Pin Name.

 

 

 

-----------------------

 

Actually, irq.h appears to be here:

 

/uclinux-dist/linux-2.6.x/arch/blackfin/mach-bf537/include/mach/

QuoteReplyEditDelete

 

 

2009-03-12 09:27:08     Re: wifi prism cf card kernel configuration for BF537

Mike Frysinger (UNITED STATES)

Message: 70860   

 

the file has moved.  considering this thread is over 1.5 years old, at the time of posting, the aforementioned location was correct.  with the latest trunk, it's moved into arch/blackfin/.

Attachments

Outcomes