From: "Steven A. Falco" <sfalco@harris.com>
To: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: PPC405EX PCI CPU vs bus address mapping question
Date: Thu, 18 Mar 2010 12:42:07 -0400 [thread overview]
Message-ID: <4BA257DF.2040300@harris.com> (raw)
I have a Kilauea board with one custom PCIE card plugged
into the PCIE1 slot. The custom card contains four PCI
devices which are connected via a PCIE-PCI bridge to the
Kilauea.
These devices need to communicate directly with each other.
This is done by telling each device the PCI bus address of
its partners.
I tried using pci_resource_start() to get the bus address,
but that apparently gives me the cpu address.
Specifically, pci_resource_start() returns the following
addresses for the four devices:
0x0000000090000000, 0x0000000094000000,
0x0000000098000000, and 0x000000009c000000.
However, if I look at the BAR registers in config space, they
are set to 80000000, 84000000, 88000000, and 8c000000.
During boot, I see:
PCI host bridge /plb/pciex@0c0000000 (primary) ranges:
MEM 0x0000000090000000..0x000000009fffffff -> 0x0000000080000000
And that does correspond to the "ranges" line in my dts file.
So there is clearly an offset of 0x10000000 between the CPU and
bus address.
My question is: What is the correct way for the driver to learn
of this offset, so that it can tell the devices where to find
their partners?
I see in pci_process_bridge_OF_ranges() that hose->pci_mem_offset
is calculated. That is probably the value I want, but I don't
see a "clean" way to access it.
Steve
reply other threads:[~2010-03-18 16:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4BA257DF.2040300@harris.com \
--to=sfalco@harris.com \
--cc=linuxppc-dev@ozlabs.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 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.