linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] Don't try to allocate resources for a POWERPC PHB
@ 2007-07-25  5:48 Kumar Gala
  0 siblings, 0 replies; only message in thread
From: Kumar Gala @ 2007-07-25  5:48 UTC (permalink / raw)
  To: benh, linuxppc-dev

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.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/kernel/pci_32.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 721a694..39f8cb1 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -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];
-- 
1.5.2.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-25  5:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25  5:48 [PATCH] [POWERPC] Don't try to allocate resources for a POWERPC PHB Kumar Gala

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).