aboutsummaryrefslogtreecommitdiff
path: root/hw/dma
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2013-04-16 10:22:41 +1000
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2013-04-16 10:04:22 +0200
commit897374db7db10a9c17fd4da4e089705b553b4ee1 (patch)
tree872df8bb68d3aa81a98c08eb890bfef090cdf48d /hw/dma
parentcbde584f58b484a8200eb578a5ba81057488f0eb (diff)
downloadqemu-897374db7db10a9c17fd4da4e089705b553b4ee1.zip
qemu-897374db7db10a9c17fd4da4e089705b553b4ee1.tar.gz
qemu-897374db7db10a9c17fd4da4e089705b553b4ee1.tar.bz2
xilinx_axidma: Register reset properly
Register the reset function as the Device::reset function rather than explicitly call it from the sysbus::init. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw/dma')
-rw-r--r--hw/dma/xilinx_axidma.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
index 0b5bb44..91b8f07 100644
--- a/hw/dma/xilinx_axidma.c
+++ b/hw/dma/xilinx_axidma.c
@@ -357,6 +357,16 @@ static void stream_process_s2mem(struct Stream *s,
}
}
+static void xilinx_axidma_reset(DeviceState *dev)
+{
+ int i;
+ XilinxAXIDMA *s = XILINX_AXI_DMA(dev);
+
+ for (i = 0; i < 2; i++) {
+ stream_reset(&s->streams[i]);
+ }
+}
+
static void
axidma_push(StreamSlave *obj, unsigned char *buf, size_t len, uint32_t *app)
{
@@ -477,7 +487,6 @@ static int xilinx_axidma_init(SysBusDevice *dev)
sysbus_init_mmio(dev, &s->iomem);
for (i = 0; i < 2; i++) {
- stream_reset(&s->streams[i]);
s->streams[i].nr = i;
s->streams[i].bh = qemu_bh_new(timer_hit, &s->streams[i]);
s->streams[i].ptimer = ptimer_init(s->streams[i].bh);
@@ -506,6 +515,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
StreamSlaveClass *ssc = STREAM_SLAVE_CLASS(klass);
k->init = xilinx_axidma_init;
+ dc->reset = xilinx_axidma_reset;
dc->props = axidma_properties;
ssc->push = axidma_push;
}