Lines Matching refs:bus_addr

345 	return r->bus_addr + lpar_addr - r->offset;  in dma_sb_lpar_to_bus()
355 DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); in _dma_dump_region()
377 unsigned long bus_addr; member
389 DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); in _dma_dump_chunk()
394 DBG("%s:%d: c.bus_addr %lxh\n", func, line, c->bus_addr); in _dma_dump_chunk()
399 unsigned long bus_addr, unsigned long len) in dma_find_chunk() argument
402 unsigned long aligned_bus = ALIGN_DOWN(bus_addr, 1 << r->page_size); in dma_find_chunk()
403 unsigned long aligned_len = ALIGN(len+bus_addr-aligned_bus, in dma_find_chunk()
408 if (aligned_bus >= c->bus_addr && in dma_find_chunk()
409 aligned_bus + aligned_len <= c->bus_addr + c->len) in dma_find_chunk()
413 if (aligned_bus + aligned_len <= c->bus_addr) in dma_find_chunk()
417 if (aligned_bus >= c->bus_addr + c->len) in dma_find_chunk()
462 if (c->bus_addr) { in dma_sb_free_chunk()
464 c->region->dev->dev_id, c->bus_addr, c->len); in dma_sb_free_chunk()
484 c->bus_addr + offset, in dma_ioc0_free_chunk()
489 c->bus_addr + offset, in dma_ioc0_free_chunk()
528 c->bus_addr = dma_sb_lpar_to_bus(r, c->lpar_addr); in dma_sb_map_pages()
534 c->bus_addr, c->len, iopte_flag); in dma_sb_map_pages()
577 c->bus_addr = r->bus_addr; in dma_ioc0_map_pages()
582 c->bus_addr = last->bus_addr + last->len; in dma_ioc0_map_pages()
584 last->bus_addr, last->len); in dma_ioc0_map_pages()
596 c->bus_addr + offset, in dma_ioc0_map_pages()
606 iopage, c->bus_addr + offset, c->lpar_addr + offset, in dma_ioc0_map_pages()
620 c->bus_addr + offset, in dma_ioc0_map_pages()
642 u64 bus_addr; in dma_sb_region_create() local
666 &bus_addr); in dma_sb_region_create()
667 r->bus_addr = bus_addr; in dma_sb_region_create()
672 r->len = r->bus_addr = 0; in dma_sb_region_create()
681 u64 bus_addr; in dma_ioc0_region_create() local
689 &bus_addr); in dma_ioc0_region_create()
690 r->bus_addr = bus_addr; in dma_ioc0_region_create()
694 r->len = r->bus_addr = 0; in dma_ioc0_region_create()
697 r->len, r->page_size, r->bus_addr); in dma_ioc0_region_create()
729 r->bus_addr); in dma_sb_region_free()
735 r->bus_addr = 0; in dma_sb_region_free()
751 result = lv1_release_io_segment(0, r->bus_addr); in dma_ioc0_region_free()
757 r->bus_addr = 0; in dma_ioc0_region_free()
775 unsigned long len, dma_addr_t *bus_addr, in dma_sb_map_area() argument
786 *bus_addr = dma_sb_lpar_to_bus(r, ps3_mm_phys_to_lpar(phys_addr)); in dma_sb_map_area()
799 *bus_addr, len); in dma_sb_map_area()
803 c = dma_find_chunk(r, *bus_addr, len); in dma_sb_map_area()
816 *bus_addr = 0; in dma_sb_map_area()
830 unsigned long len, dma_addr_t *bus_addr, in dma_ioc0_map_area() argument
853 *bus_addr = c->bus_addr + phys_addr - aligned_phys; in dma_ioc0_map_area()
863 *bus_addr = 0; in dma_ioc0_map_area()
869 *bus_addr = c->bus_addr + phys_addr - aligned_phys; in dma_ioc0_map_area()
871 virt_addr, phys_addr, aligned_phys, *bus_addr); in dma_ioc0_map_area()
887 static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, in dma_sb_unmap_area() argument
894 c = dma_find_chunk(r, bus_addr, len); in dma_sb_unmap_area()
897 unsigned long aligned_bus = ALIGN_DOWN(bus_addr, in dma_sb_unmap_area()
899 unsigned long aligned_len = ALIGN(len + bus_addr in dma_sb_unmap_area()
902 __func__, __LINE__, bus_addr); in dma_sb_unmap_area()
924 dma_addr_t bus_addr, unsigned long len) in dma_ioc0_unmap_area() argument
929 DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len); in dma_ioc0_unmap_area()
931 c = dma_find_chunk(r, bus_addr, len); in dma_ioc0_unmap_area()
934 unsigned long aligned_bus = ALIGN_DOWN(bus_addr, in dma_ioc0_unmap_area()
936 unsigned long aligned_len = ALIGN(len + bus_addr in dma_ioc0_unmap_area()
940 __func__, __LINE__, bus_addr); in dma_ioc0_unmap_area()
1028 dma_addr_t bus_addr; in dma_sb_region_free_linear() local
1037 bus_addr = dma_sb_lpar_to_bus(r, lpar_addr); in dma_sb_region_free_linear()
1038 result = dma_sb_unmap_area(r, bus_addr, len); in dma_sb_region_free_linear()
1050 bus_addr = dma_sb_lpar_to_bus(r, lpar_addr); in dma_sb_region_free_linear()
1051 result = dma_sb_unmap_area(r, bus_addr, len); in dma_sb_region_free_linear()
1074 unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr, in dma_sb_map_area_linear() argument
1079 *bus_addr = dma_sb_lpar_to_bus(r, ps3_mm_phys_to_lpar(phys_addr)); in dma_sb_map_area_linear()
1093 dma_addr_t bus_addr, unsigned long len) in dma_sb_unmap_area_linear() argument
1182 unsigned long len, dma_addr_t *bus_addr, in ps3_dma_map() argument
1185 return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag); in ps3_dma_map()
1188 int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr, in ps3_dma_unmap() argument
1191 return r->region_ops->unmap(r, bus_addr, len); in ps3_dma_unmap()