Lines Matching full:window
123 * - on bus setup, look for a matching window, or create one
160 struct iommu_window *window = in tce_build_cell() local
178 (window->ioid & CBE_IOPTE_IOID_Mask); in tce_build_cell()
181 CBE_IOPTE_SO_RW | (window->ioid & CBE_IOPTE_IOID_Mask); in tce_build_cell()
193 invalidate_tce_cache(window->iommu, io_pte, npages); in tce_build_cell()
205 struct iommu_window *window = in tce_free_cell() local
216 __pa(window->iommu->pad_page) | in tce_free_cell()
217 (window->ioid & CBE_IOPTE_IOID_Mask); in tce_free_cell()
227 invalidate_tce_cache(window->iommu, io_pte, npages); in tce_free_cell()
429 struct iommu_window *window;
433 list_for_each_entry(window, &(iommu->windows), list) {
434 if (window->offset == offset && window->size == size)
435 return window;
466 struct iommu_window *window; in cell_iommu_setup_window() local
472 window = kzalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid); in cell_iommu_setup_window()
473 BUG_ON(window == NULL); in cell_iommu_setup_window()
475 window->offset = offset; in cell_iommu_setup_window()
476 window->size = size; in cell_iommu_setup_window()
477 window->ioid = ioid; in cell_iommu_setup_window()
478 window->iommu = iommu; in cell_iommu_setup_window()
480 window->table.it_blocksize = 16; in cell_iommu_setup_window()
481 window->table.it_base = (unsigned long)iommu->ptab; in cell_iommu_setup_window()
482 window->table.it_index = iommu->nid; in cell_iommu_setup_window()
483 window->table.it_page_shift = IOMMU_PAGE_SHIFT_4K; in cell_iommu_setup_window()
484 window->table.it_offset = in cell_iommu_setup_window()
485 (offset >> window->table.it_page_shift) + pte_offset; in cell_iommu_setup_window()
486 window->table.it_size = size >> window->table.it_page_shift; in cell_iommu_setup_window()
487 window->table.it_ops = &cell_iommu_ops; in cell_iommu_setup_window()
489 iommu_init_table(&window->table, iommu->nid, 0, 0); in cell_iommu_setup_window()
491 pr_debug("\tioid %d\n", window->ioid); in cell_iommu_setup_window()
492 pr_debug("\tblocksize %ld\n", window->table.it_blocksize); in cell_iommu_setup_window()
493 pr_debug("\tbase 0x%016lx\n", window->table.it_base); in cell_iommu_setup_window()
494 pr_debug("\toffset 0x%lx\n", window->table.it_offset); in cell_iommu_setup_window()
495 pr_debug("\tsize %ld\n", window->table.it_size); in cell_iommu_setup_window()
497 list_add(&window->list, &iommu->windows); in cell_iommu_setup_window()
500 return window; in cell_iommu_setup_window()
506 * This code also assumes that we have a window that starts at 0, in cell_iommu_setup_window()
514 __set_bit(0, window->table.it_map); in cell_iommu_setup_window()
515 tce_build_cell(&window->table, window->table.it_offset, 1, in cell_iommu_setup_window()
518 return window; in cell_iommu_setup_window()
541 struct iommu_window *window; in cell_get_iommu_table() local
544 /* Current implementation uses the first window available in that in cell_get_iommu_table()
554 window = list_entry(iommu->windows.next, struct iommu_window, list); in cell_get_iommu_table()
556 return &window->table; in cell_get_iommu_table()
605 /* Use ibm,dma-window if available, else, hard code ! */ in cell_iommu_get_window()
606 dma_window = of_get_property(np, "ibm,dma-window", NULL); in cell_iommu_get_window()
637 * multiple window support since the cell iommu supports per-page ioids in cell_iommu_alloc()
667 /* Obtain a window for it */ in cell_iommu_init_one()
670 pr_debug("\ttranslating window 0x%lx...0x%lx\n", in cell_iommu_init_one()
725 * window which is always the case so far on Cell, thus we in cell_iommu_init_disabled()
727 * the DMA window from there. in cell_iommu_init_disabled()
745 /* If we found a DMA window, we check if it's big enough to enclose in cell_iommu_init_disabled()
749 printk(KERN_WARNING "iommu: force-enabled, dma window" in cell_iommu_init_disabled()
776 * we setup the fixed mapping immediately above the normal IOMMU window.
779 * IOMMU window from 0-2GB and the fixed mapping window from 2GB to 6GB. In
785 * mapping above the normal IOMMU window as we would run out of address space.
786 * Instead we move the normal IOMMU window to coincide with the hash page
936 * dynamic region, so find the top of the largest IOMMU window in cell_iommu_fixed_mapping_init()
950 hbase = 0; /* use the device tree window */ in cell_iommu_fixed_mapping_init()
965 /* The window must start and end on a segment boundary */ in cell_iommu_fixed_mapping_init()
968 pr_debug("iommu: hash window not segment aligned\n"); in cell_iommu_fixed_mapping_init()
972 /* Check the hash window fits inside the real DMA window */ in cell_iommu_fixed_mapping_init()
977 pr_debug("iommu: hash window doesn't fit in" in cell_iommu_fixed_mapping_init()
978 "real DMA window\n"); in cell_iommu_fixed_mapping_init()
998 printk(KERN_DEBUG "iommu: node %d, dynamic window 0x%lx-0x%lx " in cell_iommu_fixed_mapping_init()
999 "fixed window 0x%lx-0x%lx\n", iommu->nid, dbase, in cell_iommu_fixed_mapping_init()