[PATCH] [PPC64] iommu: avoid ISA io space on POWER3

Olof Johansson olof at austin.ibm.com
Fri Jan 14 07:00:48 EST 2005


Hi,

On some systems, the first PCI bus has a ISA I/O hole at the first 16MB. We can't
use this space for DMA addresses on the bus.

On Python-based machines, we'll skip the first 256MB on buses that have the hole,
just as we do on later systems. This means that the first bus will have 768MB of
DMA space shared between the devices on it.

Signed-off-by: Olof Johansson <olof at austin.ibm.com>
Acked-by: Paul Mackerras <paulus at samba.org>


---

 linux-2.5-olof/arch/ppc64/kernel/pSeries_iommu.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff -puN arch/ppc64/kernel/pSeries_iommu.c~iommu-iohole arch/ppc64/kernel/pSeries_iommu.c
--- linux-2.5/arch/ppc64/kernel/pSeries_iommu.c~iommu-iohole	2005-01-12 16:29:55.000000000 -0600
+++ linux-2.5-olof/arch/ppc64/kernel/pSeries_iommu.c	2005-01-12 16:34:57.000000000 -0600
@@ -327,12 +327,25 @@ static void iommu_bus_setup_pSeries(stru
 		/* Root bus */
 		if (is_python(dn)) {
 			struct iommu_table *tbl;
+			unsigned int *iohole;
 
 			DBG("Python root bus %s\n", bus->name);
 
-			/* 1GB window by default */
-			dn->phb->dma_window_size = 1 << 30;
-			dn->phb->dma_window_base_cur = 0;
+			iohole = (unsigned int *)get_property(dn, "io-hole", 0);
+
+			if (iohole) {
+				/* On first bus we need to leave room for the
+				 * ISA address space. Just skip the first 256MB
+				 * alltogether. This leaves 768MB for the window.
+				 */
+				DBG("PHB has io-hole, reserving 256MB\n");
+				dn->phb->dma_window_size = 3 << 28;
+				dn->phb->dma_window_base_cur = 1 << 28;
+			} else {
+				/* 1GB window by default */
+				dn->phb->dma_window_size = 1 << 30;
+				dn->phb->dma_window_base_cur = 0;
+			}
 
 			tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
 

_



More information about the Linuxppc64-dev mailing list