lkml.org 
[lkml]   [2004]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][PPC32] Add setup_indirect_pci_nomap() routine
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>
===== arch/ppc/syslib/indirect_pci.c 1.12 vs edited =====
--- 1.12/arch/ppc/syslib/indirect_pci.c 2004-03-17 05:02:23 -07:00
+++ edited/arch/ppc/syslib/indirect_pci.c 2004-10-12 14:24:23 -07:00
@@ -112,15 +112,24 @@
};

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);
}
===== include/asm-ppc/pci-bridge.h 1.12 vs edited =====
--- 1.12/include/asm-ppc/pci-bridge.h 2003-09-12 09:26:56 -07:00
+++ edited/include/asm-ppc/pci-bridge.h 2004-10-12 14:23:36 -07:00
@@ -94,6 +94,8 @@
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);
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.029 / U:9.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site