Lines Matching refs:bus_addr
352 return r->bus_addr + lpar_addr - r->offset; in dma_sb_lpar_to_bus()
362 DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); in _dma_dump_region()
384 unsigned long bus_addr; member
396 DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); in _dma_dump_chunk()
401 DBG("%s:%d: c.bus_addr %lxh\n", func, line, c->bus_addr); in _dma_dump_chunk()
406 unsigned long bus_addr, unsigned long len) in dma_find_chunk() argument
409 unsigned long aligned_bus = _ALIGN_DOWN(bus_addr, 1 << r->page_size); in dma_find_chunk()
410 unsigned long aligned_len = _ALIGN_UP(len+bus_addr-aligned_bus, in dma_find_chunk()
415 if (aligned_bus >= c->bus_addr && in dma_find_chunk()
416 aligned_bus + aligned_len <= c->bus_addr + c->len) in dma_find_chunk()
420 if (aligned_bus + aligned_len <= c->bus_addr) in dma_find_chunk()
424 if (aligned_bus >= c->bus_addr + c->len) in dma_find_chunk()
469 if (c->bus_addr) { in dma_sb_free_chunk()
471 c->region->dev->dev_id, c->bus_addr, c->len); in dma_sb_free_chunk()
491 c->bus_addr + offset, in dma_ioc0_free_chunk()
496 c->bus_addr + offset, in dma_ioc0_free_chunk()
536 c->bus_addr = dma_sb_lpar_to_bus(r, c->lpar_addr); in dma_sb_map_pages()
542 c->bus_addr, c->len, iopte_flag); in dma_sb_map_pages()
586 c->bus_addr = r->bus_addr; in dma_ioc0_map_pages()
591 c->bus_addr = last->bus_addr + last->len; in dma_ioc0_map_pages()
593 last->bus_addr, last->len); in dma_ioc0_map_pages()
605 c->bus_addr + offset, in dma_ioc0_map_pages()
615 iopage, c->bus_addr + offset, c->lpar_addr + offset, in dma_ioc0_map_pages()
629 c->bus_addr + offset, in dma_ioc0_map_pages()
651 u64 bus_addr; in dma_sb_region_create() local
675 &bus_addr); in dma_sb_region_create()
676 r->bus_addr = bus_addr; in dma_sb_region_create()
681 r->len = r->bus_addr = 0; in dma_sb_region_create()
690 u64 bus_addr; in dma_ioc0_region_create() local
698 &bus_addr); in dma_ioc0_region_create()
699 r->bus_addr = bus_addr; in dma_ioc0_region_create()
703 r->len = r->bus_addr = 0; in dma_ioc0_region_create()
706 r->len, r->page_size, r->bus_addr); in dma_ioc0_region_create()
738 r->bus_addr); in dma_sb_region_free()
744 r->bus_addr = 0; in dma_sb_region_free()
760 result = lv1_release_io_segment(0, r->bus_addr); in dma_ioc0_region_free()
766 r->bus_addr = 0; in dma_ioc0_region_free()
784 unsigned long len, dma_addr_t *bus_addr, in dma_sb_map_area() argument
795 *bus_addr = dma_sb_lpar_to_bus(r, ps3_mm_phys_to_lpar(phys_addr)); in dma_sb_map_area()
808 *bus_addr, len); in dma_sb_map_area()
812 c = dma_find_chunk(r, *bus_addr, len); in dma_sb_map_area()
825 *bus_addr = 0; in dma_sb_map_area()
839 unsigned long len, dma_addr_t *bus_addr, in dma_ioc0_map_area() argument
862 *bus_addr = c->bus_addr + phys_addr - aligned_phys; in dma_ioc0_map_area()
872 *bus_addr = 0; in dma_ioc0_map_area()
878 *bus_addr = c->bus_addr + phys_addr - aligned_phys; in dma_ioc0_map_area()
880 virt_addr, phys_addr, aligned_phys, *bus_addr); in dma_ioc0_map_area()
896 static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, in dma_sb_unmap_area() argument
903 c = dma_find_chunk(r, bus_addr, len); in dma_sb_unmap_area()
906 unsigned long aligned_bus = _ALIGN_DOWN(bus_addr, in dma_sb_unmap_area()
908 unsigned long aligned_len = _ALIGN_UP(len + bus_addr in dma_sb_unmap_area()
911 __func__, __LINE__, bus_addr); in dma_sb_unmap_area()
933 dma_addr_t bus_addr, unsigned long len) in dma_ioc0_unmap_area() argument
938 DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len); in dma_ioc0_unmap_area()
940 c = dma_find_chunk(r, bus_addr, len); in dma_ioc0_unmap_area()
943 unsigned long aligned_bus = _ALIGN_DOWN(bus_addr, in dma_ioc0_unmap_area()
945 unsigned long aligned_len = _ALIGN_UP(len + bus_addr in dma_ioc0_unmap_area()
949 __func__, __LINE__, bus_addr); in dma_ioc0_unmap_area()
1037 dma_addr_t bus_addr; in dma_sb_region_free_linear() local
1046 bus_addr = dma_sb_lpar_to_bus(r, lpar_addr); in dma_sb_region_free_linear()
1047 result = dma_sb_unmap_area(r, bus_addr, len); in dma_sb_region_free_linear()
1059 bus_addr = dma_sb_lpar_to_bus(r, lpar_addr); in dma_sb_region_free_linear()
1060 result = dma_sb_unmap_area(r, bus_addr, len); in dma_sb_region_free_linear()
1083 unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr, in dma_sb_map_area_linear() argument
1088 *bus_addr = dma_sb_lpar_to_bus(r, ps3_mm_phys_to_lpar(phys_addr)); in dma_sb_map_area_linear()
1102 dma_addr_t bus_addr, unsigned long len) in dma_sb_unmap_area_linear() argument
1180 unsigned long len, dma_addr_t *bus_addr, in ps3_dma_map() argument
1183 return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag); in ps3_dma_map()
1186 int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr, in ps3_dma_unmap() argument
1189 return r->region_ops->unmap(r, bus_addr, len); in ps3_dma_unmap()