* [PATCH 00/11] ARM: integrator PCI DT adaption [not found] <1365087696-9548-1-git-send-email-linus.walleij@linaro.org> [not found] ` <1365087696-9548-2-git-send-email-linus.walleij@linaro.org> @ 2013-04-04 15:29 ` Arnd Bergmann [not found] ` <1365087696-9548-11-git-send-email-linus.walleij@linaro.org> 2 siblings, 0 replies; 6+ messages in thread From: Arnd Bergmann @ 2013-04-04 15:29 UTC (permalink / raw) To: linux-arm-kernel On Thursday 04 April 2013, Linus Walleij wrote: > This patch series converts the Integrator/AP v3 PCI adapter > to use device tree, up until the point where I try to set > up the IRQ map and fail. Help on how to get the last patch > working is appreciated. > > This series is dependent on the first three patches for OF > recently submitted by Thomas Petazzoni, I will not be able > to submit them until that stuff is merged somewhere (like > ARM SoC). Looks very nice! Acked-by: Arnd Bergmann <arnd@arndb.de> including the last [RFC] patch, which also looks right to me, even though you tell me it doesn't work ;-) ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <1365087696-9548-11-git-send-email-linus.walleij@linaro.org>]
[parent not found: <1365087696-9548-12-git-send-email-linus.walleij@linaro.org>]
* [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree [not found] ` <1365087696-9548-12-git-send-email-linus.walleij@linaro.org> @ 2013-04-04 15:27 ` Arnd Bergmann 2013-04-07 18:43 ` Linus Walleij 2013-04-11 20:27 ` Linus Walleij 1 sibling, 1 reply; 6+ messages in thread From: Arnd Bergmann @ 2013-04-04 15:27 UTC (permalink / raw) To: linux-arm-kernel On Thursday 04 April 2013, Linus Walleij wrote: > This adds the interrupt-map property to the PCIv3 DTS file > and makes the bridge obtain mappings from the device tree. > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > This currently bugs out - when trying to get the IRQs for > devices of_irq_map_pci() reads the IRQ pin from the PCI config > space successfully, then comes to trying to look up the parent > PCI device by checking pdev->bus->self, which is NULL, then > tries to treat it as a bridge doing pci_bus_to_OF_node(pdev->bus) > which also results in NULL and it bails out. > > No clue why this is so - some problem with the parent of this > bus not being a PCI device in itself? Help. All the PowerPC implementations I remember had the PCI bus as a device under the root node. It's very possible that it's just a bug in of_irq_map_pci(). Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree 2013-04-04 15:27 ` [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree Arnd Bergmann @ 2013-04-07 18:43 ` Linus Walleij 0 siblings, 0 replies; 6+ messages in thread From: Linus Walleij @ 2013-04-07 18:43 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 4, 2013 at 5:27 PM, Arnd Bergmann <arnd@arndb.de> wrote: > On Thursday 04 April 2013, Linus Walleij wrote: >> This adds the interrupt-map property to the PCIv3 DTS file >> and makes the bridge obtain mappings from the device tree. >> >> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> >> --- >> This currently bugs out - when trying to get the IRQs for >> devices of_irq_map_pci() reads the IRQ pin from the PCI config >> space successfully, then comes to trying to look up the parent >> PCI device by checking pdev->bus->self, which is NULL, then >> tries to treat it as a bridge doing pci_bus_to_OF_node(pdev->bus) >> which also results in NULL and it bails out. >> >> No clue why this is so - some problem with the parent of this >> bus not being a PCI device in itself? Help. > > All the PowerPC implementations I remember had the PCI bus > as a device under the root node. It's very possible that it's > just a bug in of_irq_map_pci(). Hm, quite hard to figure this one out. Benjamin, any hints? Yours, Linus Walleij ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree [not found] ` <1365087696-9548-12-git-send-email-linus.walleij@linaro.org> 2013-04-04 15:27 ` [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree Arnd Bergmann @ 2013-04-11 20:27 ` Linus Walleij 2013-04-12 8:22 ` Andrew Murray 1 sibling, 1 reply; 6+ messages in thread From: Linus Walleij @ 2013-04-11 20:27 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 4, 2013 at 5:01 PM, Linus Walleij <linus.walleij@linaro.org> wrote: > This currently bugs out - when trying to get the IRQs for > devices of_irq_map_pci() reads the IRQ pin from the PCI config > space successfully, then comes to trying to look up the parent > PCI device by checking pdev->bus->self, which is NULL, then > tries to treat it as a bridge doing pci_bus_to_OF_node(pdev->bus) > which also results in NULL and it bails out. > > No clue why this is so - some problem with the parent of this > bus not being a PCI device in itself? Help. Tracked this down to a point where in drivers/pci/of.c pci_set_bus_of_node() is called on the root bus, at which point it calls pcibios_get_phb_of_node() which has no clue on how to obtain the DT node for the root hub. (Only bridges.) Inserting this na?ve fragment into the PCI driver makes things tick: +struct device_node *static_root; + +struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus) +{ + return static_root; +} + In probe(): + static_root = np; It'll override the weak symbol and make things work. I guess this is something for kernel/bios32.c to implement if we want to support DT on these PCI adapters, so looking into that next... But how do others get their things to work? Not using bios32? I wonder... Yours, Linus Walleij ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree 2013-04-11 20:27 ` Linus Walleij @ 2013-04-12 8:22 ` Andrew Murray 2013-04-12 8:51 ` Linus Walleij 0 siblings, 1 reply; 6+ messages in thread From: Andrew Murray @ 2013-04-12 8:22 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 11, 2013 at 09:27:53PM +0100, Linus Walleij wrote: > On Thu, Apr 4, 2013 at 5:01 PM, Linus Walleij <linus.walleij@linaro.org> wrote: > > > This currently bugs out - when trying to get the IRQs for > > devices of_irq_map_pci() reads the IRQ pin from the PCI config > > space successfully, then comes to trying to look up the parent > > PCI device by checking pdev->bus->self, which is NULL, then > > tries to treat it as a bridge doing pci_bus_to_OF_node(pdev->bus) > > which also results in NULL and it bails out. > > > > No clue why this is so - some problem with the parent of this > > bus not being a PCI device in itself? Help. > > Tracked this down to a point where in drivers/pci/of.c > pci_set_bus_of_node() is called on the root bus, at which > point it calls pcibios_get_phb_of_node() which has no clue > on how to obtain the DT node for the root hub. (Only bridges.) > > Inserting this na?ve fragment into the PCI driver makes things > tick: > > +struct device_node *static_root; > + > +struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus) > +{ > + return static_root; > +} > + > > In probe(): > + static_root = np; > > It'll override the weak symbol and make things work. > > I guess this is something for kernel/bios32.c to implement > if we want to support DT on these PCI adapters, so looking > into that next... > > But how do others get their things to work? Not using bios32? > I wonder... I think there are a mix of solutions out here, let me try and remember... * I originally [1] implemented a pcibios_get_phb_of_node function in arch/arm/bios32.c this used a new .of_node field from sysdata. The idea being that pcibios_init_hw populates .of_node from a field of the same name provided by the driver in hw_pci. * I believe Thierry's approach was to reuse the existing pcibios_get_phb_of_node function [2], to do this some changes were needed elsewhere I'm not sure the full details of this, I never got around to testing it. But I understand it's an approach that Thomas also used. It believe it requries a custom implementation of hw->scan such that instead of using pcibios_init_hw's default implementation of pci_scan_root_bus (which passes a NULL) your custom implementation calls pci_create_root_bus instead and passes a suitable struct device. * I recall having some issues with weak symbols when playing around with pcibios_get_phb_of_node - there seems to be some changes in this area [3]. I don't think any of these solutions are ideal - perhaps pcibios_init_hw needs to be changed... there are patches around which involve passing additional private data in sys_data/hw_pci see [1] and [4] if this additional data contains struct device or struct device_node then perhaps they can be plumbed into the default call to pci_scan_root_bus in bios32? If every ARM DT host bridge driver needs to implement their own scan function then something isn't quite right. I hope that helps. Andrew Murray [1] http://patchwork.ozlabs.org/patch/213570 [2] http://www.spinics.net/lists/linux-pci/msg19917.html [3] http://patchwork1.kernel.org/patch/2394451 [4] http://patchwork.kernel.org/patch/2129431 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree 2013-04-12 8:22 ` Andrew Murray @ 2013-04-12 8:51 ` Linus Walleij 0 siblings, 0 replies; 6+ messages in thread From: Linus Walleij @ 2013-04-12 8:51 UTC (permalink / raw) To: linux-arm-kernel On Fri, Apr 12, 2013 at 10:22 AM, Andrew Murray <andrew.murray@arm.com> wrote: Thanks for your prompt reply Andrew! > I don't think any of these solutions are ideal - perhaps pcibios_init_hw needs > to be changed... there are patches around which involve passing additional > private data in sys_data/hw_pci see [1] and [4] if this additional data > contains struct device or struct device_node then perhaps they can be plumbed > into the default call to pci_scan_root_bus in bios32? If every ARM DT host > bridge driver needs to implement their own scan function then something isn't > quite right. So yesterday I came up with the scheme of augmenting the pci_common_init() call in bios32.c to take an additional struct device *parent argument, then pass that to the pci_create_root_bus() call, as it is hard-coded to NULL in bios32.c today. Current users were patched to pass NULL as parent. When you assign that from a struct device* instatiated from the device tree the node gets properly resolved and the mappings start to work. However I might have been too sleepy last night and misfired the patch since it seems it has not yet made it onto the mailing list ... will resend. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-12 8:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1365087696-9548-1-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-2-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-3-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-4-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-5-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-6-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-7-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-8-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-9-git-send-email-linus.walleij@linaro.org>
2013-04-04 15:29 ` [PATCH 00/11] ARM: integrator PCI DT adaption Arnd Bergmann
[not found] ` <1365087696-9548-11-git-send-email-linus.walleij@linaro.org>
[not found] ` <1365087696-9548-12-git-send-email-linus.walleij@linaro.org>
2013-04-04 15:27 ` [PATCH 11/11] RFC: ARM: get PCI device IRQs from device tree Arnd Bergmann
2013-04-07 18:43 ` Linus Walleij
2013-04-11 20:27 ` Linus Walleij
2013-04-12 8:22 ` Andrew Murray
2013-04-12 8:51 ` Linus Walleij
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox