mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 01/11] ARM: invalidate caches thoroughly
Date: Mon, 16 Sep 2013 10:48:10 +0200	[thread overview]
Message-ID: <1379321300-8085-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1379321300-8085-1-git-send-email-s.hauer@pengutronix.de>

The data caches should be invalided once during startup. This should
also be done when we do not have the MMU enabled in barebox because
the Kernel does not invalidate the caches during start.

To make this sure this patch enables the arm_early_mmu_cache_invalidate
function even if MMU support is disabled. Additionally this patch adds
calls to arm_early_mmu_cache_invalidate in start.c and uncompress.c.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/Makefile        |  6 +++---
 arch/arm/cpu/start.c         |  4 +++-
 arch/arm/cpu/uncompress.c    |  2 ++
 arch/arm/include/asm/cache.h | 10 ----------
 4 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
index c3635a1..aba201b 100644
--- a/arch/arm/cpu/Makefile
+++ b/arch/arm/cpu/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o
 obj-$(CONFIG_CMD_ARM_MMUINFO) += mmuinfo.o
 obj-$(CONFIG_OFDEVICE) += dtb.o
 obj-$(CONFIG_MMU) += mmu.o cache.o mmu-early.o
-pbl-$(CONFIG_MMU) += cache.o mmu-early.o
+pbl-$(CONFIG_MMU) += mmu-early.o
 obj-$(CONFIG_CPU_32v4T) += cache-armv4.o
 pbl-$(CONFIG_CPU_32v4T) += cache-armv4.o
 obj-$(CONFIG_CPU_32v5) += cache-armv5.o
@@ -25,7 +25,7 @@ pbl-y += setupc.o
 pbl-$(CONFIG_PBL_SINGLE_IMAGE) += start-pbl.o
 pbl-$(CONFIG_PBL_MULTI_IMAGES) += start-images.o uncompress.o
 
-obj-y += common.o
-pbl-y += common.o
+obj-y += common.o cache.o
+pbl-y += common.o cache.o
 
 lwl-y += lowlevel.o
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 1f397ec..f8d343f 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -70,8 +70,10 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 		endmem &= ~0x3fff;
 		endmem -= SZ_16K; /* ttb */
 
-		if (!IS_ENABLED(CONFIG_PBL_IMAGE))
+		if (!IS_ENABLED(CONFIG_PBL_IMAGE)) {
+			arm_early_mmu_cache_invalidate();
 			mmu_early_enable(membase, memsize, endmem);
+		}
 	}
 
 	/*
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c
index b401f8e..b0819c7 100644
--- a/arch/arm/cpu/uncompress.c
+++ b/arch/arm/cpu/uncompress.c
@@ -54,6 +54,8 @@ static void noinline uncompress(uint32_t membase,
 	uint32_t *ptr;
 	void *pg_start;
 
+	arm_early_mmu_cache_invalidate();
+
 	endmem -= STACK_SIZE; /* stack */
 
 	if (IS_ENABLED(CONFIG_PBL_RELOCATABLE))
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index f5f8bf3..2f6eab0 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -8,17 +8,7 @@ static inline void flush_icache(void)
 
 int arm_set_cache_functions(void);
 
-#ifdef CONFIG_MMU
 void arm_early_mmu_cache_flush(void);
 void arm_early_mmu_cache_invalidate(void);
-#else
-static inline void arm_early_mmu_cache_flush(void)
-{
-}
-
-static inline void arm_early_mmu_cache_invalidate(void)
-{
-}
-#endif
 
 #endif
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-09-16  8:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  8:48 [PATCH] Altera SoCFPGA support Sascha Hauer
2013-09-16  8:48 ` Sascha Hauer [this message]
2013-09-16  8:48 ` [PATCH 02/11] clk: of: introduce of_clk_src_simple_get Sascha Hauer
2013-09-16  8:48 ` [PATCH 03/11] of: partition: Check for valid partition name Sascha Hauer
2013-09-16  8:48 ` [PATCH 04/11] serial: ns16550: Add compatible entry for snps, dw-apb-uart Sascha Hauer
2013-09-16  8:48 ` [PATCH 05/11] clk: Add Altera SoCFPGA clk support Sascha Hauer
2013-09-16  8:48 ` [PATCH 06/11] scripts: Add Altera SoCFPGA mkimage support Sascha Hauer
2013-09-16  8:48 ` [PATCH 07/11] ARM: Add Altera SoCFPGA support Sascha Hauer
2013-09-17 14:46   ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-18  8:06     ` Sascha Hauer
2013-09-16  8:48 ` [PATCH 08/11] ARM: socfpga: Add FPGA programming command Sascha Hauer
2013-09-16 10:40   ` Steffen Trumtrar
2013-09-16 11:09     ` Sascha Hauer
2013-09-16 11:43       ` Steffen Trumtrar
2013-09-17 14:51   ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-16  8:48 ` [PATCH 09/11] ARM: SoCFPGA: Add Terasic SoCkit board support Sascha Hauer
2013-09-17 14:49   ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-16  8:48 ` [PATCH 10/11] ARM: SoCFPGA: Add EBV SoCrates " Sascha Hauer
2013-09-16  8:48 ` [PATCH 11/11] ARM: Altera SoCFPGA: Add defconfig files Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379321300-8085-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox