hw/arm/virt: parameter passing cleanups
Some simple cleanups made possible by "hw/arm/virt: Merge VirtBoardInfo and VirtMachineState" Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20170102200153.28864-6-drjones@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
8c92c6a43e
commit
0127937b20
|
@ -553,10 +553,10 @@ static void create_v2m(VirtMachineState *vms, qemu_irq *pic)
|
||||||
fdt_add_v2m_gic_node(vms);
|
fdt_add_v2m_gic_node(vms);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type,
|
static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type)
|
||||||
bool secure, bool no_its)
|
|
||||||
{
|
{
|
||||||
/* We create a standalone GIC */
|
/* We create a standalone GIC */
|
||||||
|
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
|
||||||
DeviceState *gicdev;
|
DeviceState *gicdev;
|
||||||
SysBusDevice *gicbusdev;
|
SysBusDevice *gicbusdev;
|
||||||
const char *gictype;
|
const char *gictype;
|
||||||
|
@ -572,7 +572,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type,
|
||||||
*/
|
*/
|
||||||
qdev_prop_set_uint32(gicdev, "num-irq", NUM_IRQS + 32);
|
qdev_prop_set_uint32(gicdev, "num-irq", NUM_IRQS + 32);
|
||||||
if (!kvm_irqchip_in_kernel()) {
|
if (!kvm_irqchip_in_kernel()) {
|
||||||
qdev_prop_set_bit(gicdev, "has-security-extensions", secure);
|
qdev_prop_set_bit(gicdev, "has-security-extensions", vms->secure);
|
||||||
}
|
}
|
||||||
qdev_init_nofail(gicdev);
|
qdev_init_nofail(gicdev);
|
||||||
gicbusdev = SYS_BUS_DEVICE(gicdev);
|
gicbusdev = SYS_BUS_DEVICE(gicdev);
|
||||||
|
@ -618,7 +618,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type,
|
||||||
|
|
||||||
fdt_add_gic_node(vms, type);
|
fdt_add_gic_node(vms, type);
|
||||||
|
|
||||||
if (type == 3 && !no_its) {
|
if (type == 3 && !vmc->no_its) {
|
||||||
create_its(vms, gicdev);
|
create_its(vms, gicdev);
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
create_v2m(vms, pic);
|
create_v2m(vms, pic);
|
||||||
|
@ -980,8 +980,7 @@ static void create_pcie_irq_map(const VirtMachineState *vms,
|
||||||
0x7 /* PCI irq */);
|
0x7 /* PCI irq */);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_pcie(const VirtMachineState *vms, qemu_irq *pic,
|
static void create_pcie(const VirtMachineState *vms, qemu_irq *pic)
|
||||||
bool use_highmem)
|
|
||||||
{
|
{
|
||||||
hwaddr base_mmio = vms->memmap[VIRT_PCIE_MMIO].base;
|
hwaddr base_mmio = vms->memmap[VIRT_PCIE_MMIO].base;
|
||||||
hwaddr size_mmio = vms->memmap[VIRT_PCIE_MMIO].size;
|
hwaddr size_mmio = vms->memmap[VIRT_PCIE_MMIO].size;
|
||||||
|
@ -1024,7 +1023,7 @@ static void create_pcie(const VirtMachineState *vms, qemu_irq *pic,
|
||||||
mmio_reg, base_mmio, size_mmio);
|
mmio_reg, base_mmio, size_mmio);
|
||||||
memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias);
|
memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias);
|
||||||
|
|
||||||
if (use_highmem) {
|
if (vms->highmem) {
|
||||||
/* Map high MMIO space */
|
/* Map high MMIO space */
|
||||||
MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1);
|
MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1);
|
||||||
|
|
||||||
|
@ -1073,7 +1072,7 @@ static void create_pcie(const VirtMachineState *vms, qemu_irq *pic,
|
||||||
qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg",
|
qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg",
|
||||||
2, base_ecam, 2, size_ecam);
|
2, base_ecam, 2, size_ecam);
|
||||||
|
|
||||||
if (use_highmem) {
|
if (vms->highmem) {
|
||||||
qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges",
|
qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges",
|
||||||
1, FDT_PCI_RANGE_IOPORT, 2, 0,
|
1, FDT_PCI_RANGE_IOPORT, 2, 0,
|
||||||
2, base_pio, 2, size_pio,
|
2, base_pio, 2, size_pio,
|
||||||
|
@ -1384,7 +1383,7 @@ static void machvirt_init(MachineState *machine)
|
||||||
|
|
||||||
create_flash(vms, sysmem, secure_sysmem ? secure_sysmem : sysmem);
|
create_flash(vms, sysmem, secure_sysmem ? secure_sysmem : sysmem);
|
||||||
|
|
||||||
create_gic(vms, pic, gic_version, vms->secure, vmc->no_its);
|
create_gic(vms, pic, gic_version);
|
||||||
|
|
||||||
fdt_add_pmu_nodes(vms, gic_version);
|
fdt_add_pmu_nodes(vms, gic_version);
|
||||||
|
|
||||||
|
@ -1397,7 +1396,7 @@ static void machvirt_init(MachineState *machine)
|
||||||
|
|
||||||
create_rtc(vms, pic);
|
create_rtc(vms, pic);
|
||||||
|
|
||||||
create_pcie(vms, pic, vms->highmem);
|
create_pcie(vms, pic);
|
||||||
|
|
||||||
create_gpio(vms, pic);
|
create_gpio(vms, pic);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue