diff mbox

[U-Boot] Nokia RX-51: Fix calculating return address in save_boot_params

Message ID 1433869500-23728-1-git-send-email-pali.rohar@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Pali Rohár June 9, 2015, 5:05 p.m. UTC
Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f broke calculating lr register
in function save_boot_params() and caused U-Boot to crash at early boot time
on Nokia N900 board.

This patch fix calculating return address in lr register and make Nokia N900
board bootable again. Patch was tested in qemu and also on real N900 HW.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 board/nokia/rx51/lowlevel_init.S |    4 ----
 1 file changed, 4 deletions(-)

Comments

Simon Glass June 9, 2015, 6:11 p.m. UTC | #1
On 9 June 2015 at 10:05, Pali Rohár <pali.rohar@gmail.com> wrote:
> Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f broke calculating lr register
> in function save_boot_params() and caused U-Boot to crash at early boot time
> on Nokia N900 board.
>
> This patch fix calculating return address in lr register and make Nokia N900
> board bootable again. Patch was tested in qemu and also on real N900 HW.
>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  board/nokia/rx51/lowlevel_init.S |    4 ----
>  1 file changed, 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Pali Rohár June 9, 2015, 6:27 p.m. UTC | #2
On Tuesday 09 June 2015 20:11:22 Simon Glass wrote:
> On 9 June 2015 at 10:05, Pali Rohár <pali.rohar@gmail.com> wrote:
> > Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f broke calculating
> > lr register in function save_boot_params() and caused U-Boot to
> > crash at early boot time on Nokia N900 board.
> > 
> > This patch fix calculating return address in lr register and make
> > Nokia N900 board bootable again. Patch was tested in qemu and also
> > on real N900 HW.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > ---
> > 
> >  board/nokia/rx51/lowlevel_init.S |    4 ----
> >  1 file changed, 4 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>

Tom, can you please apply this patch for 2015.07?

Simon & others: in future, please can you CC me all patches which touch 
Nokia N900 board code? We can prevent such breakage. Also you can test 
u-boot for n900 in qemu.
Simon Glass June 11, 2015, 12:50 a.m. UTC | #3
Hi Pali,

On 9 June 2015 at 12:27, Pali Rohár <pali.rohar@gmail.com> wrote:
>
> On Tuesday 09 June 2015 20:11:22 Simon Glass wrote:
> > On 9 June 2015 at 10:05, Pali Rohár <pali.rohar@gmail.com> wrote:
> > > Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f broke calculating
> > > lr register in function save_boot_params() and caused U-Boot to
> > > crash at early boot time on Nokia N900 board.
> > >
> > > This patch fix calculating return address in lr register and make
> > > Nokia N900 board bootable again. Patch was tested in qemu and also
> > > on real N900 HW.
> > >
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > ---
> > >
> > >  board/nokia/rx51/lowlevel_init.S |    4 ----
> > >  1 file changed, 4 deletions(-)
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Tom, can you please apply this patch for 2015.07?
>
> Simon & others: in future, please can you CC me all patches which touch
> Nokia N900 board code? We can prevent such breakage. Also you can test
> u-boot for n900 in qemu.

Here's the list patman generates for that patch:

      Cc:  Rob Herring <robh@kernel.org>
      Cc:  Simon Glass <sjg@chromium.org>
      Cc:  Tom Warren <twarren@nvidia.com>
      Cc:  Thierry Reding <treding@nvidia.com>
      Cc:  Siarhei Siamashka <siarhei.siamashka@gmail.com>
      Cc:  Bryan Brinsko <bryan.brinsko@rockwellcollins.com>
      Cc:  Ian Campbell <ijc@hellion.org.uk>
      Cc:  York Sun <yorksun@freescale.com>
      Cc:  Nishanth Menon <nm@ti.com>
      Cc:  Hans de Goede <hdegoede@redhat.com>
      Cc:  u-boot@lists.denx.de
      Cc:  Tom Rini <trini@konsulko.com>
      Cc:  Albert Aribaud <albert.u.boot@aribaud.net>
      Cc:  Peng Fan <Peng.Fan@freescale.com>
      Cc:  Georges Savoundararadj <savoundg@gmail.com>
      Cc:  Minkyu Kang <mk7.kang@samsung.com>
      Cc:  "Pali Rohár" <pali.rohar@gmail.com>

I was probably just unwilling to email so many people, but in future I
will be more willing.

>
>
> --
> Pali Rohár
> pali.rohar@gmail.com

Regards,
Simon
Pali Rohár June 12, 2015, 11 a.m. UTC | #4
On Tuesday 09 June 2015 20:27:19 Pali Rohár wrote:
> On Tuesday 09 June 2015 20:11:22 Simon Glass wrote:
> > On 9 June 2015 at 10:05, Pali Rohár <pali.rohar@gmail.com> wrote:
> > > Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f broke calculating
> > > lr register in function save_boot_params() and caused U-Boot to
> > > crash at early boot time on Nokia N900 board.
> > > 
> > > This patch fix calculating return address in lr register and make
> > > Nokia N900 board bootable again. Patch was tested in qemu and also
> > > on real N900 HW.
> > > 
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > ---
> > > 
> > >  board/nokia/rx51/lowlevel_init.S |    4 ----
> > >  1 file changed, 4 deletions(-)
> > 
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Tom, can you please apply this patch for 2015.07?
> 

Hello, can you apply this patch? Without it Nokia N900 code is broken!
Tom Rini June 12, 2015, 12:12 p.m. UTC | #5
On Tue, Jun 09, 2015 at 07:05:00PM +0200, Pali Rohár wrote:

> Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f broke calculating lr register
> in function save_boot_params() and caused U-Boot to crash at early boot time
> on Nokia N900 board.
> 
> This patch fix calculating return address in lr register and make Nokia N900
> board bootable again. Patch was tested in qemu and also on real N900 HW.
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S
index 9d4ea1b..420ad13 100644
--- a/board/nokia/rx51/lowlevel_init.S
+++ b/board/nokia/rx51/lowlevel_init.S
@@ -105,10 +105,6 @@  fix_start:
 	/* r6 - maximal u-boot size */
 	ldr	r6, imagesize
 
-	/* fix return address */
-	subhi	lr, lr, r5
-	addlo	lr, lr, r5
-
 	/* r1 - start of u-boot after */
 	ldr	r1, startaddr