From: Jun Sun <jsun@mvista.com>
To: Keith M Wesolowski <wesolows@foobazco.org>
Cc: Pete Popov <ppopov@mvista.com>,
Wayne Gowcher <wgowcher@yahoo.com>,
Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,
linux-mips@oss.sgi.com
Subject: Re: Configuration of PCI Video card on a BIOS-less board
Date: Thu, 10 May 2001 15:02:30 -0700 [thread overview]
Message-ID: <3AFB0FF6.D84A491E@mvista.com> (raw)
In-Reply-To: 20010510131431.A27228@foobazco.org
Keith M Wesolowski wrote:
>
> On Thu, May 10, 2001 at 11:12:57AM -0700, Pete Popov wrote:
>
> > I'm not clear on how this works with the good driver. If you write to
> > 0xC000 0000, that's a mips virtual address in the kseg2 region, which is
> > a mapped region. So what physical address you put on the bus when you
> > write to 0xC000 0000 depends on the tlb entry you've setup. If 0xC000
> > 0000 is truly a PCI memory physical address, then you need to setup a
>
> Repeat after me until done: BAR values have nothing to do with CPU
> addresses. If your PCI bus happens to map PCI memory location 0 onto
> physical address 0, then they are the same. That's almost certainly
> not the case. Otherwise, an address in a BAR is the *PCI bus
> address*, NOT a CPU physical address.
>
Keith,
What you said is right in theory. However not correct in practice.
Most drivers read BAR address (in PCI memory space) and do ioremap() to get
(usually uncached) virtual address to access the PCI memory region. On mips,
the default ioremap() essentially does 1 to 1 mapping from PCI meory space to
physical address space and then further maps it into KSEG1.
That pretty much mandates each MIPS port must maintain 1:1 mapping between the
PCI memory space and CPU physical space - unless you enjoy the fun of hacking
with PCI fixups.
> A simple example: a PCI bridge exists in a system. It is wired into
> the CPU address bus such that it responds to 0x18000000-0x19ffffff
> physical. On the other side of the bridge, it maps
> 0x00000000-0x7fffffff bus addresses onto physical memory (for DMA),
> and 0x80000000-0xffffffff onto PCI memory space (for PIO). The bridge
> translates addresses such that:
>
> bus_address_for_BARs == 0x80000000 + (cpu_physical_address - 0x18000000)
> bus_address_for_DMA == cpu_physical_address
>
> and, of course,
>
> cpu_virtual_address_for_pointers == KSEG[01]ADDR (cpu_physical_address)
>
> In the example above, the PCI bus is mapped into CPU memory such that
> it can be accessed via ksegX, which is normal. If it were mapped at,
> for example, 0x40000000, that would not be the case and you would need
> a TLB entry. Note that for mips64, you can use KPHYS to access any
> physical address; ie it need not be below 0x20000000.
>
> --
> Keith M Wesolowski <wesolows@foobazco.org> http://foobazco.org/~wesolows
> ------(( Project Foobazco Coordinator and Network Administrator ))------
> "Nothing motivates a man more than to see his boss put
> in an honest day's work." -- The fortune file
next prev parent reply other threads:[~2001-05-10 22:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-10 5:55 Configuration of PCI Video card on a BIOS-less board Wayne Gowcher
2001-05-10 6:01 ` Keith M Wesolowski
2001-05-10 6:15 ` Geert Uytterhoeven
2001-05-10 17:11 ` Pete Popov
2001-05-10 17:20 ` Geert Uytterhoeven
2001-05-10 17:44 ` Pete Popov
2001-05-10 17:53 ` Wayne Gowcher
2001-05-10 18:12 ` Pete Popov
2001-05-10 18:43 ` Wayne Gowcher
2001-05-10 20:14 ` Keith M Wesolowski
2001-05-10 21:15 ` Pete Popov
2001-05-18 20:23 ` Netscape on linux-mipsel ?? Wayne Gowcher
2001-05-18 20:29 ` Pete Popov
2001-05-19 3:50 ` Ralf Baechle
2001-05-10 22:02 ` Jun Sun [this message]
2001-05-11 0:19 ` Configuration of PCI Video card on a BIOS-less board Wayne Gowcher
2001-05-10 18:23 ` Geert Uytterhoeven
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=3AFB0FF6.D84A491E@mvista.com \
--to=jsun@mvista.com \
--cc=Geert.Uytterhoeven@sonycom.com \
--cc=linux-mips@oss.sgi.com \
--cc=ppopov@mvista.com \
--cc=wesolows@foobazco.org \
--cc=wgowcher@yahoo.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.