Re: I82365 driver question
dhinds <[email protected]> Tue, 9 Apr 2002 00:28:41 -0700
| Newsgroups | gmane.linux.pcmcia.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Apr 08, 2002 at 05:10:30PM -0700, Sanjay Jain wrote: > > Following code sets the card offset register. > ... > ... > i365_set_pair(s, base+I365_W_STOP, i); > > i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff; > > if (mem->flags & MAP_WRPROT) i |= I365_MEM_WRPROT; > if (mem->flags & MAP_ATTRIB) i |= I365_MEM_REG; > i365_set_pair(s, base+I365_W_OFF, i); > ..... > ...... > > Why mem->sys_start is being subtracted from card_start? As per > the spec these registers should contain mem->card_start. No, the spec says that these registers should contain the offset between the card start and the host start addresses for each window. I'm fairly confident in the original code because it works for a wide range of values for card_start and sys_start, on multiple platforms. > With this code in place, I was not able to read CIS. > > I had to change it to > > i = (mem->card_start >> 12) & 0x3fff; > > Now I can see card CIS. Perhaps this means that the sys_start value you are using does not actually correspond to the addresses that are being passed through to the i82365 chip, on this platform. And in fact, whatever sys_start is, gets seen by the i82365 chip as host address 0. But that doesn't really make sense either, now that I think about it, because the START and STOP registers would be filled in incorrectly. -- Dave