]> git.sur5r.net Git - u-boot/blobdiff - post/lib_ppc/cpu.c
Merge 'next' branch
[u-boot] / post / lib_ppc / cpu.c
index 1f2ded2bf2642db034b0c3bc5b7057588eb80203..3793a60c3e0a1e53a4470091654bd184eac69f8d 100644 (file)
  * For more details refer to post/cpu/ *.c files.
  */
 
-#ifdef CONFIG_POST
-
 #include <watchdog.h>
 #include <post.h>
+#include <asm/mmu.h>
 
-#if CONFIG_POST & CFG_POST_CPU
+#if CONFIG_POST & CONFIG_SYS_POST_CPU
 
 extern int cpu_post_test_cmp (void);
 extern int cpu_post_test_cmpi (void);
@@ -59,6 +58,8 @@ extern int cpu_post_test_multi (void);
 extern int cpu_post_test_string (void);
 extern int cpu_post_test_complex (void);
 
+DECLARE_GLOBAL_DATA_PTR;
+
 ulong cpu_post_makecr (long v)
 {
        ulong cr = 0;
@@ -81,6 +82,10 @@ int cpu_post_test (int flags)
        WATCHDOG_RESET();
        if (ic)
                icache_disable ();
+#ifdef CONFIG_4xx_DCACHE
+       /* disable cache */
+       change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE);
+#endif
 
        if (ret == 0)
                ret = cpu_post_test_cmp ();
@@ -129,11 +134,14 @@ int cpu_post_test (int flags)
 
        if (ic)
                icache_enable ();
+#ifdef CONFIG_4xx_DCACHE
+       /* enable cache */
+       change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
+#endif
 
        WATCHDOG_RESET();
 
        return ret;
 }
 
-#endif /* CONFIG_POST & CFG_POST_CPU */
-#endif /* CONFIG_POST */
+#endif /* CONFIG_POST & CONFIG_SYS_POST_CPU */