| 1 | From 2411a3e2b5dfa4784bbe2548f8ef0ce1aea0379e Mon Sep 17 00:00:00 2001 |
| 2 | From: Jason Jin <Jason.jin@freescale.com> |
| 3 | Date: Thu, 4 Aug 2011 09:59:55 +0800 |
| 4 | Subject: [PATCH 50/52] Update the DMA map function for CF platform |
| 5 | |
| 6 | In the DMA map, only the dcache need to be flushed. |
| 7 | Flush both dcache and icache will decrease the system |
| 8 | performance. |
| 9 | |
| 10 | Signed-off-by: Jason Jin <Jason.jin@freescale.com> |
| 11 | --- |
| 12 | arch/m68k/kernel/dma.c | 12 ++++++++++-- |
| 13 | 1 files changed, 10 insertions(+), 2 deletions(-) |
| 14 | |
| 15 | --- a/arch/m68k/kernel/dma.c |
| 16 | +++ b/arch/m68k/kernel/dma.c |
| 17 | @@ -94,10 +94,18 @@ void dma_sync_single_for_device(struct d |
| 18 | { |
| 19 | switch (dir) { |
| 20 | case DMA_TO_DEVICE: |
| 21 | - cache_push(handle, size); |
| 22 | +#if defined(CONFIG_M5445X) || defined(CONFIG_M5441X) |
| 23 | + flush_dcache_range(handle, handle + size); |
| 24 | +#else |
| 25 | + flush_dcache(); |
| 26 | +#endif |
| 27 | break; |
| 28 | case DMA_FROM_DEVICE: |
| 29 | - cache_clear(handle, size); |
| 30 | +#if defined(CONFIG_M5445X) || defined(CONFIG_M5441X) |
| 31 | + cf_dcache_inv_range(handle, handle + size); |
| 32 | +#else |
| 33 | + flush_dcache(); |
| 34 | +#endif |
| 35 | break; |
| 36 | case PCI_DMA_BIDIRECTIONAL: |
| 37 | flush_dcache(); |
| 38 | |