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>
This commit is contained in:
parent
cc363c4a10
commit
270b29587f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user