Anyone tried to run u-boot under qemu-system-ppc64 on a T1040RDB?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Anyone tried to run u-boot under qemu-system-ppc64 on a T1040RDB?

Jump to solution
3,573 Views
kimliu
Contributor II

The Freescale 1.7SDK (yes, I have not yet made the jump to 1.8) has the u-boot-qoriq_2014.07.bb recipe.

Within the u-boot source tree, there is a machine/board target of qemu-ppce500, which appears to be the target to use under qemu/KVM for PowerPC.  However, when trying to start a KVM instance with the resulting u-boot image, it appears to immediately freeze/stop.  So I am wondering if anyone has already accomplished this.

Notes:

I have tried the following:

   qemu-system-ppc64 -enable-kvm -M ppce500 -nographic -bios u-boot.bin

   qemu-system-ppc64 -enable-kvm -M ppce500 -nographic -pflash u-boot.bin

   qemu-system-ppc64 -enable-kvm -M ppce500 -nographic -kernel u-boot.elf

The last line, with the -kernel, is (attempting) to boot the ELF format image of the u-boot binary. The reason for this was I was attempting to connect a remote instance of GDB to QEMU to debug what was happening, and GDB did not like the non-ELF formats.

Tags (3)
0 Kudos
1 Solution
2,318 Views
kimliu
Contributor II

My intention in running u-boot was that I wanted to have, within the virtual machine instance, a boot loader that could choose between one of two different images/kernels to boot - a primary and backup.  The backup would be booted if an upgrade or configuration of the primary failed.  The goal had been to use u-boot to handle the decision making.

However, since booting u-boot in QEMU/KVM does not appear to be supported under the t1040rdb at the moment, I used an alternative solution.

The virtual machine boots into a first-stage initial RAM disk with its own kernel.  Within that RAM disk, a script determines which image should be booted next, then a kexec call is used to boot the target kernel/image.  This gets around the lack of u-boot support.

View solution in original post

0 Kudos
3 Replies
2,319 Views
kimliu
Contributor II

My intention in running u-boot was that I wanted to have, within the virtual machine instance, a boot loader that could choose between one of two different images/kernels to boot - a primary and backup.  The backup would be booted if an upgrade or configuration of the primary failed.  The goal had been to use u-boot to handle the decision making.

However, since booting u-boot in QEMU/KVM does not appear to be supported under the t1040rdb at the moment, I used an alternative solution.

The virtual machine boots into a first-stage initial RAM disk with its own kernel.  Within that RAM disk, a script determines which image should be booted next, then a kexec call is used to boot the target kernel/image.  This gets around the lack of u-boot support.

0 Kudos
2,318 Views
scottwood
NXP Employee
NXP Employee

I believe you're supposed to use the -bios option to run U-Boot in QEMU -- but it's possible that the QEMU in the SDK is too old.  Running U-Boot in QEMU is a feature that was added upstream; it's not a supported SDK feature AFAIK.  Try downloading the latest upstream QEMU.

2,318 Views
kimliu
Contributor II

Thank you.  Trying the latest QEMU gets me closer.

The default 'u-boot.e500' image which is packaged with QEMU will not load, but an ELF format u-boot binary built out of the SDK will load - but only as long as I do not have '-enable-kvm' added.

I will continue to investigate.

0 Kudos