diff options
Diffstat (limited to 'src/arch/arm/ArmSystem.py')
-rw-r--r-- | src/arch/arm/ArmSystem.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py index b42f219ef..245ac55df 100644 --- a/src/arch/arm/ArmSystem.py +++ b/src/arch/arm/ArmSystem.py @@ -34,9 +34,11 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Ali Saidi +# Glenn Bergmans from m5.params import * from m5.SimObject import * +from m5.util.fdthelper import * from System import System @@ -79,6 +81,27 @@ class ArmSystem(System): "Base of the 64KiB PA range used for memory-mapped m5ops. Set to 0 " "to disable.") + def generateDeviceTree(self, state): + # Generate a device tree root node for the system by creating the root + # node and adding the generated subnodes of all children. + # When a child needs to add multiple nodes, this is done by also + # creating a node called '/' which will then be merged with the + # root instead of appended. + + root = FdtNode('/') + root.append(state.addrCellsProperty()) + root.append(state.sizeCellsProperty()) + + for node in self.recurseDeviceTree(state): + # Merge root nodes instead of adding them (for children + # that need to add multiple root level nodes) + if node.get_name() == root.get_name(): + root.merge(node) + else: + root.append(node) + + return root + class GenericArmSystem(ArmSystem): type = 'GenericArmSystem' cxx_header = "arch/arm/system.hh" |