summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/include/leon.h
diff options
context:
space:
mode:
authorDaniel Cederman <cederman@gaisler.com>2014-09-10 13:39:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-23 10:21:41 +0200
commit77a2226a166400d7e641eb38d126a4a014923ab4 (patch)
treee1129a4f89e229d79c9607501026010663735686 /c/src/lib/libbsp/sparc/leon3/include/leon.h
parentdosfs: Write meta-data only if it changed (diff)
downloadrtems-77a2226a166400d7e641eb38d126a4a014923ab4.tar.bz2
bsp/sparc: Ensure that data cache snooping is enabled
Check that data cache snooping exists and is enabled on all cores.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/include/leon.h')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/leon.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index a2fb3026cb..92c36b725b 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -90,6 +90,7 @@ extern "C" {
* The following defines the bits in the LEON Cache Control Register.
*/
#define LEON3_REG_CACHE_CTRL_FI 0x00200000 /* Flush instruction cache */
+#define LEON3_REG_CACHE_CTRL_DS 0x00800000 /* Data cache snooping */
/* LEON3 Interrupt Controller */
extern volatile struct irqmp_regs *LEON3_IrqCtrl_Regs;
@@ -359,6 +360,11 @@ static inline uint32_t leon3_get_cache_control_register(void)
return leon3_get_system_register(0x0);
}
+static inline bool leon3_data_cache_snooping_enabled(void)
+{
+ return leon3_get_cache_control_register() & LEON3_REG_CACHE_CTRL_DS;
+}
+
static inline uint32_t leon3_get_inst_cache_config_register(void)
{
return leon3_get_system_register(0x8);