• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/arch/powerpc/platforms/cell/

Lines Matching defs:iommu

31 #include <asm/iommu.h>
121 struct cbe_iommu *iommu;
149 static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte,
156 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd;
208 invalidate_tce_cache(window->iommu, io_pte, npages);
229 pte = IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW | __pa(window->iommu->pad_page)
240 invalidate_tce_cache(window->iommu, io_pte, npages);
246 struct cbe_iommu *iommu = data;
248 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat);
251 printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat);
263 out_be64(iommu->xlate_regs + IOC_IO_ExcpStat, stat);
280 printk(KERN_ERR "iommu: can't get address for %s\n",
308 static void cell_iommu_setup_hardware(struct cbe_iommu *iommu, unsigned long size)
316 if (cell_iommu_find_ioc(iommu->nid, &xlate_base))
318 __FUNCTION__, iommu->nid);
320 iommu->xlate_regs = ioremap(xlate_base, IOC_Reg_Size);
321 iommu->cmd_regs = iommu->xlate_regs + IOC_IOCmd_Offset;
326 pr_debug("%s: iommu[%d]: segments: %lu, pages per segment: %lu\n",
327 __FUNCTION__, iommu->nid, segments, pages_per_segment);
330 page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
332 iommu->stab = page_address(page);
333 clear_page(iommu->stab);
339 pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __FUNCTION__,
340 iommu->nid, ptab_size, get_order(ptab_size));
341 page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(ptab_size));
344 iommu->ptab = page_address(page);
345 memset(iommu->ptab, 0, ptab_size);
348 page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
350 iommu->pad_page = page_address(page);
351 clear_page(iommu->pad_page);
357 pr_debug("%s: iommu[%d]: stab at %p, ptab at %p, n_pte_pages: %lu\n",
358 __FUNCTION__, iommu->nid, iommu->stab, iommu->ptab,
375 iommu->stab[i] = reg |
376 (__pa(iommu->ptab) + n_pte_pages * IOMMU_PAGE_SIZE * i);
377 pr_debug("\t[%d] 0x%016lx\n", i, iommu->stab[i]);
383 /* setup interrupts for the iommu. */
384 reg = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat);
385 out_be64(iommu->xlate_regs + IOC_IO_ExcpStat,
387 out_be64(iommu->xlate_regs + IOC_IO_ExcpMask,
391 IIC_IRQ_IOEX_ATI | (iommu->nid << IIC_IRQ_NODE_SHIFT));
395 iommu->name, iommu);
398 /* set the IOC segment table origin register (and turn on the iommu) */
399 reg = IOC_IOST_Origin_E | __pa(iommu->stab) | IOC_IOST_Origin_HW;
400 out_be64(iommu->xlate_regs + IOC_IOST_Origin, reg);
401 in_be64(iommu->xlate_regs + IOC_IOST_Origin);
404 reg = in_be64(iommu->cmd_regs + IOC_IOCmd_Cfg) | IOC_IOCmd_Cfg_TE;
405 out_be64(iommu->cmd_regs + IOC_IOCmd_Cfg, reg);
410 cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
419 printk(KERN_WARNING "iommu: missing ioid for %s using 0\n",
422 window = kmalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid);
428 window->iommu = iommu;
432 window->table.it_base = (unsigned long)iommu->ptab;
433 window->table.it_index = iommu->nid;
438 iommu_init_table(&window->table, iommu->nid);
446 list_add(&window->list, &iommu->windows);
453 (unsigned long)iommu->pad_page, DMA_TO_DEVICE);
472 struct cbe_iommu *iommu;
475 /* If we run without iommu, no need to do anything */
480 * node's iommu. We -might- do something smarter later though it may
483 iommu = cell_iommu_for_node(archdata->numa_node);
484 if (iommu == NULL || list_empty(&iommu->windows)) {
485 printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
490 window = list_entry(iommu->windows.next, struct iommu_window, list);
542 struct cbe_iommu *iommu;
549 printk(KERN_ERR "iommu: failed to get node for %s\n",
553 pr_debug("iommu: setting up iommu for node %d (%s)\n",
558 printk(KERN_ERR "iommu: too many IOMMUs detected ! (%s)\n",
565 iommu = &iommus[i];
566 iommu->stab = NULL;
567 iommu->nid = nid;
568 snprintf(iommu->name, sizeof(iommu->name), "iommu%d", i);
569 INIT_LIST_HEAD(&iommu->windows);
578 cell_iommu_setup_hardware(iommu, size);
581 cell_iommu_setup_window(iommu, np, base, size,
600 pr_debug("iommu: cleaning up iommu on node %d\n", node);
618 /* When no iommu is present, we use direct DMA ops */
654 printk(KERN_WARNING "iommu: force-enabled, dma window"
662 printk("iommu: disabled, direct DMA offset is 0x%lx\n",
690 /* Create an iommu for each /axon node. */
697 /* Create an iommu for each toplevel /pci-internal node for
706 /* Setup default PCI iommu ops */