Card Memory windows in client driver - how to access ?

raraks raraks at gmail.com
Tue Mar 23 12:13:27 EDT 2010


- I am using 2.6.31-17
- I would think that pDev->conf.ConfigBase and pDev->conf.Present  will only 
be valid after a pcmcia_request_configuration. Is it valid in the probe 
routine ?
- pDev->conf.ConfigBase is a pointer to attribute memory or common memory 
window ? ...and how do I get the other window mapped for access ? (cistpl 
config has default flag set and uses device size as common memory size. 
Based on our last interchange I assume all attrib memory is sized 4K).

- I havent tried using INT_MEMORY_AND_IO but have tried using access speed 
0. I know the card normally works at 200ns

- I believe CardOffset = 0 ... if not I dont know what value to set here .. 
where do I get this info ? ( I have an older 2.4 card services version 
driver that does the same thing when requesting mappings for both memory 
windows ).

Thanks
-R-



----- Original Message ----- 
From: "Dominik Brodowski" <linux at dominikbrodowski.net>
To: "raraks" <raraks at gmail.com>
Cc: <linux-pcmcia at lists.infradead.org>
Sent: Tuesday, March 23, 2010 8:30 AM
Subject: Re: Card Memory windows in client driver - how to access ?


> Hey,
>
>
> On Mon, Mar 22, 2010 at 04:40:33PM -0700, raraks wrote:
>> 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];
>
> That's already available in
> p_dev->conf.ConfigBase
> p_dev->conf.Present
> no need to overwrite it here. Unless, of course, you're using an oooold
> kernel.
>
>> link->conf.IntType = INT_MEMORY;
>
> What happens if you set this to INT_MEMORY_AND_IO ?
>
>> 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;
>
> Have you tried different accessspeed settings, or keeping it at 0?
>>
>> ret = pcmcia_request_window(&link, &dev->request_attr_memory,
>> &dev->handle_attr_memory);
>>
>> if (ret != 0) {
>>  cs_error(link, RequestWindow, ret);
>> }
>
> Using cs_error is deprecated.
>
>> memreq_attr_memory.CardOffset = 0;
>
> 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
>
> Is this ordering correct? IIRC you shouldn't even have to call
> pcmcia_request_configuration...
>
> Best,
> Dominik 




More information about the linux-pcmcia mailing list