public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 02/18] arm: Allow skipping of low-level init with I-cache on
Date: Thu,  5 May 2016 07:28:06 -0600	[thread overview]
Message-ID: <1462454902-6093-3-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1462454902-6093-1-git-send-email-sjg@chromium.org>

At present CONFIG_SKIP_LOWLEVEL_INIT prevents U-Boot from calling
lowlevel_init(). This means that the instruction cache is not enabled and
the board runs very slowly.

What is really needed in many cases is to skip the call to lowlevel_init()
but still perform CP15 init. Add an option to handle this.

Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-on: smartweb, corvus, taurus, axm
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 README                         | 5 +++++
 arch/arm/cpu/arm1136/start.S   | 2 ++
 arch/arm/cpu/arm920t/start.S   | 3 ++-
 arch/arm/cpu/arm926ejs/start.S | 2 ++
 arch/arm/cpu/arm946es/start.S  | 2 ++
 arch/arm/cpu/armv7/start.S     | 5 ++++-
 arch/arm/cpu/sa1100/start.S    | 2 ++
 7 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 88ff837..9ab07b5 100644
--- a/README
+++ b/README
@@ -4829,6 +4829,11 @@ Low Level (hardware related) configuration options:
 		other boot loader or by a debugger which performs
 		these initializations itself.
 
+- CONFIG_SKIP_LOWLEVEL_INIT_ONLY
+		[ARM926EJ-S only] This allows just the call to lowlevel_init()
+		to be skipped. The normal CPU15 init (such as enabling the
+		instruction cache) is still performed.
+
 - CONFIG_SPL_BUILD
 		Modifies the behaviour of start.S when compiling a loader
 		that is executed before the actual U-Boot. E.g. when
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 3ebdfdd..2f8fd6a 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -82,6 +82,7 @@ cpu_init_crit:
 	orr	r0, r0, #0x00001000	@ set bit 12 (I) I-Cache
 	mcr	p15, 0, r0, c1, c0, 0
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 	/*
 	 * Jump to board specific initialization... The Mask ROM will have already initialized
 	 * basic memory.  Go here to bump up clock rate and handle wake up conditions.
@@ -89,5 +90,6 @@ cpu_init_crit:
 	mov	ip, lr		/* persevere link reg across call */
 	bl	lowlevel_init	/* go setup pll,mux,memory */
 	mov	lr, ip		/* restore link */
+#endif
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 69cabeb..3ada6d0 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -135,6 +135,7 @@ cpu_init_crit:
 	orr	r0, r0, #0x00001000	@ set bit 12 (I) I-Cache
 	mcr	p15, 0, r0, c1, c0, 0
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 	/*
 	 * before relocating, we have to setup RAM timing
 	 * because memory timing is board-dependend, you will
@@ -143,7 +144,7 @@ cpu_init_crit:
 	mov	ip, lr
 
 	bl	lowlevel_init
-
 	mov	lr, ip
+#endif
 	mov	pc, lr
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index f05113d..959d1ed 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -101,11 +101,13 @@ flush_dcache:
 #endif
 	mcr	p15, 0, r0, c1, c0, 0
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 	/*
 	 * Go setup Memory and board specific bits prior to relocation.
 	 */
 	mov	ip, lr		/* perserve link reg across call */
 	bl	lowlevel_init	/* go setup pll,mux,memory */
 	mov	lr, ip		/* restore link */
+#endif
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index 214cd8c..51053c3 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -90,11 +90,13 @@ cpu_init_crit:
 	orr	r0, r0, #0x00001000	/* set bit 12 (I) I-Cache */
 	mcr	p15, 0, r0, c1, c0, 0
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 	/*
 	 * Go setup Memory and board specific bits prior to relocation.
 	 */
 	mov	ip, lr		/* perserve link reg across call */
 	bl	lowlevel_init	/* go setup memory */
 	mov	lr, ip		/* restore link */
+#endif
 	mov	pc, lr		/* back to my caller */
 #endif
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index b180944..691e5d3 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -66,8 +66,10 @@ save_boot_params_ret:
 	/* the mask ROM code should have PLL and others stable */
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 	bl	cpu_init_cp15
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 	bl	cpu_init_crit
 #endif
+#endif
 
 	bl	_main
 
@@ -250,7 +252,8 @@ skip_errata_621766:
 	mov	pc, r5			@ back to my caller
 ENDPROC(cpu_init_cp15)
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
 /*************************************************************************
  *
  * CPU_init_critical registers
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index 408b70d..f5318c9 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -96,6 +96,7 @@ cpu_init_crit:
 	ldr	r1, cpuspeed
 	str	r1, [r0, #PPCR]
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 	/*
 	 * before relocating, we have to setup RAM timing
 	 * because memory timing is board-dependend, you will
@@ -104,6 +105,7 @@ cpu_init_crit:
 	mov	ip,	lr
 	bl	lowlevel_init
 	mov	lr,	ip
+#endif
 
 	/*
 	 * disable MMU stuff and enable I-cache
-- 
2.8.0.rc3.226.g39d4020

  parent reply	other threads:[~2016-05-05 13:28 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 13:28 [U-Boot] [PATCH v2 00/18] at91: Convert Ethernet and LCD to driver model Simon Glass
2016-05-05 13:28 ` [U-Boot] [PATCH v2 01/18] at91: Add support for the AT91 slow clock controller Simon Glass
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` Simon Glass [this message]
2016-05-05 14:07   ` [U-Boot] [PATCH v2 02/18] arm: Allow skipping of low-level init with I-cache on Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 03/18] bootm: Align cache flush end address correctly Simon Glass
2016-05-05 14:19   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 04/18] net: Handle an empty bootp extension section Simon Glass
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 05/18] net: macb: Prepare for driver-model conversion Simon Glass
2016-05-05 18:31   ` Joe Hershberger
2016-05-28 22:32   ` Andreas Bießmann
2016-06-20  1:30     ` Simon Glass
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 06/18] net: macb: Flush correct cache portion when sending Simon Glass
2016-05-28 12:35   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 07/18] net: macb: Convert to driver model Simon Glass
2016-05-28 22:43   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot,v2,07/18] " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 08/18] arm: at91: dts: Bring in device tree file for AT91SAM9G45 Simon Glass
2016-05-28 22:45   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 09/18] arm: at91: Add a header file for the real-time clock Simon Glass
2016-05-28 12:49   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 10/18] at91: Correct NAND ECC register access Simon Glass
2016-05-28 21:06   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 11/18] at91: nand: Set up the ECC strength correctly Simon Glass
2016-05-28 21:12   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 12/18] mtd: nand: Drop a blank line in nand_wait() Simon Glass
2016-05-28 12:53   ` Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 13/18] at91: Add driver-model GPIO devices for AT91SAM9G45 Simon Glass
2016-05-28 22:46   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 14/18] at91: mtd: nand: Add dev_warn() to correct build error in driver Simon Glass
2016-05-28 23:04   ` Andreas Bießmann
2016-06-04 20:27   ` [U-Boot] [PATCH] linux/compat.h: add dev_warn() Andreas Bießmann
2016-06-10  0:35     ` Simon Glass
2016-06-12 22:01     ` [U-Boot] " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 15/18] at91: video: Prepare for driver-model conversion Simon Glass
2016-06-04 20:08   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 16/18] at91: video: Support driver-model for the LCD driver Simon Glass
2016-06-04 20:11   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 17/18] fdt: Correct return value in fdtdec_decode_display_timing() Simon Glass
2016-06-04 20:14   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-05-05 13:28 ` [U-Boot] [PATCH v2 18/18] arm: at91: Add support for gurnard Simon Glass
2016-06-04 20:31   ` Andreas Bießmann
2016-06-12 22:01   ` [U-Boot] [U-Boot,v2,18/18] " Andreas Bießmann

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=1462454902-6093-3-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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