Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
?
EE Times-Asia > Embedded
?
?
Embedded??

Device tree partitioning for embedded software design

Posted: 26 Nov 2014 ?? ?Print Version ?Bookmark and Share

Keywords:Symmetric multi-processing? OS? multi-core processing? Flattened device trees? partitioning?

Figure 1 is a flow diagram for a supervised heterogeneous multi-OS design with this tool in action. It shows a hypervisor-based design in which platform information for virtual machines (hypervisor guests) is obtained from a master device tree structure. The tool also extracts relevant information about virtual machines required by the hypervisor. Although not shown here it is easy to extend this flow to generate platform information in any format, thus supporting OSes that don't employ device trees.

An algorithm for FDT partitioning
Resource configuration based on FDTs can be accomplished with the following steps:

Annotate the master DTS with additional information about multi-core, multi-OS system. There are two parts of this annotation:

First in the form of new bindings where the additional information is kept under a new node defined at the base of the tree. This information covers design specifications such as how many OSes are present in the system, their memory partitioning, cores on which they run, and the devices allocated to them.

The second part is the labelling of nodes in the master device tree in case such labels are missing. This is required for referencing master DTS nodes in the newly defined configuration node.

Decide which nodes in the master DTS should be retained for each OS. This step is the bulk of the work as it requires finding the dependency sub-trees. Additionally, there might be some mandatory nodes that need to be included for the output to be considered a valid device tree for that platform, so those need to be marked up as well, along with the dependency sub-trees.

Copy the master DTB to a buffer per OS. Run a filter removing all unmarked nodes from the copied DTB.

For supervised heterogeneous designs, additional nodes such as virtual devices might be required in the guest DTBs. Some guest related information, memory partitioning, etc., is also required by the hypervisor at runtime. The tool should have the ability to extract this information (preferably in the form of macros and definitions).

 Resource partitioning based on FDTs

Figure 1: Flow diagram for resource partitioning based on FDTs.

Supervised dual guest use case
Let's take a dummy master device tree and use the above steps to partition it for a supervised dual guest-OS configuration. It is assumed that the hardware platform is an ARM SoC, so some essential data from ARM bindings would appear in the master DTS. Guest OSes are assumed to be Linux, and the hypervisor is assumed to be stand-alone software running on bare metal.

Listing 1 shows the master device tree supporting two CPUs, each dependent on a base-clk node for its ticks. The master DTS for an ARM SoC has some essential nodes in the shape of timer and gic nodes. It also has only a couple of peripherals, namely a general purpose I/O (GPIO) and a universal asynchronous receiver/transmitter (UART). These peripherals depend on some pin multiplex (pin-mux) settings. All device nodes are labelled so that they can be referenced later on.

 Listing 1

 Listing 1

 Listing 1

Listing 1: Base (master) device tree structure.


?First Page?Previous Page 1???2???3?Next Page?Last Page



Article Comments - Device tree partitioning for embedde...
Comments:??
*? You can enter [0] more charecters.
*Verify code:
?
?
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

?
?
Back to Top