From: Pete Popov <ppopov@embeddedalley.com>
To: Ulrich Eckhardt <eckhardt@satorlaser.com>
Cc: linux-mips@linux-mips.org
Subject: Re: need help with CompactFlash/PCMCIA
Date: Thu, 17 Mar 2005 20:13:01 -0800 [thread overview]
Message-ID: <423A554D.2080505@embeddedalley.com> (raw)
In-Reply-To: <200503171626.01092.eckhardt@satorlaser.com>
Ulrich Eckhardt wrote:
> Pete Popov wrote:
>
>>>Looking at EBOOT (a bootloader for win CE that boots off the
>>>compactflash), it tries to access the IDE interface at address 0x1a00000
>>>for io_addr and 0x1a00000e for control, let's see if I can find any IDE
>>>hardware at that address...
>>
>>Uhm, I don't think you'll resolve this that easily. There is some code that
>>needs to go in the au1x00 socket driver which means you would have to
>>understand pretty well how this thing works. Ultimately the addresses
>>you'll probe are very high ioremapped addresses, since the pcmcia
>>attribute, common mem, and i/o are 36 bit physical addresses.
>
>
> Looking at EBOOT, it creates these mappings here in the TLB:
> 0xf 0000 0000 -> 0x1a00 0000 (IO)
> 0xf 4000 0000 -> 0x1c00 0000 (attrib)
> 0xf 8000 0000 -> 0x1e00 0000 (mem)
> each time mapping 32MiB.
> In the Linux PCMCIA code, I see that only the IO range above gets ioremap()ed,
> and only 4KiB thereof.
That's all that's really needed.
> For the other two ranges, it uses two addresses that
> are intended for use with fixup_bigphys_addr()[1] but seem to target the
> equivalent physical addresses as in EBOOT.
Correct. The pcmcia stack will call ioremap on those phys addresses when necessary.
> I tried simply ioremap()ing the IO region and looked for an ATA interface at
> the beginning of that range, but the contents of that memory seem to be
> rather random.
Well, that's the I/O registers. If you remapped them correctly and you are
actually talking to the device, then the data should not be so random. But the
attribute memory is a better first test. Hack up the driver to ioremap the attr
space after a card is inserted, dump some of that data, and then free the region
-- just a simple test to make sure the device is powered and you're actually
talking to it.
> I'll next try to remove both PCMCIA and IDE drivers, just to
> make sure they don't interact in any unforseeable way with my ad-hoc code,
> but that's scheduled for tuesday.
> I also found www.ata-atapi.com/atadrvr.zip, which contains low-level driver
> sourcecode and examples, so I have something to read over the weekend. ;)
>
> Thank you all for your help!
>
> Uli
>
> [1] Why the difference in the handling of the three ranges? Also, what
> additional effect does ioremap() have when compared to using the TLB? Is it
> that ioremap() is the Right Way(tm) on any architecture
Yes.
> while TLB is the way that works only on MIPS?
No, other processors have TLBs too. I assume you're refering to the yamon vs
Linux kernel. Yamon just uses statically setup TLBs to access those addresses.
When you call ioremap in the kernel, the kernel will setup the necessary tables
to be able to map and handle those phys addresses only when needed. Those TLBs
are flushed randomly, and then reentered by the kernel dynamically when needed
because of a page fault.
Pete
prev parent reply other threads:[~2005-03-18 4:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-15 11:45 need help with CompactFlash/PCMCIA Ulrich Eckhardt
2005-03-15 17:31 ` Pete Popov
2005-03-16 5:51 ` Ulrich Eckhardt
2005-03-16 6:06 ` Pete Popov
2005-03-16 7:16 ` Ulrich Eckhardt
2005-03-16 8:02 ` Pete Popov
2005-03-16 17:08 ` Ulrich Eckhardt
2005-03-16 17:21 ` Pete Popov
2005-03-17 15:26 ` Ulrich Eckhardt
2005-03-18 4:13 ` Pete Popov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=423A554D.2080505@embeddedalley.com \
--to=ppopov@embeddedalley.com \
--cc=eckhardt@satorlaser.com \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox