aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/pci/tioca_provider.c
diff options
context:
space:
mode:
authorMark Maule <maule@sgi.com>2005-09-06 14:03:51 -0400
committerTony Luck <tony.luck@intel.com>2005-09-07 19:23:41 -0400
commit5fbcf9a5c6904bd563f584d12d1f4d3f68a19d7d (patch)
tree2da130b000e5c442345e473b4f53104b92a76e4c /arch/ia64/sn/pci/tioca_provider.c
parent4706df3d3c42af802597d82c8b1542c3d52eab23 (diff)
[IA64-SGI] volatile semantics in places where it seems necessary
Resend using accessors instead of volatile qualifiers per hch comments, and easier to understand convenience macros per rja comments. Patch to apply volatile semantics when accessing MMR's in various SN files. Signed-off-by: Mark Maule <maule@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn/pci/tioca_provider.c')
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index ea09c12f0258..eaae2472d6b4 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -37,7 +37,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
37 uint64_t offset; 37 uint64_t offset;
38 struct page *tmp; 38 struct page *tmp;
39 struct tioca_common *tioca_common; 39 struct tioca_common *tioca_common;
40 volatile struct tioca *ca_base; 40 struct tioca *ca_base;
41 41
42 tioca_common = tioca_kern->ca_common; 42 tioca_common = tioca_kern->ca_common;
43 ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 43 ca_base = (struct tioca *)tioca_common->ca_common.bs_base;
@@ -174,27 +174,29 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
174 * DISABLE GART PREFETCHING due to hw bug tracked in SGI PV930029 174 * DISABLE GART PREFETCHING due to hw bug tracked in SGI PV930029
175 */ 175 */
176 176
177 ca_base->ca_control1 |= CA_AGPDMA_OP_ENB_COMBDELAY; /* PV895469 ? */ 177 __sn_setq_relaxed(&ca_base->ca_control1,
178 ca_base->ca_control2 &= ~(CA_GART_MEM_PARAM); 178 CA_AGPDMA_OP_ENB_COMBDELAY); /* PV895469 ? */
179 ca_base->ca_control2 |= (0x2ull << CA_GART_MEM_PARAM_SHFT); 179 __sn_clrq_relaxed(&ca_base->ca_control2, CA_GART_MEM_PARAM);
180 __sn_setq_relaxed(&ca_base->ca_control2,
181 (0x2ull << CA_GART_MEM_PARAM_SHFT));
180 tioca_kern->ca_gart_iscoherent = 1; 182 tioca_kern->ca_gart_iscoherent = 1;
181 ca_base->ca_control2 &= 183 __sn_clrq_relaxed(&ca_base->ca_control2,
182 ~(CA_GART_WR_PREFETCH_ENB | CA_GART_RD_PREFETCH_ENB); 184 (CA_GART_WR_PREFETCH_ENB | CA_GART_RD_PREFETCH_ENB));
183 185
184 /* 186 /*
185 * Unmask GART fetch error interrupts. Clear residual errors first. 187 * Unmask GART fetch error interrupts. Clear residual errors first.
186 */ 188 */
187 189
188 ca_base->ca_int_status_alias = CA_GART_FETCH_ERR; 190 writeq(CA_GART_FETCH_ERR, &ca_base->ca_int_status_alias);
189 ca_base->ca_mult_error_alias = CA_GART_FETCH_ERR; 191 writeq(CA_GART_FETCH_ERR, &ca_base->ca_mult_error_alias);
190 ca_base->ca_int_mask &= ~CA_GART_FETCH_ERR; 192 __sn_clrq_relaxed(&ca_base->ca_int_mask, CA_GART_FETCH_ERR);
191 193
192 /* 194 /*
193 * Program the aperature and gart registers in TIOCA 195 * Program the aperature and gart registers in TIOCA
194 */ 196 */
195 197
196 ca_base->ca_gart_aperature = ap_reg; 198 writeq(ap_reg, &ca_base->ca_gart_aperature);
197 ca_base->ca_gart_ptr_table = tioca_kern->ca_gart_coretalk_addr | 1; 199 writeq(tioca_kern->ca_gart_coretalk_addr|1, &ca_base->ca_gart_ptr_table);
198 200
199 return 0; 201 return 0;
200} 202}
@@ -211,7 +213,6 @@ void
211tioca_fastwrite_enable(struct tioca_kernel *tioca_kern) 213tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
212{ 214{
213 int cap_ptr; 215 int cap_ptr;
214 uint64_t ca_control1;
215 uint32_t reg; 216 uint32_t reg;
216 struct tioca *tioca_base; 217 struct tioca *tioca_base;
217 struct pci_dev *pdev; 218 struct pci_dev *pdev;
@@ -256,9 +257,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
256 */ 257 */
257 258
258 tioca_base = (struct tioca *)common->ca_common.bs_base; 259 tioca_base = (struct tioca *)common->ca_common.bs_base;
259 ca_control1 = tioca_base->ca_control1; 260 __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE);
260 ca_control1 |= CA_AGP_FW_ENABLE;
261 tioca_base->ca_control1 = ca_control1;
262} 261}
263 262
264EXPORT_SYMBOL(tioca_fastwrite_enable); /* used by agp-sgi */ 263EXPORT_SYMBOL(tioca_fastwrite_enable); /* used by agp-sgi */
@@ -345,7 +344,7 @@ tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
345 return 0; 344 return 0;
346 } 345 }
347 346
348 agp_dma_extn = ca_base->ca_agp_dma_addr_extn; 347 agp_dma_extn = __sn_readq_relaxed(&ca_base->ca_agp_dma_addr_extn);
349 if (node_upper != (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT)) { 348 if (node_upper != (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT)) {
350 printk(KERN_ERR "%s: coretalk upper node (%u) " 349 printk(KERN_ERR "%s: coretalk upper node (%u) "
351 "mismatch with ca_agp_dma_addr_extn (%lu)\n", 350 "mismatch with ca_agp_dma_addr_extn (%lu)\n",