mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [PATCH 3/4] ARM Samsung: fix booting from NAND with pbl
Date: Sun, 18 May 2014 16:46:29 +0200	[thread overview]
Message-ID: <1400424390-24736-4-git-send-email-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <1400424390-24736-1-git-send-email-m.olbrich@pengutronix.de>

The ARM pbl is linked at (TEXT_BASE - SZ_2M). This conflicts with the temporary
stack used in s3c24x0_nand_boot. Moving the stack to (TEXT_BASE - SZ_2M) fixes
this problem. With this patch a compressed barebox with pbl can boot on
mini2440 from NAND.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---

This seems to work with and without a pbl, but isn't really nice. Is there
a better address that could be used here?

 arch/arm/mach-samsung/lowlevel-s3c24x0.S | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-samsung/lowlevel-s3c24x0.S b/arch/arm/mach-samsung/lowlevel-s3c24x0.S
index b59ba67..e2efd86 100644
--- a/arch/arm/mach-samsung/lowlevel-s3c24x0.S
+++ b/arch/arm/mach-samsung/lowlevel-s3c24x0.S
@@ -15,6 +15,7 @@
  */
 
 #include <config.h>
+#include <sizes.h>
 #include <mach/s3c-iomap.h>
 
 	.section ".text_bare_init.s3c24x0_disable_wd","ax"
@@ -258,7 +259,7 @@ s3c24x0_nand_boot:
 	beq 2f
 	mov pc, lr	/* NOR case: nothing to do here */
 
-2:	ldr sp, =TEXT_BASE	/* Setup a temporary stack in SDRAM */
+2:	ldr sp, =(TEXT_BASE - SZ_2M)	/* Setup a temporary stack in SDRAM */
 /*
  * We still run at a location we are not linked to. But lets still running
  * from the internal SRAM, this may speed up the boot
@@ -269,7 +270,7 @@ s3c24x0_nand_boot:
 /*
  * Adjust the return address to the correct address in SDRAM
  */
-	ldr r1, =TEXT_BASE
+	ldr r1, =(TEXT_BASE - SZ_2M)
 	add lr, lr, r1
 
 	mov pc, lr
-- 
2.0.0.rc0


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

  parent reply	other threads:[~2014-05-18 14:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-18 14:46 [PATCH 0/4] some mini2440 updates Michael Olbrich
2014-05-18 14:46 ` [PATCH 1/4] ARM: mini2440: switch to env2 Michael Olbrich
2014-05-18 14:46 ` [PATCH 2/4] ARM: mini2440: update defconfig Michael Olbrich
2014-05-18 14:46 ` Michael Olbrich [this message]
2014-05-18 14:46 ` [PATCH 4/4] net: dm9k: only read on packet for each call to dm9k_eth_rx() Michael Olbrich
2014-05-19  7:46 ` [PATCH 0/4] some mini2440 updates 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=1400424390-24736-4-git-send-email-m.olbrich@pengutronix.de \
    --to=m.olbrich@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