pci-dma.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  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. purge_tlb_start(flags);
  85. set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
  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(struct device *dev, size_t size,
  355. dma_addr_t *dma_handle, gfp_t flag, unsigned long attrs)
  356. {
  357. unsigned long vaddr;
  358. unsigned long paddr;
  359. int order;
  360. order = get_order(size);
  361. size = 1 << (order + PAGE_SHIFT);
  362. vaddr = pcxl_alloc_range(size);
  363. paddr = __get_free_pages(flag, order);
  364. flush_kernel_dcache_range(paddr, size);
  365. paddr = __pa(paddr);
  366. map_uncached_pages(vaddr, size, paddr);
  367. *dma_handle = (dma_addr_t) paddr;
  368. #if 0
  369. /* This probably isn't needed to support EISA cards.
  370. ** ISA cards will certainly only support 24-bit DMA addressing.
  371. ** Not clear if we can, want, or need to support ISA.
  372. */
  373. if (!dev || *dev->coherent_dma_mask < 0xffffffff)
  374. gfp |= GFP_DMA;
  375. #endif
  376. return (void *)vaddr;
  377. }
  378. static void pa11_dma_free(struct device *dev, size_t size, void *vaddr,
  379. dma_addr_t dma_handle, unsigned long attrs)
  380. {
  381. int order;
  382. order = get_order(size);
  383. size = 1 << (order + PAGE_SHIFT);
  384. unmap_uncached_pages((unsigned long)vaddr, size);
  385. pcxl_free_range((unsigned long)vaddr, size);
  386. free_pages((unsigned long)__va(dma_handle), order);
  387. }
  388. static dma_addr_t pa11_dma_map_page(struct device *dev, struct page *page,
  389. unsigned long offset, size_t size,
  390. enum dma_data_direction direction, unsigned long attrs)
  391. {
  392. void *addr = page_address(page) + offset;
  393. BUG_ON(direction == DMA_NONE);
  394. flush_kernel_dcache_range((unsigned long) addr, size);
  395. return virt_to_phys(addr);
  396. }
  397. static void pa11_dma_unmap_page(struct device *dev, dma_addr_t dma_handle,
  398. size_t size, enum dma_data_direction direction,
  399. unsigned long attrs)
  400. {
  401. BUG_ON(direction == DMA_NONE);
  402. if (direction == DMA_TO_DEVICE)
  403. return;
  404. /*
  405. * For PCI_DMA_FROMDEVICE this flush is not necessary for the
  406. * simple map/unmap case. However, it IS necessary if if
  407. * pci_dma_sync_single_* has been called and the buffer reused.
  408. */
  409. flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle), size);
  410. return;
  411. }
  412. static int pa11_dma_map_sg(struct device *dev, struct scatterlist *sglist,
  413. int nents, enum dma_data_direction direction,
  414. unsigned long attrs)
  415. {
  416. int i;
  417. struct scatterlist *sg;
  418. BUG_ON(direction == DMA_NONE);
  419. for_each_sg(sglist, sg, nents, i) {
  420. unsigned long vaddr = (unsigned long)sg_virt(sg);
  421. sg_dma_address(sg) = (dma_addr_t) virt_to_phys(vaddr);
  422. sg_dma_len(sg) = sg->length;
  423. flush_kernel_dcache_range(vaddr, sg->length);
  424. }
  425. return nents;
  426. }
  427. static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
  428. int nents, enum dma_data_direction direction,
  429. unsigned long attrs)
  430. {
  431. int i;
  432. struct scatterlist *sg;
  433. BUG_ON(direction == DMA_NONE);
  434. if (direction == DMA_TO_DEVICE)
  435. return;
  436. /* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
  437. for_each_sg(sglist, sg, nents, i)
  438. flush_kernel_vmap_range(sg_virt(sg), sg->length);
  439. return;
  440. }
  441. static void pa11_dma_sync_single_for_cpu(struct device *dev,
  442. dma_addr_t dma_handle, size_t size,
  443. enum dma_data_direction direction)
  444. {
  445. BUG_ON(direction == DMA_NONE);
  446. flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle),
  447. size);
  448. }
  449. static void pa11_dma_sync_single_for_device(struct device *dev,
  450. dma_addr_t dma_handle, size_t size,
  451. enum dma_data_direction direction)
  452. {
  453. BUG_ON(direction == DMA_NONE);
  454. flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle),
  455. size);
  456. }
  457. static void pa11_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
  458. {
  459. int i;
  460. struct scatterlist *sg;
  461. /* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
  462. for_each_sg(sglist, sg, nents, i)
  463. flush_kernel_vmap_range(sg_virt(sg), sg->length);
  464. }
  465. static void pa11_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction direction)
  466. {
  467. int i;
  468. struct scatterlist *sg;
  469. /* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
  470. for_each_sg(sglist, sg, nents, i)
  471. flush_kernel_vmap_range(sg_virt(sg), sg->length);
  472. }
  473. struct dma_map_ops pcxl_dma_ops = {
  474. .dma_supported = pa11_dma_supported,
  475. .alloc = pa11_dma_alloc,
  476. .free = pa11_dma_free,
  477. .map_page = pa11_dma_map_page,
  478. .unmap_page = pa11_dma_unmap_page,
  479. .map_sg = pa11_dma_map_sg,
  480. .unmap_sg = pa11_dma_unmap_sg,
  481. .sync_single_for_cpu = pa11_dma_sync_single_for_cpu,
  482. .sync_single_for_device = pa11_dma_sync_single_for_device,
  483. .sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu,
  484. .sync_sg_for_device = pa11_dma_sync_sg_for_device,
  485. };
  486. static void *pcx_dma_alloc(struct device *dev, size_t size,
  487. dma_addr_t *dma_handle, gfp_t flag, unsigned long attrs)
  488. {
  489. void *addr;
  490. if ((attrs & DMA_ATTR_NON_CONSISTENT) == 0)
  491. return NULL;
  492. addr = (void *)__get_free_pages(flag, get_order(size));
  493. if (addr)
  494. *dma_handle = (dma_addr_t)virt_to_phys(addr);
  495. return addr;
  496. }
  497. static void pcx_dma_free(struct device *dev, size_t size, void *vaddr,
  498. dma_addr_t iova, unsigned long attrs)
  499. {
  500. free_pages((unsigned long)vaddr, get_order(size));
  501. return;
  502. }
  503. struct dma_map_ops pcx_dma_ops = {
  504. .dma_supported = pa11_dma_supported,
  505. .alloc = pcx_dma_alloc,
  506. .free = pcx_dma_free,
  507. .map_page = pa11_dma_map_page,
  508. .unmap_page = pa11_dma_unmap_page,
  509. .map_sg = pa11_dma_map_sg,
  510. .unmap_sg = pa11_dma_unmap_sg,
  511. .sync_single_for_cpu = pa11_dma_sync_single_for_cpu,
  512. .sync_single_for_device = pa11_dma_sync_single_for_device,
  513. .sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu,
  514. .sync_sg_for_device = pa11_dma_sync_sg_for_device,
  515. };