Lines Matching full:window

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