aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2008-10-09 02:11:57 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-09 02:11:57 -0400
commitf099f39acf7575eff3dee3c562cec4e592876c33 (patch)
tree57beb28f62712f061789626ad15eabbe31cc5286
parent8606801b0361e0f8520892c9bf524df89c35e690 (diff)
Blackfin arch: Make L2 SRAM cacheable
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/Kconfig7
-rw-r--r--arch/blackfin/include/asm/cplb.h8
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinit.c10
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c4
4 files changed, 26 insertions, 3 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 554ac5827c1d..10c97efbd91f 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -772,6 +772,13 @@ config BFIN_WT
772 772
773endchoice 773endchoice
774 774
775config BFIN_L2_CACHEABLE
776 bool "Cache L2 SRAM"
777 depends on (BFIN_DCACHE || BFIN_ICACHE) && (BF54x || BF561)
778 default n
779 help
780 Select to make L2 SRAM cacheable in L1 data and instruction cache.
781
775config MPU 782config MPU
776 bool "Enable the memory protection unit (EXPERIMENTAL)" 783 bool "Enable the memory protection unit (EXPERIMENTAL)"
777 default n 784 default n
diff --git a/arch/blackfin/include/asm/cplb.h b/arch/blackfin/include/asm/cplb.h
index 05d6f05fb748..9e8b4035fcec 100644
--- a/arch/blackfin/include/asm/cplb.h
+++ b/arch/blackfin/include/asm/cplb.h
@@ -55,7 +55,13 @@
55#endif 55#endif
56 56
57#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON) 57#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON)
58#define L2_MEMORY (CPLB_COMMON) 58#ifdef CONFIG_BFIN_L2_CACHEABLE
59#define L2_IMEMORY (SDRAM_IGENERIC)
60#define L2_DMEMORY (SDRAM_DGENERIC)
61#else
62#define L2_IMEMORY (CPLB_COMMON)
63#define L2_DMEMORY (CPLB_COMMON)
64#endif
59#define SDRAM_DNON_CHBL (CPLB_COMMON) 65#define SDRAM_DNON_CHBL (CPLB_COMMON)
60#define SDRAM_EBIU (CPLB_COMMON) 66#define SDRAM_EBIU (CPLB_COMMON)
61#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY) 67#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
index d4257d0ad6a8..55af729f8495 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
@@ -83,8 +83,18 @@ void __init generate_cplb_tables(void)
83 dcplb_tbl[i_d].addr = L1_DATA_A_START; 83 dcplb_tbl[i_d].addr = L1_DATA_A_START;
84 dcplb_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; 84 dcplb_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
85#endif 85#endif
86#if L1_CODE_LENGTH > 0
86 icplb_tbl[i_i].addr = L1_CODE_START; 87 icplb_tbl[i_i].addr = L1_CODE_START;
87 icplb_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; 88 icplb_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
89#endif
90
91 /* Cover L2 memory */
92#if L2_LENGTH > 0
93 dcplb_tbl[i_d].addr = L2_START;
94 dcplb_tbl[i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB;
95 icplb_tbl[i_i].addr = L2_START;
96 icplb_tbl[i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB;
97#endif
88 98
89 first_mask_dcplb = i_d; 99 first_mask_dcplb = i_d;
90 first_switched_dcplb = i_d + (1 << page_mask_order); 100 first_switched_dcplb = i_d + (1 << page_mask_order);
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index 2c45c16c3520..301252e84441 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -168,8 +168,8 @@ static struct cplb_desc cplb_data[] = {
168 .end = L2_START + L2_LENGTH, 168 .end = L2_START + L2_LENGTH,
169 .psize = SIZE_1M, 169 .psize = SIZE_1M,
170 .attr = SWITCH_T | I_CPLB | D_CPLB, 170 .attr = SWITCH_T | I_CPLB | D_CPLB,
171 .i_conf = L2_MEMORY, 171 .i_conf = L2_IMEMORY,
172 .d_conf = L2_MEMORY, 172 .d_conf = L2_DMEMORY,
173 .valid = (L2_LENGTH > 0), 173 .valid = (L2_LENGTH > 0),
174 .name = "L2 Memory", 174 .name = "L2 Memory",
175 }, 175 },