mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* qemu and barebox
@ 2018-07-18 13:02 Giuseppe Levi
  2018-07-18 13:44 ` Roland Hieber
  2018-07-18 14:03 ` Alessandro Rubini
  0 siblings, 2 replies; 6+ messages in thread
From: Giuseppe Levi @ 2018-07-18 13:02 UTC (permalink / raw)
  To: barebox

Hi all,
i'm trying to run barebox using qemu because I need to develop and
emulate a spacial boot configuration of the CERN White Rabbit switch
(http://white-rabbit.web.cern.ch/).
I used  the ARCH=arm
and CROSS_COMPILE=aarch64-linux-gnu-

Selected the qemu virt board in menuconfig.

Compilation seems ok but when trying
qemu-system-aarch64 -m 2048M -cpu cortex-a57 -machine virt -display
none -serial stdio -kernel barebox

The system does not give me any output eve if is running using 100% of
one core on my 4 core machine.

The final goal would be to setup barebox to boot from network and then
arrange a bootp server un another virtual machine.

What I'm doing wrong ? is the CPU type cortex-a57 correct even if in
menuconfig the type is market as Atemel-AT91 ?



Thenks, Giuseppe Levi

-- 
Dr. Giuseppe Levi
Physics Dpt and INFN
viale Berti Pichat 6/2
40127 BOLOGNA
Mobile: +39 393 0086704

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

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

* Re: qemu and barebox
  2018-07-18 13:02 qemu and barebox Giuseppe Levi
@ 2018-07-18 13:44 ` Roland Hieber
  2018-07-18 14:03 ` Alessandro Rubini
  1 sibling, 0 replies; 6+ messages in thread
From: Roland Hieber @ 2018-07-18 13:44 UTC (permalink / raw)
  To: Giuseppe Levi; +Cc: barebox

Hi Giuseppe,

this was discussed recently; see
https://www.mail-archive.com/barebox@lists.infradead.org/msg27074.html

tldr: there are issues with QEMU and ARM64, and no solution yet.

 - Roland

On Wed, Jul 18, 2018 at 03:02:48PM +0200, Giuseppe Levi wrote:
> Hi all,
> i'm trying to run barebox using qemu because I need to develop and
> emulate a spacial boot configuration of the CERN White Rabbit switch
> (http://white-rabbit.web.cern.ch/).
> I used  the ARCH=arm
> and CROSS_COMPILE=aarch64-linux-gnu-
> 
> Selected the qemu virt board in menuconfig.
> 
> Compilation seems ok but when trying
> qemu-system-aarch64 -m 2048M -cpu cortex-a57 -machine virt -display
> none -serial stdio -kernel barebox
> 
> The system does not give me any output eve if is running using 100% of
> one core on my 4 core machine.
> 
> The final goal would be to setup barebox to boot from network and then
> arrange a bootp server un another virtual machine.
> 
> What I'm doing wrong ? is the CPU type cortex-a57 correct even if in
> menuconfig the type is market as Atemel-AT91 ?
> 
> 
> 
> Thenks, Giuseppe Levi

-- 
Roland Hieber                     | r.hieber@pengutronix.de     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
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] 6+ messages in thread

* Re: qemu and barebox
  2018-07-18 13:02 qemu and barebox Giuseppe Levi
  2018-07-18 13:44 ` Roland Hieber
@ 2018-07-18 14:03 ` Alessandro Rubini
  2018-07-18 18:50   ` Giuseppe Levi
  1 sibling, 1 reply; 6+ messages in thread
From: Alessandro Rubini @ 2018-07-18 14:03 UTC (permalink / raw)
  To: giuseppe.levi; +Cc: barebox

Hello.

> emulate a spacial boot configuration of the CERN White Rabbit switch
> (http://white-rabbit.web.cern.ch/).

The White Rabbit switch is AT91SAM9G45 (I have one on my desk).
Unless your own WR switch is a new design running on cortex-a57, you
shoul cross-compile for arm32 and use a corresponding qemu
configuration.

/alessandro

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

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

* Re: qemu and barebox
  2018-07-18 14:03 ` Alessandro Rubini
@ 2018-07-18 18:50   ` Giuseppe Levi
  2018-07-18 19:53     ` Andrey Smirnov
  2018-07-18 20:39     ` Alessandro Rubini
  0 siblings, 2 replies; 6+ messages in thread
From: Giuseppe Levi @ 2018-07-18 18:50 UTC (permalink / raw)
  To: Alessandro Rubini; +Cc: barebox

Ok tried with  CROSS_COMPILE=arm-linux-gnueabi- this should be 32bit arm
then: qemu-system-arm -m 256M -machine virt -display none  -serial
stdio -kernel barebox

hangs..... any idea ? Should I use a different machine ?

It would be very complex to create a White Rabbit virtual machine ?
(HW description is open)



2018-07-18 16:03 GMT+02:00 Alessandro Rubini <rubini-list@gnudd.com>:
> Hello.
>
>> emulate a spacial boot configuration of the CERN White Rabbit switch
>> (http://white-rabbit.web.cern.ch/).
>
> The White Rabbit switch is AT91SAM9G45 (I have one on my desk).
> Unless your own WR switch is a new design running on cortex-a57, you
> shoul cross-compile for arm32 and use a corresponding qemu
> configuration.
>
> /alessandro



-- 
Dr. Giuseppe Levi
Physics Dpt and INFN
viale Berti Pichat 6/2
40127 BOLOGNA
Mobile: +39 393 0086704

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

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

* Re: qemu and barebox
  2018-07-18 18:50   ` Giuseppe Levi
@ 2018-07-18 19:53     ` Andrey Smirnov
  2018-07-18 20:39     ` Alessandro Rubini
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-07-18 19:53 UTC (permalink / raw)
  To: giuseppe.levi; +Cc: Barebox List

On Wed, Jul 18, 2018 at 11:51 AM Giuseppe Levi <giuseppe.levi@gmail.com> wrote:
>
> Ok tried with  CROSS_COMPILE=arm-linux-gnueabi- this should be 32bit arm
> then: qemu-system-arm -m 256M -machine virt -display none  -serial
> stdio -kernel barebox
>
> hangs..... any idea ? Should I use a different machine ?
>

NOTE: All of the below pertains to upstream QEMU

You are running QEMU emulating "mach-virt", which is a special generic
ARM machine in QEMU against a Barebox built for AT91. Last time I
checked former can only be configured to have Cortex-A15 (ARMv7), A53
or A57(ARMv8) as a CPU, whereas the latter is ARM9 (ARMv5), not to
mention that memory map layout for all of the peripherals _and_ type
of IP blocks used is very different. Unless I am getting something
very wrong, I'd be very much surprised if it actually worked for you.

As for using a different machine, I don't think that would help.
AFAIK, what you are trying to do is not currently supported.

> It would be very complex to create a White Rabbit virtual machine ?
> (HW description is open)

Not sure if I'd say it would be "complex", but time consuming for
sure. It took me a couple of weeks of work to add enough i.MX7 support
to QEMU for it would be able to boot stock Linux and I had a headstart
because QEMU already supported i.MX6 when I started. I haven't looked
at QEMU tree for probably 4 months, so my knowledge is a bit outdated,
but AFAIK, while ARM9 CPU emulation is availible, there's no AT91 SoC
specific IP blocks emulation that it supports. So, at a bare minimum,
just to see some serial in QEMU, you are looking at implementing your
AT91 machine with its memory map, UART IP block emulation plus any
peripherals that have to be emulated to "fool" Barebox into booting.

Thanks,
Andrey Smirnov

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

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

* Re: qemu and barebox
  2018-07-18 18:50   ` Giuseppe Levi
  2018-07-18 19:53     ` Andrey Smirnov
@ 2018-07-18 20:39     ` Alessandro Rubini
  1 sibling, 0 replies; 6+ messages in thread
From: Alessandro Rubini @ 2018-07-18 20:39 UTC (permalink / raw)
  To: andrew.smirnov; +Cc: barebox, giuseppe.levi

> Not sure if I'd say it would be "complex", but time consuming for
> sure.

Yes.

> but AFAIK, while ARM9 CPU emulation is availible, there's no AT91 SoC
> specific IP blocks emulation that it supports.

I think the fastest way to work out this setup is building barebox for
versatile and using "qemu -M versatilepb".  The WR kernel includes
drivers for the special ethernet device, but the WR port of barebox
has no serious hardware dependencies (it's just uart, flash and i2c
eeprom).  So IMHO there's no need for AT91 SOC emulation to test
different boot procedures.

/alessandro

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

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

end of thread, other threads:[~2018-07-18 20:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 13:02 qemu and barebox Giuseppe Levi
2018-07-18 13:44 ` Roland Hieber
2018-07-18 14:03 ` Alessandro Rubini
2018-07-18 18:50   ` Giuseppe Levi
2018-07-18 19:53     ` Andrey Smirnov
2018-07-18 20:39     ` Alessandro Rubini

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