Blackfin arch: fix bug - Fail to boot jffs2 kernel for BF561 with SMP patch
[pandora-kernel.git] / arch / blackfin / kernel / cplb-nompu / cplbinit.c
index 728f708..2debc90 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/module.h>
 
 #include <asm/blackfin.h>
+#include <asm/cacheflush.h>
 #include <asm/cplb.h>
 #include <asm/cplbinit.h>
 
@@ -168,8 +169,8 @@ static struct cplb_desc cplb_data[] = {
                .end = L2_START + L2_LENGTH,
                .psize = SIZE_1M,
                .attr = SWITCH_T | I_CPLB | D_CPLB,
-               .i_conf = L2_MEMORY,
-               .d_conf = L2_MEMORY,
+               .i_conf = L2_IMEMORY,
+               .d_conf = L2_DMEMORY,
                .valid = (L2_LENGTH > 0),
                .name = "L2 Memory",
        },
@@ -187,10 +188,11 @@ static struct cplb_desc cplb_data[] = {
 
 static u16 __init lock_kernel_check(u32 start, u32 end)
 {
-       if ((end   <= (u32) _end && end   >= (u32)_stext) ||
-           (start <= (u32) _end && start >= (u32)_stext))
-               return IN_KERNEL;
-       return 0;
+       if (start >= (u32)_end || end <= (u32)_stext)
+               return 0;
+
+       /* This cplb block overlapped with kernel area. */
+       return IN_KERNEL;
 }
 
 static unsigned short __init
@@ -308,7 +310,7 @@ __fill_data_cplbtab(struct cplb_tab *t, int i, u32 a_start, u32 a_end)
        }
 }
 
-void __init generate_cpl_tables(void)
+void __init generate_cplb_tables(void)
 {
 
        u16 i, j, process;