Lines Matching refs:window
125 * - on bus setup, look for a matching window, or create one
162 struct iommu_window *window =
180 (window->ioid & CBE_IOPTE_IOID_Mask);
183 CBE_IOPTE_SO_RW | (window->ioid & CBE_IOPTE_IOID_Mask);
195 invalidate_tce_cache(window->iommu, io_pte, npages);
207 struct iommu_window *window =
218 __pa(window->iommu->pad_page) |
219 (window->ioid & CBE_IOPTE_IOID_Mask);
229 invalidate_tce_cache(window->iommu, io_pte, npages);
431 struct iommu_window *window;
435 list_for_each_entry(window, &(iommu->windows), list) {
436 if (window->offset == offset && window->size == size)
437 return window;
468 struct iommu_window *window;
474 window = kzalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid);
475 BUG_ON(window == NULL);
477 window->offset = offset;
478 window->size = size;
479 window->ioid = ioid;
480 window->iommu = iommu;
482 window->table.it_blocksize = 16;
483 window->table.it_base = (unsigned long)iommu->ptab;
484 window->table.it_index = iommu->nid;
485 window->table.it_page_shift = IOMMU_PAGE_SHIFT_4K;
486 window->table.it_offset =
487 (offset >> window->table.it_page_shift) + pte_offset;
488 window->table.it_size = size >> window->table.it_page_shift;
489 window->table.it_ops = &cell_iommu_ops;
491 if (!iommu_init_table(&window->table, iommu->nid, 0, 0))
494 pr_debug("\tioid %d\n", window->ioid);
495 pr_debug("\tblocksize %ld\n", window->table.it_blocksize);
496 pr_debug("\tbase 0x%016lx\n", window->table.it_base);
497 pr_debug("\toffset 0x%lx\n", window->table.it_offset);
498 pr_debug("\tsize %ld\n", window->table.it_size);
500 list_add(&window->list, &iommu->windows);
503 return window;
509 * This code also assumes that we have a window that starts at 0,
517 __set_bit(0, window->table.it_map);
518 tce_build_cell(&window->table, window->table.it_offset, 1,
521 return window;
544 struct iommu_window *window;
547 /* Current implementation uses the first window available in that
557 window = list_entry(iommu->windows.next, struct iommu_window, list);
559 return &window->table;
608 /* Use ibm,dma-window if available, else, hard code ! */
609 dma_window = of_get_property(np, "ibm,dma-window", NULL);
640 * multiple window support since the cell iommu supports per-page ioids
670 /* Obtain a window for it */
673 pr_debug("\ttranslating window 0x%lx...0x%lx\n",
730 * window which is always the case so far on Cell, thus we
732 * the DMA window from there.
750 /* If we found a DMA window, we check if it's big enough to enclose
754 printk(KERN_WARNING "iommu: force-enabled, dma window"
781 * we setup the fixed mapping immediately above the normal IOMMU window.
784 * IOMMU window from 0-2GB and the fixed mapping window from 2GB to 6GB. In
790 * mapping above the normal IOMMU window as we would run out of address space.
791 * Instead we move the normal IOMMU window to coincide with the hash page
941 * dynamic region, so find the top of the largest IOMMU window
955 hbase = 0; /* use the device tree window */
970 /* The window must start and end on a segment boundary */
973 pr_debug("iommu: hash window not segment aligned\n");
977 /* Check the hash window fits inside the real DMA window */
982 pr_debug("iommu: hash window doesn't fit in"
983 "real DMA window\n");
1004 printk(KERN_DEBUG "iommu: node %d, dynamic window 0x%lx-0x%lx "
1005 "fixed window 0x%lx-0x%lx\n", iommu->nid, dbase,