Pull altix-mmr into release branch
authorTony Luck <tony.luck@intel.com>
Fri, 28 Oct 2005 18:15:08 +0000 (11:15 -0700)
committerTony Luck <tony.luck@intel.com>
Fri, 28 Oct 2005 18:15:08 +0000 (11:15 -0700)
1  2 
arch/ia64/sn/pci/tioca_provider.c

index 19bced34d5f1f1e79998fb11917053c91567ad1f,9b8dbce2b7b6a93ef30f2a0da37e36ac7f523dcf..46b646a6d3459b228adbab5124b0d8580e7e71b5
@@@ -11,6 -11,7 +11,7 @@@
  #include <linux/pci.h>
  #include <asm/sn/sn_sal.h>
  #include <asm/sn/addrs.h>
+ #include <asm/sn/io.h>
  #include <asm/sn/pcidev.h>
  #include <asm/sn/pcibus_provider_defs.h>
  #include <asm/sn/tioca_provider.h>
@@@ -37,7 -38,7 +38,7 @@@ tioca_gart_init(struct tioca_kernel *ti
        uint64_t offset;
        struct page *tmp;
        struct tioca_common *tioca_common;
-       volatile struct tioca *ca_base;
+       struct tioca *ca_base;
  
        tioca_common = tioca_kern->ca_common;
        ca_base = (struct tioca *)tioca_common->ca_common.bs_base;
        tioca_kern->ca_pcigart_entries =
            tioca_kern->ca_pciap_size / tioca_kern->ca_ap_pagesize;
        tioca_kern->ca_pcigart_pagemap =
 -          kcalloc(1, tioca_kern->ca_pcigart_entries / 8, GFP_KERNEL);
 +          kzalloc(tioca_kern->ca_pcigart_entries / 8, GFP_KERNEL);
        if (!tioca_kern->ca_pcigart_pagemap) {
                free_pages((unsigned long)tioca_kern->ca_gart,
                           get_order(tioca_kern->ca_gart_size));
         *      DISABLE GART PREFETCHING due to hw bug tracked in SGI PV930029
         */
  
-       ca_base->ca_control1 |= CA_AGPDMA_OP_ENB_COMBDELAY;     /* PV895469 ? */
-       ca_base->ca_control2 &= ~(CA_GART_MEM_PARAM);
-       ca_base->ca_control2 |= (0x2ull << CA_GART_MEM_PARAM_SHFT);
+       __sn_setq_relaxed(&ca_base->ca_control1,
+                       CA_AGPDMA_OP_ENB_COMBDELAY);    /* PV895469 ? */
+       __sn_clrq_relaxed(&ca_base->ca_control2, CA_GART_MEM_PARAM);
+       __sn_setq_relaxed(&ca_base->ca_control2,
+                       (0x2ull << CA_GART_MEM_PARAM_SHFT));
        tioca_kern->ca_gart_iscoherent = 1;
-       ca_base->ca_control2 &=
-           ~(CA_GART_WR_PREFETCH_ENB | CA_GART_RD_PREFETCH_ENB);
+       __sn_clrq_relaxed(&ca_base->ca_control2,
+                       (CA_GART_WR_PREFETCH_ENB | CA_GART_RD_PREFETCH_ENB));
  
        /*
         * Unmask GART fetch error interrupts.  Clear residual errors first.
         */
  
-       ca_base->ca_int_status_alias = CA_GART_FETCH_ERR;
-       ca_base->ca_mult_error_alias = CA_GART_FETCH_ERR;
-       ca_base->ca_int_mask &= ~CA_GART_FETCH_ERR;
+       writeq(CA_GART_FETCH_ERR, &ca_base->ca_int_status_alias);
+       writeq(CA_GART_FETCH_ERR, &ca_base->ca_mult_error_alias);
+       __sn_clrq_relaxed(&ca_base->ca_int_mask, CA_GART_FETCH_ERR);
  
        /*
         * Program the aperature and gart registers in TIOCA
         */
  
-       ca_base->ca_gart_aperature = ap_reg;
-       ca_base->ca_gart_ptr_table = tioca_kern->ca_gart_coretalk_addr | 1;
+       writeq(ap_reg, &ca_base->ca_gart_aperature);
+       writeq(tioca_kern->ca_gart_coretalk_addr|1, &ca_base->ca_gart_ptr_table);
  
        return 0;
  }
@@@ -211,7 -214,6 +214,6 @@@ voi
  tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
  {
        int cap_ptr;
-       uint64_t ca_control1;
        uint32_t reg;
        struct tioca *tioca_base;
        struct pci_dev *pdev;
         */
  
        tioca_base = (struct tioca *)common->ca_common.bs_base;
-       ca_control1 = tioca_base->ca_control1;
-       ca_control1 |= CA_AGP_FW_ENABLE;
-       tioca_base->ca_control1 = ca_control1;
+       __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE);
  }
  
  EXPORT_SYMBOL(tioca_fastwrite_enable);        /* used by agp-sgi */
@@@ -345,7 -345,7 +345,7 @@@ tioca_dma_d48(struct pci_dev *pdev, uin
                return 0;
        }
  
-       agp_dma_extn = ca_base->ca_agp_dma_addr_extn;
+       agp_dma_extn = __sn_readq_relaxed(&ca_base->ca_agp_dma_addr_extn);
        if (node_upper != (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT)) {
                printk(KERN_ERR "%s:  coretalk upper node (%u) "
                       "mismatch with ca_agp_dma_addr_extn (%lu)\n",
@@@ -392,7 -392,7 +392,7 @@@ tioca_dma_mapped(struct pci_dev *pdev, 
         * allocate a map struct
         */
  
 -      ca_dmamap = kcalloc(1, sizeof(struct tioca_dmamap), GFP_ATOMIC);
 +      ca_dmamap = kzalloc(sizeof(struct tioca_dmamap), GFP_ATOMIC);
        if (!ca_dmamap)
                goto map_return;
  
@@@ -600,7 -600,7 +600,7 @@@ tioca_bus_fixup(struct pcibus_bussoft *
         * Allocate kernel bus soft and copy from prom.
         */
  
 -      tioca_common = kcalloc(1, sizeof(struct tioca_common), GFP_KERNEL);
 +      tioca_common = kzalloc(sizeof(struct tioca_common), GFP_KERNEL);
        if (!tioca_common)
                return NULL;
  
  
        /* init kernel-private area */
  
 -      tioca_kern = kcalloc(1, sizeof(struct tioca_kernel), GFP_KERNEL);
 +      tioca_kern = kzalloc(sizeof(struct tioca_kernel), GFP_KERNEL);
        if (!tioca_kern) {
                kfree(tioca_common);
                return NULL;