|
@@ -175,3 +175,23 @@ void invalidate_dcache_range(ulong start_addr, ulong stop)
|
|
|
/* ensure cache ops complete before any further memory accesses */
|
|
|
sync();
|
|
|
}
|
|
|
+
|
|
|
+int dcache_status(void)
|
|
|
+{
|
|
|
+ unsigned int cca = read_c0_config() & CONF_CM_CMASK;
|
|
|
+ return cca != CONF_CM_UNCACHED;
|
|
|
+}
|
|
|
+
|
|
|
+void dcache_enable(void)
|
|
|
+{
|
|
|
+ puts("Not supported!\n");
|
|
|
+}
|
|
|
+
|
|
|
+void dcache_disable(void)
|
|
|
+{
|
|
|
+ /* change CCA to uncached */
|
|
|
+ change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
|
|
|
+
|
|
|
+ /* ensure the pipeline doesn't contain now-invalid instructions */
|
|
|
+ instruction_hazard_barrier();
|
|
|
+}
|