diff options
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r-- | arch/blackfin/mach-common/arch_checks.c | 16 | ||||
-rw-r--r-- | arch/blackfin/mach-common/cache.S | 15 | ||||
-rw-r--r-- | arch/blackfin/mach-common/dpmc_modes.S | 24 | ||||
-rw-r--r-- | arch/blackfin/mach-common/pm.c | 17 |
4 files changed, 22 insertions, 50 deletions
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c index f2ca211a76a0..bceb98126c21 100644 --- a/arch/blackfin/mach-common/arch_checks.c +++ b/arch/blackfin/mach-common/arch_checks.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Do some checking to make sure things are OK | 2 | * Do some checking to make sure things are OK |
3 | * | 3 | * |
4 | * Copyright 2007-2009 Analog Devices Inc. | 4 | * Copyright 2007-2010 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -47,18 +47,20 @@ | |||
47 | # error "The kernel load address is too high; keep it below 10meg for safety" | 47 | # error "The kernel load address is too high; keep it below 10meg for safety" |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #if ANOMALY_05000263 && defined(CONFIG_MPU) | ||
51 | # error the MPU will not function safely while Anomaly 05000263 applies | ||
52 | #endif | ||
53 | |||
50 | #if ANOMALY_05000448 | 54 | #if ANOMALY_05000448 |
51 | # error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes. | 55 | # error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes. |
52 | #endif | 56 | #endif |
53 | 57 | ||
54 | /* if 220 exists, can not set External Memory WB and L2 not_cached, either External Memory not_cached and L2 WB */ | 58 | /* if 220 exists, can not set External Memory WB and L2 not_cached, either External Memory not_cached and L2 WB */ |
55 | #if ANOMALY_05000220 && \ | 59 | #if ANOMALY_05000220 && \ |
56 | ((defined(CONFIG_BFIN_EXTMEM_WRITEBACK) && !defined(CONFIG_BFIN_L2_DCACHEABLE)) || \ | 60 | (defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)) |
57 | (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK))) | 61 | # error "Anomaly 05000220 does not allow you to use Write Back cache with L2 or External Memory" |
58 | # error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB. | ||
59 | #endif | 62 | #endif |
60 | 63 | ||
61 | #if ANOMALY_05000475 && \ | 64 | #if ANOMALY_05000491 && !defined(CONFIG_CACHE_FLUSH_L1) |
62 | (defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)) | 65 | # error You need IFLUSH in L1 inst while Anomaly 05000491 applies |
63 | # error "Anomaly 475 does not allow you to use Write Back cache with L2 or External Memory" | ||
64 | #endif | 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 | ||
diff --git a/arch/blackfin/mach-common/dpmc_modes.S b/arch/blackfin/mach-common/dpmc_modes.S index b03716896051..5969d86836a5 100644 --- a/arch/blackfin/mach-common/dpmc_modes.S +++ b/arch/blackfin/mach-common/dpmc_modes.S | |||
@@ -17,9 +17,6 @@ ENTRY(_sleep_mode) | |||
17 | 17 | ||
18 | call _set_sic_iwr; | 18 | call _set_sic_iwr; |
19 | 19 | ||
20 | R0 = 0xFFFF (Z); | ||
21 | call _set_rtc_istat; | ||
22 | |||
23 | P0.H = hi(PLL_CTL); | 20 | P0.H = hi(PLL_CTL); |
24 | P0.L = lo(PLL_CTL); | 21 | P0.L = lo(PLL_CTL); |
25 | R1 = W[P0](z); | 22 | R1 = W[P0](z); |
@@ -65,9 +62,6 @@ ENTRY(_hibernate_mode) | |||
65 | call _set_dram_srfs; | 62 | call _set_dram_srfs; |
66 | SSYNC; | 63 | SSYNC; |
67 | 64 | ||
68 | R0 = 0xFFFF (Z); | ||
69 | call _set_rtc_istat; | ||
70 | |||
71 | P0.H = hi(VR_CTL); | 65 | P0.H = hi(VR_CTL); |
72 | P0.L = lo(VR_CTL); | 66 | P0.L = lo(VR_CTL); |
73 | 67 | ||
@@ -95,9 +89,6 @@ ENTRY(_sleep_deeper) | |||
95 | call _set_sic_iwr; | 89 | call _set_sic_iwr; |
96 | call _set_dram_srfs; /* Set SDRAM Self Refresh */ | 90 | call _set_dram_srfs; /* Set SDRAM Self Refresh */ |
97 | 91 | ||
98 | /* Clear all the interrupts,bits sticky */ | ||
99 | R0 = 0xFFFF (Z); | ||
100 | call _set_rtc_istat; | ||
101 | P0.H = hi(PLL_DIV); | 92 | P0.H = hi(PLL_DIV); |
102 | P0.L = lo(PLL_DIV); | 93 | P0.L = lo(PLL_DIV); |
103 | R6 = W[P0](z); | 94 | R6 = W[P0](z); |
@@ -269,21 +260,6 @@ ENTRY(_set_sic_iwr) | |||
269 | RTS; | 260 | RTS; |
270 | ENDPROC(_set_sic_iwr) | 261 | ENDPROC(_set_sic_iwr) |
271 | 262 | ||
272 | ENTRY(_set_rtc_istat) | ||
273 | #ifndef CONFIG_BF561 | ||
274 | P0.H = hi(RTC_ISTAT); | ||
275 | P0.L = lo(RTC_ISTAT); | ||
276 | w[P0] = R0.L; | ||
277 | SSYNC; | ||
278 | #elif (ANOMALY_05000371) | ||
279 | nop; | ||
280 | nop; | ||
281 | nop; | ||
282 | nop; | ||
283 | #endif | ||
284 | RTS; | ||
285 | ENDPROC(_set_rtc_istat) | ||
286 | |||
287 | ENTRY(_test_pll_locked) | 263 | ENTRY(_test_pll_locked) |
288 | P0.H = hi(PLL_STAT); | 264 | P0.H = hi(PLL_STAT); |
289 | P0.L = lo(PLL_STAT); | 265 | P0.L = lo(PLL_STAT); |
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index ea7f95f6bb4c..09c1fb410748 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c | |||
@@ -61,10 +61,11 @@ void bfin_pm_suspend_standby_enter(void) | |||
61 | 61 | ||
62 | int bf53x_suspend_l1_mem(unsigned char *memptr) | 62 | int bf53x_suspend_l1_mem(unsigned char *memptr) |
63 | { | 63 | { |
64 | dma_memcpy(memptr, (const void *) L1_CODE_START, L1_CODE_LENGTH); | 64 | dma_memcpy_nocache(memptr, (const void *) L1_CODE_START, |
65 | dma_memcpy(memptr + L1_CODE_LENGTH, (const void *) L1_DATA_A_START, | 65 | L1_CODE_LENGTH); |
66 | L1_DATA_A_LENGTH); | 66 | dma_memcpy_nocache(memptr + L1_CODE_LENGTH, |
67 | dma_memcpy(memptr + L1_CODE_LENGTH + L1_DATA_A_LENGTH, | 67 | (const void *) L1_DATA_A_START, L1_DATA_A_LENGTH); |
68 | dma_memcpy_nocache(memptr + L1_CODE_LENGTH + L1_DATA_A_LENGTH, | ||
68 | (const void *) L1_DATA_B_START, L1_DATA_B_LENGTH); | 69 | (const void *) L1_DATA_B_START, L1_DATA_B_LENGTH); |
69 | memcpy(memptr + L1_CODE_LENGTH + L1_DATA_A_LENGTH + | 70 | memcpy(memptr + L1_CODE_LENGTH + L1_DATA_A_LENGTH + |
70 | L1_DATA_B_LENGTH, (const void *) L1_SCRATCH_START, | 71 | L1_DATA_B_LENGTH, (const void *) L1_SCRATCH_START, |
@@ -75,10 +76,10 @@ int bf53x_suspend_l1_mem(unsigned char *memptr) | |||
75 | 76 | ||
76 | int bf53x_resume_l1_mem(unsigned char *memptr) | 77 | int bf53x_resume_l1_mem(unsigned char *memptr) |
77 | { | 78 | { |
78 | dma_memcpy((void *) L1_CODE_START, memptr, L1_CODE_LENGTH); | 79 | dma_memcpy_nocache((void *) L1_CODE_START, memptr, L1_CODE_LENGTH); |
79 | dma_memcpy((void *) L1_DATA_A_START, memptr + L1_CODE_LENGTH, | 80 | dma_memcpy_nocache((void *) L1_DATA_A_START, memptr + L1_CODE_LENGTH, |
80 | L1_DATA_A_LENGTH); | 81 | L1_DATA_A_LENGTH); |
81 | dma_memcpy((void *) L1_DATA_B_START, memptr + L1_CODE_LENGTH + | 82 | dma_memcpy_nocache((void *) L1_DATA_B_START, memptr + L1_CODE_LENGTH + |
82 | L1_DATA_A_LENGTH, L1_DATA_B_LENGTH); | 83 | L1_DATA_A_LENGTH, L1_DATA_B_LENGTH); |
83 | memcpy((void *) L1_SCRATCH_START, memptr + L1_CODE_LENGTH + | 84 | memcpy((void *) L1_SCRATCH_START, memptr + L1_CODE_LENGTH + |
84 | L1_DATA_A_LENGTH + L1_DATA_B_LENGTH, L1_SCRATCH_LENGTH); | 85 | L1_DATA_A_LENGTH + L1_DATA_B_LENGTH, L1_SCRATCH_LENGTH); |
@@ -167,7 +168,7 @@ int bfin_pm_suspend_mem_enter(void) | |||
167 | _disable_icplb(); | 168 | _disable_icplb(); |
168 | bf53x_suspend_l1_mem(memptr); | 169 | bf53x_suspend_l1_mem(memptr); |
169 | 170 | ||
170 | do_hibernate(wakeup | vr_wakeup); /* Goodbye */ | 171 | do_hibernate(wakeup | vr_wakeup); /* See you later! */ |
171 | 172 | ||
172 | bf53x_resume_l1_mem(memptr); | 173 | bf53x_resume_l1_mem(memptr); |
173 | 174 | ||