mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
apb: QOMify IOMMU
This is in preparation to split the IOMMU device out of the APB. As part of this commit we also enforce separation of the IOMMU and APB devices by using a QOM object link to pass the IOMMU reference and accessing the IOMMU registers via a separate memory region mapped into the APB config space rather than directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
This commit is contained in:
parent
f5980f757c
commit
aea5b07101
3 changed files with 70 additions and 22 deletions
|
@ -469,7 +469,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
PCIDevice *ebus, *pci_dev;
|
||||
SysBusDevice *s;
|
||||
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
|
||||
DeviceState *dev;
|
||||
DeviceState *iommu, *dev;
|
||||
FWCfgState *fw_cfg;
|
||||
NICInfo *nd;
|
||||
MACAddr macaddr;
|
||||
|
@ -478,6 +478,10 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
/* init CPUs */
|
||||
cpu = sparc64_cpu_devinit(machine->cpu_type, hwdef->prom_addr);
|
||||
|
||||
/* IOMMU */
|
||||
iommu = qdev_create(NULL, TYPE_SUN4U_IOMMU);
|
||||
qdev_init_nofail(iommu);
|
||||
|
||||
/* set up devices */
|
||||
ram_init(0, machine->ram_size);
|
||||
|
||||
|
@ -487,6 +491,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
apb = APB_DEVICE(qdev_create(NULL, TYPE_APB));
|
||||
qdev_prop_set_uint64(DEVICE(apb), "special-base", APB_SPECIAL_BASE);
|
||||
qdev_prop_set_uint64(DEVICE(apb), "mem-base", APB_MEM_BASE);
|
||||
object_property_set_link(OBJECT(apb), OBJECT(iommu), "iommu", &error_abort);
|
||||
qdev_init_nofail(DEVICE(apb));
|
||||
|
||||
/* Wire up PCI interrupts to CPU */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue