diff options
-rw-r--r-- | arch/blackfin/Kconfig | 12 | ||||
-rw-r--r-- | arch/blackfin/mach-common/arch_checks.c | 4 | ||||
-rw-r--r-- | arch/blackfin/mach-common/cache.S | 15 |
3 files changed, 20 insertions, 11 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index f66294b4f9d2..de4bd432b439 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -853,6 +853,18 @@ config CPLB_SWITCH_TAB_L1 | |||
853 | If enabled, the CPLB Switch Tables are linked | 853 | If enabled, the CPLB Switch Tables are linked |
854 | into L1 data memory. (less latency) | 854 | into L1 data memory. (less latency) |
855 | 855 | ||
856 | config CACHE_FLUSH_L1 | ||
857 | bool "Locate cache flush funcs in L1 Inst Memory" | ||
858 | default y | ||
859 | help | ||
860 | If enabled, the Blackfin cache flushing functions are linked | ||
861 | into L1 instruction memory. | ||
862 | |||
863 | Note that this might be required to address anomalies, but | ||
864 | these functions are pretty small, so it shouldn't be too bad. | ||
865 | If you are using a processor affected by an anomaly, the build | ||
866 | system will double check for you and prevent it. | ||
867 | |||
856 | config APP_STACK_L1 | 868 | config APP_STACK_L1 |
857 | bool "Support locating application stack in L1 Scratch Memory" | 869 | bool "Support locating application stack in L1 Scratch Memory" |
858 | default y | 870 | default y |
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c index 77d1c320d7e6..bceb98126c21 100644 --- a/arch/blackfin/mach-common/arch_checks.c +++ b/arch/blackfin/mach-common/arch_checks.c | |||
@@ -60,3 +60,7 @@ | |||
60 | (defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)) | 60 | (defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)) |
61 | # error "Anomaly 05000220 does not allow you to use Write Back cache with L2 or External Memory" | 61 | # error "Anomaly 05000220 does not allow you to use Write Back cache with L2 or External Memory" |
62 | #endif | 62 | #endif |
63 | |||
64 | #if ANOMALY_05000491 && !defined(CONFIG_CACHE_FLUSH_L1) | ||
65 | # error You need IFLUSH in L1 inst while Anomaly 05000491 applies | ||
66 | #endif | ||
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S index ea540318a228..790c767ca95a 100644 --- a/arch/blackfin/mach-common/cache.S +++ b/arch/blackfin/mach-common/cache.S | |||
@@ -11,7 +11,11 @@ | |||
11 | #include <asm/cache.h> | 11 | #include <asm/cache.h> |
12 | #include <asm/page.h> | 12 | #include <asm/page.h> |
13 | 13 | ||
14 | #ifdef CONFIG_CACHE_FLUSH_L1 | ||
15 | .section .l1.text | ||
16 | #else | ||
14 | .text | 17 | .text |
18 | #endif | ||
15 | 19 | ||
16 | /* 05000443 - IFLUSH cannot be last instruction in hardware loop */ | 20 | /* 05000443 - IFLUSH cannot be last instruction in hardware loop */ |
17 | #if ANOMALY_05000443 | 21 | #if ANOMALY_05000443 |
@@ -64,17 +68,6 @@ | |||
64 | 68 | ||
65 | /* Invalidate all instruction cache lines assocoiated with this memory area */ | 69 | /* Invalidate all instruction cache lines assocoiated with this memory area */ |
66 | ENTRY(_blackfin_icache_flush_range) | 70 | ENTRY(_blackfin_icache_flush_range) |
67 | /* | ||
68 | * Walkaround to avoid loading wrong instruction after invalidating icache | ||
69 | * and following sequence is met. | ||
70 | * | ||
71 | * 1) One instruction address is cached in the instruction cache. | ||
72 | * 2) This instruction in SDRAM is changed. | ||
73 | * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range(). | ||
74 | * 4) This instruction is executed again, but the old one is loaded. | ||
75 | */ | ||
76 | P0 = R0; | ||
77 | IFLUSH[P0]; | ||
78 | do_flush IFLUSH | 71 | do_flush IFLUSH |
79 | ENDPROC(_blackfin_icache_flush_range) | 72 | ENDPROC(_blackfin_icache_flush_range) |
80 | 73 | ||