aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-10-28 16:23:50 -0400
committerTony Luck <tony.luck@intel.com>2005-10-28 16:23:50 -0400
commitfbbb0bd1f6eb2d8b28d246a4821453bdc3d01b2f (patch)
tree9e6df2bc4b9dfdc795c4ba1b0c4385fdd9635fca /arch/ia64/sn
parent9472d8ce147fecb80a2f29ad8ab781e596858916 (diff)
parent61b9cf7c6cf5077c40ad37480fa56f6574af3db5 (diff)
Pull sn_pci_legacy_read-write into release branch
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/pci/pci_dma.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 0e4b9ad9ef02..abdf6eea6ac8 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -326,6 +326,29 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
326{ 326{
327 unsigned long addr; 327 unsigned long addr;
328 int ret; 328 int ret;
329 struct ia64_sal_retval isrv;
330
331 /*
332 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work
333 * around hw issues at the pci bus level. SGI proms older than
334 * 4.10 don't implment this.
335 */
336
337 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,
338 pci_domain_nr(bus), bus->number,
339 0, /* io */
340 0, /* read */
341 port, size, __pa(val));
342
343 if (isrv.status == 0)
344 return size;
345
346 /*
347 * If the above failed, retry using the SAL_PROBE call which should
348 * be present in all proms (but which cannot work round PCI chipset
349 * bugs). This code is retained for compatability with old
350 * pre-4.10 proms, and should be removed at some point in the future.
351 */
329 352
330 if (!SN_PCIBUS_BUSSOFT(bus)) 353 if (!SN_PCIBUS_BUSSOFT(bus))
331 return -ENODEV; 354 return -ENODEV;
@@ -349,6 +372,29 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
349 int ret = size; 372 int ret = size;
350 unsigned long paddr; 373 unsigned long paddr;
351 unsigned long *addr; 374 unsigned long *addr;
375 struct ia64_sal_retval isrv;
376
377 /*
378 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work
379 * around hw issues at the pci bus level. SGI proms older than
380 * 4.10 don't implment this.
381 */
382
383 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,
384 pci_domain_nr(bus), bus->number,
385 0, /* io */
386 1, /* write */
387 port, size, __pa(&val));
388
389 if (isrv.status == 0)
390 return size;
391
392 /*
393 * If the above failed, retry using the SAL_PROBE call which should
394 * be present in all proms (but which cannot work round PCI chipset
395 * bugs). This code is retained for compatability with old
396 * pre-4.10 proms, and should be removed at some point in the future.
397 */
352 398
353 if (!SN_PCIBUS_BUSSOFT(bus)) { 399 if (!SN_PCIBUS_BUSSOFT(bus)) {
354 ret = -ENODEV; 400 ret = -ENODEV;