From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Ling Su Cc: ecos-discuss@sources.redhat.com, Nick Garnett Subject: Re: [ECOS] How to access PCI memory(HELP).... Date: Sun, 10 Sep 2000 21:29:00 -0000 Message-id: <39BC5F8F.695822B4@redhat.com> References: <003401c019c5$26092880$1201a8c0@crusoe> <39BC46ED.987DB46B@redhat.com> <39BC47E6.B8579E55@redhat.com> <007201c01ba1$dcf6cba0$89622a3f@snvl1.sfba.home.com> X-SW-Source: 2000-09/msg00128.html 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