summaryrefslogtreecommitdiff
path: root/src/dev/arm/gpu_nomali.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-02-23 11:49:35 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2016-02-23 11:49:35 +0000
commite2cea54deb1a06bb38e669937bf5f6aad24220c4 (patch)
tree1179b500fb26d1038dd3702348d410f3b75eaf57 /src/dev/arm/gpu_nomali.cc
parent81a8ce356460c020bcab12801d91726ea886f7c2 (diff)
downloadgem5-e2cea54deb1a06bb38e669937bf5f6aad24220c4.tar.xz
dev, arm: Implement the NoMali reset callback
Add a callback handler for the NoMali reset callback. This callback is called whenever the GPU is reset using the register interface or the NoMali API. The callback can be used to override ID registers using the raw register API.
Diffstat (limited to 'src/dev/arm/gpu_nomali.cc')
-rw-r--r--src/dev/arm/gpu_nomali.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/dev/arm/gpu_nomali.cc b/src/dev/arm/gpu_nomali.cc
index 3f074b595..da0f43ef9 100644
--- a/src/dev/arm/gpu_nomali.cc
+++ b/src/dev/arm/gpu_nomali.cc
@@ -92,6 +92,13 @@ NoMaliGpu::NoMaliGpu(const NoMaliGpuParams *p)
cbk_int.func.interrupt = NoMaliGpu::_interrupt;
setCallback(cbk_int);
+ /* Setup a reset callback */
+ nomali_callback_t cbk_rst;
+ cbk_rst.type = NOMALI_CALLBACK_RESET;
+ cbk_rst.usr = (void *)this;
+ cbk_rst.func.reset = NoMaliGpu::_reset;
+ setCallback(cbk_rst);
+
panicOnErr(
nomali_get_info(nomali, &nomaliInfo),
"Failed to get NoMali information struct");
@@ -102,6 +109,18 @@ NoMaliGpu::~NoMaliGpu()
nomali_destroy(nomali);
}
+
+void
+NoMaliGpu::init()
+{
+ PioDevice::init();
+
+ /* Reset the GPU here since the reset callback won't have been
+ * installed when the GPU was reset at instantiation time.
+ */
+ reset();
+}
+
void
NoMaliGpu::serialize(CheckpointOut &cp) const
{
@@ -268,6 +287,12 @@ NoMaliGpu::onInterrupt(nomali_int_t intno, bool set)
}
void
+NoMaliGpu::onReset()
+{
+ DPRINTF(NoMali, "Reset\n");
+}
+
+void
NoMaliGpu::setCallback(const nomali_callback_t &callback)
{
DPRINTF(NoMali, "Registering callback %i\n",
@@ -287,6 +312,14 @@ NoMaliGpu::_interrupt(nomali_handle_t h, void *usr,
_this->onInterrupt(intno, !!set);
}
+void
+NoMaliGpu::_reset(nomali_handle_t h, void *usr)
+{
+ NoMaliGpu *_this(static_cast<NoMaliGpu *>(usr));
+
+ _this->onReset();
+}
+
NoMaliGpu *
NoMaliGpuParams::create()
{