public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
@ 2008-11-18  9:48 Jens Scharsig
  2008-11-19 12:31 ` Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jens Scharsig @ 2008-11-18  9:48 UTC (permalink / raw)
  To: u-boot

This patch fix the broken boot from NOR Flash on AT91RM9200 boards, if
CONFIG_AT91RM9200 is defined and nor preloader is used.

Please see <http://lists.denx.de/pipermail/u-boot/2008-November/043078.html>
<http://lists.denx.de/pipermail/u-boot/2008-November/043093.html>
for reason

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
---

diff --git a/cpu/arm920t/start.S b/cpu/arm920t/start.S
index 17977c2..52aff13 100644
--- a/cpu/arm920t/start.S
+++ b/cpu/arm920t/start.S
@@ -24,7 +24,6 @@
  * MA 02111-1307 USA
  */

-
 #include <config.h>
 #include <version.h>
 #include <status_led.h>
@@ -178,8 +177,6 @@ copyex:
 	bl	cpu_init_crit
 #endif

-#ifndef	CONFIG_AT91RM9200
-
 #ifndef CONFIG_SKIP_RELOCATE_UBOOT
 relocate:				/* relocate U-Boot to RAM	    */
 	adr	r0, _start		/* r0 <- current position of code   */
@@ -198,7 +195,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end addreee [r2]    */
 	ble	copy_loop
 #endif	/* CONFIG_SKIP_RELOCATE_UBOOT */
-#endif
+
 	/* Set up the stack						    */
 stack_setup:
 	ldr	r0, _TEXT_BASE		/* upper 128 KiB: relocated uboot   */
diff --git a/include/configs/at91rm9200dk.h b/include/configs/at91rm9200dk.h
index 633a053..5c239d7 100644
--- a/include/configs/at91rm9200dk.h
+++ b/include/configs/at91rm9200dk.h
@@ -72,6 +72,8 @@
 #define SDRC_MR_VAL2	0x00000003 /* Load Mode Register */
 #define SDRC_MR_VAL3	0x00000000 /* Normal Mode */
 #define SDRC_TR_VAL	0x000002E0 /* Write refresh rate */
+#else
+#define CONFIG_SKIP_RELOCATE_UBOOT
 #endif	/* CONFIG_SKIP_LOWLEVEL_INIT */
 /*
  * Size of malloc() pool
diff --git a/include/configs/cmc_pu2.h b/include/configs/cmc_pu2.h
index 527921e..cdd308d 100644
--- a/include/configs/cmc_pu2.h
+++ b/include/configs/cmc_pu2.h
@@ -71,6 +71,8 @@
 #define SDRC_MR_VAL2	0x00000003 /* Load Mode Register */
 #define SDRC_MR_VAL3	0x00000000 /* Normal Mode */
 #define SDRC_TR_VAL	0x000002E0 /* Write refresh rate */
+#else
+#define CONFIG_SKIP_RELOCATE_UBOOT
 #endif	/* CONFIG_SKIP_LOWLEVEL_INIT */

 /*
diff --git a/include/configs/csb637.h b/include/configs/csb637.h
index 38fd25c..682db44 100644
--- a/include/configs/csb637.h
+++ b/include/configs/csb637.h
@@ -72,6 +72,8 @@
 #define SDRC_MR_VAL2	0x00000003 /* Load Mode Register */
 #define SDRC_MR_VAL3	0x00000000 /* Normal Mode */
 #define SDRC_TR_VAL	0x000002E0 /* Write refresh rate */
+#else
+#define CONFIG_SKIP_RELOCATE_UBOOT
 #endif	/* CONFIG_SKIP_LOWLEVEL_INIT */
 /*
  * Size of malloc() pool
diff --git a/include/configs/kb9202.h b/include/configs/kb9202.h
index 55cda32..1ce8c69 100644
--- a/include/configs/kb9202.h
+++ b/include/configs/kb9202.h
@@ -51,6 +51,8 @@
 #define CONFIG_INITRD_TAG	1

 #define	CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SKIP_RELOCATE_UBOOT	/* undef this for direct boot from */
+									/* NOR flash without preloader */

 #define	CONFIG_SYS_LONGHELP

diff --git a/include/configs/mp2usb.h b/include/configs/mp2usb.h
index 2ffeae6..cbbdb0c 100644
--- a/include/configs/mp2usb.h
+++ b/include/configs/mp2usb.h
@@ -76,6 +76,8 @@
 #define SDRC_MR_VAL2	0x00000003 /* Load Mode Register */
 #define SDRC_MR_VAL3	0x00000000 /* Normal Mode */
 #define SDRC_TR_VAL	0x000002E0 /* Write refresh rate */
+#else
+#define CONFIG_SKIP_RELOCATE_UBOOT
 #endif	/* CONFIG_SKIP_LOWLEVEL_INIT */

 /*

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

* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
  2008-11-18  9:48 [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash Jens Scharsig
@ 2008-11-19 12:31 ` Jean-Christophe PLAGNIOL-VILLARD
  2008-11-24  0:28 ` Wolfgang Denk
  2008-11-24 21:12 ` Jean-Christophe PLAGNIOL-VILLARD
  2 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-19 12:31 UTC (permalink / raw)
  To: u-boot

On 10:48 Tue 18 Nov     , Jens Scharsig wrote:
> This patch fix the broken boot from NOR Flash on AT91RM9200 boards, if
> CONFIG_AT91RM9200 is defined and nor preloader is used.
> 
> Please see <http://lists.denx.de/pipermail/u-boot/2008-November/043078.html>
> <http://lists.denx.de/pipermail/u-boot/2008-November/043093.html>
> for reason
> 
> Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
> ---
Wolfgang could you test on the cmc_pu2 and the DK?

Best Regards,
J.

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

* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
  2008-11-18  9:48 [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash Jens Scharsig
  2008-11-19 12:31 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-11-24  0:28 ` Wolfgang Denk
  2008-11-24 12:06   ` Jens Scharsig
  2008-11-24 21:12 ` Jean-Christophe PLAGNIOL-VILLARD
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2008-11-24  0:28 UTC (permalink / raw)
  To: u-boot

Dear Jens,

In message <gfu31h$hf8$1@ger.gmane.org> you wrote:
> This patch fix the broken boot from NOR Flash on AT91RM9200 boards, if
> CONFIG_AT91RM9200 is defined and nor preloader is used.
> 
> Please see <http://lists.denx.de/pipermail/u-boot/2008-November/043078.html>
> <http://lists.denx.de/pipermail/u-boot/2008-November/043093.html>
> for reason

I  testedm  the  patch,  but  it  doesn't  fix  the  problem  on  the
AT91RM9200DK  board  (that's  the  one  I  could  easily  test at the
moment).

I bisected the problem, and for me culprit seems to be commit ID
d4fc6012fd0a5c211b825691f44b06f8032c0551

Bisecting is a bit difficult,m because close to the end there is a
non-compiling version; these are the last few steps:

...
f01dbb5424a81453c81190dd30e945891466f621 bad
71d67f43dabe8dd8adbe594b6c61944a2d106efa good
65d7ada64557e76094b4fd3bad30a0f18f5fb2b2 doesn't build; seems bad
dcbfd2e5649f97aa04fbbc6ea2b008aa4486e225 bad

=> 

commit d4fc6012fd0a5c211b825691f44b06f8032c0551
Author: Peter Pearse <peter.pearse@arm.com>
Date:   Tue Aug 14 10:10:52 2007 +0100

    Add MACH_TYPE records for several AT91 boards.
    Merge to two at45.c files into a common file, split to at45.c and spi.c
    Fix spelling error in DM9161 PHY Support.
    Initialize at91rm9200 board (and set LED).
    Add PIO control for at91rm9200dk LEDs and Mux.
    Change dataflash partition boundaries to be compatible with Linux 2.6.
    
    Signed-off-by:      Peter Pearse <peter.pearse@arm.com>
    Signed-off-by:      Ulf Samuelsson <ulf@atmel.com>


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Build a system that even a fool can use and only a fool will want  to
use it.

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

* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
  2008-11-24  0:28 ` Wolfgang Denk
@ 2008-11-24 12:06   ` Jens Scharsig
  2008-11-24 20:29     ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Scharsig @ 2008-11-24 12:06 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,
Hello at all,

>
> I  testedm  the  patch,  but  it  doesn't  fix  the  problem  on  the
> AT91RM9200DK  board  (that's  the  one  I  could  easily  test at the
> moment).
>

I think my patch only don't work on AT91RM9200DK, AT91RM9200EK or
AT91RM9200DF board. Blame it on this solution is the #ifdef construct in
/cpu/arm920t/start.s at line 264. There are no low_level_init run for
DK, EK andDF board.

It's only effect on Atmel Boards. I can't test is it truth.
So the question goes to DK users and arm custodian.


Best regards

Jens Scharsig

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

* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
  2008-11-24 12:06   ` Jens Scharsig
@ 2008-11-24 20:29     ` Wolfgang Denk
  2008-11-24 23:35       ` Pink Boy
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2008-11-24 20:29 UTC (permalink / raw)
  To: u-boot

Dear Jens Scharsig,

In message <gge5b5$4vp$1@ger.gmane.org> you wrote:
> 
> > I  testedm  the  patch,  but  it  doesn't  fix  the  problem  on  the
> > AT91RM9200DK  board  (that's  the  one  I  could  easily  test at the
> > moment).
> 
> I think my patch only don't work on AT91RM9200DK, AT91RM9200EK or
> AT91RM9200DF board. Blame it on this solution is the #ifdef construct in
> /cpu/arm920t/start.s at line 264. There are no low_level_init run for
> DK, EK andDF board.

I agree. That code looks pretty bogus to me, too.

I can confirm that removing the "defined(CONFIG_AT91RM9200DK) ||" part
there makes the code work on the AT91RM9200DK board (j24: patch
following ASAP).

Any AT91RM9200EK and AT91RM9200DF users out there to test this?

> It's only effect on Atmel Boards. I can't test is it truth.
> So the question goes to DK users and arm custodian.

For DK, the situation looks clear now.

Thanks for the patch!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Ja, mach' nur einen Plan,    sei nur ein grosses Licht
und mach' dann noch 'nen zweiten Plan,    geh'n tun sie beide nicht."
                                     -- Bert Brecht, Dreigroschenoper

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

* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
  2008-11-18  9:48 [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash Jens Scharsig
  2008-11-19 12:31 ` Jean-Christophe PLAGNIOL-VILLARD
  2008-11-24  0:28 ` Wolfgang Denk
@ 2008-11-24 21:12 ` Jean-Christophe PLAGNIOL-VILLARD
  2 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-24 21:12 UTC (permalink / raw)
  To: u-boot

On 10:48 Tue 18 Nov     , Jens Scharsig wrote:
> This patch fix the broken boot from NOR Flash on AT91RM9200 boards, if
> CONFIG_AT91RM9200 is defined and nor preloader is used.
> 
> Please see <http://lists.denx.de/pipermail/u-boot/2008-November/043078.html>
> <http://lists.denx.de/pipermail/u-boot/2008-November/043093.html>
> for reason
> 
> Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
> ---
apply to u-boot-at91

Best Regards,
J.

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

* [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash
  2008-11-24 20:29     ` Wolfgang Denk
@ 2008-11-24 23:35       ` Pink Boy
  0 siblings, 0 replies; 7+ messages in thread
From: Pink Boy @ 2008-11-24 23:35 UTC (permalink / raw)
  To: u-boot


Wolkgang Denk sez,

> Jens Scharsig claims,

>> I think my patch only don't work on AT91RM9200DK,
>> AT91RM9200EK or AT91RM9200DF board. Blame it on this 
>> solution is the #ifdef construct in /cpu/arm920t/start.s 
>> at line 264. There are no low_level_init run for DK, 
>> EK andDF board.
 
> I agree. That code looks pretty bogus to me, too.

I've had the problem where trying to run u-boot directly
from rom fails, and read various bits about the defines in
start.s being goofed.
 
> I can confirm that removing the "defined(CONFIG_AT91RM9200DK) ||" 
> part there makes the code work on the AT91RM9200DK board (j24:
> patch following ASAP).
> 
> Any AT91RM9200EK and AT91RM9200DF users out there to test
> this?

I'll be happy to do that, I have an AT91RM9200-EK board that
I'm doing dev on right now.  I assume that I can download the
current tree and get the patched version?

Matt
---
Beating my head against the AT91RM9200 for too long.

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

end of thread, other threads:[~2008-11-24 23:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-18  9:48 [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash Jens Scharsig
2008-11-19 12:31 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-24  0:28 ` Wolfgang Denk
2008-11-24 12:06   ` Jens Scharsig
2008-11-24 20:29     ` Wolfgang Denk
2008-11-24 23:35       ` Pink Boy
2008-11-24 21:12 ` Jean-Christophe PLAGNIOL-VILLARD

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