mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* regression: ARM: pca100: Use _text rather than TEXT_BASE
@ 2012-09-11 19:21 Christoph Fritz
  2012-10-01 16:24 ` Christoph Fritz
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Fritz @ 2012-09-11 19:21 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi Sascha,

your commit 244198e "ARM boards: Use _text rather than TEXT_BASE"
breaks board pca100 (phycard-i.MX27): It doesn't boot.

Revering the patch fixes the problem.

Any ideas?

 Thanks,
   -- Christoph


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: regression: ARM: pca100: Use _text rather than TEXT_BASE
  2012-09-11 19:21 regression: ARM: pca100: Use _text rather than TEXT_BASE Christoph Fritz
@ 2012-10-01 16:24 ` Christoph Fritz
  2012-10-01 17:00   ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Fritz @ 2012-10-01 16:24 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Tue, Sep 11, 2012 at 09:21:00PM +0200, Christoph Fritz wrote:
> Hi Sascha,
> 
> your commit 244198e "ARM boards: Use _text rather than TEXT_BASE"
> breaks board pca100 (phycard-i.MX27): It doesn't boot.
> 
> Revering the patch fixes the problem.
> 
> Any ideas?

*ping*

---
Subject: [PATCH] ARM: pca100: revert TEXT_BASE changes

This reverts commit 244198ea8bdf592799ebfd430fe9ab165284e480
its changes for pca100.
---
 arch/arm/boards/phycard-i.MX27/lowlevel_init.S |    8 ++++++--
 arch/arm/boards/phycard-i.MX27/pca100.c        |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
index 0907382..7b700c5 100644
--- a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
+++ b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
@@ -115,7 +115,7 @@ board_init_lowlevel:
 	bhi	ret
 
 	/* Move ourselves out of NFC SRAM */
-	ldr	r1, =_text
+	ldr	r1, =TEXT_BASE
 
 copy_loop:
 	ldmia	r0!, {r3-r9}		/* copy from source address [r0]    */
@@ -125,7 +125,11 @@ copy_loop:
 
 	ldr	pc, =1f			/* Jump to SDRAM                    */
 1:
-	b	nand_boot		/* Load barebox from NAND Flash      */
+	bl	nand_boot		/* Load barebox from NAND Flash      */
+
+	ldr	r1, =IMX_NFC_BASE - TEXT_BASE
+	sub	r10, r10, r1		/* adjust return address from NFC SRAM */
+					/* to SDRAM                            */
 
 #endif /* CONFIG_NAND_IMX_BOOT */
 
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index b77e532..3e60ccd 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -339,7 +339,7 @@ console_initcall(pca100_console_init);
 #ifdef CONFIG_NAND_IMX_BOOT
 void __bare_init nand_boot(void)
 {
-	imx_nand_load_image(_text, barebox_image_size);
+	imx_nand_load_image((void *)TEXT_BASE, barebox_image_size);
 }
 #endif
 
-- 
1.7.2.5

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: regression: ARM: pca100: Use _text rather than TEXT_BASE
  2012-10-01 16:24 ` Christoph Fritz
@ 2012-10-01 17:00   ` Sascha Hauer
  2012-10-02  6:49     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2012-10-01 17:00 UTC (permalink / raw)
  To: Christoph Fritz; +Cc: barebox

On Mon, Oct 01, 2012 at 06:24:01PM +0200, Christoph Fritz wrote:
> On Tue, Sep 11, 2012 at 09:21:00PM +0200, Christoph Fritz wrote:
> > Hi Sascha,
> > 
> > your commit 244198e "ARM boards: Use _text rather than TEXT_BASE"
> > breaks board pca100 (phycard-i.MX27): It doesn't boot.
> > 
> > Revering the patch fixes the problem.
> > 
> > Any ideas?
> 
> *ping*

Sorry, missed this one.

Does the following fix it?

8<------------------------------------------------------------

From d199fdf0b57879485fcde51c6a4e4d6e316816ee Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Mon, 1 Oct 2012 18:58:16 +0200
Subject: [PATCH] ARM i.MX pca100: Add missing jump to
 board_init_lowlevel_return()

This is broken since:

| commit 244198ea8bdf592799ebfd430fe9ab165284e480
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Sun Jul 8 18:30:42 2012 +0200
|
|     ARM boards: Use _text rather than TEXT_BASE
|
|     With compressed image support TEXT_BASE will become the base
|     address of the uncompressed image. What the boards want instead
|     is the base address of the decompressor code or, if not compressed,
|     the base address of the uncompressed image. Use _text which is
|     the correct one for both cases.
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/phycard-i.MX27/pca100.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 614bfc6..4b6e26e 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -329,6 +329,7 @@ console_initcall(pca100_console_init);
 void __bare_init nand_boot(void)
 {
 	imx_nand_load_image(_text, barebox_image_size);
+	board_init_lowlevel_return();
 }
 #endif
 
-- 
1.7.10.4

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: regression: ARM: pca100: Use _text rather than TEXT_BASE
  2012-10-01 17:00   ` Sascha Hauer
@ 2012-10-02  6:49     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-10-02  6:49 UTC (permalink / raw)
  To: Christoph Fritz; +Cc: barebox

On Mon, Oct 01, 2012 at 07:00:32PM +0200, Sascha Hauer wrote:
> On Mon, Oct 01, 2012 at 06:24:01PM +0200, Christoph Fritz wrote:
> > On Tue, Sep 11, 2012 at 09:21:00PM +0200, Christoph Fritz wrote:
> > > Hi Sascha,
> > > 
> > > your commit 244198e "ARM boards: Use _text rather than TEXT_BASE"
> > > breaks board pca100 (phycard-i.MX27): It doesn't boot.
> > > 
> > > Revering the patch fixes the problem.
> > > 
> > > Any ideas?
> > 
> > *ping*
> 
> Sorry, missed this one.
> 
> Does the following fix it?
> 

I'll rather go with the following patch which also allows to use pbl
support with this board. I tested the patch, it should work for you.

Sascha


8<------------------------------------------------------------


From 47d0240b9cdcf9ed8aa166ae62fba5ac48e11bba Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Mon, 1 Oct 2012 18:58:16 +0200
Subject: [PATCH] ARM i.MX pca100: Fix nand boot

The following missed to add a jump to board_init_lowlevel_return for the
phycard pca100 board:

| commit 244198ea8bdf592799ebfd430fe9ab165284e480
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Sun Jul 8 18:30:42 2012 +0200
|
|     ARM boards: Use _text rather than TEXT_BASE
|
|     With compressed image support TEXT_BASE will become the base
|     address of the uncompressed image. What the boards want instead
|     is the base address of the decompressor code or, if not compressed,
|     the base address of the uncompressed image. Use _text which is
|     the correct one for both cases.
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

This fixes it by adding the jump. Also imx_nand_load_image is directly
called from lowlevel_init.S which fixes compilation with pbl support
enabled.

Tested with both compression enabled and disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/phycard-i.MX27/lowlevel_init.S |    5 ++++-
 arch/arm/boards/phycard-i.MX27/pca100.c        |    8 --------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
index c24edd4..f983642 100644
--- a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
+++ b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
@@ -116,7 +116,10 @@ copy_loop:
 
 	ldr	pc, =1f			/* Jump to SDRAM                    */
 1:
-	b	nand_boot		/* Load barebox from NAND Flash      */
+	ldr	r0,=_text
+	ldr	r1,=_barebox_image_size
+	bl	imx_nand_load_image
+	b	board_init_lowlevel_return
 
 #endif /* CONFIG_NAND_IMX_BOOT */
 
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 614bfc6..53eec8f 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -324,11 +324,3 @@ static int pca100_console_init(void)
 }
 
 console_initcall(pca100_console_init);
-
-#ifdef CONFIG_NAND_IMX_BOOT
-void __bare_init nand_boot(void)
-{
-	imx_nand_load_image(_text, barebox_image_size);
-}
-#endif
-
-- 
1.7.10.4

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-02  6:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-11 19:21 regression: ARM: pca100: Use _text rather than TEXT_BASE Christoph Fritz
2012-10-01 16:24 ` Christoph Fritz
2012-10-01 17:00   ` Sascha Hauer
2012-10-02  6:49     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox