[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/2] hw/intc: Add Loongson Inter Processor Interrupt contr
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v3 1/2] hw/intc: Add Loongson Inter Processor Interrupt controller |
Date: |
Mon, 18 Jan 2021 10:09:04 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
Hi Jiaxun,
On 1/18/21 2:17 AM, Jiaxun Yang wrote:
> Loongson IPI controller is a MMIO based simple level triggered
> interrupt controller. It will trigger IRQ to it's upstream
> processor when set register is written.
>
> It also has 4 64bit mailboxes to pass boot information to
> secondary processor.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> include/hw/intc/loongson_ipi.h | 20 ++++
> hw/intc/loongson_ipi.c | 174 +++++++++++++++++++++++++++++++++
> hw/intc/Kconfig | 3 +
> hw/intc/meson.build | 1 +
> hw/intc/trace-events | 4 +
> 5 files changed, 202 insertions(+)
> create mode 100644 include/hw/intc/loongson_ipi.h
> create mode 100644 hw/intc/loongson_ipi.c
...
> +static void loongson_ipi_init(Object *obj)
> +{
> + struct loongson_ipi *p = LOONGSON_IPI(obj);
> +
> + sysbus_init_irq(SYS_BUS_DEVICE(obj), &p->parent_irq);
> +
> + memory_region_init_io(&p->mmio, obj, &pic_mmio_ops, p,
> + "loongson.ipi", R_END * 4);
> + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &p->mmio);
> + qemu_register_reset(ipi_reset, p);
You forgot to address 2 comments from v2:
- Use DeviceReset instead of qemu_register_reset()
- Missing VMState
https://www.mail-archive.com/qemu-devel@nongnu.org/msg772949.html
> +}
> +
> +static const TypeInfo loongson_ipi_info = {
> + .name = TYPE_LOONGSON_IPI,
> + .parent = TYPE_SYS_BUS_DEVICE,
> + .instance_size = sizeof(struct loongson_ipi),
> + .instance_init = loongson_ipi_init,
> +};