aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parisc/sba_iommu.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 42cfcd9eb9aa..1ff1b67e8b27 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -575,7 +575,7 @@ sba_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
575 575
576 mtsp(sid,1); 576 mtsp(sid,1);
577 asm("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (vba)); 577 asm("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (vba));
578 pa |= (ci >> 12) & 0xff; /* move CI (8 bits) into lowest byte */ 578 pa |= (ci >> PAGE_SHIFT) & 0xff; /* move CI (8 bits) into lowest byte */
579 579
580 pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */ 580 pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */
581 *pdir_ptr = cpu_to_le64(pa); /* swap and store into I/O Pdir */ 581 *pdir_ptr = cpu_to_le64(pa); /* swap and store into I/O Pdir */
@@ -1376,7 +1376,7 @@ static void
1376sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num) 1376sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
1377{ 1377{
1378 u32 iova_space_size, iova_space_mask; 1378 u32 iova_space_size, iova_space_mask;
1379 unsigned int pdir_size, iov_order; 1379 unsigned int pdir_size, iov_order, tcnfg;
1380 1380
1381 /* 1381 /*
1382 ** Determine IOVA Space size from memory size. 1382 ** Determine IOVA Space size from memory size.
@@ -1468,8 +1468,19 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
1468 WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa+IOC_IBASE); 1468 WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa+IOC_IBASE);
1469 WRITE_REG(ioc->imask, ioc->ioc_hpa+IOC_IMASK); 1469 WRITE_REG(ioc->imask, ioc->ioc_hpa+IOC_IMASK);
1470 1470
1471 /* Set I/O PDIR Page size to 4K */ 1471 /* Set I/O PDIR Page size to system page size */
1472 WRITE_REG(0, ioc->ioc_hpa+IOC_TCNFG); 1472 switch (PAGE_SHIFT) {
1473 case 12: tcnfg = 0; break; /* 4K */
1474 case 13: tcnfg = 1; break; /* 8K */
1475 case 14: tcnfg = 2; break; /* 16K */
1476 case 16: tcnfg = 3; break; /* 64K */
1477 default:
1478 panic(__FILE__ "Unsupported system page size %d",
1479 1 << PAGE_SHIFT);
1480 break;
1481 }
1482 /* Set I/O PDIR Page size to PAGE_SIZE (4k/16k/...) */
1483 WRITE_REG(tcnfg, ioc->ioc_hpa+IOC_TCNFG);
1473 1484
1474 /* 1485 /*
1475 ** Clear I/O TLB of any possible entries. 1486 ** Clear I/O TLB of any possible entries.