From: Will Deacon <will.deacon@arm.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Kumar Gala <galak@codeaurora.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 3/3] PCI: ARM: add support for generic PCI host controller
Date: Thu, 13 Feb 2014 19:51:48 +0000 [thread overview]
Message-ID: <20140213195148.GP13576@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20140213180616.GD17248@obsidianresearch.com>
On Thu, Feb 13, 2014 at 06:06:16PM +0000, Jason Gunthorpe wrote:
> On Thu, Feb 13, 2014 at 11:07:21AM +0000, Will Deacon wrote:
>
> > Not in this case! kvmtool generates the following:
>
> Well, the example is nice so someone can review it..
>
> > pci {
> > #address-cells = <0x3>;
> > #size-cells = <0x2>;
> > #interrupt-cells = <0x1>;
> > compatible = "arm,pci-cam-generic";
> > reg = <0x0 0x40000000>;
> > ranges = <0x1000000 0x0 0x0 0x0 0x0 0x0 0x10000 0x2000000 0x0 0x41000000 0x0 0x41000000 0x0 0x3f000000>;
> > interrupt-map = <0x0 0x0 0x0 0x1 0x1 0x0 0x4 0x1 0x800 0x0 0x0 0x1 0x1 0x0 0x5 0x1 0x1000 0x0 0x0 0x1 0x1 0x0 0x6 0x1 0x1800 0x0 0x0 0x1 0x1 0x0 0x7 0x1>;
> > interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
> > };
>
>
> Looks like there are a few misses in the above. How about this:
>
> pci {
> compatible = "arm,pci-cam-generic"
> device_type = "pci";
> ** ^^^^^^^^^^^^^^^^^
> ** MANDATORY for the host bridge node
Ok, I'll add that.
> #address-cells = <3>;
> #size-cells = <2>;
>
> // BUS_ADDRESS(3) CPU_PHYSICAL(2) SIZE(2)
> ranges = <0x1000000 0x0 0x00000000 0x0 0x00000000 0x0 0x00010000>,
> ^^^^^^^^^^^^^^
> ** ?? Is this why you had problems with the offset? Should
> ** be the cpu physical address of the start of the IO window.
> <0x2000000 0x0 0x41000000 0x0 0x41000000 0x0 0x3f000000>;
>
>
> #interrupt-cells = <0x1>;
> // PCI_DEVICE(3) INT#(1) CONTROLLER(PHANDLE) CONTROLLER_DATA(3)
> interrupt-map = < 0x0 0x0 0x0 0x1 0x1 0x0 0x4 0x1
> 0x800 0x0 0x0 0x1 0x1 0x0 0x5 0x1
> 0x1000 0x0 0x0 0x1 0x1 0x0 0x6 0x1
> 0x1800 0x0 0x0 0x1 0x1 0x0 0x7 0x1>;
> ** ^^^^^^
> ** This should be a phandle to the interrupt controller
That is a phandle, libfdt/kvmtool just ends up dealing with the number
directly. I'll fix in the example.
> // PCI_DEVICE(3) INT#1()
> interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
> }
>
> I keep thinking of making a pcie-dt.h file with helper macros for
> all this. :|
If it's not being generated automatically, that could be useful.
> FWWI, I like to put a double space between the logically distinct
> things in the lists.
Makes sense, I may well do the same.
Thanks,
Will
next prev parent reply other threads:[~2014-02-13 19:52 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 20:16 [PATCH v2 0/3] ARM: PCI: implement generic PCI host controller Will Deacon
2014-02-12 20:16 ` [PATCH v2 1/3] ARM: mach-virt: allow PCI support to be selected Will Deacon
2014-02-12 20:16 ` [PATCH v2 2/3] ARM: bios32: use pci_enable_resource to enable PCI resources Will Deacon
2014-02-12 22:28 ` Jason Gunthorpe
2014-02-13 10:06 ` Will Deacon
2014-02-13 12:22 ` Jingoo Han
2014-02-12 20:16 ` [PATCH v2 3/3] PCI: ARM: add support for generic PCI host controller Will Deacon
2014-02-12 20:59 ` Arnd Bergmann
2014-02-13 11:04 ` Will Deacon
2014-02-13 11:47 ` Arnd Bergmann
2014-02-13 12:00 ` Will Deacon
2014-02-13 12:21 ` Arnd Bergmann
2014-02-12 21:51 ` Kumar Gala
2014-02-13 11:07 ` Will Deacon
2014-02-13 16:22 ` Kumar Gala
2014-02-13 16:25 ` Will Deacon
2014-02-13 16:28 ` Arnd Bergmann
2014-02-13 18:11 ` Mark Rutland
2014-02-13 18:26 ` Jason Gunthorpe
2014-02-13 19:53 ` Will Deacon
2014-02-13 20:20 ` Jason Gunthorpe
2014-02-14 9:59 ` Arnd Bergmann
2014-02-14 22:00 ` Liviu Dudau
2014-02-15 13:03 ` Arnd Bergmann
2014-02-18 17:41 ` Jason Gunthorpe
2014-02-18 18:25 ` Arnd Bergmann
2014-02-18 18:45 ` Jason Gunthorpe
2014-02-18 19:13 ` Arnd Bergmann
2014-02-19 2:44 ` Liviu Dudau
2014-02-19 6:48 ` Jason Gunthorpe
2014-02-19 10:24 ` Arnd Bergmann
2014-02-19 11:37 ` Liviu Dudau
2014-02-19 13:26 ` Arnd Bergmann
2014-02-19 15:30 ` Liviu Dudau
2014-02-19 19:47 ` Arnd Bergmann
2014-02-19 0:28 ` Bjorn Helgaas
2014-02-19 9:58 ` Arnd Bergmann
2014-02-19 18:20 ` Bjorn Helgaas
2014-02-19 19:06 ` Arnd Bergmann
2014-02-19 20:18 ` Bjorn Helgaas
2014-02-19 20:48 ` Arnd Bergmann
2014-02-19 21:10 ` Jason Gunthorpe
2014-02-19 21:33 ` Bjorn Helgaas
2014-02-19 22:12 ` Arnd Bergmann
2014-02-19 22:18 ` Bjorn Helgaas
2014-02-13 19:52 ` Rob Herring
2014-02-13 18:06 ` Jason Gunthorpe
2014-02-13 19:51 ` Will Deacon [this message]
2014-02-13 18:26 ` [PATCH v2 0/3] ARM: PCI: implement " Jason Gunthorpe
2014-02-14 11:05 ` Arnd Bergmann
2014-02-18 18:00 ` Jason Gunthorpe
2014-02-18 18:40 ` Arnd Bergmann
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=20140213195148.GP13576@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=galak@codeaurora.org \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).