hw/intc/loongarch_extioi: Use cpu plug notification
Use hotplug_handler_plug() to nofity extioi object when cold-plug
cpu is created, so that extioi can set and configure irq routing
to new cpu.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 0629347..907f965 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -312,7 +312,7 @@
static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
{
- int num, pin;
+ int num;
MachineState *ms = MACHINE(lvms);
MachineClass *mc = MACHINE_GET_CLASS(ms);
const CPUArchIdList *possible_cpus;
@@ -328,15 +328,7 @@
}
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), DEVICE(cs), &err);
-
- /*
- * connect ext irq to the cpu irq
- * cpu_pin[9:2] <= intc_pin[7:0]
- */
- for (pin = 0; pin < LS3A_INTC_IP; pin++) {
- qdev_connect_gpio_out(lvms->extioi, (num * LS3A_INTC_IP + pin),
- qdev_get_gpio_in(DEVICE(cs), pin + 2));
- }
+ hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), DEVICE(cs), &err);
}
}