aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-04 10:25:15 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-08 18:52:36 +0100
commit270b29587f4705aa8d6b46ba2c0ff5bf712cc637 (patch)
tree389d72383debd0d7166a970fb4b55f7f0aa2dbf8
parentcc363c4a10b99709ea4e9e185c7b71de72f88a17 (diff)
dino: add memory-as property containing a link to the memory address space
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220504092600.10048-6-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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
index bc27aad5dc..13b2210462 100644
--- a/hw/hppa/dino.c
+++ b/hw/hppa/dino.c
@@ -17,6 +17,7 @@
#include "hw/irq.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
+#include "hw/qdev-properties.h"
#include "migration/vmstate.h"
#include "hppa_sys.h"
#include "trace.h"
@@ -124,6 +125,8 @@ struct DinoState {
MemoryRegion pci_mem;
MemoryRegion pci_mem_alias[32];
+ MemoryRegion *memory_as;
+
AddressSpace bm_as;
MemoryRegion bm;
MemoryRegion bm_ram_alias;
@@ -521,6 +524,8 @@ PCIBus *dino_init(MemoryRegion *addr_space,
PCIBus *b;
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);
s->iar0 = s->iar1 = CPU_HPA + 3;
s->toc_addr = 0xFFFA0030; /* IO_COMMAND of CPU */
@@ -603,10 +608,17 @@ static void dino_pcihost_init(Object *obj)
sysbus_init_mmio(sbd, &s->this_mem);
}
+static Property dino_pcihost_properties[] = {
+ DEFINE_PROP_LINK("memory-as", DinoState, memory_as, TYPE_MEMORY_REGION,
+ MemoryRegion *),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void dino_pcihost_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ device_class_set_props(dc, dino_pcihost_properties);
dc->vmsd = &vmstate_dino;
}