No Cardbus interrupts

Ports
2002-10-10
2002-10-23
  • Chuck Partridge

    Chuck Partridge - 2002-10-10

    I am running pcmcia-cs 3.1.33 on a 82xx PPC that is running 2.4.17 (MVL 2.1) on an embedded design.

    I can get pcmcia card interrupts fine, but when I plug in a Cardbus card, I get no interrupts from the Cardbus card.  I have a TI1410A bridge and have configured it to PCI only interrupts in the Device Control Reg of the bridge.

    Does anyone know if there is anything special required for Cardbus cards?

    Here's a snippet of the output of my console.

    Starting PCMCIA services: modulesUsing /lib/modules/2.4.17_amx-2250/pcmcia/pcmcia_core.o

      use
    Using /lib/modules/2.4.17_amx-2250/pcmcia/i82365.o
    Intel ISA/PCI/CardBus PCIC probe:
    pci_probe v:104c d:ac50
    pci_probe v:104c d:ac50 name: [dyn mode] flags:4004
       [dyn mode] rev 02 PCI-to-CardBus at slot 00:12, mem 0xb7fff000
        host opts [0]: [pci only] [pci irq 17] [lat 32/176] [bus 1/1]
        PCI card interrupts, polling interval = 1000 ms
    Using /lib/modules/2.4.17_amx-2250/pcmcia/ds.o
    cardmgr.
    cardmgr[208]: watching 1 sockets
    cardmgr[209]: starting, version is 3.1.33
    cs: cb_alloc(bus 1): vendor 0x10b7, device 0x5157
    cardmgr[209]: socket 0: 3Com 3CCFE575B/3CXFE575B Fast EtherLink XL
    cardmgr[209]: executing: 'modprobe cb_enabler'
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/pcmcia_core.o
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/ds.o
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/pcmcia_core.o
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/cb_enabler.o
    cardmgr[209]: executing: 'modprobe 3c575_cb'
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/pcmcia_core.o
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/ds.o
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/pcmcia_core.o
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/cb_enabler.o
    3c59x.c:v0.99Q 5/16/2000 Donald Becker, becker@scyld.com
      http://www.scyld.com/network/vortex.html
    cardmgr[209]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/3c575_cb.o
    cardmgr[209]: get dev info on socket 0 failed: Resource temporarily unavailable

     
    • David Hinds

      David Hinds - 2002-10-11

      Why do you think this is a CardBus interrupt problem, exactly?

      Are there no other messages from the 3c575_cb driver, other than the version info?

      -- Dave

       
      • Chuck Partridge

        Chuck Partridge - 2002-10-11

        I think it is a Cardbus issue because  interrupts happen when using a PCMCIA card. The PCMCIA cards work fine.  When using Cardbus cards, the card is recognized and identified, the driver is loaded, but I never get an interrupt, in fact the interrupt doesn't even show up in /proc/interrupts

        There are no other messages that come out from the 3c575_cb driver.    The only message after the driver version is
        cardmgr[210]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/3c575_cb.o
        cardmgr[210]: get dev info on socket 0 failed: Resource temporarily unavailable

        CHuck

         
        • David Hinds

          David Hinds - 2002-10-12

          It isn't an interrupt problem.  The correct driver got loaded, but that driver never reported that it had found an appropriate card to talk to.  An eth0 device never got set up.

          Have you made any changes to /etc/pcmcia/config?

          Can you show the contents of /proc/bus/pccard/drivers in this configuration?

          -- Dave

           
          • Chuck Partridge

            Chuck Partridge - 2002-10-22

            After digging around, what I see is the .rodata segment of the 3c575_cb module is wrong after the module is loaded.  This causes the driver not to bind to the socket. 

            1. The name pointer in the vortex_ops struct does not point to string data  constant "3c575_cb", but somewhere else in the .rodata section.

            2. The cb_enabler module registers (by register_pccard_driver()) the 3c575_cb module with a garbage name (in this case ".4x, link partner capability %4.4x, setting %s-duplex.")

            3. do_insert() in cardmgr.c tries to bind a client to a socket, but it uses (somehow), the correct name "3c575_cb" and the names don't
            match what was registered, so the driver is not found.

            I also see garbage being displayed by printk's in loading pcmcai_core (The version and options are not printed). 

            Do you have any idea why the .rodata segment would be incorrect?  What would you try next?  I'm stumped.

            Thanks,

            Chuck

             
            • Chuck Partridge

              Chuck Partridge - 2002-10-22

              Hold the phone!

              After realizing that we were using busybox for insmod, I put the reak insmod down on the target.  Now my module loads fine and the driver is loaded, but now I'm back to no interrupts.

              If I cat /proc/interrupts I get:
              # cat /proc/interrupts
                         CPU0
              16:       1243   OpenPIC   Level     eth0
              17:          2   OpenPIC   Level     eth1
              19:      12354   OpenPIC   Level     ide0
              20:          0   OpenPIC   Level     Crystal CS4281
              137:        702   OpenPIC   Level     serial
              138:         25   OpenPIC   Level     serial
              BAD:          0
              #

              Any ideas?

              Thanks,

              Chuck

              Here's what I get on startup:

              Using /lib/modules/2.4.17_amx-2250/pcmcia/pcmcia_core.o
              Linux PCMCIA Card Services 3.1.22
                kernel build: 2.4.17_amx-2250 #278 Thu Oct 10 11:43:37 CDT 2002
                options:  [pci] [cardbus]
              Intel ISA/PCI/CardBus PCIC probe:
                TI 1410 rev 02 PCI-to-CardBus at slot 00:12, mem 0xb7fff000
                  host opts [0]: [pci only] [pci irq 17] [lat 32/176] [bus 1/1]
                  PCI card interrupts, polling interval = 1000 ms
              Using /lib/modules/2.4.17_amx-2250/pcmcia/ds.o
              cardmgr[218]: watching 1 sockets
              done.
              cardmgr[219]: starting, version is 3.2.1
              cs: cb_alloc(bus 1): vendor 0x10b7, device 0x5157
              cardmgr[219]: socket 0: 3Com 3CCFE575B/3CXFE575B Fast EtherLink XL
              cardmgr[219]: executing: 'modprobe cb_enabler'
              cardmgr[219]: + Using /lib/modules/2.4.17_amx-2250/pcmcia/cb_enabler.o
              cardmgr[219]: executing: 'modprobe 3c575_cb'

              MontaVista Linux 2.1, Professional Edition

              cardmgr[219]: + 3c59x.c:v0.99Q 5/16/2000 Donald Becker, becker@scyld.com
              http://www.scyld.com/network/vortex.html

              Using /lib/modules/2.4.17_amx-2250/pcmcia/3c575_cb.o
              cs: cb_config(bus 1)
                fn 0 bar 1: io 0x100-0x17f
                fn 0 bar 2: mem 0x60021000-0x6002107f
                fn 0 bar 3: mem 0x60020000-0x6002007f
                fn 0 rom: mem 0x60000000-0x6001ffff
                irq 17
              cs: cb_enable(bus 1)
                bridge io map 0 (flags 0x21): 0x100-0x17f
                bridge mem map 0 (flags 0x1): 0x60000000-0x60021fff
              vortex_attach(device 01:00.0)
              eth1: 3Com 3CCFE575BT Cyclone CardBus at 0x100, 00:50:04:8c:49:fc, irq 17
                product code 'TX' rev 07.1 date 06-20-99
                8K byte-wide RAM 5:3 Rx:Tx split, 10baseT interface.
              cardmgr[219]: executing: './network start eth1'
              NETDEV WATCHDOG: eth1: transmit timed out
              eth1: transmit timed out, tx_status 00 status e601.
                diagnostics: net 0cc2 media 88c0 dma 0000003a.
              eth1: Interrupt posted but not delivered -- IRQ blocked by another device?
              NETDEV WATCHDOG: eth1: transmit timed out
              eth1: transmit timed out, tx_status 00 status e601.
                diagnostics: net 0cc2 media 88c0 dma 000000ba.
              eth1: Interrupt posted but not delivered -- IRQ blocked by another device?
              NETDEV WATCHDOG: eth1: transmit timed out
              eth1: transmit timed out, tx_status 00 status e601.
                diagnostics: net 0cc2 media 88c0 dma 0000003a.
              eth1: Interrupt posted but not delivered -- IRQ blocked by another device?
              BusyBox v0.60.3 (2002.09.06-16:37+0000) Built-in shell (ash)
              Enter 'help' for a list of built-in commands.
              # NETDEV WATCHDOG: eth1: transmit timed out
              eth1: transmit timed out, tx_status 00 status e601.
                diagnostics: net 0cc2 media 88c0 dma 0000003a.
              eth1: Interrupt posted but not delivered -- IRQ blocked by another device?

               
              • David Hinds

                David Hinds - 2002-10-22

                Well you are not "back to" an interrupt problem; this is the first time you've actually had an interrupt problem ;)

                You said in your original message that you have no trouble with interrupt delivery for 16-bit PCMCIA cards.  Can you verify that?  (I'm not sure why the bad-insmod problem you had would have only interfered with the 3c575_cb driver)

                Also your first message said that you had configured the TI bridge for PCI only interrupts.  What did you mean by that, exactly?  (the i82365 module should have done that for you, so I'm wondering what you did to explicitly do this)

                -- Dave

                 
                • Chuck Partridge

                  Chuck Partridge - 2002-10-23

                  Yes, PCMCIA cards work fine.  I have a Linksys NP100 card that uses the axnet_cs driver.  Interrupts are posted and serviced, and I can communicated via IP over that interface.

                  Here's what I do to setup the bridge:

                  #define TI1410_SYS_CTL_REG      0x80
                  #define TI1410_SYS_CTL_INT_OSC   (1 << 27)

                  #define TI1410_MFR_REG          0x8C

                  #define TI1410_MFR_RSVD         (0x00)
                  #define TI1410_MFR_INTA         (0x02)
                  #define TI1410_MFR_LEDSKT       (0x0C)
                  #define TI1410_MFR_PCILOCK      (0x02)

                  #define TI1410_MFR_MF0          TI1410_MFR_INTA
                  #define TI1410_MFR_MF0_SHFT     0
                  #define TI1410_MFR_MF1          TI1410_MFR_RSVD
                  #define TI1410_MFR_MF1_SHFT     4
                  #define TI1410_MFR_MF2          TI1410_MFR_RSVD
                  #define TI1410_MFR_MF2_SHFT     8
                  #define TI1410_MFR_MF3          TI1410_MFR_RSVD
                  #define TI1410_MFR_MF3_SHFT     12
                  #define TI1410_MFR_MF4          TI1410_MFR_PCILOCK
                  #define TI1410_MFR_MF4_SHFT     16
                  #define TI1410_MFR_MF5          TI1410_MFR_LEDSKT
                  #define TI1410_MFR_MF5_SHFT     20
                  #define TI1410_MFR_MF6          TI1410_MFR_RSVD
                  #define TI1410_MFR_MF6_SHFT     24

                  #define TI1410_DEV_CTL_REG      0x92

                  #define TI1410_DEV_CTL_INTMODE_MSK  0x06
                  #define TI1410_DEV_CTL_INTMODE_PPCI_ONLY  0
                  #define TI1410_DEV_CTL_INTMODE_PIRQ_PPCI  0x02
                  #define TI1410_DEV_CTL_INTMODE_SIRQ_PPCI  0x04
                  #define TI1410_DEV_CTL_INTMODE_SIRQ_SPCI  0x06

                  /*
                  *
                  * Fix Cardbus Bridge CLOCK pin direction.
                  */
                  static void __init
                  amx2250_fix_hw(void)
                  {

                      struct pci_dev *pdev;
                      u32 lVal,new_lVal;
                      u8  bVal,new_bVal;
                      u16 wVal;

                      pdev = pci_find_device(PCI_VENDOR_ID_TI,
                                         PCI_DEVICE_ID_TI_1410,
                                         NULL);

                      if(pdev)
                      {
                          pci_read_config_dword(pdev,TI1410_SYS_CTL_REG, &lVal);
                          new_lVal = lVal | TI1410_SYS_CTL_INT_OSC;                      /* make clock pin an output */
                          pci_write_config_dword(pdev,TI1410_SYS_CTL_REG, new_lVal);
                          new_lVal = ((TI1410_MFR_MF0 << TI1410_MFR_MF0_SHFT) |
                                     (TI1410_MFR_MF1 << TI1410_MFR_MF1_SHFT) |
                                     (TI1410_MFR_MF2 << TI1410_MFR_MF2_SHFT) |
                                     (TI1410_MFR_MF3 << TI1410_MFR_MF3_SHFT) |
                                     (TI1410_MFR_MF4 << TI1410_MFR_MF4_SHFT) |
                                     (TI1410_MFR_MF5 << TI1410_MFR_MF5_SHFT) |
                                     (TI1410_MFR_MF6 << TI1410_MFR_MF6_SHFT));
                          pci_write_config_dword(pdev,TI1410_MFR_REG, new_lVal);

                          pci_read_config_byte(pdev,TI1410_DEV_CTL_REG, &bVal);
                          new_bVal = bVal & ~TI1410_DEV_CTL_INTMODE_MSK;
                          new_bVal |= TI1410_DEV_CTL_INTMODE_PPCI_ONLY;
                          pci_write_config_byte(pdev,TI1410_DEV_CTL_REG, new_bVal);
                          printk("amx2250_fix_hw oldDCR=%x newDCR=%x\n",bVal,new_bVal);

                          pci_read_config_byte(pdev,0x3c, &bVal);
                          printk("amx2250_fix_hw IntLine=%x\n",bVal);

                          pci_read_config_byte(pdev,0x3d, &bVal);
                          printk("amx2250_fix_hw IntPin=%x\n",bVal);

                          pci_read_config_word(pdev,0x3e, &wVal);
                          printk("amx2250_fix_hw BridgeCtl=%x\n",wVal);

                          return;
                      }

                      pdev = pci_find_device(PCI_VENDOR_ID_TI,
                                         PCI_DEVICE_ID_TI_1420,
                                         NULL);

                      if(pdev)
                      {
                          pci_read_config_dword(pdev,TI1420_SYS_CTL_REG, &lVal);
                          new_lVal = lVal | TI1420_SYS_CTL_P2CCLK | TI1420_SYS_CTL_INTRTIE;  /* make clock pin an output, INTS shared in INTA */
                          pci_write_config_dword(pdev,TI1420_SYS_CTL_REG, new_lVal);
                          new_lVal = ((TI1420_MFR_MF0 << TI1420_MFR_MF0_SHFT) |
                                     (TI1420_MFR_MF1 << TI1420_MFR_MF1_SHFT) |
                                     (TI1420_MFR_MF2 << TI1420_MFR_MF2_SHFT) |
                                     (TI1420_MFR_MF3 << TI1420_MFR_MF3_SHFT) |
                                     (TI1420_MFR_MF4 << TI1420_MFR_MF4_SHFT) |
                                     (TI1420_MFR_MF5 << TI1420_MFR_MF5_SHFT) |
                                     (TI1420_MFR_MF6 << TI1420_MFR_MF6_SHFT));
                          pci_write_config_dword(pdev,TI1420_MFR_REG, new_lVal);

                          return;
                      }

                    return;
                  }

                   

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks