From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Michael Ellerman <mpe@ellerman.id.au>,
Darren Stevens <darren@stevens-zone.net>,
linuxppc-dev@lists.ozlabs.org
Cc: Olof Johansson <olof@lixom.net>
Subject: [PATCH] powerpc/pasemi: Seach for PCI root bus by compatible property
Date: Tue, 31 Jul 2018 17:34:09 +0200 [thread overview]
Message-ID: <fde71219-5e0e-cc12-a31f-258ce547f471@xenosoft.de> (raw)
In-Reply-To: <87zhy7fw7f.fsf@concordia.ellerman.id.au>
Just for info: I tested it on my Nemo board today and it works.
-- Christian
On 31 July 2018 at 2:04PM, Michael Ellerman wrote:
> Michael Ellerman <mpe@ellerman.id.au> writes:
>> Darren Stevens <darren@stevens-zone.net> writes:
>>
>>> Pasemi arch code finds the root of the PCI-e bus by searching the
>>> device-tree for a node called 'pxp'. But the root bus has a
>>> compatible property of 'pasemi,rootbus' so search for that instead.
>>>
>>> Signed-off-by: Darren Stevens <darren@stevens-zone.net>
>>> ---
>>>
>>> This works on the Amigaone X1000, I don't know if this method of
>>> finding the pci bus was there bcause of earlier firmwares.
>> Does anyone have another pasemi board they can test this on?
>>
>> The last time I plugged mine in it popped the power supply and took out
>> power to half the office :) - I haven't had a chance to try it since.
> I actually I remembered I have a device tree lying around from an electra.
>
> It has:
>
> [I] home:pxp@0,80000000(7)(I)> lsprop name compatible
> name "pxp"
> compatible "pasemi,rootbus"
> "pa-pxp"
>
>
> So it looks like the patch would work fine on it at least.
>
> cheers
>
>>> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
>>> index c7c8607..be62380 100644
>>> --- a/arch/powerpc/platforms/pasemi/pci.c
>>> +++ b/arch/powerpc/platforms/pasemi/pci.c
>>> @@ -216,6 +216,7 @@ static int __init pas_add_bridge(struct device_node *dev)
>>> void __init pas_pci_init(void)
>>> {
>>> struct device_node *np, *root;
>>> + int res;
>>>
>>> root = of_find_node_by_path("/");
>>> if (!root) {
>>> @@ -226,11 +227,11 @@ void __init pas_pci_init(void)
>>>
>>> pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);
>>>
>>> - for (np = NULL; (np = of_get_next_child(root, np)) != NULL;)
>>> - if (np->name && !strcmp(np->name, "pxp") && !pas_add_bridge(np))
>>> - of_node_get(np);
>>> -
>>> - of_node_put(root);
>>> + np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
>>> + if (np) {
>>> + res = pas_add_bridge(np);
>>> + of_node_put(np);
>>> + }
>>> }
>>>
>>> void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
next prev parent reply other threads:[~2018-07-31 15:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 20:55 [PATCH] powerpc/pasemi: Seach for PCI root bus by compatible property Darren Stevens
2018-07-31 11:55 ` Michael Ellerman
2018-07-31 12:04 ` Michael Ellerman
2018-07-31 15:34 ` Christian Zigotzky [this message]
2018-08-01 14:36 ` Michael Ellerman
2018-08-01 16:17 ` Olof Johansson
2018-08-03 10:20 ` Michael Ellerman
2018-08-08 14:25 ` Michael Ellerman
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=fde71219-5e0e-cc12-a31f-258ce547f471@xenosoft.de \
--to=chzigotzky@xenosoft.de \
--cc=darren@stevens-zone.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=olof@lixom.net \
/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).