diff options
author | Tianrui Zhao <zhaotianrui@loongson.cn> | 2022-12-14 09:57:18 +0800 |
---|---|---|
committer | Song Gao <gaosong@loongson.cn> | 2023-01-06 14:12:26 +0800 |
commit | 270950b49d36659372acbc12e65ff34969bed678 (patch) | |
tree | 6339ab29ab622befe9fd58b423ad4d863e3203ab /hw/loongarch | |
parent | 6027d2740524cf04ab38564c0c299fddbeaa6723 (diff) |
hw/intc/loongarch_pch_pic: add irq number property
With loongarch 7A1000 manual, irq number supported can be set
in PCH_PIC_INT_ID_HI register. This patch adds irq number property
for loongarch_pch_pic, so that virt machine can set different
irq number when pch_pic intc is added.
Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20230104020518.2564263-3-zhaotianrui@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'hw/loongarch')
-rw-r--r-- | hw/loongarch/virt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 82b2fb6a10..35d4bce3b3 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -616,6 +616,8 @@ static void loongarch_irq_init(LoongArchMachineState *lams) } pch_pic = qdev_new(TYPE_LOONGARCH_PCH_PIC); + num = PCH_PIC_IRQ_NUM; + qdev_prop_set_uint32(pch_pic, "pch_pic_irq_num", num); d = SYS_BUS_DEVICE(pch_pic); sysbus_realize_and_unref(d, &error_fatal); memory_region_add_subregion(get_system_memory(), VIRT_IOAPIC_REG_BASE, @@ -627,13 +629,13 @@ static void loongarch_irq_init(LoongArchMachineState *lams) VIRT_IOAPIC_REG_BASE + PCH_PIC_INT_STATUS_LO, sysbus_mmio_get_region(d, 2)); - /* Connect 64 pch_pic irqs to extioi */ - for (int i = 0; i < PCH_PIC_IRQ_NUM; i++) { + /* Connect pch_pic irqs to extioi */ + for (int i = 0; i < num; i++) { qdev_connect_gpio_out(DEVICE(d), i, qdev_get_gpio_in(extioi, i)); } pch_msi = qdev_new(TYPE_LOONGARCH_PCH_MSI); - start = PCH_PIC_IRQ_NUM; + start = num; num = EXTIOI_IRQS - start; qdev_prop_set_uint32(pch_msi, "msi_irq_base", start); qdev_prop_set_uint32(pch_msi, "msi_irq_num", num); |