Skip to contentSkip to conversation

Don't try to allocate resources for a POWERPC PHB

PATCH Superseded Kumar Gala 1 participant 1 message Jul 25, 2007 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 Don't try to allocate resources for a POWERPC PHB

The Freescale PCI PHBs actual report back values in the BAR registers this causes issues in that we try to allocate resources for them and will get error messages like the following on MPC8544 DS:

PCI: Failed to allocate mem resource #1:80000000@0 for 0000:00:00.0

To address this if we are class PCI_CLASS_PROCESSOR_POWERPC, a normal header type, and the PHB don't try to assign resources.

---
 arch/powerpc/kernel/pci_32.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
arch/powerpc/kernel/pci_32.c +11 -0
index 721a694..39f8cb1 100644
@@ -508,6 +508,13 @@ pcibios_allocate_resources(int pass)
 	struct resource *r;
 
 	for_each_pci_dev(dev) {
+		int class = dev->class >> 8;
+
+		if ((class == PCI_CLASS_PROCESSOR_POWERPC) &&
+		    (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
+		    (dev->bus->parent == NULL))
+			continue;
+
 		pci_read_config_word(dev, PCI_COMMAND, &command);
 		for (idx = 0; idx < 6; idx++) {
 			r = &dev->resource[idx];
@@ -550,6 +557,10 @@ pcibios_assign_resources(void)
 		/* Don't touch classless devices and host bridges */
 		if (!class || class == PCI_CLASS_BRIDGE_HOST)
 			continue;
+		if ((class == PCI_CLASS_PROCESSOR_POWERPC) &&
+		    (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
+		    (dev->bus->parent == NULL))
+			continue;
 
 		for (idx = 0; idx < 6; idx++) {
 			r = &dev->resource[idx];
Signature · 1 line
1.5.2.2