diff options
author | Paul Walmsley <paul@pwsan.com> | 2009-05-12 19:27:09 -0400 |
---|---|---|
committer | paul <paul@twilight.(none)> | 2009-05-12 19:27:09 -0400 |
commit | d9295746c0ed3991bdec18c6a5890d71d88904b4 (patch) | |
tree | e14575b7a727cb7f2f7529024ebb6e0ead59b2a3 /arch/arm/plat-omap/sram.c | |
parent | 1d80cac0fe44fb87b2a3d35fddd7f534ea81cd90 (diff) |
OMAP3 SRAM: mark OCM RAM as Non-cacheable Normal memory
Mark the SRAM (aka OCM RAM) as Non-cacheable Normal memory[1]. This
is to prevent the ARM from evicting existing cache lines to SDRAM
while code is executing from the SRAM. Necessary since one of the
primary uses for the SRAM is to hold the code and data for the CORE
DPLL M2 divider reprogramming code, which must execute while the SDRC
is idled. If the ARM attempts to write cache lines back to the while
the SRAM code is running, the ARM will stall[2].
TI deals with this problem in the CDP kernel by marking the SRAM as
Strongly-ordered memory.
Tero Kristo <tero.kristo@nokia.com> caught a bug in an earlier version of
this patch - thanks Tero.
...
1. ARMv7 ARM (DDI 0406A) pp. A3-30, A3-31, B3-32.
2. Private communication with Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/sram.c')
-rw-r--r-- | arch/arm/plat-omap/sram.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index fa5297d643d3..38353386e91e 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -201,6 +201,15 @@ void __init omap_map_sram(void) | |||
201 | base = OMAP3_SRAM_PA; | 201 | base = OMAP3_SRAM_PA; |
202 | base = ROUND_DOWN(base, PAGE_SIZE); | 202 | base = ROUND_DOWN(base, PAGE_SIZE); |
203 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | 203 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); |
204 | |||
205 | /* | ||
206 | * SRAM must be marked as non-cached on OMAP3 since the | ||
207 | * CORE DPLL M2 divider change code (in SRAM) runs with the | ||
208 | * SDRAM controller disabled, and if it is marked cached, | ||
209 | * the ARM may attempt to write cache lines back to SDRAM | ||
210 | * which will cause the system to hang. | ||
211 | */ | ||
212 | omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; | ||
204 | } | 213 | } |
205 | 214 | ||
206 | omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ | 215 | omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ |