aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-04 10:25:18 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-08 18:52:36 +0100
commit98d168f359319ddd20b21058a081ec77837f7347 (patch)
tree893a4ef7e6fdfb7fdb68ae60349148aa4d4a3e12
parent9cf69f444c4034e5278ec52ae9869f13ae9a2bd2 (diff)
downloadqemu-98d168f359319ddd20b21058a081ec77837f7347.zip
qemu-98d168f359319ddd20b21058a081ec77837f7347.tar.gz
qemu-98d168f359319ddd20b21058a081ec77837f7347.tar.bz2
dino: move initial register configuration to new dino_pcihost_reset() function
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220504092600.10048-9-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--hw/hppa/dino.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
index ae79ddb..d3cd857 100644
--- a/hw/hppa/dino.c
+++ b/hw/hppa/dino.c
@@ -527,8 +527,6 @@ PCIBus *dino_init(MemoryRegion *addr_space,
object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space),
&error_fatal);
s = DINO_PCI_HOST_BRIDGE(dev);
- s->iar0 = s->iar1 = CPU_HPA + 3;
- s->toc_addr = 0xFFFA0030; /* IO_COMMAND of CPU */
b = s->parent_obj.bus;
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
@@ -542,6 +540,14 @@ PCIBus *dino_init(MemoryRegion *addr_space,
return b;
}
+static void dino_pcihost_reset(DeviceState *dev)
+{
+ DinoState *s = DINO_PCI_HOST_BRIDGE(dev);
+
+ s->iar0 = s->iar1 = CPU_HPA + 3;
+ s->toc_addr = 0xFFFA0030; /* IO_COMMAND of CPU */
+}
+
static void dino_pcihost_realize(DeviceState *dev, Error **errp)
{
DinoState *s = DINO_PCI_HOST_BRIDGE(dev);
@@ -632,6 +638,7 @@ static void dino_pcihost_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ dc->reset = dino_pcihost_reset;
dc->realize = dino_pcihost_realize;
dc->unrealize = dino_pcihost_unrealize;
device_class_set_props(dc, dino_pcihost_properties);