@@ -709,6 +709,7 @@ extern void __weak sh4__flush_region_init(void);
*/
void __init sh4_cache_init(void)
{
+ unsigned int cache_enabled = !!(__raw_readl(CCR) & CCR_CACHE_ENABLE);
unsigned int wt_enabled = !!(__raw_readl(CCR) & CCR_CACHE_WT);
printk("PVR=%08x CVR=%08x PRR=%08x\n",
@@ -716,6 +717,17 @@ void __init sh4_cache_init(void)
ctrl_inl(CCN_CVR),
ctrl_inl(CCN_PRR));
+ /* disabled cache handling:
+ *
+ * __flush_dcache_segment_fn() implementations in this file make use
+ * of the movca instruction which bombs out if caches are disabled.
+ *
+ * no flushing is necessary in the disabled cache case so we can
+ * just keep the noop functions in local_flush_..() and __flush_..()
+ */
+ if (!cache_enabled)
+ return;
+
if (wt_enabled)
__flush_dcache_segment_fn = __flush_dcache_segment_writethrough;
else {