All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyungmin Park <kmpark@infradead.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Reduce apollon OneNAND IPL code
Date: Mon, 12 Oct 2009 09:17:49 +0900	[thread overview]
Message-ID: <20091012001749.GA23445@july> (raw)

After OneNAND IPL updated, apollon boot code exceeds 1KiB size,

This patch reduces the apollon boot code

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
diff --git a/onenand_ipl/board/apollon/apollon.c b/onenand_ipl/board/apollon/apollon.c
index 4936e00..4d4564c 100644
--- a/onenand_ipl/board/apollon/apollon.c
+++ b/onenand_ipl/board/apollon/apollon.c
@@ -54,7 +54,6 @@ static void muxSetupUART1(void)
 	/* UART1_RX pin configuration, PIN = T21 */
 	write_config_reg(CONTROL_PADCONF_UART1_RX, 0);
 }
-#endif
 
 /**********************************************************
  * Routine: s_init
@@ -63,8 +62,7 @@ static void muxSetupUART1(void)
  **********************************************************/
 int s_init(int skip)
 {
-#ifdef CONFIG_SYS_PRINTF
 	muxSetupUART1();
-#endif
 	return 0;
 }
+#endif
diff --git a/onenand_ipl/board/apollon/low_levelinit.S b/onenand_ipl/board/apollon/low_levelinit.S
index 205170f..1eb116e 100644
--- a/onenand_ipl/board/apollon/low_levelinit.S
+++ b/onenand_ipl/board/apollon/low_levelinit.S
@@ -64,6 +64,10 @@
 #error "Please configure PRCM schecm"
 #endif
 
+/*
+ * r5 has zero always
+ */
+
 _TEXT_BASE:
 	.word	TEXT_BASE	/* sdram load addr from config.mk */
 
@@ -87,15 +91,11 @@ lowlevel_init:
 #endif
 
 	/* Pin muxing for SDRC */
-	mov	r1, #0x00
-	ldr	r0, =0x480000A1		/* ball C12, mode 0 */
-	strb	r1, [r0]
-
-	ldr	r0, =0x48000032		/* ball D11, mode 0 */
-	strb	r1, [r0]
-
-	ldr	r0, =0x480000A3		/* ball B13, mode 0 */
-	strb	r1, [r0]
+	mov	r5, #0x00
+	ldr	r0, =0x48000000
+	strb	r5, [r0, #0xA1]		/* ball C12, mode 0 */
+	strb	r5, [r0, #0x32]		/* ball D11, mode 0 */
+	strb	r5, [r0, #0xA3]		/* ball B13, mode 0 */
 
 	/* SDRC setting */
 	ldr	r0, =OMAP2420_SDRC_BASE
@@ -129,8 +129,7 @@ lowlevel_init:
 	ldr	r1, =0x00000007
 	str	r1, [r0, #0xA8]
 
-	ldr	r1, =0x00000000
-	str	r1, [r0, #0xA8]
+	str	r5, [r0, #0xA8]
 
 	ldr	r1, =0x00000001
 	str	r1, [r0, #0xA8]
@@ -150,9 +149,8 @@ lowlevel_init:
 
 	/* Note: You MUST set EMR values */
 	/* EMR1 & EMR2 */
-	ldr	r1, =0x00000000
-	str	r1, [r0, #0x88]
-	str	r1, [r0, #0x8C]
+	str	r5, [r0, #0x88]
+	str	r5, [r0, #0x8C]
 
 #ifdef OLD_SDRC_DLLA_CTRL
 	/* SDRC_DLLA_CTRL */
@@ -185,6 +183,7 @@ lowlevel_init:
 	subs	r2, r2, #0x1
 	bne	1b
 
+#ifdef CONFIG_PRINTF
 	ldr	sp, SRAM_STACK
 	str	ip, [sp]	/* stash old link register */
 	mov	ip, lr		/* save link reg across call */
@@ -194,6 +193,7 @@ lowlevel_init:
 
 	ldr	ip, [sp]	/* restore save ip */
 	mov	lr, ip		/* restore link reg */
+#endif
 
 	/* back to arch calling code */
 	mov	pc,	lr

             reply	other threads:[~2009-10-12  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12  0:17 Kyungmin Park [this message]
2009-10-12 16:48 ` [U-Boot] [PATCH] Reduce apollon OneNAND IPL code Scott Wood
2009-10-13  1:44   ` Kyungmin Park
2009-11-22 22:56 ` Wolfgang Denk

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=20091012001749.GA23445@july \
    --to=kmpark@infradead.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 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.