Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[sfrench/cifs-2.6.git] / arch / arm / mm / init.c
index 749a5a6f61433ef733102231cb96b7ab8d905cc9..4920a206dce936fe9ab601bfd569f0133c3d757c 100644 (file)
@@ -239,6 +239,22 @@ static void __init arm_initrd_init(void)
 #endif
 }
 
+#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
+void check_cpu_icache_size(int cpuid)
+{
+       u32 size, ctr;
+
+       asm("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
+
+       size = 1 << ((ctr & 0xf) + 2);
+       if (cpuid != 0 && icache_size != size)
+               pr_info("CPU%u: detected I-Cache line size mismatch, workaround enabled\n",
+                       cpuid);
+       if (icache_size > size)
+               icache_size = size;
+}
+#endif
+
 void __init arm_memblock_init(const struct machine_desc *mdesc)
 {
        /* Register the kernel text, kernel data and initrd with memblock. */
@@ -447,12 +463,6 @@ static void __init free_highpages(void)
  */
 void __init mem_init(void)
 {
-#ifdef CONFIG_HAVE_TCM
-       /* These pointers are filled in on TCM detection */
-       extern u32 dtcm_end;
-       extern u32 itcm_end;
-#endif
-
        set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
 
        /* this will put all unused low memory onto the freelists */