* [PATCH] [POWERPC] 4xx: PCIe driver now detects if a port is disabled via the dev-tree
@ 2008-06-05 14:22 Stefan Roese
2008-06-06 4:05 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Roese @ 2008-06-05 14:22 UTC (permalink / raw)
To: linuxppc-dev
This patch add a check to the PPC4xx PCIe driver to detect if the port
is disabled via the device-tree. This is needed for the AMCC Canyonlands
board which has an option to either select 2 PCIe ports or 1 PCIe port
and one SATA port. The SATA port and the 1st PCIe port pins are multiplexed
so we can't start both drivers.
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/sysdev/ppc4xx_pci.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index b4a54c5..76886cf 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1634,6 +1634,15 @@ static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
}
port = &ppc4xx_pciex_ports[portno];
port->index = portno;
+
+ /*
+ * Check if device is enabled
+ */
+ if (!of_device_is_available(np)) {
+ printk(KERN_INFO "PCIE%d: Port disabled via device-tree\n", port->index);
+ return;
+ }
+
port->node = of_node_get(np);
pval = of_get_property(np, "sdr-base", NULL);
if (pval == NULL) {
--
1.5.5.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] [POWERPC] 4xx: PCIe driver now detects if a port is disabled via the dev-tree
2008-06-05 14:22 [PATCH] [POWERPC] 4xx: PCIe driver now detects if a port is disabled via the dev-tree Stefan Roese
@ 2008-06-06 4:05 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2008-06-06 4:05 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
On Thu, 2008-06-05 at 16:22 +0200, Stefan Roese wrote:
> This patch add a check to the PPC4xx PCIe driver to detect if the port
> is disabled via the device-tree. This is needed for the AMCC Canyonlands
> board which has an option to either select 2 PCIe ports or 1 PCIe port
> and one SATA port. The SATA port and the 1st PCIe port pins are multiplexed
> so we can't start both drivers.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/powerpc/sysdev/ppc4xx_pci.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
> index b4a54c5..76886cf 100644
> --- a/arch/powerpc/sysdev/ppc4xx_pci.c
> +++ b/arch/powerpc/sysdev/ppc4xx_pci.c
> @@ -1634,6 +1634,15 @@ static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
> }
> port = &ppc4xx_pciex_ports[portno];
> port->index = portno;
> +
> + /*
> + * Check if device is enabled
> + */
> + if (!of_device_is_available(np)) {
> + printk(KERN_INFO "PCIE%d: Port disabled via device-tree\n", port->index);
> + return;
> + }
> +
> port->node = of_node_get(np);
> pval = of_get_property(np, "sdr-base", NULL);
> if (pval == NULL) {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-06 4:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-05 14:22 [PATCH] [POWERPC] 4xx: PCIe driver now detects if a port is disabled via the dev-tree Stefan Roese
2008-06-06 4:05 ` Benjamin Herrenschmidt
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).