diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-09-30 16:37:52 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-10-10 14:05:30 +0000 |
commit | fbc32cef923893f3fae6d3ab1086a99c87b058f7 (patch) | |
tree | 1df79916060b4a9825b3d895fa4f1deb7f298fbf | |
parent | e5914503f747d6e5213d08597a7da4aa95edcf59 (diff) | |
download | gem5-fbc32cef923893f3fae6d3ab1086a99c87b058f7.tar.xz |
arch-arm: Move generateDtb to ArmSystem
This is aligning with the fact that dtb autogeneration is already
possible with an ArmSystem.
Change-Id: I72149927ee70d29458f8718a03845bb293c12145
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/public/gem5/+/21602
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r-- | src/arch/arm/ArmSystem.py | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py index 70cc277b7..5629ab511 100644 --- a/src/arch/arm/ArmSystem.py +++ b/src/arch/arm/ArmSystem.py @@ -97,6 +97,23 @@ class ArmSystem(System): "Base of the 64KiB PA range used for memory-mapped m5ops. Set to 0 " "to disable.") + dtb_filename = Param.String("", + "File that contains the Device Tree Blob. Don't use DTB if empty.") + + 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) + + 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. @@ -137,30 +154,16 @@ class GenericArmSystem(ArmSystem): "Machine id from http://www.arm.linux.org.uk/developer/machines/") atags_addr = Param.Addr("Address where default atags structure should " \ "be written") - dtb_filename = Param.String("", - "File that contains the Device Tree Blob. Don't use DTB if empty.") early_kernel_symbols = Param.Bool(False, "enable early kernel symbol tables before MMU") - enable_context_switch_stats_dump = Param.Bool(False, "enable stats/task info dumping at context switch boundaries") + enable_context_switch_stats_dump = Param.Bool(False, + "enable stats/task info dumping at context switch boundaries") panic_on_panic = Param.Bool(False, "Trigger a gem5 panic if the " \ "guest kernel panics") 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" |