diff options
author | David Guillen Fandos <david.guillen@arm.com> | 2015-05-13 15:02:25 +0100 |
---|---|---|
committer | David Guillen Fandos <david.guillen@arm.com> | 2015-05-13 15:02:25 +0100 |
commit | 65ecd954861aa76532ca79453afcf66a837e1fa6 (patch) | |
tree | 65a7eef6c12995b1215ce5b0622da7732fd87cea /src/dev/arm/rv_ctrl.hh | |
parent | 75c82f1fe3e654ca7d472d8f824424ff450c01d1 (diff) | |
download | gem5-65ecd954861aa76532ca79453afcf66a837e1fa6.tar.xz |
sim: Thermal support for Linux
This patch enables Linux to read the temperature using hwmon infrastructure.
In order to use this in your gem5 you need to compile the kernel using the
following configs:
CONFIG_HWMON=y
CONFIG_SENSORS_VEXPRESS=y
And a proper dts file (containing an entry such as):
dcc {
compatible = "arm,vexpress,config-bus";
arm,vexpress,config-bridge = <&v2m_sysreg>;
temp@0 {
compatible = "arm,vexpress-temp";
arm,vexpress-sysreg,func = <4 0>;
label = "DCC";
};
};
Diffstat (limited to 'src/dev/arm/rv_ctrl.hh')
-rw-r--r-- | src/dev/arm/rv_ctrl.hh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/dev/arm/rv_ctrl.hh b/src/dev/arm/rv_ctrl.hh index 1a55025a8..b325c4b16 100644 --- a/src/dev/arm/rv_ctrl.hh +++ b/src/dev/arm/rv_ctrl.hh @@ -44,6 +44,7 @@ #include "dev/io_device.hh" #include "params/RealViewCtrl.hh" #include "params/RealViewOsc.hh" +#include "params/RealViewTemperatureSensor.hh" /** @file * This implements the simple real view registers on a PBXA9 @@ -219,5 +220,32 @@ class RealViewOsc void clockPeriod(Tick clock_period); }; +/** + * This device implements the temperature sensor used in the + * RealView/Versatile Express platform. + * + * See ARM DUI 0447J (ARM Motherboard Express uATX -- V2M-P1). + */ +class RealViewTemperatureSensor + : public SimObject, RealViewCtrl::Device +{ + public: + RealViewTemperatureSensor(RealViewTemperatureSensorParams *p) + : SimObject(p), + RealViewCtrl::Device(*p->parent, RealViewCtrl::FUNC_TEMP, + p->site, p->position, p->dcc, p->device), + system(p->system) + {} + virtual ~RealViewTemperatureSensor() {}; + + public: // RealViewCtrl::Device interface + uint32_t read() const override; + void write(uint32_t temp) override {} + + protected: + /** The system this RV device belongs to */ + System * system; +}; + #endif // __DEV_ARM_RV_HH__ |