This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to access PCI memory(HELP)....
Ling Su wrote:
>
> > Jonathan Larmour wrote:
> > >
> > > > BAR[0] 0x00410008 / probed size 0xFFFFF008 / CPU addr 0xC0410000
> > > ^^^^^^^^^^
> > >
> > > Looks like this address is where the I/O ports for this card should have
> >
> > I mean "memory", not "I/O ports".
> >
>
> Thanks, Jifl.
>
> You mean I can use 0xC0410000 pointer to access the PCI memeory, is that
> correct? But what physical address will appear on the PCI bus then? I check
> the source in platform.S for vrc4373, I didn't quite catch how the PCI
> address and CPU address mapping for the window 0xC0xxxxxx, both the two PCI
> memory access window registers are not configured for mapping this piece of
> memory, you can refer the last message that I sent to you for more
> information. I did check the VR4373 manual, especially on the PCI interface
> part, but I didn't quite get the idea how to transfter CPU 0xC0xxxxxx to PCI
> address. Please do me a favor to give me some hints. Thanks!
After another look I now see what's going on. Yes, there is a problem here
I believe and some of my understanding before was wrong(!) The relevant
stuff is in hal_memc_setup_table (a table-driven initialization thing
driven by hal_memc_setup) in platform.S.
In there, PCI_IOSPACE_BASE is set to 0x0c. This is used at the entry:
# Map PCI IO space Phys == Local
.long PCIMSTRIO, (0x000fd000 | ( PCI_IOSPACE_BASE << 24) |
PCI_IOSPACE_BASE)
So while the space is being mapped 1:1, it is indeed set up for 0x0C000000
and not 0xC0000000, as you suggested.
The fix may be just changing the definition of
HAL_PCI_PHYSICAL_MEMORY_BASE in plf_io.h to 0x0C000000
Give that a go and let us know if it worked.
Nick, any comments?
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault