All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] barebox on Canon A1100
@ 2019-01-03 22:56 Antony Pavlov
  2019-01-04  8:17 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Antony Pavlov @ 2019-01-03 22:56 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Barebox List, Marc Kleine-Budde, Thomas Huth, Peter Maydell,
	QEMU Developers, qemu-arm

Hi Sascha!

I have some good news and some bad news.

First the good news.

Barebox was used for Day 18 of QEMU 2018 advent (https://www.qemu-advent-calendar.org/2018/).

Here is a quote:

  > This is an image for QEMU's emulated Canon A1100 Arm machine:
  > Play 2048 in the Barebox firmware environment.

The bad news.

Current master branch barebox for Canon A1100 does not work under qemu,
barebox v2017.02.0 was used for qemu advent.

Thomas Huth reported the problem in the qemu-devel mailing
list two months ago. Please see https://www.mail-archive.com/qemu-devel@nongnu.org/msg571887.html
for details.

The commit a43e2bbc468a71 breaks barebox for Canon A1100:

  > commit a43e2bbc468a71fb8825e8acafb7fac7ad7c6dad
  > Author: Sascha Hauer <s.hauer@pengutronix.de>
  > Date:   Wed Mar 7 10:04:07 2018 +0100
  >
  >    ARM: return positive offset in get_runtime_offset()

Any suggestion?

-- 
Best regards,
  Antony Pavlov

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

* Re: [Qemu-devel] barebox on Canon A1100
  2019-01-03 22:56 [Qemu-devel] barebox on Canon A1100 Antony Pavlov
@ 2019-01-04  8:17 ` Sascha Hauer
  2019-01-04 10:54   ` Antony Pavlov
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2019-01-04  8:17 UTC (permalink / raw)
  To: Antony Pavlov
  Cc: Barebox List, Marc Kleine-Budde, Thomas Huth, Peter Maydell,
	QEMU Developers, qemu-arm

On Fri, Jan 04, 2019 at 01:56:41AM +0300, Antony Pavlov wrote:
> Hi Sascha!
> 
> I have some good news and some bad news.
> 
> First the good news.
> 
> Barebox was used for Day 18 of QEMU 2018 advent (https://www.qemu-advent-calendar.org/2018/).
> 
> Here is a quote:
> 
>   > This is an image for QEMU's emulated Canon A1100 Arm machine:
>   > Play 2048 in the Barebox firmware environment.

Hey nice :)

> 
> The bad news.
> 
> Current master branch barebox for Canon A1100 does not work under qemu,
> barebox v2017.02.0 was used for qemu advent.
> 
> Thomas Huth reported the problem in the qemu-devel mailing
> list two months ago. Please see https://www.mail-archive.com/qemu-devel@nongnu.org/msg571887.html
> for details.
> 
> The commit a43e2bbc468a71 breaks barebox for Canon A1100:
> 
>   > commit a43e2bbc468a71fb8825e8acafb7fac7ad7c6dad
>   > Author: Sascha Hauer <s.hauer@pengutronix.de>
>   > Date:   Wed Mar 7 10:04:07 2018 +0100
>   >
>   >    ARM: return positive offset in get_runtime_offset()
> 
> Any suggestion?

Yes, try again with a recent barebox. There was a bug in this commit that
should be fixed with the following:

| commit 0230365df6601cd561c9e3e368c96222076ec9f5
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Wed Dec 12 08:55:31 2018 +0100
| 
|     ARM: fix setup_c when runtime offset is != 0
|     
|     The runtime offset has to be added to the memcpy source address and
|     substracted from the return address. This should have been changed in
|     a43e2bbc46 which changed from returning the negative runtime offset
|     into changing the positive runtime offset. Instead a43e2bbc46 only
|     changed a zero substraction ("subs r4, r0, #0") into a zero addition
|     ("adds r4, r0, #0") which was used as a equal to zero test and changed
|     nothing. This part is reverted here.
|     
|     Fixes wrong copy / return locations when setup_c is called with
|     different runtime and link addresses.
|     
|     fixes: a43e2bbc46 ("ARM: return positive offset in get_runtime_offset()")
|     
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

-- 
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 |

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

* Re: [Qemu-devel] barebox on Canon A1100
  2019-01-04  8:17 ` Sascha Hauer
@ 2019-01-04 10:54   ` Antony Pavlov
  0 siblings, 0 replies; 3+ messages in thread
From: Antony Pavlov @ 2019-01-04 10:54 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Barebox List, Marc Kleine-Budde, Thomas Huth, Peter Maydell,
	QEMU Developers, qemu-arm

On Fri, 4 Jan 2019 09:17:41 +0100
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> On Fri, Jan 04, 2019 at 01:56:41AM +0300, Antony Pavlov wrote:
> > Hi Sascha!
> > 
> > I have some good news and some bad news.
> > 
> > First the good news.
> > 
> > Barebox was used for Day 18 of QEMU 2018 advent (https://www.qemu-advent-calendar.org/2018/).
> > 
> > Here is a quote:
> > 
> >   > This is an image for QEMU's emulated Canon A1100 Arm machine:
> >   > Play 2048 in the Barebox firmware environment.
> 
> Hey nice :)
> 
> > 
> > The bad news.
> > 
> > Current master branch barebox for Canon A1100 does not work under qemu,
> > barebox v2017.02.0 was used for qemu advent.
> > 
> > Thomas Huth reported the problem in the qemu-devel mailing
> > list two months ago. Please see https://www.mail-archive.com/qemu-devel@nongnu.org/msg571887.html
> > for details.
> > 
> > The commit a43e2bbc468a71 breaks barebox for Canon A1100:
> > 
> >   > commit a43e2bbc468a71fb8825e8acafb7fac7ad7c6dad
> >   > Author: Sascha Hauer <s.hauer@pengutronix.de>
> >   > Date:   Wed Mar 7 10:04:07 2018 +0100
> >   >
> >   >    ARM: return positive offset in get_runtime_offset()
> > 
> > Any suggestion?
> 
> Yes, try again with a recent barebox. There was a bug in this commit that
> should be fixed with the following:
>
> | commit 0230365df6601cd561c9e3e368c96222076ec9f5
> | Author: Sascha Hauer <s.hauer@pengutronix.de>
> | Date:   Wed Dec 12 08:55:31 2018 +0100
> | 
> |     ARM: fix setup_c when runtime offset is != 0
> |     
> |     The runtime offset has to be added to the memcpy source address and
> |     substracted from the return address. This should have been changed in
> |     a43e2bbc46 which changed from returning the negative runtime offset
> |     into changing the positive runtime offset. Instead a43e2bbc46 only
> |     changed a zero substraction ("subs r4, r0, #0") into a zero addition
> |     ("adds r4, r0, #0") which was used as a equal to zero test and changed
> |     nothing. This part is reverted here.
> |     
> |     Fixes wrong copy / return locations when setup_c is called with
> |     different runtime and link addresses.
> |     
> |     fixes: a43e2bbc46 ("ARM: return positive offset in get_runtime_offset()")
> |     
> |     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Thanks for noting!

I have just tested recent master branch barebox with qemu-3.1.0 from Debian unstable.
It works!

Here is the log:

$ qemu-system-arm --version
QEMU emulator version 3.1.0 (Debian 1:3.1+dfsg-2)
Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers
$ qemu-system-arm -M canon-a1100 -display none -serial stdio -bios barebox.canon-a1100.bin
Switch to console [cs0]


barebox 2018.12.0-00140-g64fc4ac1b5 #1 Fri Jan 4 13:36:42 MSK 2019


Board: Canon PowerShot A1100 IS
digic-gpio c0220000.gpio.of: probed gpiochip-1 with base 0
cfi_flash f8000000.flash@f8000000.of: found cfi flash at 0xf8000000, size 4 MiB
malloc space: 0x00100000 -> 0x002fffff (size 2 MiB)
running /env/bin/init...
/env/bin/init not found
canon-a1100 > /


-- 
Best regards,
  Antony Pavlov

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

end of thread, other threads:[~2019-01-04 10:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 22:56 [Qemu-devel] barebox on Canon A1100 Antony Pavlov
2019-01-04  8:17 ` Sascha Hauer
2019-01-04 10:54   ` Antony Pavlov

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.