PCMCIA Bluetooth Card (AnyCom CF - 300) on ARM

Itzhak Ben-Akiva itzhak.benakiva at guardit-tech.com
Mon Sep 26 01:34:17 EDT 2005


Hi all,

May I request your help in solving a problem I have with pcmcia
bluetooth card?

I'm working on ARM Integrator/AP platform with Linux 2.6.13. And, I'm
using PCI Bus Card Drive: PCI-IF1/C (32Bit) and PCMCIA Bluetooth Card -
Anycom Blue CF - 300.

Initially, to get yenta to recognize my pccard bus I had to apply a
patch to the yenta_socket driver. Thanks to Russel King for the patch:

diff -u linux-2.5-pcmcia/drivers/pcmcia/yenta_socket.c
linux/drivers/pcmcia/yenta_socket.c
--- linux-2.5-pcmcia/drivers/pcmcia/yenta_socket.c      Sun Mar 23
11:57:21 2003
+++ linux/drivers/pcmcia/yenta_socket.c Fri Mar 28 23:17:12 2003
@@ -524,6 +524,7 @@
        return 0;
 }
 
+#if 0
 /*
  * Use an adaptive allocation for the memory resource,
  * sometimes the memory behind pci bridges is limited:
@@ -698,6 +699,7 @@
                res->start = res->end = 0;
        }
 }
+#endif
 
 
 /*
@@ -721,8 +723,9 @@
 
        if (sock->base)
                iounmap(sock->base);
+#if 0
        yenta_free_resources(sock);
-
+#endif
        pci_release_regions(dev);
        pci_disable_device(dev);
        pci_set_drvdata(dev, NULL);
@@ -940,6 +943,7 @@
        pci_set_power_state(socket->dev, 0);
 
        config_writel(socket, CB_LEGACY_MODE_BASE, 0);
+#if 0
        config_writel(socket, PCI_BASE_ADDRESS_0,
dev->resource[0].start);
        config_writew(socket, PCI_COMMAND,
                        PCI_COMMAND_IO |
@@ -955,6 +959,7 @@
                (dev->subordinate->subordinate << 16) | /* subordinate
bus */
                (dev->subordinate->secondary << 8) |  /* secondary bus
*/
                dev->subordinate->primary);                /* primary
bus */
+#endif
 
        /*
         * Set up the bridging state:
@@ -1037,9 +1042,14 @@
        /* Disable all events */
        cb_writel(socket, CB_SOCKET_MASK, 0x0);
 
+#if 0
        /* Set up the bridge regions.. */
        yenta_allocate_resources(socket);
+#endif
 
+       pci_set_master(dev);
+       /* FIXME: should we also pci_set_mwi(dev); ? */
+
        socket->cb_irq = dev->irq;
 
        /* Do we have special options for the device? */

After I have applied the patch, yenta recognizes my pccard and allocates
properly the necessary resources as reported in syslog:

PCI: enabling device 0000:00:0b.0 (0140 -> 0143)
Yenta: CardBus bridge found at 0000:00:0b.0 [0000:0000]
Yenta: Enabling burst memory read transactions
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:00:0b.0, mfunc 0x00001c02, devctl 0x62
Yenta: ISA IRQ mask 0x0000, PCI irq 15
Socket status: 30000010
pcmcia: parent PCI bridge Memory window: 0x40000000 - 0x4fffffff
pcmcia: parent PCI bridge Memory window: 0x50000000 - 0x5fffffff
cs: memory probe 0x40000000-0x4fffffff: excluding 0x40000000-0x427fffff
cs: memory probe 0x50000000-0x5fffffff: excluding 0x50000000-0x5fffffff

When I insert the bluetooth pcmcia card into the slot syslog reports:

This is just a warning. Your computer is OK
function=0x00000000, data=0x0
[<c0025c84>] (dump_stack+0x0/0x14) from [<c003f598>] (check_timer_failed
+0x4c/0x6c)
[<c003f54c>] (check_timer_failed+0x0/0x6c) from [<c003f6fc>] (del_timer
+0x28/0x80)
r4 = C7A20A88
[<c003f6d4>] (del_timer+0x0/0x80) from [<bf038da4>] (bluecard_release
+0x2c/0x64 [bluecard_cs])
r5 = C7A209E0 r4 = C7A209E0
[<bf038d78>] (bluecard_release+0x0/0x64 [bluecard_cs]) from [<bf0393f4>]
(bluecard_event+0x490/0x534 [bluecard_cs])
r5 = C7A209E0 r4 = C7A209E0
[<bf038f64>] (bluecard_event+0x0/0x534 [bluecard_cs]) from [<bf00b31c>]
(pcmcia_register_client+0x1d8/0x200 [pcmcia])
[<bf00b144>] (pcmcia_register_client+0x0/0x200 [pcmcia]) from
[<bf038f24>] (bluecard_attach+0xac/0xec [bluecard_cs])
[<bf038e78>] (bluecard_attach+0x0/0xec [bluecard_cs]) from [<bf00a2fc>]
(pcmcia_device_probe+0x80/0x108 [pcmcia])
r6 = C7DEA63C r5 = C7DEA600 r4 = BF03A6DC
[<bf00a27c>] (pcmcia_device_probe+0x0/0x108 [pcmcia]) from [<c014729c>]
(driver_probe_device+0x5c/0xa8)
r7 = BF03A6F0 r6 = BF03A6F0 r5 = 00000000 r4 = C7DEA63C
[<c0147240>] (driver_probe_device+0x0/0xa8) from [<c01473e0>]
(__driver_attach+0x4c/0x78)
r6 = C0147394 r5 = C7C25DBC r4 = C7DEA6E4
[<c0147394>] (__driver_attach+0x0/0x78) from [<c01469bc>]
(bus_for_each_dev+0x50/0x84)
r4 = 00000000
[<c014696c>] (bus_for_each_dev+0x0/0x84) from [<c014742c>]
(driver_attach+0x20/0x28)
r7 = BF00FD14 r6 = BF03A684 r5 = BF03A6F0 r4 = BF03A704
[<c014740c>] (driver_attach+0x0/0x28) from [<c0146e30>] (bus_add_driver
+0x6c/0x138)
[<c0146dc4>] (bus_add_driver+0x0/0x138) from [<c01477e4>]
(driver_register+0x34/0x38)
[<c01477b0>] (driver_register+0x0/0x38) from [<bf00a1d8>]
(pcmcia_register_driver+0xf8/0x114 [pcmcia])
r4 = BF03A6DC
[<bf00a0e0>] (pcmcia_register_driver+0x0/0x114 [pcmcia]) from
[<bf03c014>] (init_bluecard_cs+0x14/0x1c [bluecard_cs])
r7 = C02218D0 r6 = BF03A7A0 r5 = BF03A7A0 r4 = C02218E0
[<bf03c000>] (init_bluecard_cs+0x0/0x1c [bluecard_cs]) from [<c0051a74>]
(sys_init_module+0x155c/0x16bc)
[<c0050518>] (sys_init_module+0x0/0x16bc) from [<c0020d00>]
(ret_fast_syscall+0x0/0x2c)

However, whenever I run cardmgr or cardctl I get always the same
message:

cardctl ident
no pcmcia driver in /proc/devices

I should see something like that instead: 

Socket 0:
  product info: "BTCFCARD", "LSE139"
  manfid: 0x0264, 0x000b
  function: 6 (network)
The above is the result I see on my laptop. On ARM board I should also
see the same result. However, I get "no pcmcia driver in /proc/devices".
What is wrong?

The file /proc/devices on my ARM board is:

Character devices:
1 mem
2 pty
3 ttyp
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
29 fb
108 ppp
128 ptm
136 pts
204 ttyAM
216 rfcomm
254 ttySLP

Block devices:
1 ramdisk
7 loop

I compared /proc/devices that I have on the ARM board to the one I have
in my laptop, and the entry 254 pcmcia is missing in the file on the
board as seen above. Why pcmcia driver is failing to register the 254
pcmcia entry into /proc/devices?

I've got all the configuration in place, i.e., /etc/pcmcia contains the
files:
bluetooth       ide            network       scsi.opts    wireless.opts
bluetooth.conf  ide.opts       network.opts  serial
cis             ieee1394       parport       serial.opts
config          ieee1394.opts  parport.opts  shared
config.opts     isdn           scsi          wireless

I have a start-up script for pcmcia, which loads the pcmcia drivers and
starts cardmgr. It is the default script provides by pcmcia-cs. By the
way, I'm using pcmcia-cs-3.2.8, cross-compiled to ARM processor.

Thanks in advance for any help.

cheers,
Itzhak




More information about the linux-pcmcia mailing list