2005-04-16 15:20:36 -07:00
/ *
* linux/ a r c h / a r m / m m / c a c h e - v4 . S
*
* Copyright ( C ) 1 9 9 7 - 2 0 0 2 R u s s e l l k i n g
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
* /
# include < l i n u x / l i n k a g e . h >
# include < l i n u x / i n i t . h >
2014-06-30 16:29:12 +01:00
# include < a s m / a s s e m b l e r . h >
2005-04-16 15:20:36 -07:00
# include < a s m / p a g e . h >
# include " p r o c - m a c r o s . S "
2010-10-28 11:27:40 +01:00
/ *
* flush_ i c a c h e _ a l l ( )
*
* Unconditionally c l e a n a n d i n v a l i d a t e t h e e n t i r e i c a c h e .
* /
ENTRY( v4 _ f l u s h _ i c a c h e _ a l l )
2014-06-30 16:29:12 +01:00
ret l r
2010-10-28 11:27:40 +01:00
ENDPROC( v4 _ f l u s h _ i c a c h e _ a l l )
2005-04-16 15:20:36 -07:00
/ *
* flush_ u s e r _ c a c h e _ a l l ( )
*
* Invalidate a l l c a c h e e n t r i e s i n a p a r t i c u l a r a d d r e s s
* space.
*
* - mm - m m _ s t r u c t d e s c r i b i n g a d d r e s s s p a c e
* /
ENTRY( v4 _ f l u s h _ u s e r _ c a c h e _ a l l )
/* FALLTHROUGH */
/ *
* flush_ k e r n _ c a c h e _ a l l ( )
*
* Clean a n d i n v a l i d a t e t h e e n t i r e c a c h e .
* /
ENTRY( v4 _ f l u s h _ k e r n _ c a c h e _ a l l )
2008-10-16 17:37:24 +01:00
# ifdef C O N F I G _ C P U _ C P 1 5
2005-04-16 15:20:36 -07:00
mov r0 , #0
mcr p15 , 0 , r0 , c7 , c7 , 0 @ flush ID cache
2014-06-30 16:29:12 +01:00
ret l r
2006-09-26 17:36:37 +09:00
# else
/* FALLTHROUGH */
# endif
2005-04-16 15:20:36 -07:00
/ *
* flush_ u s e r _ c a c h e _ r a n g e ( s t a r t , e n d , f l a g s )
*
* Invalidate a r a n g e o f c a c h e e n t r i e s i n t h e s p e c i f i e d
* address s p a c e .
*
* - start - s t a r t a d d r e s s ( m a y n o t b e a l i g n e d )
* - end - e n d a d d r e s s ( e x c l u s i v e , m a y n o t b e a l i g n e d )
* - flags - v m a _ a r e a _ s t r u c t f l a g s d e s c r i b i n g a d d r e s s s p a c e
* /
ENTRY( v4 _ f l u s h _ u s e r _ c a c h e _ r a n g e )
2008-10-16 17:37:24 +01:00
# ifdef C O N F I G _ C P U _ C P 1 5
2005-04-16 15:20:36 -07:00
mov i p , #0
2013-01-22 19:11:38 +00:00
mcr p15 , 0 , i p , c7 , c7 , 0 @ flush ID cache
2014-06-30 16:29:12 +01:00
ret l r
2006-09-26 17:36:37 +09:00
# else
/* FALLTHROUGH */
# endif
2005-04-16 15:20:36 -07:00
/ *
* coherent_ k e r n _ r a n g e ( s t a r t , e n d )
*
* Ensure c o h e r e n c y b e t w e e n t h e I c a c h e a n d t h e D c a c h e i n t h e
* region d e s c r i b e d b y s t a r t . I f y o u h a v e n o n - s n o o p i n g
* Harvard c a c h e s , y o u n e e d t o i m p l e m e n t t h i s f u n c t i o n .
*
* - start - v i r t u a l s t a r t a d d r e s s
* - end - v i r t u a l e n d a d d r e s s
* /
ENTRY( v4 _ c o h e r e n t _ k e r n _ r a n g e )
/* FALLTHROUGH */
/ *
* coherent_ u s e r _ r a n g e ( s t a r t , e n d )
*
* Ensure c o h e r e n c y b e t w e e n t h e I c a c h e a n d t h e D c a c h e i n t h e
* region d e s c r i b e d b y s t a r t . I f y o u h a v e n o n - s n o o p i n g
* Harvard c a c h e s , y o u n e e d t o i m p l e m e n t t h i s f u n c t i o n .
*
* - start - v i r t u a l s t a r t a d d r e s s
* - end - v i r t u a l e n d a d d r e s s
* /
ENTRY( v4 _ c o h e r e n t _ u s e r _ r a n g e )
2012-04-27 13:08:53 +01:00
mov r0 , #0
2014-06-30 16:29:12 +01:00
ret l r
2005-04-16 15:20:36 -07:00
/ *
2009-11-26 12:56:21 +00:00
* flush_ k e r n _ d c a c h e _ a r e a ( v o i d * a d d r , s i z e _ t s i z e )
2005-04-16 15:20:36 -07:00
*
* Ensure n o D c a c h e a l i a s i n g o c c u r s , e i t h e r w i t h i t s e l f o r
* the I c a c h e
*
2009-11-26 12:56:21 +00:00
* - addr - k e r n e l a d d r e s s
* - size - r e g i o n s i z e
2005-04-16 15:20:36 -07:00
* /
2009-11-26 12:56:21 +00:00
ENTRY( v4 _ f l u s h _ k e r n _ d c a c h e _ a r e a )
2005-04-16 15:20:36 -07:00
/* FALLTHROUGH */
/ *
* dma_ f l u s h _ r a n g e ( s t a r t , e n d )
*
* Clean a n d i n v a l i d a t e t h e s p e c i f i e d v i r t u a l a d d r e s s r a n g e .
*
* - start - v i r t u a l s t a r t a d d r e s s
* - end - v i r t u a l e n d a d d r e s s
* /
ENTRY( v4 _ d m a _ f l u s h _ r a n g e )
2008-10-16 17:37:24 +01:00
# ifdef C O N F I G _ C P U _ C P 1 5
2005-04-16 15:20:36 -07:00
mov r0 , #0
mcr p15 , 0 , r0 , c7 , c7 , 0 @ flush ID cache
2006-09-26 17:36:37 +09:00
# endif
2014-06-30 16:29:12 +01:00
ret l r
2005-04-16 15:20:36 -07:00
2009-11-26 16:19:58 +00:00
/ *
* dma_ u n m a p _ a r e a ( s t a r t , s i z e , d i r )
* - start - k e r n e l v i r t u a l s t a r t a d d r e s s
* - size - s i z e o f r e g i o n
* - dir - D M A d i r e c t i o n
* /
ENTRY( v4 _ d m a _ u n m a p _ a r e a )
teq r2 , #D M A _ T O _ D E V I C E
2009-11-26 16:24:19 +00:00
bne v4 _ d m a _ f l u s h _ r a n g e
2009-11-26 16:19:58 +00:00
/* FALLTHROUGH */
/ *
* dma_ m a p _ a r e a ( s t a r t , s i z e , d i r )
* - start - k e r n e l v i r t u a l s t a r t a d d r e s s
* - size - s i z e o f r e g i o n
* - dir - D M A d i r e c t i o n
* /
ENTRY( v4 _ d m a _ m a p _ a r e a )
2014-06-30 16:29:12 +01:00
ret l r
2009-11-26 16:19:58 +00:00
ENDPROC( v4 _ d m a _ u n m a p _ a r e a )
ENDPROC( v4 _ d m a _ m a p _ a r e a )
2012-09-06 18:35:13 +05:30
.globl v4_flush_kern_cache_louis
.equ v4 _ f l u s h _ k e r n _ c a c h e _ l o u i s , v4 _ f l u s h _ k e r n _ c a c h e _ a l l
2005-04-16 15:20:36 -07:00
_ _ INITDATA
2011-06-23 17:14:52 +01:00
@ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
define_ c a c h e _ f u n c t i o n s v4