pci-dma.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. /*
  2. ** PARISC 1.1 Dynamic DMA mapping support.
  3. ** This implementation is for PA-RISC platforms that do not support
  4. ** I/O TLBs (aka DMA address translation hardware).
  5. ** See Documentation/DMA-API-HOWTO.txt for interface definitions.
  6. **
  7. ** (c) Copyright 1999,2000 Hewlett-Packard Company
  8. ** (c) Copyright 2000 Grant Grundler
  9. ** (c) Copyright 2000 Philipp Rumpf <prumpf@tux.org>
  10. ** (c) Copyright 2000 John Marvin
  11. **
  12. ** "leveraged" from 2.3.47: arch/ia64/kernel/pci-dma.c.
  13. ** (I assume it's from David Mosberger-Tang but there was no Copyright)
  14. **
  15. ** AFAIK, all PA7100LC and PA7300LC platforms can use this code.
  16. **
  17. ** - ggg
  18. */
  19. #include <linux/init.h>
  20. #include <linux/gfp.h>
  21. #include <linux/mm.h>
  22. #include <linux/pci.h>
  23. #include <linux/proc_fs.h>
  24. #include <linux/seq_file.h>
  25. #include <linux/string.h>
  26. #include <linux/types.h>
  27. #include <linux/scatterlist.h>
  28. #include <linux/export.h>
  29. #include <asm/cacheflush.h>
  30. #include <asm/dma.h> /* for DMA_CHUNK_SIZE */
  31. #include <asm/io.h>
  32. #include <asm/page.h> /* get_order */
  33. #include <asm/pgalloc.h>
  34. #include <asm/uaccess.h>
  35. #include <asm/tlbflush.h> /* for purge_tlb_*() macros */
  36. static struct proc_dir_entry * proc_gsc_root __read_mostly = NULL;
  37. static unsigned long pcxl_used_bytes __read_mostly = 0;
  38. static unsigned long pcxl_used_pages __read_mostly = 0;
  39. extern unsigned long pcxl_dma_start; /* Start of pcxl dma mapping area */
  40. static spinlock_t pcxl_res_lock;
  41. static char *pcxl_res_map;
  42. static int pcxl_res_hint;
  43. static int pcxl_res_size;
  44. #ifdef DEBUG_PCXL_RESOURCE
  45. #define DBG_RES(x...) printk(x)
  46. #else
  47. #define DBG_RES(x...)
  48. #endif
  49. /*
  50. ** Dump a hex representation of the resource map.
  51. */
  52. #ifdef DUMP_RESMAP
  53. static
  54. void dump_resmap(void)
  55. {
  56. u_long *res_ptr = (unsigned long *)pcxl_res_map;
  57. u_long i = 0;
  58. printk("res_map: ");
  59. for(; i < (pcxl_res_size / sizeof(unsigned long)); ++i, ++res_ptr)
  60. printk("%08lx ", *res_ptr);
  61. printk("\n");
  62. }
  63. #else
  64. static inline void dump_resmap(void) {;}
  65. #endif
  66. static int pa11_dma_supported( struct device *dev, u64 mask)
  67. {
  68. return 1;
  69. }
  70. static inline int map_pte_uncached(pte_t * pte,
  71. unsigned long vaddr,
  72. unsigned long size, unsigned long *paddr_ptr)
  73. {
  74. unsigned long end;
  75. unsigned long orig_vaddr = vaddr;
  76. vaddr &= ~PMD_MASK;
  77. end = vaddr + size;
  78. if (end > PMD_SIZE)
  79. end = PMD_SIZE;
  80. do {
  81. unsigned long flags;
  82. if (!pte_none(*pte))
  83. printk(KERN_ERR "map_pte_uncached: page already exists\n");
  84. set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
  85. purge_tlb_start(flags);
  86. pdtlb_kernel(orig_vaddr);
  87. purge_tlb_end(flags);
  88. vaddr += PAGE_SIZE;
  89. orig_vaddr += PAGE_SIZE;
  90. (*paddr_ptr) += PAGE_SIZE;
  91. pte++;
  92. } while (vaddr < end);
  93. return 0;
  94. }
  95. static inline int map_pmd_uncached(pmd_t * pmd, unsigned long vaddr,
  96. unsigned long size, unsigned long *paddr_ptr)
  97. {
  98. unsigned long end;
  99. unsigned long orig_vaddr = vaddr;
  100. vaddr &= ~PGDIR_MASK;
  101. end = vaddr + size;
  102. if (end > PGDIR_SIZE)
  103. end = PGDIR_SIZE;
  104. do {
  105. pte_t * pte = pte_alloc_kernel(pmd, vaddr);
  106. if (!pte)
  107. return -ENOMEM;
  108. if (map_pte_uncached(pte, orig_vaddr, end - vaddr, paddr_ptr))
  109. return -ENOMEM;
  110. vaddr = (vaddr + PMD_SIZE) & PMD_MASK;
  111. orig_vaddr += PMD_SIZE;
  112. pmd++;
  113. } while (vaddr < end);
  114. return 0;
  115. }
  116. static inline int map_uncached_pages(unsigned long vaddr, unsigned long size,
  117. unsigned long paddr)
  118. {
  119. pgd_t * dir;
  120. unsigned long end = vaddr + size;
  121. dir = pgd_offset_k(vaddr);
  122. do {
  123. pmd_t *pmd;
  124. pmd = pmd_alloc(NULL, dir, vaddr);
  125. if (!pmd)
  126. return -ENOMEM;
  127. if (map_pmd_uncached(pmd, vaddr, end - vaddr, &paddr))
  128. return -ENOMEM;
  129. vaddr = vaddr + PGDIR_SIZE;
  130. dir++;
  131. } while (vaddr && (vaddr < end));
  132. return 0;
  133. }
  134. static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr,
  135. unsigned long size)
  136. {
  137. pte_t * pte;
  138. unsigned long end;
  139. unsigned long orig_vaddr = vaddr;
  140. if (pmd_none(*pmd))
  141. return;
  142. if (pmd_bad(*pmd)) {
  143. pmd_ERROR(*pmd);
  144. pmd_clear(pmd);
  145. return;
  146. }
  147. pte = pte_offset_map(pmd, vaddr);
  148. vaddr &= ~PMD_MASK;
  149. end = vaddr + size;
  150. if (end > PMD_SIZE)
  151. end = PMD_SIZE;
  152. do {
  153. unsigned long flags;
  154. pte_t page = *pte;
  155. pte_clear(&init_mm, vaddr, pte);
  156. purge_tlb_start(flags);
  157. pdtlb_kernel(orig_vaddr);
  158. purge_tlb_end(flags);
  159. vaddr += PAGE_SIZE;
  160. orig_vaddr += PAGE_SIZE;
  161. pte++;
  162. if (pte_none(page) || pte_present(page))
  163. continue;
  164. printk(KERN_CRIT "Whee.. Swapped out page in kernel page table\n");
  165. } while (vaddr < end);
  166. }
  167. static inline void unmap_uncached_pmd(pgd_t * dir, unsigned long vaddr,
  168. unsigned long size)
  169. {
  170. pmd_t * pmd;
  171. unsigned long end;
  172. unsigned long orig_vaddr = vaddr;
  173. if (pgd_none(*dir))
  174. return;
  175. if (pgd_bad(*dir)) {
  176. pgd_ERROR(*dir);
  177. pgd_clear(dir);
  178. return;
  179. }
  180. pmd = pmd_offset(dir, vaddr);
  181. vaddr &= ~PGDIR_MASK;
  182. end = vaddr + size;
  183. if (end > PGDIR_SIZE)
  184. end = PGDIR_SIZE;
  185. do {
  186. unmap_uncached_pte(pmd, orig_vaddr, end - vaddr);
  187. vaddr = (vaddr + PMD_SIZE) & PMD_MASK;
  188. orig_vaddr += PMD_SIZE;
  189. pmd++;
  190. } while (vaddr < end);
  191. }
  192. static void unmap_uncached_pages(unsigned long vaddr, unsigned long size)
  193. {
  194. pgd_t * dir;
  195. unsigned long end = vaddr + size;
  196. dir = pgd_offset_k(vaddr);
  197. do {
  198. unmap_uncached_pmd(dir, vaddr, end - vaddr);
  199. vaddr = vaddr + PGDIR_SIZE;
  200. dir++;
  201. } while (vaddr && (vaddr < end));
  202. }
  203. #define PCXL_SEARCH_LOOP(idx, mask, size) \
  204. for(; res_ptr < res_end; ++res_ptr) \
  205. { \
  206. if(0 == ((*res_ptr) & mask)) { \
  207. *res_ptr |= mask; \
  208. idx = (int)((u_long)res_ptr - (u_long)pcxl_res_map); \
  209. pcxl_res_hint = idx + (size >> 3); \
  210. goto resource_found; \
  211. } \
  212. }
  213. #define PCXL_FIND_FREE_MAPPING(idx, mask, size) { \
  214. u##size *res_ptr = (u##size *)&(pcxl_res_map[pcxl_res_hint & ~((size >> 3) - 1)]); \
  215. u##size *res_end = (u##size *)&pcxl_res_map[pcxl_res_size]; \
  216. PCXL_SEARCH_LOOP(idx, mask, size); \
  217. res_ptr = (u##size *)&pcxl_res_map[0]; \
  218. PCXL_SEARCH_LOOP(idx, mask, size); \
  219. }
  220. unsigned long
  221. pcxl_alloc_range(size_t size)
  222. {
  223. int res_idx;
  224. u_long mask, flags;
  225. unsigned int pages_needed = size >> PAGE_SHIFT;
  226. mask = (u_long) -1L;
  227. mask >>= BITS_PER_LONG - pages_needed;
  228. DBG_RES("pcxl_alloc_range() size: %d pages_needed %d pages_mask 0x%08lx\n",
  229. size, pages_needed, mask);
  230. spin_lock_irqsave(&pcxl_res_lock, flags);
  231. if(pages_needed <= 8) {
  232. PCXL_FIND_FREE_MAPPING(res_idx, mask, 8);
  233. } else if(pages_needed <= 16) {
  234. PCXL_FIND_FREE_MAPPING(res_idx, mask, 16);
  235. } else if(pages_needed <= 32) {
  236. PCXL_FIND_FREE_MAPPING(res_idx, mask, 32);
  237. } else {
  238. panic("%s: pcxl_alloc_range() Too many pages to map.\n",
  239. __FILE__);
  240. }
  241. dump_resmap();
  242. panic("%s: pcxl_alloc_range() out of dma mapping resources\n",
  243. __FILE__);
  244. resource_found:
  245. DBG_RES("pcxl_alloc_range() res_idx %d mask 0x%08lx res_hint: %d\n",
  246. res_idx, mask, pcxl_res_hint);
  247. pcxl_used_pages += pages_needed;
  248. pcxl_used_bytes += ((pages_needed >> 3) ? (pages_needed >> 3) : 1);
  249. spin_unlock_irqrestore(&pcxl_res_lock, flags);
  250. dump_resmap();
  251. /*
  252. ** return the corresponding vaddr in the pcxl dma map
  253. */
  254. return (pcxl_dma_start + (res_idx << (PAGE_SHIFT + 3)));
  255. }
  256. #define PCXL_FREE_MAPPINGS(idx, m, size) \
  257. u##size *res_ptr = (u##size *)&(pcxl_res_map[(idx) + (((size >> 3) - 1) & (~((size >> 3) - 1)))]); \
  258. /* BUG_ON((*res_ptr & m) != m); */ \
  259. *res_ptr &= ~m;
  260. /*
  261. ** clear bits in the pcxl resource map
  262. */
  263. static void
  264. pcxl_free_range(unsigned long vaddr, size_t size)
  265. {
  266. u_long mask, flags;
  267. unsigned int res_idx = (vaddr - pcxl_dma_start) >> (PAGE_SHIFT + 3);
  268. unsigned int pages_mapped = size >> PAGE_SHIFT;
  269. mask = (u_long) -1L;
  270. mask >>= BITS_PER_LONG - pages_mapped;
  271. DBG_RES("pcxl_free_range() res_idx: %d size: %d pages_mapped %d mask 0x%08lx\n",
  272. res_idx, size, pages_mapped, mask);
  273. spin_lock_irqsave(&pcxl_res_lock, flags);
  274. if(pages_mapped <= 8) {
  275. PCXL_FREE_MAPPINGS(res_idx, mask, 8);
  276. } else if(pages_mapped <= 16) {
  277. PCXL_FREE_MAPPINGS(res_idx, mask, 16);
  278. } else if(pages_mapped <= 32) {
  279. PCXL_FREE_MAPPINGS(res_idx, mask, 32);
  280. } else {
  281. panic("%s: pcxl_free_range() Too many pages to unmap.\n",
  282. __FILE__);
  283. }
  284. pcxl_used_pages -= (pages_mapped ? pages_mapped : 1);
  285. pcxl_used_bytes -= ((pages_mapped >> 3) ? (pages_mapped >> 3) : 1);
  286. spin_unlock_irqrestore(&pcxl_res_lock, flags);
  287. dump_resmap();
  288. }
  289. static int proc_pcxl_dma_show(struct seq_file *m, void *v)
  290. {
  291. #if 0
  292. u_long i = 0;
  293. unsigned long *res_ptr = (u_long *)pcxl_res_map;
  294. #endif
  295. unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */
  296. seq_printf(m, "\nDMA Mapping Area size : %d bytes (%ld pages)\n",
  297. PCXL_DMA_MAP_SIZE, total_pages);
  298. seq_printf(m, "Resource bitmap : %d bytes\n", pcxl_res_size);
  299. seq_puts(m, " total: free: used: % used:\n");
  300. seq_printf(m, "blocks %8d %8ld %8ld %8ld%%\n", pcxl_res_size,
  301. pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes,
  302. (pcxl_used_bytes * 100) / pcxl_res_size);
  303. seq_printf(m, "pages %8ld %8ld %8ld %8ld%%\n", total_pages,
  304. total_pages - pcxl_used_pages, pcxl_used_pages,
  305. (pcxl_used_pages * 100 / total_pages));
  306. #if 0
  307. seq_puts(m, "\nResource bitmap:");
  308. for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) {
  309. if ((i & 7) == 0)
  310. seq_puts(m,"\n ");
  311. seq_printf(m, "%s %08lx", buf, *res_ptr);
  312. }
  313. #endif
  314. seq_putc(m, '\n');
  315. return 0;
  316. }
  317. static int proc_pcxl_dma_open(struct inode *inode, struct file *file)
  318. {
  319. return single_open(file, proc_pcxl_dma_show, NULL);
  320. }
  321. static const struct file_operations proc_pcxl_dma_ops = {
  322. .owner = THIS_MODULE,
  323. .open = proc_pcxl_dma_open,
  324. .read = seq_read,
  325. .llseek = seq_lseek,
  326. .release = single_release,
  327. };
  328. static int __init
  329. pcxl_dma_init(void)
  330. {
  331. if (pcxl_dma_start == 0)
  332. return 0;
  333. spin_lock_init(&pcxl_res_lock);
  334. pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3);
  335. pcxl_res_hint = 0;
  336. pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL,
  337. get_order(pcxl_res_size));
  338. memset(pcxl_res_map, 0, pcxl_res_size);
  339. proc_gsc_root = proc_mkdir("gsc", NULL);
  340. if (!proc_gsc_root)
  341. printk(KERN_WARNING
  342. "pcxl_dma_init: Unable to create gsc /proc dir entry\n");
  343. else {
  344. struct proc_dir_entry* ent;
  345. ent = proc_create("pcxl_dma", 0, proc_gsc_root,
  346. &proc_pcxl_dma_ops);
  347. if (!ent)
  348. printk(KERN_WARNING
  349. "pci-dma.c: Unable to create pcxl_dma /proc entry.\n");
  350. }
  351. return 0;
  352. }
  353. __initcall(pcxl_dma_init);
  354. static void * pa11_dma_alloc_consistent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag)
  355. {
  356. unsigned long vaddr;
  357. unsigned long paddr;
  358. int order;
  359. order = get_order(size);
  360. size = 1 << (order + PAGE_SHIFT);
  361. vaddr = pcxl_alloc_range(size);
  362. paddr = __get_free_pages(flag, order);
  363. flush_kernel_dcache_range(paddr, size);
  364. paddr = __pa(paddr);
  365. map_uncached_pages(vaddr, size, paddr);
  366. *dma_handle = (dma_addr_t) paddr;
  367. #if 0
  368. /* This probably isn't needed to support EISA cards.
  369. ** ISA cards will certainly only support 24-bit DMA addressing.
  370. ** Not clear if we can, want, or need to support ISA.
  371. */
  372. if (!dev || *dev->coherent_dma_mask < 0xffffffff)
  373. gfp |= GFP_DMA;
  374. #endif
  375. return (void *)vaddr;
  376. }
  377. static void pa11_dma_free_consistent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
  378. {
  379. int order;
  380. order = get_order(size);
  381. size = 1 << (order + PAGE_SHIFT);
  382. unmap_uncached_pages((unsigned long)vaddr, size);
  383. pcxl_free_range((unsigned long)vaddr, size);
  384. free_pages((unsigned long)__va(dma_handle), order);
  385. }
  386. static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction)
  387. {
  388. BUG_ON(direction == DMA_NONE);
  389. flush_kernel_dcache_range((unsigned long) addr, size);
  390. return virt_to_phys(addr);
  391. }
  392. static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
  393. {
  394. BUG_ON(direction == DMA_NONE);
  395. if (direction == DMA_TO_DEVICE)
  396. return;
  397. /*
  398. * For PCI_DMA_FROMDEVICE this flush is not necessary for the
  399. * simple map/unmap case. However, it IS necessary if if
  400. * pci_dma_sync_single_* has been called and the buffer reused.
  401. */
  402. flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle), size);
  403. return;
  404. }
  405. static int pa11_dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
  406. {
  407. int i;
  408. struct scatterlist *sg;
  409. BUG_ON(direction == DMA_NONE);
  410. for_each_sg(sglist, sg, nents, i) {
  411. unsigned long vaddr = (unsigned long)sg_virt(sg);
  412. sg_dma_address(sg) = (dma_addr_t) virt_to_phys(vaddr);
  413. sg_dma_len(sg) = sg->length;
  414. flush_kernel_dcache_range(vaddr, sg->length);
  415. }
  416. return nents;
  417. }
  418. static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
  419. {
  420. int i;
  421. struct scatterlist *sg;
  422. BUG_ON(direction == DMA_NONE);
  423. if (direction == DMA_TO_DEVICE)
  424. return;
  425. /* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
  426. for_each_sg(sglist, sg, nents, i)
  427. flush_kernel_vmap_range(sg_virt(sg), sg->length);
  428. return;
  429. }
  430. static void pa11_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction)
  431. {
  432. BUG_ON(direction == DMA_NONE);
  433. flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
  434. }
  435. static void pa11_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction)
  436. {
  437. BUG_ON(direction == DMA_NONE);
  438. flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
  439. }
  440. static void pa11_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
  441. {
  442. int i;
  443. struct scatterlist *sg;
  444. /* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
  445. for_each_sg(sglist, sg, nents, i)
  446. flush_kernel_vmap_range(sg_virt(sg), sg->length);
  447. }
  448. static void pa11_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
  449. {
  450. int i;
  451. struct scatterlist *sg;
  452. /* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
  453. for_each_sg(sglist, sg, nents, i)
  454. flush_kernel_vmap_range(sg_virt(sg), sg->length);
  455. }
  456. struct hppa_dma_ops pcxl_dma_ops = {
  457. .dma_supported = pa11_dma_supported,
  458. .alloc_consistent = pa11_dma_alloc_consistent,
  459. .alloc_noncoherent = pa11_dma_alloc_consistent,
  460. .free_consistent = pa11_dma_free_consistent,
  461. .map_single = pa11_dma_map_single,
  462. .unmap_single = pa11_dma_unmap_single,
  463. .map_sg = pa11_dma_map_sg,
  464. .unmap_sg = pa11_dma_unmap_sg,
  465. .dma_sync_single_for_cpu = pa11_dma_sync_single_for_cpu,
  466. .dma_sync_single_for_device = pa11_dma_sync_single_for_device,
  467. .dma_sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu,
  468. .dma_sync_sg_for_device = pa11_dma_sync_sg_for_device,
  469. };
  470. static void *fail_alloc_consistent(struct device *dev, size_t size,
  471. dma_addr_t *dma_handle, gfp_t flag)
  472. {
  473. return NULL;
  474. }
  475. static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
  476. dma_addr_t *dma_handle, gfp_t flag)
  477. {
  478. void *addr;
  479. addr = (void *)__get_free_pages(flag, get_order(size));
  480. if (addr)
  481. *dma_handle = (dma_addr_t)virt_to_phys(addr);
  482. return addr;
  483. }
  484. static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
  485. void *vaddr, dma_addr_t iova)
  486. {
  487. free_pages((unsigned long)vaddr, get_order(size));
  488. return;
  489. }
  490. struct hppa_dma_ops pcx_dma_ops = {
  491. .dma_supported = pa11_dma_supported,
  492. .alloc_consistent = fail_alloc_consistent,
  493. .alloc_noncoherent = pa11_dma_alloc_noncoherent,
  494. .free_consistent = pa11_dma_free_noncoherent,
  495. .map_single = pa11_dma_map_single,
  496. .unmap_single = pa11_dma_unmap_single,
  497. .map_sg = pa11_dma_map_sg,
  498. .unmap_sg = pa11_dma_unmap_sg,
  499. .dma_sync_single_for_cpu = pa11_dma_sync_single_for_cpu,
  500. .dma_sync_single_for_device = pa11_dma_sync_single_for_device,
  501. .dma_sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu,
  502. .dma_sync_sg_for_device = pa11_dma_sync_sg_for_device,
  503. };