| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * arch/arm/include/asm/outercache.h | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (C) 2010 ARM Ltd. | 
					
						
							|  |  |  |  * Written by Catalin Marinas <catalin.marinas@arm.com> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU General Public License version 2 as | 
					
						
							|  |  |  |  * published by the Free Software Foundation. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software | 
					
						
							|  |  |  |  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __ASM_OUTERCACHE_H
 | 
					
						
							|  |  |  | #define __ASM_OUTERCACHE_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | #include <linux/types.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | struct outer_cache_fns { | 
					
						
							|  |  |  | 	void (*inv_range)(unsigned long, unsigned long); | 
					
						
							|  |  |  | 	void (*clean_range)(unsigned long, unsigned long); | 
					
						
							|  |  |  | 	void (*flush_range)(unsigned long, unsigned long); | 
					
						
							| 
									
										
										
										
											2010-07-31 21:06:06 +05:30
										 |  |  | 	void (*flush_all)(void); | 
					
						
							|  |  |  | 	void (*inv_all)(void); | 
					
						
							|  |  |  | 	void (*disable)(void); | 
					
						
							| 
									
										
										
										
											2010-03-24 16:47:53 +01:00
										 |  |  | #ifdef CONFIG_OUTER_CACHE_SYNC
 | 
					
						
							|  |  |  | 	void (*sync)(void); | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2011-03-08 06:59:54 +01:00
										 |  |  | 	void (*set_debug)(unsigned long); | 
					
						
							| 
									
										
										
										
											2011-09-30 14:43:12 +01:00
										 |  |  | 	void (*resume)(void); | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern struct outer_cache_fns outer_cache; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-17 20:12:57 -05:00
										 |  |  | #ifdef CONFIG_OUTER_CACHE
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.inv_range) | 
					
						
							|  |  |  | 		outer_cache.inv_range(start, end); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | static inline void outer_clean_range(phys_addr_t start, phys_addr_t end) | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.clean_range) | 
					
						
							|  |  |  | 		outer_cache.clean_range(start, end); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | static inline void outer_flush_range(phys_addr_t start, phys_addr_t end) | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.flush_range) | 
					
						
							|  |  |  | 		outer_cache.flush_range(start, end); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-31 21:06:06 +05:30
										 |  |  | static inline void outer_flush_all(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.flush_all) | 
					
						
							|  |  |  | 		outer_cache.flush_all(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static inline void outer_inv_all(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.inv_all) | 
					
						
							|  |  |  | 		outer_cache.inv_all(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static inline void outer_disable(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.disable) | 
					
						
							|  |  |  | 		outer_cache.disable(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-30 14:43:12 +01:00
										 |  |  | static inline void outer_resume(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.resume) | 
					
						
							|  |  |  | 		outer_cache.resume(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | #else
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | { } | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | static inline void outer_clean_range(phys_addr_t start, phys_addr_t end) | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | { } | 
					
						
							| 
									
										
										
										
											2011-02-15 12:41:49 +01:00
										 |  |  | static inline void outer_flush_range(phys_addr_t start, phys_addr_t end) | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | { } | 
					
						
							| 
									
										
										
										
											2010-07-31 21:06:06 +05:30
										 |  |  | static inline void outer_flush_all(void) { } | 
					
						
							|  |  |  | static inline void outer_inv_all(void) { } | 
					
						
							|  |  |  | static inline void outer_disable(void) { } | 
					
						
							| 
									
										
										
										
											2013-02-04 07:46:57 +01:00
										 |  |  | static inline void outer_resume(void) { } | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-24 16:47:53 +01:00
										 |  |  | #ifdef CONFIG_OUTER_CACHE_SYNC
 | 
					
						
							|  |  |  | static inline void outer_sync(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (outer_cache.sync) | 
					
						
							|  |  |  | 		outer_cache.sync(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | static inline void outer_sync(void) | 
					
						
							|  |  |  | { } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-24 16:46:52 +01:00
										 |  |  | #endif	/* __ASM_OUTERCACHE_H */
 |