public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] Flush the date cache before disabling it.
@ 2012-01-09 18:25 Sughosh Ganu
  2012-01-09 18:41 ` Mike Frysinger
  2012-01-10 18:12 ` [U-Boot] [PATCH 1/2 V2] arm926: Flush the data " Sughosh Ganu
  0 siblings, 2 replies; 73+ messages in thread
From: Sughosh Ganu @ 2012-01-09 18:25 UTC (permalink / raw)
  To: u-boot

The current implementation invalidates the cache instead of flushing
it. This causes problems on platforms where the spl/u-boot is already
loaded to the RAM, with caches enabled by a first stage bootloader.

The V bit of the cp15's control register c1 is set to the value of
VINITHI on reset. Do not clear this bit by default, as there are SOC's
with no valid memory region at 0x0.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
---
 arch/arm/cpu/arm926ejs/start.S |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 6a09c02..112f708 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -355,17 +355,21 @@ _dynsym_start_ofs:
  */
 cpu_init_crit:
 	/*
-	 * flush v4 I/D caches
+	 * flush D cache before disabling it
 	 */
 	mov	r0, #0
-	mcr	p15, 0, r0, c7, c7, 0	/* flush v3/v4 cache */
+flush_dcache:
+	mrc	p15, 0, r15, c7, c10, 3
+	bne	flush_dcache
+
+	mov	r0, #0
 	mcr	p15, 0, r0, c8, c7, 0	/* flush v4 TLB */
 
 	/*
 	 * disable MMU stuff and caches
 	 */
 	mrc	p15, 0, r0, c1, c0, 0
-	bic	r0, r0, #0x00002300	/* clear bits 13, 9:8 (--V- --RS) */
+	bic	r0, r0, #0x00000300	/* clear bits 13, 9:8 ( --RS) */
 	bic	r0, r0, #0x00000087	/* clear bits 7, 2:0 (B--- -CAM) */
 	orr	r0, r0, #0x00000002	/* set bit 2 (A) Align */
 	orr	r0, r0, #0x00001000	/* set bit 12 (I) I-Cache */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2012-02-19  8:31 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-09 18:25 [U-Boot] [PATCH 1/2] Flush the date cache before disabling it Sughosh Ganu
2012-01-09 18:41 ` Mike Frysinger
2012-01-09 18:51   ` Sughosh Ganu
2012-01-10 18:12 ` [U-Boot] [PATCH 1/2 V2] arm926: Flush the data " Sughosh Ganu
2012-01-10 20:07   ` Marek Vasut
2012-01-11  6:20     ` Sughosh Ganu
2012-01-11 10:47       ` Marek Vasut
2012-01-11 12:11         ` Sughosh Ganu
2012-01-11 12:42           ` Marek Vasut
2012-01-11 13:31             ` Sughosh Ganu
2012-01-11 13:51               ` Marek Vasut
2012-01-11 13:52                 ` Marek Vasut
2012-01-11 14:50                   ` Sughosh Ganu
2012-01-11 15:01                     ` Marek Vasut
2012-01-11 15:09                       ` Sughosh Ganu
2012-01-11 18:50                         ` Marek Vasut
2012-01-11 21:07                           ` Christian Riesch
2012-01-11 22:13                             ` Marek Vasut
2012-01-12  5:56                               ` Christian Riesch
2012-01-12  6:29                                 ` Sughosh Ganu
2012-01-14  9:09                                   ` Albert ARIBAUD
2012-01-14 17:18                                     ` Christian Riesch
2012-01-12 12:03   ` Christian Riesch
2012-01-12 13:53     ` Sughosh Ganu
2012-01-12 14:04       ` Christian Riesch
2012-01-12 14:43         ` Sughosh Ganu
2012-01-14 17:20           ` Christian Riesch
2012-01-14 18:02             ` Sughosh Ganu
2012-01-13  8:06   ` Christian Riesch
2012-01-13  8:26     ` Sughosh Ganu
2012-01-13 14:41       ` Tom Rini
2012-01-13 17:23         ` Sughosh Ganu
2012-01-13 15:29       ` Heiko Schocher
2012-01-13 17:38         ` Sughosh Ganu
2012-01-13 18:19           ` Aneesh V
2012-01-14  7:45             ` Sughosh Ganu
2012-01-15  8:13           ` Heiko Schocher
2012-01-16 17:57           ` Tom Rini
2012-01-17  6:39             ` Heiko Schocher
2012-01-17  6:46             ` Sughosh Ganu
2012-01-17 15:27               ` Tom Rini
2012-01-19  6:53                 ` Sughosh Ganu
2012-01-19 10:17                   ` Aneesh V
2012-01-19 11:30                     ` Christian Riesch
2012-01-19 11:54                       ` Aneesh V
2012-01-20  7:28                         ` Christian Riesch
2012-01-20  8:52                           ` Aneesh V
2012-01-20  9:21                             ` Christian Riesch
2012-01-20 12:13                               ` Aneesh V
2012-01-20 12:48                                 ` Christian Riesch
2012-01-20 13:06                                   ` Aneesh V
2012-01-27 18:33                                     ` Tom Rini
2012-01-29 13:36                                       ` Christian Riesch
2012-01-30  6:39                                         ` Heiko Schocher
2012-01-30  8:10                                           ` Christian Riesch
2012-01-30  9:04                                             ` Sughosh Ganu
2012-01-30 10:38                                           ` Christian Riesch
2012-01-30  7:06                                         ` Sughosh Ganu
2012-01-30 17:03                                         ` Tom Rini
2012-01-31  4:09                                           ` Sughosh Ganu
2012-01-31 13:58                                           ` Christian Riesch
2012-01-20 11:56                           ` Tom Rini
2012-01-13 15:06     ` Heiko Schocher
2012-01-13 17:22       ` Sughosh Ganu
2012-01-14  7:49   ` [U-Boot] [PATCH 1/2 V3] " Sughosh Ganu
2012-01-14  9:02     ` Albert ARIBAUD
2012-01-14  9:21       ` Sughosh Ganu
2012-01-14 10:34         ` Albert ARIBAUD
2012-01-14 14:02     ` [U-Boot] [PATCH 1/2 V4] " Sughosh Ganu
2012-02-18 15:41       ` Albert ARIBAUD
2012-02-18 18:51         ` [U-Boot] [PATCH 1/2 V3] " Christian Riesch
2012-02-19  8:31           ` Albert ARIBAUD
2012-01-20  9:22   ` [U-Boot] [PATCH 1/2 V2] " James W.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox