All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Prasun.kapoor@cavium.com,
	Manish Jaggi <mjaggi@caviumnetworks.com>,
	Vijaya Kumar <Vijaya.Kumar@caviumnetworks.com>,
	Julien Grall <julien.grall@linaro.org>,
	xen-devel@lists.xen.org,
	"StefanoStabellini(Stefano.Stabellini@citrix.com)"
	<stefano.stabellini@citrix.com>
Subject: Re: RFC: [PATCH 1/3] Enhance platform support for PCI
Date: Fri, 20 Feb 2015 17:33:39 +0000	[thread overview]
Message-ID: <1424453619.30924.381.camel@citrix.com> (raw)
In-Reply-To: <54E75D8702000078000621DD@mail.emea.novell.com>

On Fri, 2015-02-20 at 15:15 +0000, Jan Beulich wrote:
> > That's the issue we are trying to resolve, with device tree there is no
> > explicit segment ID, so we have an essentially unindexed set of PCI
> > buses in both Xen and dom0.
> 
> How that? What if two bus numbers are equal? There ought to be
> some kind of topology information. Or if all buses are distinct, then
> you don't need a segment number.

It's very possible that I simply don't have the PCI terminology straight
in my head, leading to me talking nonsense.

I'll explain how I'm using it and perhaps you can put me straight...

My understanding was that a PCI segment equates to a PCI host
controller, i.e. a specific instance of some PCI host IP on an SoC. I
think that PCI specs etc perhaps call a segment a PCI domain, which we
avoided in Xen due to the obvious potential for confusion.

A PCI host controller defines the root of a bus, within which the BDF
need not be distinct due to the differing segments which are effectively
a higher level namespace on the BDFs.

So given a system with two PCI host controllers we end up with two
segments (lets say A and B, but choosing those is the topic of this
thread) and it is acceptable for both to contain a bus 0 with a device 1
on it, i.e. (A:0:0.0) and (B:0:0.0) are distinct and can coexist.

It sounds like you are saying that this is not actually acceptable and
that 0:0.0 must be unique in the system irrespective of the associated
segment? iow (B:0:0.0) must be e.g. (B:1:0.0) instead?

Just for reference a DT node describing a PCI host controller might look
like (taking the APM Mustang one as an example):

                pcie0: pcie@1f2b0000 {
                        status = "disabled";
                        device_type = "pci";
                        compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
                        #interrupt-cells = <1>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        reg = < 0x00 0x1f2b0000 0x0 0x00010000   /* Controller registers */
                                0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */
                        reg-names = "csr", "cfg";
                        ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000   /* io */
                                  0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */
                        dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
                                      0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
                        interrupt-map-mask = <0x0 0x0 0x0 0x7>;
                        interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc2 0x1
                                         0x0 0x0 0x0 0x2 &gic 0x0 0xc3 0x1
                                         0x0 0x0 0x0 0x3 &gic 0x0 0xc4 0x1
                                         0x0 0x0 0x0 0x4 &gic 0x0 0xc5 0x1>;
                        dma-coherent;
                        clocks = <&pcie0clk 0>;
                };

I expect most of this is uninteresting but the key thing is that there
is no segment number nor topology relative to e.g. "pcie1:
pcie@1f2c0000" (the node look identical except e.g. all the base
addresses and interrupt numbers differ).

(FWIW reg here shows that the PCI cfg space is at 0xe0d0000000,
interrupt-map shows that SPI(AKA GSI) 0xc2 is INTA and 0xc3 is INTB (I
think, a bit fuzzy...), ranges is the space where BARs live, I think you
can safely ignore everything else for the purposes of this
conversation).

Ian.

  reply	other threads:[~2015-02-20 17:33 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 11:34 RFC: [PATCH 1/3] Enhance platform support for PCI Manish Jaggi
2015-02-20 12:03 ` Julien Grall
2015-02-20 12:10   ` Manish Jaggi
2015-02-20 12:20     ` Julien Grall
2015-02-20 12:34       ` Manish Jaggi
2015-02-20 13:01         ` Manish Jaggi
2015-02-20 13:45           ` Ian Campbell
2015-02-20 14:11             ` Jan Beulich
2015-02-20 14:26               ` Ian Campbell
2015-02-20 14:39                 ` Jan Beulich
2015-02-20 15:01                   ` Ian Campbell
2015-02-20 15:13                     ` Manish Jaggi
2015-02-20 15:15                       ` Julien Grall
2015-02-20 15:15                     ` Jan Beulich
2015-02-20 17:33                       ` Ian Campbell [this message]
2015-02-23  8:43                         ` Jan Beulich
2015-02-23 12:45                           ` Ian Campbell
2015-02-23 14:07                             ` Jan Beulich
2015-02-23 14:33                               ` Ian Campbell
2015-02-23 14:45                                 ` Jan Beulich
2015-02-23 15:02                                   ` Ian Campbell
2015-02-23 15:27                                     ` Jan Beulich
2015-02-23 15:46                                       ` Ian Campbell
2015-02-23 16:20                                         ` Jan Beulich
2015-02-26 10:09                                           ` Manish Jaggi
2015-02-26 10:30                                             ` Jan Beulich
2015-02-26 11:05                                             ` Ian Campbell
2015-02-27 14:33                                               ` Stefano Stabellini
2015-02-27 14:42                                                 ` Ian Campbell
2015-02-27 14:54                                                   ` Stefano Stabellini
2015-02-27 15:24                                                     ` Ian Campbell
2015-02-27 15:29                                                       ` Ian Campbell
2015-02-27 16:35                                                       ` Jan Beulich
2015-02-27 16:50                                                         ` Ian Campbell
2015-02-27 17:15                                                           ` Stefano Stabellini
2015-03-02 11:48                                                             ` Ian Campbell
2015-03-03  9:19                                                               ` Manish Jaggi
2015-03-17  5:26                                                           ` Manish Jaggi
2015-03-17  7:28                                                             ` Jan Beulich
2015-03-17 12:06                                                               ` Manish Jaggi
2015-03-17 12:31                                                                 ` Jan Beulich
2015-03-18  4:05                                                                   ` Manish Jaggi
2015-03-17 13:17                                                             ` Konrad Rzeszutek Wilk
2015-03-11 18:26                           ` Stefano Stabellini
2015-03-12  9:16                             ` Jan Beulich
2015-03-12 10:33                               ` Stefano Stabellini
2015-03-12 11:28                                 ` Jan Beulich
2015-03-12  9:30                             ` Ian Campbell
2015-02-20 14:14             ` Manish Jaggi
2015-02-20 14:39               ` Ian Campbell
2015-02-23 10:59                 ` Manish Jaggi
2015-02-23 11:14                   ` Julien Grall
2015-02-23 11:50                     ` Manish Jaggi
2015-02-23 15:15                       ` Julien Grall
2015-02-23 17:12                         ` Manish Jaggi
2015-02-23 21:39                           ` Julien Grall
2015-02-24  0:23                             ` Manish Jaggi
2015-02-24 13:43                               ` Julien Grall
2015-02-25  2:33                                 ` Manish Jaggi
2015-02-25 10:20                                   ` Ian Campbell
2015-02-26 10:49                                     ` Vijay Kilari
2015-02-26 11:12                                       ` Ian Campbell
2015-02-26 13:58                                         ` Julien Grall
2015-02-26 14:46                                       ` Pranavkumar Sawargaonkar
2015-02-26 15:17                                         ` Julien Grall
2015-02-27 10:11                                           ` Pranavkumar Sawargaonkar
2015-02-27 10:38                                             ` Ian Campbell
2015-02-27 13:22                                               ` Ian Campbell
2015-02-27 13:59                                                 ` Vijay Kilari
2015-02-20 13:37       ` Ian Campbell

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=1424453619.30924.381.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Prasun.kapoor@cavium.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=julien.grall@linaro.org \
    --cc=mjaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.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.