arm: DT autogeneration - Generate energy controller node
authorGlenn Bergmans <glenn.bergmans@arm.com>
Fri, 22 Jan 2016 15:40:14 +0000 (15:40 +0000)
committerCurtis Dunham <curtis.dunham@arm.com>
Mon, 29 Jan 2018 22:22:29 +0000 (22:22 +0000)
Adds Device Tree methods for the energy controller to allow for
DVFS simulations with automatically generated DTB files

Change-Id: Id8682f07dff1bbe63987e757faa0694e03ee86ab
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5966
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/dev/arm/EnergyCtrl.py

index 4e504bf8041d9186e459e871061c7ac8ea5edfb2..571f941784ba78971643064deba1e66be26bd6f1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2012-2014 ARM Limited
+# Copyright (c) 2012-2014, 2016 ARM Limited
 # All rights reserved.
 #
 # The license below extends only to copyright in the software and shall
 #
 # Authors: Vasileios Spiliopoulos
 #          Akash Bagdia
+#          Glenn Bergmans
 
 from m5.params import *
 from m5.SimObject import SimObject
 from Device import BasicPioDevice
 from m5.proxy import *
+from m5.util.fdthelper import *
 
 class EnergyCtrl(BasicPioDevice):
     type = 'EnergyCtrl'
     cxx_header = "dev/arm/energy_ctrl.hh"
     dvfs_handler = Param.DVFSHandler(Parent.dvfs_handler, "DVFS handler")
+
+    def generateDeviceTree(self, state):
+        node = self.generateBasicPioDeviceNode(state, 'gem5_energy_ctrl',
+            self.pio_addr, 0x1000)
+
+        node.appendCompatible("arm,gem5-energy-ctrl")
+
+        yield node