Skip to contentSkip to conversation

ppc4xx: Allow 4xx PCI bridge to be disabled via device tree

PATCH In review Matthias Fuchs 2 participants 2 messages Sep 10, 2008 – Sep 11, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4xx: Allow 4xx PCI bridge to be disabled via device tree

This patch allows the 4xx (conventional) PCI bridge to be disabled via the device tree. This is needed for 4xx PCI adapter hardware.

Use the PCI node's status property to disable the PCI bridge.

---
 arch/powerpc/sysdev/ppc4xx_pci.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +8 -1
index fb368df..8c13d4f 100644
@@ -277,9 +277,16 @@ static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
 	const int *bus_range;
 	int primary = 0;
 
+	/* Check if device is enabled */
+	if (!of_device_is_available(np)) {
+		printk(KERN_INFO "%s: Port disabled via device-tree\n",
+		       np->full_name);
+		return;
+	}
+
 	/* Fetch config space registers address */
 	if (of_address_to_resource(np, 0, &rsrc_cfg)) {
-		printk(KERN_ERR "%s:Can't get PCI config register base !",
+		printk(KERN_ERR "%s: Can't get PCI config register base !",
 		       np->full_name);
 		return;
 	}
Signature · 1 line
1.5.3