summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2017-09-11 15:17:00 -0500
committerCurtis Dunham <curtis.dunham@arm.com>2018-01-29 22:22:56 +0000
commit30919a7ef5b8d36069139e928f3b188122c50572 (patch)
treeae4f679844537002b067bc27c0c8958c2e25ce12 /configs
parentdcab5b577e35f9bf9969ccfd91309455758aaed8 (diff)
downloadgem5-30919a7ef5b8d36069139e928f3b188122c50572.tar.xz
config, arm: enable device tree autogeneration for bigLITTLE
Change-Id: Iaa5eeb3504b3ff9e46b6f592a06d6b833c830d83 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/5969 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'configs')
-rw-r--r--configs/example/arm/fs_bigLITTLE.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/configs/example/arm/fs_bigLITTLE.py b/configs/example/arm/fs_bigLITTLE.py
index 489bc53b7..7e0555c00 100644
--- a/configs/example/arm/fs_bigLITTLE.py
+++ b/configs/example/arm/fs_bigLITTLE.py
@@ -57,7 +57,6 @@ import devices
from devices import AtomicCluster, KvmCluster
-default_dtb = 'armv8_gem5_v1_big_little_2_2.dtb'
default_kernel = 'vmlinux4.3.aarch64'
default_disk = 'aarch64-ubuntu-trusty-headless.img'
default_rcs = 'bootscript.rcS'
@@ -153,7 +152,7 @@ if devices.have_kvm:
def addOptions(parser):
parser.add_argument("--restore-from", type=str, default=None,
help="Restore from checkpoint")
- parser.add_argument("--dtb", type=str, default=default_dtb,
+ parser.add_argument("--dtb", type=str, default=None,
help="DTB file to load")
parser.add_argument("--kernel", type=str, default=default_kernel,
help="Linux kernel")
@@ -249,7 +248,19 @@ def build(options):
_build_kvm(system, all_cpus)
# Linux device tree
- system.dtb_filename = SysPaths.binary(options.dtb)
+ if options.dtb is not None:
+ system.dtb_filename = SysPaths.binary(options.dtb)
+ else:
+ def create_dtb_for_system(system, filename):
+ state = FdtState(addr_cells=2, size_cells=2, cpu_cells=1)
+ rootNode = system.generateDeviceTree(state)
+
+ fdt = Fdt()
+ fdt.add_rootnode(rootNode)
+ dtb_filename = os.path.join(m5.options.outdir, filename)
+ return fdt.writeDtbFile(dtb_filename)
+
+ system.dtb_filename = create_dtb_for_system(system, 'system.dtb')
return root