Commit a1062242 authored by Olof Johansson's avatar Olof Johansson Committed by Linus Torvalds

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

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: default avatarOlof Johansson <olof@austin.ibm.com>
Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7d033a99
...@@ -327,12 +327,25 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus) ...@@ -327,12 +327,25 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
/* Root bus */ /* Root bus */
if (is_python(dn)) { if (is_python(dn)) {
struct iommu_table *tbl; struct iommu_table *tbl;
unsigned int *iohole;
DBG("Python root bus %s\n", bus->name); DBG("Python root bus %s\n", bus->name);
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 */ /* 1GB window by default */
dn->phb->dma_window_size = 1 << 30; dn->phb->dma_window_size = 1 << 30;
dn->phb->dma_window_base_cur = 0; dn->phb->dma_window_base_cur = 0;
}
tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment