ArmSystem.py (12469:ea3fefba5a72) ArmSystem.py (12471:5744a5f7ed2e)
1# Copyright (c) 2009, 2012-2013, 2015-2017 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 74 unchanged lines hidden (view full) ---

83
84 def generateDeviceTree(self, state):
85 # Generate a device tree root node for the system by creating the root
86 # node and adding the generated subnodes of all children.
87 # When a child needs to add multiple nodes, this is done by also
88 # creating a node called '/' which will then be merged with the
89 # root instead of appended.
90
1# Copyright (c) 2009, 2012-2013, 2015-2017 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 74 unchanged lines hidden (view full) ---

83
84 def generateDeviceTree(self, state):
85 # Generate a device tree root node for the system by creating the root
86 # node and adding the generated subnodes of all children.
87 # When a child needs to add multiple nodes, this is done by also
88 # creating a node called '/' which will then be merged with the
89 # root instead of appended.
90
91 def generateMemNode(mem_range):
92 node = FdtNode("memory@%x" % long(mem_range.start))
93 node.append(FdtPropertyStrings("device_type", ["memory"]))
94 node.append(FdtPropertyWords("reg",
95 state.addrCells(mem_range.start) +
96 state.sizeCells(mem_range.size()) ))
97 return node
98
91 root = FdtNode('/')
92 root.append(state.addrCellsProperty())
93 root.append(state.sizeCellsProperty())
94
99 root = FdtNode('/')
100 root.append(state.addrCellsProperty())
101 root.append(state.sizeCellsProperty())
102
103 # Add memory nodes
104 for mem_range in self.mem_ranges:
105 root.append(generateMemNode(mem_range))
106
95 for node in self.recurseDeviceTree(state):
96 # Merge root nodes instead of adding them (for children
97 # that need to add multiple root level nodes)
98 if node.get_name() == root.get_name():
99 root.merge(node)
100 else:
101 root.append(node)
102

--- 36 unchanged lines hidden ---
107 for node in self.recurseDeviceTree(state):
108 # Merge root nodes instead of adding them (for children
109 # that need to add multiple root level nodes)
110 if node.get_name() == root.get_name():
111 root.merge(node)
112 else:
113 root.append(node)
114

--- 36 unchanged lines hidden ---