Skip to content

Commit

Permalink
dino: move initial register configuration to new dino_pcihost_reset()…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
mcayland authored and taylorsimpson committed May 9, 2022
1 parent ca9280c commit 570a767
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hw/hppa/dino.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 570a767

Please sign in to comment.