Card Memory windows in client driver - how to access ?

raraks raraks at gmail.com
Mon Mar 22 19:40:33 EDT 2010


I have a 16 bit PCMCIA card driver I am working on which requires memory 
windows to read and write both attribute and common memory. Card needs only 
memory windows to work (no IO or irq).

I use the foll. method to get access to the card memory windows after 
setting up  the window attributes appropriately

 link->conf.ConfigBase = parse.config.base;
 link->conf.Present = parse.config.rmask[0];
 link->conf.IntType = INT_MEMORY;

dev->request_attr_memory.Attributes = ( WIN_DATA_WIDTH_8 | 
WIN_MEMORY_TYPE_AM | WIN_ENABLE );
 dev->request_attr_memory.Base = 0;
 dev->request_attr_memory.Size = 0x1000;
 dev->request_attr_memory.AccessSpeed = 200;

 ret = pcmcia_request_window(&link, &dev->request_attr_memory, 
&dev->handle_attr_memory);

 if (ret != 0) {
  cs_error(link, RequestWindow, ret);
}

 memreq_attr_memory.CardOffset = 0;
 memreq_attr_memory.Page = 0;

 ret = pcmcia_map_mem_page(dev->handle_attr_memory, &memreq_attr_memory);

 if (ret != 0) {
  cs_error(link, MapMemPage, ret);}

 dev->attr_memory = ioremap( dev->request_attr_memory.Base, 
dev->request_attr_memory.Size);

All the above succeed and then I call pcmcia_request_configuration


Now if I try to dump say the first 512 bytes of memory at the address 
returned by ioremap - the bytes there dont look anything like what I am 
supposed to see in the CIS.  In fact they are all 0's. Same with common 
memory window that I request and create like the above except for the size 
and attribute being differnet

So I am obviously not doing something right here ....

Any pointers on what I am/could be doing wrong will be much appreciated.

Thanks





More information about the linux-pcmcia mailing list