Skip to content

Commit

Permalink
hppa: move dino_init() from dino.c to machine.c
Browse files Browse the repository at this point in the history
Now that dino_init() is completely decoupled from dino.c it can be moved to
machine.c with the rest of the board configuration.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-20-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 committed May 8, 2022
1 parent 36f9bbd commit 0d06899
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
14 changes: 0 additions & 14 deletions hw/hppa/dino.c
Expand Up @@ -399,20 +399,6 @@ static int dino_pci_map_irq(PCIDevice *d, int irq_num)
return slot & 0x03;
}

DinoState *dino_init(MemoryRegion *addr_space)
{
DeviceState *dev;
DinoState *s;

dev = qdev_new(TYPE_DINO_PCI_HOST_BRIDGE);
object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space),
&error_fatal);
s = DINO_PCI_HOST_BRIDGE(dev);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);

return s;
}

static void dino_pcihost_reset(DeviceState *dev)
{
DinoState *s = DINO_PCI_HOST_BRIDGE(dev);
Expand Down
2 changes: 0 additions & 2 deletions hw/hppa/hppa_sys.h
Expand Up @@ -9,9 +9,7 @@
#include "hw/intc/i8259.h"

#include "hppa_hardware.h"
#include "dino.h"

DinoState *dino_init(MemoryRegion *);
DeviceState *lasi_init(MemoryRegion *);
#define enable_lasi_lan() 0

Expand Down
12 changes: 12 additions & 0 deletions hw/hppa/machine.c
Expand Up @@ -122,6 +122,18 @@ static FWCfgState *create_fw_cfg(MachineState *ms)
return fw_cfg;
}

static DinoState *dino_init(MemoryRegion *addr_space)
{
DeviceState *dev;

dev = qdev_new(TYPE_DINO_PCI_HOST_BRIDGE);
object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space),
&error_fatal);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);

return DINO_PCI_HOST_BRIDGE(dev);
}

static void machine_hppa_init(MachineState *machine)
{
const char *kernel_filename = machine->kernel_filename;
Expand Down

0 comments on commit 0d06899

Please sign in to comment.