[U-Boot] [ppc] qemu-ppce500 howto

Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Are there any patches pending or any tweak that should be done?
Is there any way to provide more information?
I tried: $ ./qemu-system-ppc -M ppce500 -nographic -M ppce500 -m 256 -s -S $ gdb (gdb) target remote :1234 Remote debugging using :1234 warning: Can not parse XML target description; XML support was disabled at compile time 0x00000000 in ?? () (gdb) load u-boot Loading section .bootpg, size 0x2f4 lma 0xf00000 Load failed
How can I inject the firmware using gdb?
Thanks! Alon Bar-Lev

On 22.05.14 09:52, Alon Bar-Lev wrote:
Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
If you also want to run this using KVM, please keep in mind that you need a few extra patches that are in my kvm-ppc-queue branch as well.
Alex

On Thu, May 22, 2014 at 12:04 PM, Alexander Graf agraf@suse.de wrote:
On 22.05.14 09:52, Alon Bar-Lev wrote:
Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
WORKING! thanks!
Is there any support for flush and/or mtd for this target (-drive if=pflash, -mtdblock)?
If you also want to run this using KVM, please keep in mind that you need a few extra patches that are in my kvm-ppc-queue branch as well.
Alex

On 24.05.14 09:23, Alon Bar-Lev wrote:
On Thu, May 22, 2014 at 12:04 PM, Alexander Graf agraf@suse.de wrote:
On 22.05.14 09:52, Alon Bar-Lev wrote:
Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
WORKING! thanks!
Is there any support for flush and/or mtd for this target (-drive if=pflash, -mtdblock)?
I haven't implemented pflash yet, sorry. Do you need the flash device for configuration storage or as backing storage for your kernel?
Alex

On Sun, May 25, 2014 at 1:08 PM, Alexander Graf agraf@suse.de wrote:
On 24.05.14 09:23, Alon Bar-Lev wrote:
On Thu, May 22, 2014 at 12:04 PM, Alexander Graf agraf@suse.de wrote:
On 22.05.14 09:52, Alon Bar-Lev wrote:
Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
WORKING! thanks!
Is there any support for flush and/or mtd for this target (-drive if=pflash, -mtdblock)?
I haven't implemented pflash yet, sorry. Do you need the flash device for configuration storage or as backing storage for your kernel?
Well, I wish both... :)
boot qemu as if it were a target....
1. put u-boot on pflash, and boot from it. 2. have backing storage for kernel (can be mtd). 3. have data partition (can be mtd).
we can skip (1) as -bios is good enough... but for (2), (3) I do not see solution but have either mtd or other block device support... is that possible?
Alex

On 25.05.2014, at 13:10, Alon Bar-Lev alon.barlev@gmail.com wrote:
On Sun, May 25, 2014 at 1:08 PM, Alexander Graf agraf@suse.de wrote:
On 24.05.14 09:23, Alon Bar-Lev wrote:
On Thu, May 22, 2014 at 12:04 PM, Alexander Graf agraf@suse.de wrote:
On 22.05.14 09:52, Alon Bar-Lev wrote:
Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
WORKING! thanks!
Is there any support for flush and/or mtd for this target (-drive if=pflash, -mtdblock)?
I haven't implemented pflash yet, sorry. Do you need the flash device for configuration storage or as backing storage for your kernel?
Well, I wish both... :)
boot qemu as if it were a target....
- put u-boot on pflash, and boot from it.
- have backing storage for kernel (can be mtd).
- have data partition (can be mtd).
we can skip (1) as -bios is good enough... but for (2), (3) I do not
For (2) you can use the -kernel option. It should make the payload's physical address available through an environment variable. If it's a uImage, it will get loaded automatically. For (3) you can use all the emulated block storage options QEMU provides, such as virtio-pci or ahci.
see solution but have either mtd or other block device support... is that possible?
It's definitely possible, yes :). I simply didn't implement any mtd device emulation so far in the QEMU machine model. But patches are definitely welcome!
Alex

On Sun, May 25, 2014 at 2:16 PM, Alexander Graf agraf@suse.de wrote:
On 25.05.2014, at 13:10, Alon Bar-Lev alon.barlev@gmail.com wrote:
On Sun, May 25, 2014 at 1:08 PM, Alexander Graf agraf@suse.de wrote:
On 24.05.14 09:23, Alon Bar-Lev wrote:
On Thu, May 22, 2014 at 12:04 PM, Alexander Graf agraf@suse.de wrote:
On 22.05.14 09:52, Alon Bar-Lev wrote:
Hi,
Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal.
I am using latest u-boot master and qemu master.
Command: $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin
Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
WORKING! thanks!
Is there any support for flush and/or mtd for this target (-drive if=pflash, -mtdblock)?
I haven't implemented pflash yet, sorry. Do you need the flash device for configuration storage or as backing storage for your kernel?
Well, I wish both... :)
boot qemu as if it were a target....
- put u-boot on pflash, and boot from it.
- have backing storage for kernel (can be mtd).
- have data partition (can be mtd).
we can skip (1) as -bios is good enough... but for (2), (3) I do not
For (2) you can use the -kernel option. It should make the payload's physical address available through an environment variable. If it's a uImage, it will get loaded automatically. For (3) you can use all the emulated block storage options QEMU provides, such as virtio-pci or ahci.
ahci works, thanks I did not know this notation is possible:
qemu .... \ -device ahci,id=ahci0 \ -drive if=none,file=/tmp/img1,format=raw,id=drive-sata0-0-0 \ -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0
Now I see mass storage device on pci bus.
Thanks for the reference!
Now, I am almost sure we are missing commands within the u-boot configuration to allow accessing the ide/scsi, fsinfo and friends.
see solution but have either mtd or other block device support... is that possible?
It's definitely possible, yes :). I simply didn't implement any mtd device emulation so far in the QEMU machine model. But patches are definitely welcome!
I would have glad to... However, unfortunately, I am not at that level... :(
Thanks! Alon

On 25.05.2014, at 13:33, Alon Bar-Lev alon.barlev@gmail.com wrote:
On Sun, May 25, 2014 at 2:16 PM, Alexander Graf agraf@suse.de wrote:
On 25.05.2014, at 13:10, Alon Bar-Lev alon.barlev@gmail.com wrote:
On Sun, May 25, 2014 at 1:08 PM, Alexander Graf agraf@suse.de wrote:
On 24.05.14 09:23, Alon Bar-Lev wrote:
On Thu, May 22, 2014 at 12:04 PM, Alexander Graf agraf@suse.de wrote:
On 22.05.14 09:52, Alon Bar-Lev wrote: > > Hi, > > Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and no luck, I get live signal. > > I am using latest u-boot master and qemu master. > > Command: > $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin > > Tried to load u-boot as well, same.
Yes, that command should work with the right patches :). Unfortunately they are not in master yet, but instead waiting in my queue:
Please give things a try with the ppc-next branch in there. That should get things working for you.
WORKING! thanks!
Is there any support for flush and/or mtd for this target (-drive if=pflash, -mtdblock)?
I haven't implemented pflash yet, sorry. Do you need the flash device for configuration storage or as backing storage for your kernel?
Well, I wish both... :)
boot qemu as if it were a target....
- put u-boot on pflash, and boot from it.
- have backing storage for kernel (can be mtd).
- have data partition (can be mtd).
we can skip (1) as -bios is good enough... but for (2), (3) I do not
For (2) you can use the -kernel option. It should make the payload's physical address available through an environment variable. If it's a uImage, it will get loaded automatically. For (3) you can use all the emulated block storage options QEMU provides, such as virtio-pci or ahci.
ahci works, thanks I did not know this notation is possible:
qemu .... \ -device ahci,id=ahci0 \ -drive if=none,file=/tmp/img1,format=raw,id=drive-sata0-0-0 \ -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0
Now I see mass storage device on pci bus.
Thanks for the reference!
Now, I am almost sure we are missing commands within the u-boot configuration to allow accessing the ide/scsi, fsinfo and friends.
Yes, the only device that I managed to get working was the emulated e1000 adapter. There are no virtio drivers in u-boot and the AHCI driver didn't compile for me :).
see solution but have either mtd or other block device support... is that possible?
It's definitely possible, yes :). I simply didn't implement any mtd device emulation so far in the QEMU machine model. But patches are definitely welcome!
I would have glad to... However, unfortunately, I am not at that level... :(
I'll put it on my todo list, but don't expect me to get around to it very soon :)
Alex
participants (2)
-
Alexander Graf
-
Alon Bar-Lev