Skip to contentSkip to conversation

4xx: PCIe driver now detects if a port is disabled via the dev-tree

PATCH In review Stefan Roese 2 participants 2 messages Jun 5, 2008 – Jun 6, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 4xx: PCIe driver now detects if a port is disabled via the dev-tree

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.

---
 arch/powerpc/sysdev/ppc4xx_pci.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +9 -0
index b4a54c5..76886cf 100644
@@ -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) {
Signature · 1 line
1.5.5.3
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Stefan Roese

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.

Quoted 24 lines
---
 arch/powerpc/sysdev/ppc4xx_pci.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +9 -0
index b4a54c5..76886cf 100644
@@ -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) {