Re: [PATCH 13/31] nds32: DMA mapping API

2017-11-10 Thread Greentime Hu
2017-11-09 18:14 GMT+08:00 Arnd Bergmann : > On Thu, Nov 9, 2017 at 8:12 AM, Greentime Hu wrote: >> 2017-11-08 17:09 GMT+08:00 Arnd Bergmann : >>> On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu wrote: >>> > >>> You do the same cache operations for _to_cpu and _to_device, which >>> usually works, >>

Re: [PATCH 13/31] nds32: DMA mapping API

2017-11-09 Thread Arnd Bergmann
On Thu, Nov 9, 2017 at 8:12 AM, Greentime Hu wrote: > 2017-11-08 17:09 GMT+08:00 Arnd Bergmann : >> On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu wrote: >> >> You do the same cache operations for _to_cpu and _to_device, which >> usually works, >> but is more expensive than you need. It's better t

Re: [PATCH 13/31] nds32: DMA mapping API

2017-11-08 Thread Greentime Hu
2017-11-08 17:09 GMT+08:00 Arnd Bergmann : > On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu wrote: > >> +static void consistent_sync(void *vaddr, size_t size, int direction) >> +{ >> + unsigned long start = (unsigned long)vaddr; >> + unsigned long end = start + size; >> + >> + swit

Re: [PATCH 13/31] nds32: DMA mapping API

2017-11-08 Thread Arnd Bergmann
On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu wrote: > +static void consistent_sync(void *vaddr, size_t size, int direction) > +{ > + unsigned long start = (unsigned long)vaddr; > + unsigned long end = start + size; > + > + switch (direction) { > + case DMA_FROM_DEVICE: /

[PATCH 13/31] nds32: DMA mapping API

2017-11-07 Thread Greentime Hu
From: Greentime Hu Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu --- arch/nds32/include/asm/dma-mapping.h | 27 ++ arch/nds32/kernel/dma.c | 478 ++ 2 files changed, 505 insertions(+) create mode 100644 arch/nds32/include/asm/dma-mappi