
From: "Mark A. Greer" <mgreer@mvista.com>

This patch adds a routine that sets up indirect pci config space access but
doesn't ioremap the config space addr/data registers.

Signed-off-by: Mark Greer <mgreer@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ppc/syslib/indirect_pci.c |   15 ++++++++++++---
 25-akpm/include/asm-ppc/pci-bridge.h   |    2 ++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff -puN arch/ppc/syslib/indirect_pci.c~ppc32-add-setup_indirect_pci_nomap-routine arch/ppc/syslib/indirect_pci.c
--- 25/arch/ppc/syslib/indirect_pci.c~ppc32-add-setup_indirect_pci_nomap-routine	Mon Nov  8 15:30:37 2004
+++ 25-akpm/arch/ppc/syslib/indirect_pci.c	Mon Nov  8 15:30:37 2004
@@ -112,15 +112,24 @@ static struct pci_ops indirect_pci_ops =
 };
 
 void __init
+setup_indirect_pci_nomap(struct pci_controller* hose, u32 cfg_addr,
+	u32 cfg_data)
+{
+	hose->cfg_addr = (unsigned int *)cfg_addr;
+	hose->cfg_data = (unsigned char *)cfg_data;
+	hose->ops = &indirect_pci_ops;
+}
+
+void __init
 setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
 {
 	unsigned long base = cfg_addr & PAGE_MASK;
 	char *mbase;
 
 	mbase = ioremap(base, PAGE_SIZE);
-	hose->cfg_addr = (unsigned int *)(mbase + (cfg_addr & ~PAGE_MASK));
+	cfg_addr = (u32)(mbase + (cfg_addr & ~PAGE_MASK));
 	if ((cfg_data & PAGE_MASK) != base)
 		mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
-	hose->cfg_data = (unsigned char *)(mbase + (cfg_data & ~PAGE_MASK));
-	hose->ops = &indirect_pci_ops;
+	cfg_data = (u32)(mbase + (cfg_data & ~PAGE_MASK));
+	setup_indirect_pci_nomap(hose, cfg_addr, cfg_data);
 }
diff -puN include/asm-ppc/pci-bridge.h~ppc32-add-setup_indirect_pci_nomap-routine include/asm-ppc/pci-bridge.h
--- 25/include/asm-ppc/pci-bridge.h~ppc32-add-setup_indirect_pci_nomap-routine	Mon Nov  8 15:30:37 2004
+++ 25-akpm/include/asm-ppc/pci-bridge.h	Mon Nov  8 15:30:37 2004
@@ -94,6 +94,8 @@ int early_write_config_word(struct pci_c
 int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
 			     int where, u32 val);
 
+extern void setup_indirect_pci_nomap(struct pci_controller* hose,
+			       u32 cfg_addr, u32 cfg_data);
 extern void setup_indirect_pci(struct pci_controller* hose,
 			       u32 cfg_addr, u32 cfg_data);
 extern void setup_grackle(struct pci_controller *hose);
_
