aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/include/asm/cplb.h
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2009-06-16 05:48:33 -0400
committerMike Frysinger <vapier@gentoo.org>2009-06-22 21:15:59 -0400
commit41ba653f24a39a0e6a4afe9b2763a95a57e042c2 (patch)
tree43eb086046d4eef764878e04512ddd215ca8845b /arch/blackfin/include/asm/cplb.h
parent7c039a90f02c3fdcab8d3ca170c05ad37014189e (diff)
Blackfin: decouple unrelated cache settings to get exact behavior
The current cache options don't really represent the hardware features. They end up setting different aspects of the hardware so that the end result is to turn on/off the cache. Unfortunately, when we hit cache problems with the hardware, it's difficult to test different settings to root cause the problem. The current settings also don't cleanly allow for different caching behaviors with different regions of memory. So split the configure options such that they properly reflect the settings that are applied to the hardware. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/include/asm/cplb.h')
-rw-r--r--arch/blackfin/include/asm/cplb.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/blackfin/include/asm/cplb.h b/arch/blackfin/include/asm/cplb.h
index a75a6a9f0949..c5dacf8f8cf9 100644
--- a/arch/blackfin/include/asm/cplb.h
+++ b/arch/blackfin/include/asm/cplb.h
@@ -37,8 +37,6 @@
37#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK) 37#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
38#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID) 38#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
39 39
40/*Use the menuconfig cache policy here - CONFIG_BFIN_WT/CONFIG_BFIN_WB*/
41
42#if ANOMALY_05000158 40#if ANOMALY_05000158
43#define ANOMALY_05000158_WORKAROUND 0x200 41#define ANOMALY_05000158_WORKAROUND 0x200
44#else 42#else
@@ -47,10 +45,12 @@
47 45
48#define CPLB_COMMON (CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND) 46#define CPLB_COMMON (CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
49 47
50#ifdef CONFIG_BFIN_WB /*Write Back Policy */ 48#ifdef CONFIG_BFIN_EXTMEM_WRITEBACK
51#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_COMMON) 49#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_COMMON)
52#else /*Write Through */ 50#elif defined(CONFIG_BFIN_EXTMEM_WRITETHROUGH)
53#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON) 51#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON)
52#else
53#define SDRAM_DGENERIC (CPLB_COMMON)
54#endif 54#endif
55 55
56#define SDRAM_DNON_CHBL (CPLB_COMMON) 56#define SDRAM_DNON_CHBL (CPLB_COMMON)
@@ -61,21 +61,23 @@
61 61
62#ifdef CONFIG_SMP 62#ifdef CONFIG_SMP
63#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB) 63#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB)
64#define L2_IMEMORY (CPLB_COMMON) 64#define L2_IMEMORY (CPLB_COMMON | PAGE_SIZE_1MB)
65#define L2_DMEMORY (CPLB_LOCK | CPLB_COMMON) 65#define L2_DMEMORY (CPLB_LOCK | CPLB_COMMON | PAGE_SIZE_1MB)
66 66
67#else 67#else
68#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB) 68#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB)
69#define L2_IMEMORY (SDRAM_IGENERIC) 69# if defined(CONFIG_BFIN_L2_ICACHEABLE)
70 70# define L2_IMEMORY (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | PAGE_SIZE_1MB)
71# if defined(CONFIG_BFIN_L2_WB) 71# else
72# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_COMMON) 72# define L2_IMEMORY ( CPLB_USER_RD | CPLB_VALID | PAGE_SIZE_1MB)
73# elif defined(CONFIG_BFIN_L2_WT) 73# endif
74# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON) 74
75# elif defined(CONFIG_BFIN_L2_NOT_CACHED) 75# if defined(CONFIG_BFIN_L2_WRITEBACK)
76# define L2_DMEMORY (CPLB_COMMON) 76# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_COMMON | PAGE_SIZE_1MB)
77# elif defined(CONFIG_BFIN_L2_WRITETHROUGH)
78# define L2_DMEMORY (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON | PAGE_SIZE_1MB)
77# else 79# else
78# define L2_DMEMORY (0) 80# define L2_DMEMORY (CPLB_COMMON | PAGE_SIZE_1MB)
79# endif 81# endif
80#endif /* CONFIG_SMP */ 82#endif /* CONFIG_SMP */
81 83