All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Lilja <lilja.magnus@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 1/6] ARM1136: Introduce CONFIG_PRELOADER macro.
Date: Sat, 13 Jun 2009 20:50:00 +0200	[thread overview]
Message-ID: <4a62b27ae616d894b9302d1b73a3e4a71bbdfbf1.1244918138.git.lilja.magnus@gmail.com> (raw)
In-Reply-To: <cover.1244918138.git.lilja.magnus@gmail.com>

Currently CONFIG_ONENAND_IPL is used in a number of #ifdef's
in start.S. In preparation for adding support for NAND SPL
the macro CONFIG_PRELOADER is introducted and replaces the
CONFIG_ONENAND_IPL in start.S.

Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
---

NOTE: This patch applies to u-boot/next but not u-boot-arm/next since
the OBJCFLAGS spelling error is corrected in u-boot/next. Atleast
StGit had problems applying the patch to u-boot-arm/next, don't know
what git thinks about.

 README                             |    5 +++++
 cpu/arm1136/start.S                |   24 ++++++++++++------------
 onenand_ipl/board/apollon/Makefile |    4 ++--
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/README b/README
index 561c100..0e84337 100644
--- a/README
+++ b/README
@@ -2702,6 +2702,11 @@ Low Level (hardware related) configuration options:
 		some other boot loader or by a debugger which
 		performs these initializations itself.
 
+- CONFIG_PRELOADER
+
+		Modifies the behaviour of start.S when compiling a loader
+		that is executed before the actual U-Boot. E.g. when
+		compiling a NAND SPL.
 
 Building the Software:
 ======================
diff --git a/cpu/arm1136/start.S b/cpu/arm1136/start.S
index 999b184..28cb5fd 100644
--- a/cpu/arm1136/start.S
+++ b/cpu/arm1136/start.S
@@ -32,7 +32,7 @@
 #include <version.h>
 .globl _start
 _start: b	reset
-#ifdef CONFIG_ONENAND_IPL
+#ifdef CONFIG_PRELOADER
 	ldr	pc, _hang
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -67,7 +67,7 @@ _not_used:		.word not_used
 _irq:			.word irq
 _fiq:			.word fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
-#endif	/* CONFIG_ONENAND_IPL */
+#endif	/* CONFIG_PRELOADER */
 .global _end_vect
 _end_vect:
 
@@ -156,9 +156,9 @@ relocate:				/* relocate U-Boot to RAM	    */
 	adr	r0, _start		/* r0 <- current position of code   */
 	ldr	r1, _TEXT_BASE		/* test if we run from flash or RAM */
 	cmp	r0, r1			/* don't reloc during debug	    */
-#ifndef CONFIG_ONENAND_IPL
+#ifndef CONFIG_PRELOADER
 	beq	stack_setup
-#endif	/* CONFIG_ONENAND_IPL */
+#endif	/* CONFIG_PRELOADER */
 
 	ldr	r2, _armboot_start
 	ldr	r3, _bss_start
@@ -175,7 +175,7 @@ copy_loop:
 	/* Set up the stack						    */
 stack_setup:
 	ldr	r0, _TEXT_BASE		/* upper 128 KiB: relocated uboot   */
-#ifdef CONFIG_ONENAND_IPL
+#ifdef CONFIG_PRELOADER
 	sub	sp, r0, #128		/* leave 32 words for abort-stack   */
 #else
 	sub	r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area			    */
@@ -184,14 +184,14 @@ stack_setup:
 	sub	r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
 #endif
 	sub	sp, r0, #12		/* leave 3 words for abort-stack    */
-#endif	/* CONFIG_ONENAND_IPL */
+#endif	/* CONFIG_PRELOADER */
 
 clear_bss:
 	ldr	r0, _bss_start		/* find start of bss segment	    */
 	ldr	r1, _bss_end		/* stop here			    */
 	mov	r2, #0x00000000		/* clear			    */
 
-#ifndef CONFIG_ONENAND_IPL
+#ifndef CONFIG_PRELOADER
 clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
@@ -244,7 +244,7 @@ cpu_init_crit:
 	mov	lr, ip		/* restore link */
 	mov	pc, lr		/* back to my caller */
 
-#ifndef CONFIG_ONENAND_IPL
+#ifndef CONFIG_PRELOADER
 /*
  *************************************************************************
  *
@@ -357,17 +357,17 @@ cpu_init_crit:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_ONENAND_IPL */
+#endif	/* CONFIG_PRELOADER */
 
 /*
  * exception handlers
  */
-#ifdef CONFIG_ONENAND_IPL
+#ifdef CONFIG_PRELOADER
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
-#else	/* !CONFIG_ONENAND IPL */
+#else	/* !CONFIG_PRELOADER */
 	.align	5
 undefined_instruction:
 	get_bad_stack
@@ -435,4 +435,4 @@ fiq:
 arm1136_cache_flush:
 		mcr	p15, 0, r1, c7, c5, 0	@ invalidate I cache
 		mov	pc, lr			@ back to caller
-#endif	/* CONFIG_ONENAND_IPL */
+#endif	/* CONFIG_PRELOADER */
diff --git a/onenand_ipl/board/apollon/Makefile b/onenand_ipl/board/apollon/Makefile
index f6c36ec..49a8e90 100644
--- a/onenand_ipl/board/apollon/Makefile
+++ b/onenand_ipl/board/apollon/Makefile
@@ -4,8 +4,8 @@ include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk
 
 LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
 LDFLAGS	= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
-AFLAGS	+= -DCONFIG_ONENAND_IPL
-CFLAGS	+= -DCONFIG_ONENAND_IPL
+AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
+CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
 OBJCFLAGS += --gap-fill=0x00
 
 SOBJS	:= low_levelinit.o
-- 
1.5.6

  reply	other threads:[~2009-06-13 18:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 18:49 [U-Boot] [PATCH v4 0/6] MX31: NAND boot for PDK boards Magnus Lilja
2009-06-13 18:50 ` Magnus Lilja [this message]
2009-06-13 18:50   ` [U-Boot] [PATCH v4 2/6] MX31: Add NAND SPL for i.MX31 Magnus Lilja
2009-06-13 18:50     ` [U-Boot] [PATCH v4 3/6] ARM: Add macros.h to be used in assembler file Magnus Lilja
2009-06-13 18:50       ` [U-Boot] [PATCH v4 4/6] i.MX31: Create a common device file Magnus Lilja
2009-06-13 18:50         ` [U-Boot] [PATCH v4 5/6] MX31: Add basic support for Freescale i.MX31 PDK board Magnus Lilja
2009-06-13 18:50           ` [U-Boot] [PATCH v4 6/6] MX31: Add NAND SPL boot support to " Magnus Lilja
2009-06-29 19:11             ` Magnus Lilja
2009-06-29 20:16               ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-29 20:39                 ` Magnus Lilja
2009-06-29 21:03             ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-30  6:00               ` Magnus Lilja
2009-06-30 19:09                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-30 19:29                   ` Magnus Lilja
2009-06-30 20:23                     ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-30 21:22                   ` Scott Wood
2009-07-01  5:48                     ` Magnus Lilja
2009-07-02 20:45                       ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-02 20:58                         ` Scott Wood
2009-06-20 12:53           ` [U-Boot] [PATCH v4 5/6] MX31: Add basic support for Freescale " Jean-Christophe PLAGNIOL-VILLARD
2009-06-28  9:56             ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-29 21:07           ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-20 12:50         ` [U-Boot] [PATCH v4 4/6] i.MX31: Create a common device file Jean-Christophe PLAGNIOL-VILLARD
2009-07-07 19:45           ` Wolfgang Denk
2009-06-20 12:49       ` [U-Boot] [PATCH v4 3/6] ARM: Add macros.h to be used in assembler file Jean-Christophe PLAGNIOL-VILLARD
2009-07-07 19:33       ` Wolfgang Denk
2009-07-07 20:24         ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-07 21:28           ` Wolfgang Denk
2009-07-07 22:07             ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-20 12:47     ` [U-Boot] [PATCH v4 2/6] MX31: Add NAND SPL for i.MX31 Jean-Christophe PLAGNIOL-VILLARD
2009-06-20 12:46   ` [U-Boot] [PATCH v4 1/6] ARM1136: Introduce CONFIG_PRELOADER macro Jean-Christophe PLAGNIOL-VILLARD
2009-06-18 20:09 ` [U-Boot] [PATCH v4 0/6] MX31: NAND boot for PDK boards Magnus Lilja
2009-06-18 20:41   ` Jean-Christophe PLAGNIOL-VILLARD

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=4a62b27ae616d894b9302d1b73a3e4a71bbdfbf1.1244918138.git.lilja.magnus@gmail.com \
    --to=lilja.magnus@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.