Device Trees for Embedded Systems
In this paper, we present a method for booting a ppc64 Linux kernel on an embedded machine. To do this, we supply the kernel with a compact flattened-tree representation of the system's hardware. The layout of this flattened device tree is based closely on the device tree supplied by Open Firmware on IBM servers and Apple PowerMacs. The "blob" representing the device tree can be created using dtc - the Device Tree Compiler - which turns a simple text representation of the tree into the compact representation used by the kernel. The compiler can produce either a binary "blob" or an assembler file ready to be built into a firmware or bootwrapper image. The flattened device tree approach was originally developed to implement kexec() on ppc64. It's now used even on systems with Open Firmware as an interface between the firmware environment and the main kernel entry point. This common entry point thus takes device representation which is clean, compact and flexible. This is now the only supported method of booting a ppc64 system without Open Firmware. We believe it has a number of advantages over existing methods of booting on embedded systems. It: - easily allows a single kernel image to boot on multiple different embedded systems (particularly useful for minor board revisions) - avoids the proliferation of ad-hoc, incompatible and limited methods of getting boot information from the firmware, which has made a complete mess of ppc32 embedded support - provides a full tree, rather than a fixed set of parameters (like earlier bi_recs proposals, and the ATAGS system used on ARM Linux) - easily allows arbitrary device or board specific parameters to be included We are considering backporting the flattened device tree method to the ppc32 kernel, thereby cleaning up and consolidating the existing embedded boot code there. The code could be ported to other architectures, although since those don't have Open Firmware, the rationale is less clear.
David Gibson is a member of the IBM Linux Technology, working from Canberra, Australia. Recently he has worked on Linux hugepage support and performance counter support for ppc64, as well as the device tree compiler. In the past, he has worked on bringup for various ppc64 and ppc64 embedded systems, the orinoco wireless driver, ramfs, and a userspace checkpointing system (esky).
Benjamin Herrenschmidt was a MacOS developper for about 10 years, but ultimately saw the light and installed Linux on his Apple PowerPC machine.
After writing a bootloader, BootX, for it in 1998, he started contributing to the PowerPC linux port in various areas, mostly around the support for Apple machines. He became official PowerMac maintainer in 2001.
In 2003, he joined the IBM Linux Technology Center in Canberra, Australia, where he ported the 64 bit PowerPC kernel to Apple G5 machines and the Maple embedded board, among others things. He's a member of the ppc64 development "team" and one of his current goals is to make the integration of embedded platforms smoother and more maintainable than in the 32 bit PowerPC kernel.