linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/4] ARM: add flush_mem api for ARMv6
@ 2012-06-19 11:21 Gupta, Ramesh
  2012-06-20  8:45 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Gupta, Ramesh @ 2012-06-19 11:21 UTC (permalink / raw)
  To: linux-arm-kernel

>From 630a3a8f341eb7f58f9a63bf786d732b5bdfd01e Mon Sep 17 00:00:00 2001
From: Ramesh Gupta G <grgupta@ti.com>
Date: Fri, 15 Jun 2012 16:39:21 +0530
Subject: [PATCH v2 2/4] ARM: add flush_mem api for ARMv6

Added flush_mem cache maintenance api for ARMv6.
The implementation is based on dma_flush_range.

Signed-off-by: Ramesh Gupta G <grgupta@ti.com>
---
 arch/arm/mm/cache-v6.S |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index 74c2e5a..f91d847 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -328,6 +328,34 @@ ENTRY(v6_dma_unmap_area)
 	mov	pc, lr
 ENDPROC(v6_dma_unmap_area)

+/*
+ *	v6_flush_mem(start,end)
+ *	- start   - virtual start address of region
+ *	- end     - virtual end address of region
+ */
+ENTRY(v6_flush_mem)
+#ifdef CONFIG_DMA_CACHE_RWFO
+	ldrb	r2, [r0]		@ read for ownership
+	strb	r2, [r0]		@ write for ownership
+#endif
+	bic	r0, r0, #D_CACHE_LINE_SIZE - 1
+1:
+#ifdef HARVARD_CACHE
+	mcr	p15, 0, r0, c7, c14, 1		@ clean & invalidate D line
+#else
+	mcr	p15, 0, r0, c7, c15, 1		@ clean & invalidate line
+#endif
+	add	r0, r0, #D_CACHE_LINE_SIZE
+	cmp	r0, r1
+#ifdef CONFIG_DMA_CACHE_RWFO
+	ldrlob	r2, [r0]			@ read for ownership
+	strlob	r2, [r0]			@ write for ownership
+#endif
+	blo	1b
+	mov	r0, #0
+	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
+	mov	pc, lr
+ENDPROC(v6_flush_mem)
 	__INITDATA

 	@ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
-- 
1.7.0.4


-- 
regards
Ramesh Gupta G

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 2/4] ARM: add flush_mem api for ARMv6
  2012-06-19 11:21 [PATCH v2 2/4] ARM: add flush_mem api for ARMv6 Gupta, Ramesh
@ 2012-06-20  8:45 ` Russell King - ARM Linux
  2012-06-20  9:02   ` Gupta, Ramesh
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-06-20  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 19, 2012 at 04:51:16PM +0530, Gupta, Ramesh wrote:
> >From 630a3a8f341eb7f58f9a63bf786d732b5bdfd01e Mon Sep 17 00:00:00 2001
> From: Ramesh Gupta G <grgupta@ti.com>
> Date: Fri, 15 Jun 2012 16:39:21 +0530
> Subject: [PATCH v2 2/4] ARM: add flush_mem api for ARMv6
> 
> Added flush_mem cache maintenance api for ARMv6.
> The implementation is based on dma_flush_range.

And what about all the other users of the define_cache_functions macro?

This series is incomplete, and therefore entirely unsuitable for
upstreaming.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 2/4] ARM: add flush_mem api for ARMv6
  2012-06-20  8:45 ` Russell King - ARM Linux
@ 2012-06-20  9:02   ` Gupta, Ramesh
  0 siblings, 0 replies; 3+ messages in thread
From: Gupta, Ramesh @ 2012-06-20  9:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Russell,


On Wed, Jun 20, 2012 at 2:15 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>
> On Tue, Jun 19, 2012 at 04:51:16PM +0530, Gupta, Ramesh wrote:
> > >From 630a3a8f341eb7f58f9a63bf786d732b5bdfd01e Mon Sep 17 00:00:00 2001
> > From: Ramesh Gupta G <grgupta@ti.com>
> > Date: Fri, 15 Jun 2012 16:39:21 +0530
> > Subject: [PATCH v2 2/4] ARM: add flush_mem api for ARMv6
> >
> > Added flush_mem cache maintenance api for ARMv6.
> > The implementation is based on dma_flush_range.
>
> And what about all the other users of the define_cache_functions macro?

I initially added only for ARMv6/7 and I will add this for the other users.

> This series is incomplete, and therefore entirely unsuitable for
> upstreaming.

I will send an updated patch set.

Thank you for the comments.

Regards
Ramesh Gupta G

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-20  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 11:21 [PATCH v2 2/4] ARM: add flush_mem api for ARMv6 Gupta, Ramesh
2012-06-20  8:45 ` Russell King - ARM Linux
2012-06-20  9:02   ` Gupta, Ramesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).