[Qemu-devel] CELF Project Proposal - Device tree support for QEMU system emulation.


Blue Swirl <blauwirbel@...>
 

On Thu, Dec 17, 2009 at 4:46 AM, Rob Landley <rob@...> wrote:
For background of CELF project proposals, see:

 http://elinux.org/CELF_Open_Project_Proposal_2010

Summary:

Integrate a flattened device tree parser into the emulator QEMU, so QEMU can
create board emulations on the fly (at runtime) from the same data files the
Linux kernel uses to attach drivers to hardware.

Proposer:

Rob Landley

Description:

Currently, the QEMU is emulating system boards via hardwired .c files, which
explicitly set up the resources for each emulation in a separate C function.
In theory, QEMU could parse the same device tree data format the Linux kernel
uses to set up its hardware resources,  and then pass hardware resources along
to kernels it invokes through its built-in bootloader (I.E. with the -kernel
option).  This could allow new boards to be added to qemu simply by supplying
device tree files at runtime (assuming emulations for the appropriate
peripherals had already been implemented in QEMU).
In addition to -kernel case, the device tree should be passed to
OpenBIOS, which would generate OF tree from DT. This would be useful
for OSes other than Linux.

Another interesting case is sun4v hypervisor, which uses a similar
device tree. Some DT transformation would be required in QEMU.