diff options
author | Glenn Bergmans <glenn.bergmans@arm.com> | 2016-01-22 15:25:40 +0000 |
---|---|---|
committer | Curtis Dunham <curtis.dunham@arm.com> | 2018-01-29 22:22:06 +0000 |
commit | 1a51f335ffbcf9abb685ae18daa8d00aecc6bee8 (patch) | |
tree | 0c631173f16ab60ec4f1bd098578485ff81e4b80 /src/arch/arm/ArmSystem.py | |
parent | 7e9adcce565a00de9091d7d0f9b46d9e479e6625 (diff) | |
download | gem5-1a51f335ffbcf9abb685ae18daa8d00aecc6bee8.tar.xz |
arm: DT autogeneration - Generate memory node
Implements a high level method for generating a Device Tree node for
an AbstractMemory object.
Change-Id: I544ec642f182f103df26de535fdfaf03b3787a08
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5964
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/ArmSystem.py')
-rw-r--r-- | src/arch/arm/ArmSystem.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py index 245ac55df..f76140bc9 100644 --- a/src/arch/arm/ArmSystem.py +++ b/src/arch/arm/ArmSystem.py @@ -88,10 +88,22 @@ class ArmSystem(System): # creating a node called '/' which will then be merged with the # root instead of appended. + def generateMemNode(mem_range): + node = FdtNode("memory@%x" % long(mem_range.start)) + node.append(FdtPropertyStrings("device_type", ["memory"])) + node.append(FdtPropertyWords("reg", + state.addrCells(mem_range.start) + + state.sizeCells(mem_range.size()) )) + return node + root = FdtNode('/') root.append(state.addrCellsProperty()) root.append(state.sizeCellsProperty()) + # Add memory nodes + for mem_range in self.mem_ranges: + root.append(generateMemNode(mem_range)) + for node in self.recurseDeviceTree(state): # Merge root nodes instead of adding them (for children # that need to add multiple root level nodes) |