summaryrefslogtreecommitdiff
path: root/src/arch/arm
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2019-01-25 14:29:24 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2019-01-30 12:14:00 +0000
commit00ef23b5700175830834f32cdd678e0b002a777d (patch)
tree79795c398474d8aa7819b6c6de675e6a287c4af6 /src/arch/arm
parentb2d24ff236dd3acd555579b260870538f309708c (diff)
downloadgem5-00ef23b5700175830834f32cdd678e0b002a777d.tar.xz
arch-arm, configs: Create single instance of DTB autogeneration
This patch is rewriting the DTB autogeneration functions available in fs_bigLITTLE.py and fs.py as a single method in the GenericArmSystem so that other configuration scripts can make use of it. Change-Id: I492bbf77e6b0ac5c5fbdbc75c0eecba29bd63bda Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15958 Reviewed-by: Ciro Santilli <ciro.santilli@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm')
-rw-r--r--src/arch/arm/ArmSystem.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py
index bee38a41c..98ff95918 100644
--- a/src/arch/arm/ArmSystem.py
+++ b/src/arch/arm/ArmSystem.py
@@ -37,6 +37,7 @@
# Glenn Bergmans
from m5.params import *
+from m5.options import *
from m5.SimObject import *
from m5.util.fdthelper import *
@@ -138,6 +139,19 @@ class GenericArmSystem(ArmSystem):
panic_on_oops = Param.Bool(False, "Trigger a gem5 panic if the " \
"guest kernel oopses")
+ def generateDtb(self, outdir, filename):
+ """
+ Autogenerate DTB. Arguments are the folder where the DTB
+ will be stored, and the name of the DTB file.
+ """
+ state = FdtState(addr_cells=2, size_cells=2, cpu_cells=1)
+ rootNode = self.generateDeviceTree(state)
+
+ fdt = Fdt()
+ fdt.add_rootnode(rootNode)
+ dtb_filename = os.path.join(outdir, filename)
+ self.dtb_filename = fdt.writeDtbFile(dtb_filename)
+
class LinuxArmSystem(GenericArmSystem):
type = 'LinuxArmSystem'
cxx_header = "arch/arm/linux/system.hh"