PCI-to-Cardbus question

Hello,

I am writing a PCMCIA card driver for Win2K. The card is inserted into a CardBus that utilizes the TI PCI1420 PC Controller chip. I have the WDM shell for the code working fine. The card is enumerated when inserted into the slot, resources are allocated, everything is fine except for one thing–I cannot access the 1420 registers.

In my legacy NT driver code, the registers were accessed via Host I/O locations 0x3e0 and 0x3e1. Both of the PCMCIA Card registers were accessed via these locations via the following method:

  1. WRITE_PORT_UCHAR() was invoked on location 0x3e0, specifying the desired register offset (0x00 to 0x3f for card 1 and 0x40 to 0x7f for card2)
  2. READ_PORT_UCHAR() or WRITE_PORT_UCHAR() were invoked on location 0x3e1. If it was a READ operation the value of the register written to 0x3e0 was returned; for WRITE operations the value specified was written to the register value previously written to 0x3e0.

The problem I have been encountering is that this scheme no longer seems to work. Since the CardBus is already powered-up and working when my card is inserted, I expect to be able to access the 1420’s registers to perform some initialization for my cards. However, when I attempt to read the registers via the 0x3e0/0x3e1 scheme I get values of 0xff for all.

Again, since the CardBus is functional (it has to be for my card to be enumerated-right?) I expect to see valid register values. Attempts to write to a given (writable) register value result in the value written not taking.

And this is strange…after my device initialization, I decided to write out each of the register locations again and no longer get all 0xff’s. This time, reads of 0x3e1 return the values written to 0x3e0: 0x00, 0x01, 0x02 . 0x3f. Doh!

I got the data book for the PCI1420 from TI and it indicated that in addition to being able to access the registers via the index/data method, they may be accessed directly via an alias to PCI memory space. I know that this memory offset is specified in the PCI header; however, I have no idea where this header resides in memory and no documentation has been enlightening enough to provide me with it. Does anyone know how I find this out?

Thanks for any help…

Jeremy in sunny FLA

No PCMCIA gurus, huh? I find it difficult to get any PCMCIA info at all anywhere. Does anyone know a good site or newsgroup or consultant I can hire to try to solve this problem?

Jeremy R.

----- Original Message -----
From: Jeremy Rasmussen
To: Windows System Software Devs Interest List
Sent: Monday, January 26, 2004 4:50 PM
Subject: [ntdev] PCI-to-Cardbus question

Hello,

I am writing a PCMCIA card driver for Win2K. The card is inserted into a CardBus that utilizes the TI PCI1420 PC Controller chip. I have the WDM shell for the code working fine. The card is enumerated when inserted into the slot, resources are allocated, everything is fine except for one thing–I cannot access the 1420 registers.

In my legacy NT driver code, the registers were accessed via Host I/O locations 0x3e0 and 0x3e1. Both of the PCMCIA Card registers were accessed via these locations via the following method:

  1. WRITE_PORT_UCHAR() was invoked on location 0x3e0, specifying the desired register offset (0x00 to 0x3f for card 1 and 0x40 to 0x7f for card2)
  2. READ_PORT_UCHAR() or WRITE_PORT_UCHAR() were invoked on location 0x3e1. If it was a READ operation the value of the register written to 0x3e0 was returned; for WRITE operations the value specified was written to the register value previously written to 0x3e0.

The problem I have been encountering is that this scheme no longer seems to work. Since the CardBus is already powered-up and working when my card is inserted, I expect to be able to access the 1420’s registers to perform some initialization for my cards. However, when I attempt to read the registers via the 0x3e0/0x3e1 scheme I get values of 0xff for all.

Again, since the CardBus is functional (it has to be for my card to be enumerated-right?) I expect to see valid register values. Attempts to write to a given (writable) register value result in the value written not taking.

And this is strange…after my device initialization, I decided to write out each of the register locations again and no longer get all 0xff’s. This time, reads of 0x3e1 return the values written to 0x3e0: 0x00, 0x01, 0x02 . 0x3f. Doh!

I got the data book for the PCI1420 from TI and it indicated that in addition to being able to access the registers via the index/data method, they may be accessed directly via an alias to PCI memory space. I know that this memory offset is specified in the PCI header; however, I have no idea where this header resides in memory and no documentation has been enlightening enough to provide me with it. Does anyone know how I find this out?

Thanks for any help…

Jeremy in sunny FLA


Isn’t the TI PCI1420 a bridge chip? If so you shouldn’t be programming it.
If you can explain in basic terms what you are trying to do, I suspect this
group can offer help.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: Jeremy Rasmussen
To: Windows System Software Devs Interest List
Sent: Wednesday, January 28, 2004 9:06 AM
Subject: Re: [ntdev] PCI-to-Cardbus question

No PCMCIA gurus, huh? I find it difficult to get any PCMCIA info at all
anywhere. Does anyone know a good site or newsgroup or consultant I can
hire to try to solve this problem?

Jeremy R.

----- Original Message -----
From: Jeremy Rasmussen
To: Windows System Software Devs Interest List
Sent: Monday, January 26, 2004 4:50 PM
Subject: [ntdev] PCI-to-Cardbus question

Hello,

I am writing a PCMCIA card driver for Win2K. The card is inserted into a
CardBus that utilizes the TI PCI1420 PC Controller chip. I have the WDM
shell for the code working fine. The card is enumerated when inserted into
the slot, resources are allocated, everything is fine except for one
thing–I cannot access the 1420 registers.

In my legacy NT driver code, the registers were accessed via Host I/O
locations 0x3e0 and 0x3e1. Both of the PCMCIA Card registers were accessed
via these locations via the following method:

  1. WRITE_PORT_UCHAR() was invoked on location 0x3e0, specifying the desired
    register offset (0x00 to 0x3f for card 1 and 0x40 to 0x7f for card2)
  2. READ_PORT_UCHAR() or WRITE_PORT_UCHAR() were invoked on location 0x3e1.
    If it was a READ operation the value of the register written to 0x3e0 was
    returned; for WRITE operations the value specified was written to the
    register value previously written to 0x3e0.

The problem I have been encountering is that this scheme no longer seems to
work. Since the CardBus is already powered-up and working when my card is
inserted, I expect to be able to access the 1420’s registers to perform some
initialization for my cards. However, when I attempt to read the registers
via the 0x3e0/0x3e1 scheme I get values of 0xff for all.

Again, since the CardBus is functional (it has to be for my card to be
enumerated-right?) I expect to see valid register values. Attempts to write
to a given (writable) register value result in the value written not taking.

And this is strange…after my device initialization, I decided to write out
each of the register locations again and no longer get all 0xff’s. This
time, reads of 0x3e1 return the values written to 0x3e0: 0x00, 0x01, 0x02 .
0x3f. Doh!

I got the data book for the PCI1420 from TI and it indicated that in
addition to being able to access the registers via the index/data method,
they may be accessed directly via an alias to PCI memory space. I know that
this memory offset is specified in the PCI header; however, I have no idea
where this header resides in memory and no documentation has been
enlightening enough to provide me with it. Does anyone know how I find this
out?

Thanks for any help…

Jeremy in sunny FLA



Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@acm.org
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Jeremy,

I have written driver for both PCMCIA and Cardbus cards for custom requirement, both of which were tested and verified through their insertion in TI1420 pci-cardbus converter. The catch though is that I faced some problem with interrupt in win2k but in XP it worked perfectly well.

Coming to your problem, there is no need to access the 1420’s registers for your card initialization. When the card is inserted the Host should see that a PCMCIA card is inserted and would allocate IO space for that PCMCIA/Cardbus card as requested in your configuration registers in hardware. You will get a handle to this IO space when you query on this resource and you can use that to access your registers. The 1420 is completely transparent this whole process.

Like I said, I too faced problems with 1420 in win2K environment, but I could access the registers on my hardware correctly and could read and write into them even in 2K environment. Only when my card is raising interrupt the host is not able to recognize that interrupt correctly.

Again, in XP (I use professional), I faced no problems with this controller and things worked fine with me. I suggest to give XP a try.

Regards,
Susaant.
----- Original Message -----
From: Jeremy Rasmussen
To: Windows System Software Devs Interest List
Sent: Wednesday, January 28, 2004 7:36 PM
Subject: Re: [ntdev] PCI-to-Cardbus question

No PCMCIA gurus, huh? I find it difficult to get any PCMCIA info at all anywhere. Does anyone know a good site or newsgroup or consultant I can hire to try to solve this problem?

Jeremy R.

----- Original Message -----
From: Jeremy Rasmussen
To: Windows System Software Devs Interest List
Sent: Monday, January 26, 2004 4:50 PM
Subject: [ntdev] PCI-to-Cardbus question

Hello,

I am writing a PCMCIA card driver for Win2K. The card is inserted into a CardBus that utilizes the TI PCI1420 PC Controller chip. I have the WDM shell for the code working fine. The card is enumerated when inserted into the slot, resources are allocated, everything is fine except for one thing–I cannot access the 1420 registers.

In my legacy NT driver code, the registers were accessed via Host I/O locations 0x3e0 and 0x3e1. Both of the PCMCIA Card registers were accessed via these locations via the following method:

  1. WRITE_PORT_UCHAR() was invoked on location 0x3e0, specifying the desired register offset (0x00 to 0x3f for card 1 and 0x40 to 0x7f for card2)
  2. READ_PORT_UCHAR() or WRITE_PORT_UCHAR() were invoked on location 0x3e1. If it was a READ operation the value of the register written to 0x3e0 was returned; for WRITE operations the value specified was written to the register value previously written to 0x3e0.

The problem I have been encountering is that this scheme no longer seems to work. Since the CardBus is already powered-up and working when my card is inserted, I expect to be able to access the 1420’s registers to perform some initialization for my cards. However, when I attempt to read the registers via the 0x3e0/0x3e1 scheme I get values of 0xff for all.

Again, since the CardBus is functional (it has to be for my card to be enumerated-right?) I expect to see valid register values. Attempts to write to a given (writable) register value result in the value written not taking.

And this is strange…after my device initialization, I decided to write out each of the register locations again and no longer get all 0xff’s. This time, reads of 0x3e1 return the values written to 0x3e0: 0x00, 0x01, 0x02 . 0x3f. Doh!

I got the data book for the PCI1420 from TI and it indicated that in addition to being able to access the registers via the index/data method, they may be accessed directly via an alias to PCI memory space. I know that this memory offset is specified in the PCI header; however, I have no idea where this header resides in memory and no documentation has been enlightening enough to provide me with it. Does anyone know how I find this out?

Thanks for any help…

Jeremy in sunny FLA



Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@redpinesignals.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks, I will look into that. Sounds like Windows wants to control things now, and won’t let you make the hardware calls directly.

Jeremy R.
----- Original Message -----
From: Susaant
To: Windows System Software Devs Interest List
Sent: Wednesday, January 28, 2004 9:15 AM
Subject: Re: [ntdev] PCI-to-Cardbus question

Hi Jeremy,

I have written driver for both PCMCIA and Cardbus cards for custom requirement, both of which were tested and verified through their insertion in TI1420 pci-cardbus converter. The catch though is that I faced some problem with interrupt in win2k but in XP it worked perfectly well.

Coming to your problem, there is no need to access the 1420’s registers for your card initialization. When the card is inserted the Host should see that a PCMCIA card is inserted and would allocate IO space for that PCMCIA/Cardbus card as requested in your configuration registers in hardware. You will get a handle to this IO space when you query on this resource and you can use that to access your registers. The 1420 is completely transparent this whole process.

Like I said, I too faced problems with 1420 in win2K environment, but I could access the registers on my hardware correctly and could read and write into them even in 2K environment. Only when my card is raising interrupt the host is not able to recognize that interrupt correctly.

Again, in XP (I use professional), I faced no problems with this controller and things worked fine with me. I suggest to give XP a try.

Regards,
Susaant.

Yes, you’re right…
You cannot work with bridge directly.
Instead that you can use PCMCIA_INTERFACE_STANDARD (if you have 16-bit card) to modify the memory windows, and set Vpp
But if you realy need to work with controller directly, try old NT HalSet/GetBusData on 2k or XP.

Good luck
Nikolay
“Jeremy Rasmussen” wrote in message news:xxxxx@ntdev…
Thanks, I will look into that. Sounds like Windows wants to control things now, and won’t let you make the hardware calls directly.

Jeremy R.
----- Original Message -----
From: Susaant
To: Windows System Software Devs Interest List
Sent: Wednesday, January 28, 2004 9:15 AM
Subject: Re: [ntdev] PCI-to-Cardbus question

Hi Jeremy,

I have written driver for both PCMCIA and Cardbus cards for custom requirement, both of which were tested and verified through their insertion in TI1420 pci-cardbus converter. The catch though is that I faced some problem with interrupt in win2k but in XP it worked perfectly well.

Coming to your problem, there is no need to access the 1420’s registers for your card initialization. When the card is inserted the Host should see that a PCMCIA card is inserted and would allocate IO space for that PCMCIA/Cardbus card as requested in your configuration registers in hardware. You will get a handle to this IO space when you query on this resource and you can use that to access your registers. The 1420 is completely transparent this whole process.

Like I said, I too faced problems with 1420 in win2K environment, but I could access the registers on my hardware correctly and could read and write into them even in 2K environment. Only when my card is raising interrupt the host is not able to recognize that interrupt correctly.

Again, in XP (I use professional), I faced no problems with this controller and things worked fine with me. I suggest to give XP a try.

Regards,
Susaant.