mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 19:14:58 -06:00
hw/arm/virt: Enable TZ extensions on the GIC if we are using them
If we're creating a board with support for TrustZone, then enable it on the GIC model as well as on the CPUs. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-id: 1441383782-24378-7-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
2d710006a0
commit
0e21f183ca
1 changed files with 5 additions and 2 deletions
|
@ -396,7 +396,7 @@ static void create_v2m(VirtBoardInfo *vbi, qemu_irq *pic)
|
||||||
fdt_add_v2m_gic_node(vbi);
|
fdt_add_v2m_gic_node(vbi);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic)
|
static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic, bool secure)
|
||||||
{
|
{
|
||||||
/* We create a standalone GIC v2 */
|
/* We create a standalone GIC v2 */
|
||||||
DeviceState *gicdev;
|
DeviceState *gicdev;
|
||||||
|
@ -413,6 +413,9 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic)
|
||||||
* interrupts; there are always 32 of the former (mandated by GIC spec).
|
* interrupts; there are always 32 of the former (mandated by GIC spec).
|
||||||
*/
|
*/
|
||||||
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()) {
|
||||||
|
qdev_prop_set_bit(gicdev, "has-security-extensions", secure);
|
||||||
|
}
|
||||||
qdev_init_nofail(gicdev);
|
qdev_init_nofail(gicdev);
|
||||||
gicbusdev = SYS_BUS_DEVICE(gicdev);
|
gicbusdev = SYS_BUS_DEVICE(gicdev);
|
||||||
sysbus_mmio_map(gicbusdev, 0, vbi->memmap[VIRT_GIC_DIST].base);
|
sysbus_mmio_map(gicbusdev, 0, vbi->memmap[VIRT_GIC_DIST].base);
|
||||||
|
@ -967,7 +970,7 @@ static void machvirt_init(MachineState *machine)
|
||||||
|
|
||||||
create_flash(vbi);
|
create_flash(vbi);
|
||||||
|
|
||||||
create_gic(vbi, pic);
|
create_gic(vbi, pic, vms->secure);
|
||||||
|
|
||||||
create_uart(vbi, pic);
|
create_uart(vbi, pic);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue