/
Understanding System Device Tree vs. Device Tree

Understanding System Device Tree vs. Device Tree

In the realm of embedded systems, understanding the distinction between a system device tree and a device tree is crucial for effective development and configuration. This page aims to clarify these differences and guide customers on how to utilize AMD™'s tools such as STDGen and gen-machineconf accordingly.

Table of Contents

What is a System Device Tree?

A System Device Tree is a comprehensive representation of the entire system's hardware configuration. It encompasses not only the components relevant to the Linux operating system but also other elements that might be part of a multi-domain software system, such as hypervisors and real-time operating systems (RTOS). The system device tree provides a holistic view of the hardware setup, facilitating communication and coordination across different software domains.

What is a Device Tree?

A Device Tree, in contrast, is a data structure used specifically by an individual operating system (for example, the Linux kernel) to describe the hardware components of a system. It provides the necessary information for the operating system to understand and interact with the hardware, enabling the kernel to load appropriate drivers and manage resources effectively.

Using STDGen and gen-machine-conf

Transition from DTG to STDGen and gen-machine-conf

Previously, the Device Tree Generator (DTG) was an AMD tool used to produce a Linux device tree directly as part of PetaLinux. However, with the introduction of STDGen and gen-machine-conf, the process has evolved to offer greater flexibility and integration with multi-domain systems.

Simple Method to Obtain a Linux Device Tree

  1. Use STDGen: Begin by using the System Device Tree Generator (STDGen) to convert information from a proprietary output format, generated by the AMD Vivado Design Suite, into a system device tree. This output is standardized, open source, and stable, providing a comprehensive view of the system's hardware configuration.

  2. Utilize gen-machineconf: Next, employ gen-machineconf to extract the necessary information from the system device tree specifically for Linux. This tool creates Yocto machine configurations and isolates the Linux device tree from the broader system device tree.

By following this process, customers can obtain a Linux device tree tailored to their specific needs, while also benefiting from the broader context provided by the system device tree.

Although it is possible to use a System Device Tree directly in Linux, AMD recommends using the above method to lop off the parts of the hardware Linux cannot or should not use. In particular, depending on the order of the CPUs in the System Device Tree, Linux might attempt to use the R cores instead of the A cores.

Alternative Method Using Lopper

For users seeking an alternative method, the Lopper tool can be used to convert a system device tree into a Linux device tree. Lopper provides a flexible approach to manipulate and transform device trees.

This answer record provides instructions for how to use Lopper directly to parse a system device tree into a Linux device tree, but this method is earlier in its development cycle and is not documented or validated for all generations of AMD adaptive SoCs.

For more details on using Lopper, please visit the Lopper GitHub repository and watch this informative video.

Conclusion

Understanding the distinction between system device trees and device trees is essential for leveraging AMD's advanced tooling effectively. By using STDGen and gen-machineconf, or alternatively Lopper, customers can achieve a more integrated and flexible approach to hardware configuration, aligning with modern multi-domain software systems.

 

Related content

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy