ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in()
Signed-off-by: Cédric Le Goater <clg@kaod.org> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220705145814.461723-4-clg@kaod.org> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
47b60fc625
commit
0f3e0c6fd3
@ -262,16 +262,16 @@ static void ppc_core99_init(MachineState *machine)
|
||||
switch (PPC_INPUT(env)) {
|
||||
case PPC_FLAGS_INPUT_6xx:
|
||||
openpic_irqs[i].irq[OPENPIC_OUTPUT_INT] =
|
||||
((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
|
||||
qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT);
|
||||
openpic_irqs[i].irq[OPENPIC_OUTPUT_CINT] =
|
||||
((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
|
||||
qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT);
|
||||
openpic_irqs[i].irq[OPENPIC_OUTPUT_MCK] =
|
||||
((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_MCP];
|
||||
qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_MCP);
|
||||
/* Not connected ? */
|
||||
openpic_irqs[i].irq[OPENPIC_OUTPUT_DEBUG] = NULL;
|
||||
/* Check this */
|
||||
openpic_irqs[i].irq[OPENPIC_OUTPUT_RESET] =
|
||||
((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_HRESET];
|
||||
qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_HRESET);
|
||||
break;
|
||||
#if defined(TARGET_PPC64)
|
||||
case PPC_FLAGS_INPUT_970:
|
||||
|
@ -271,7 +271,7 @@ static void ppc_heathrow_init(MachineState *machine)
|
||||
case PPC_FLAGS_INPUT_6xx:
|
||||
/* XXX: we register only 1 output pin for heathrow PIC */
|
||||
qdev_connect_gpio_out(pic_dev, 0,
|
||||
((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT]);
|
||||
qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT));
|
||||
break;
|
||||
default:
|
||||
error_report("Bus model not supported on OldWorld Mac machine");
|
||||
|
@ -155,7 +155,7 @@ static void pegasos2_init(MachineState *machine)
|
||||
|
||||
/* Marvell Discovery II system controller */
|
||||
pm->mv = DEVICE(sysbus_create_simple(TYPE_MV64361, -1,
|
||||
((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT]));
|
||||
qdev_get_gpio_in(DEVICE(pm->cpu), PPC6xx_INPUT_INT)));
|
||||
pci_bus = mv64361_get_pci_bus(pm->mv, 1);
|
||||
|
||||
/* VIA VT8231 South Bridge (multifunction PCI device) */
|
||||
|
@ -154,10 +154,7 @@ static void ppc6xx_set_irq(void *opaque, int pin, int level)
|
||||
|
||||
void ppc6xx_irq_init(PowerPCCPU *cpu)
|
||||
{
|
||||
CPUPPCState *env = &cpu->env;
|
||||
|
||||
env->irq_inputs = (void **)qemu_allocate_irqs(&ppc6xx_set_irq, cpu,
|
||||
PPC6xx_INPUT_NB);
|
||||
qdev_init_gpio_in(DEVICE(cpu), ppc6xx_set_irq, PPC6xx_INPUT_NB);
|
||||
}
|
||||
|
||||
#if defined(TARGET_PPC64)
|
||||
|
@ -275,7 +275,7 @@ static void ibm_40p_init(MachineState *machine)
|
||||
/* PCI -> ISA bridge */
|
||||
i82378_dev = DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(11, 0), "i82378"));
|
||||
qdev_connect_gpio_out(i82378_dev, 0,
|
||||
cpu->env.irq_inputs[PPC6xx_INPUT_INT]);
|
||||
qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT));
|
||||
sysbus_connect_irq(pcihost, 0, qdev_get_gpio_in(i82378_dev, 15));
|
||||
isa_bus = ISA_BUS(qdev_get_child_bus(i82378_dev, "isa.0"));
|
||||
|
||||
|
@ -262,7 +262,7 @@ static void prep_systemio_realize(DeviceState *dev, Error **errp)
|
||||
qemu_set_irq(s->non_contiguous_io_map_irq,
|
||||
s->iomap_type & PORT0850_IOMAP_NONCONTIGUOUS);
|
||||
cpu = POWERPC_CPU(first_cpu);
|
||||
s->softreset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
|
||||
s->softreset_irq = qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_HRESET);
|
||||
|
||||
isa_register_portio_list(isa, &s->portio, 0x0, ppc_io800_port_list, s,
|
||||
"systemio800");
|
||||
|
Loading…
Reference in New Issue
Block a user