From patchwork Wed Jul 25 20:55:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 949384 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41bTk46ZQpz9s2g for ; Thu, 26 Jul 2018 08:02:52 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=stevens-zone.net Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41bTk45DVrzF0BT for ; Thu, 26 Jul 2018 08:02:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=stevens-zone.net X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=stevens-zone.net (client-ip=217.72.192.74; helo=mout.kundenserver.de; envelope-from=darren@stevens-zone.net; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=stevens-zone.net X-Greylist: delayed 312 seconds by postgrey-1.36 at bilbo; Thu, 26 Jul 2018 08:01:00 AEST Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41bTgw0LVWzF09Y for ; Thu, 26 Jul 2018 08:00:59 +1000 (AEST) Received: from mintppc.home ([86.171.142.179]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.179]) with ESMTPA (Nemesis) id 0Mfjsa-1fNSxF3p2a-00N8da; Wed, 25 Jul 2018 23:55:34 +0200 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org Date: Wed, 25 Jul 2018 21:55:18 +0100 (BST) Message-ID: <4c4cb2b4391.4d23d508@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH] powerpc/pasemi: Seach for PCI root bus by compatible property MIME-Version: 1.0 X-Provags-ID: V03:K1:uvrUZyO39QV6JpuOEWVrAu2goDAP94XoRvm4+0t3B1wi4VP/GA/ /BFB5sGKD4C1peV2DS0ubCg2ixszbLFfl5STqsg1/UJkKXAuGBwgIN3axGG2G8ehY/cwBE4 J+IwjJzZijjsiN+/t/3wzjTDJzIzCdNQGPUqGBl2YLwsHBXeUMRwGFsK8H5fgG/BkHammHS Paba5zj0dS7MGsm8M/hdQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ejq3iG8XSqg=:3Jp7DdCc5rrk5NACbqX00P 8iPn9p6ypshWLWVi1iMLoBmdEBCt98g+Wuv3+NHgs+W9z93y0S0hZYdZw+uXd2JWe6oLdo0XO jma0MnBNc1Q5uzsDW+KIyj+hsZu/cxC6OLxyAoseL32oumo9aKb+6NfWS6SgSr7VS8b3m8rzo xRjv5VglzR9AM0dcBGX3W28qxK6z2HMK384S5+bjJE4plpYdLp0s3bIget95gMjrPeREmUag5 RmGVLxbfiwBH/SLAf+xTLx5367rsCgNvWli0r1rY6v/VYNysXGtUWRMZQScz43Tr4+T/WI2O2 eItIoRufcGRyP9d99h/v/bcfRuGzLu8GXYQ/Ob8weP/VHdqHPz//iscxjZgUy+ubSJMQfpDMR MFRZdgGOt/vEs0Wvs5O3ArfjFBE/8uan0HmRtGDDtwlcKHAFIfC3f5hTGsVnmm7XYZXWh2fsH LBbE1BQJMkq/gHnGHWos9piPow0hR1/EeTS+anXMvmPvwtsudfHWJ6gibKXkFsLA5gjKJSN2e mc0ahu/fLOfvBjH0zTYMYDM/WUGSr35FljPrjkTba0pRax8uWL7VJ9GH3g2SMGPfsIuHRjAs5 rWs+Me3NrbzrMCq2O5qT54xIbyMI0VxyBh66O3NRa/hZ90x8/hAmoqMh5vcOtiKVfQ8MjXl20 fqIEHLUIOT2+Lq7Ty0NXRCSEzxApsXxHvRYzgV9Ev/J4D7POs1HV+jK5vB0iZ4S046CnQ2aqD g9PEOzCh+UOuHHNg X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Olof Johansson , Christian Zigotzky Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 Acked-by: Olof Johansson --- This works on the Amigaone X1000, I don't know if this method of finding the pci bus was there bcause of earlier firmwares. 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)