aboutsummaryrefslogtreecommitdiffstats
path: root/src/sam4e8e/sam4_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sam4e8e/sam4_cache.c')
-rw-r--r--src/sam4e8e/sam4_cache.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sam4e8e/sam4_cache.c b/src/sam4e8e/sam4_cache.c
new file mode 100644
index 00000000..75459660
--- /dev/null
+++ b/src/sam4e8e/sam4_cache.c
@@ -0,0 +1,16 @@
+// SAM4 cache enable
+//
+// Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
+//
+// This file may be distributed under the terms of the GNU GPLv3 license.
+
+#include "sam4e.h" // CMCC
+#include "sched.h" // DECL_INIT
+
+void
+sam4_cache_init(void)
+{
+ if (!(CMCC->CMCC_SR & CMCC_SR_CSTS))
+ CMCC->CMCC_CTRL = CMCC_CTRL_CEN;
+}
+DECL_INIT(sam4_cache_init);