[IA64] Make SN2 PCI code use ioremap rather than manually mangle the address
authorJes Sorensen <jes@sgi.com>
Mon, 18 Jun 2007 15:19:05 +0000 (17:19 +0200)
committerTony Luck <tony.luck@intel.com>
Tue, 26 Jun 2007 20:35:45 +0000 (13:35 -0700)
This one changes the SN2 specific PCI drivers to use ioremap() for
obtaining the real address to access for the PCI registers instead of
manually calculating them with __IA64_UNCACHED_OFFSET.

The patch should have no real change when running on a normal Linux
kernel, but when running as a paravirtualized it is needed.

Signed-off-by: Jes Sorenson <jes@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/sn/pci/pcibr/pcibr_provider.c
arch/ia64/sn/pci/tioca_provider.c
arch/ia64/sn/pci/tioce_provider.c

index 04a8256017eb6ab8c0294580c52b12b584c15102..b42bfcae6f911108f364473ae7e3d7a7fcf80b26 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/sn/pcibus_provider_defs.h>
 #include <asm/sn/pcidev.h>
 #include <asm/sn/sn_sal.h>
+#include <asm/sn/pic.h>
 #include <asm/sn/sn2/sn_hwperf.h>
 #include "xtalk/xwidgetdev.h"
 #include "xtalk/hubdev.h"
@@ -130,9 +131,9 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
        }
 
        memcpy(soft, prom_bussoft, sizeof(struct pcibus_info));
-       soft->pbi_buscommon.bs_base =
-           (((u64) soft->pbi_buscommon.
-             bs_base << 4) >> 4) | __IA64_UNCACHED_OFFSET;
+       soft->pbi_buscommon.bs_base = (unsigned long)
+               ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base),
+                       sizeof(struct pic));
 
        spin_lock_init(&soft->pbi_lock);
 
index b9bedbd6e1d628d38016e9910fd0ab0b6307b7a8..d798dd4d0dc444eb2144eaaf4404e71552c3c7af 100644 (file)
@@ -610,7 +610,9 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
                return NULL;
 
        memcpy(tioca_common, prom_bussoft, sizeof(struct tioca_common));
-       tioca_common->ca_common.bs_base |= __IA64_UNCACHED_OFFSET;
+       tioca_common->ca_common.bs_base = (unsigned long)
+               ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base),
+                       sizeof(struct tioca_common));
 
        /* init kernel-private area */
 
index f4c0b961a9390ccbaad79dc45413615a9f6addc3..84b72b27e27fcdc6917e3587f52c8b55039a355b 100644 (file)
@@ -1002,7 +1002,9 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
                return NULL;
 
        memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common));
-       tioce_common->ce_pcibus.bs_base |= __IA64_UNCACHED_OFFSET;
+       tioce_common->ce_pcibus.bs_base = (unsigned long)
+               ioremap(REGION_OFFSET(tioce_common->ce_pcibus.bs_base),
+                       sizeof(struct tioce_common));
 
        tioce_kern = tioce_kern_init(tioce_common);
        if (tioce_kern == NULL) {