irqchip/loongarch-avec: Add AVEC irqchip support
authorTianyang Zhang <zhangtianyang@loongson.cn>
Fri, 23 Aug 2024 10:43:37 +0000 (18:43 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 Aug 2024 18:40:27 +0000 (20:40 +0200)
commitae16f05c928a1336d5d9d19fd805d7bf29c3f0c8
tree8401ebc9dcb5177136a38791fdd35040cd6d86bc
parenta1d4646d34c6642194a421ca9afbd060b0f9aa00
irqchip/loongarch-avec: Add AVEC irqchip support

Introduce the advanced extended interrupt controllers (AVECINTC). This
feature will allow each core to have 256 independent interrupt vectors
and MSI interrupts can be independently routed to any vector on any CPU.

The whole topology of irqchips in LoongArch machines looks like this if
AVECINTC is supported:

  +-----+     +-----------------------+     +-------+
  | IPI | --> |        CPUINTC        | <-- | Timer |
  +-----+     +-----------------------+     +-------+
               ^          ^          ^
               |          |          |
        +---------+ +----------+ +---------+     +-------+
        | EIOINTC | | AVECINTC | | LIOINTC | <-- | UARTs |
        +---------+ +----------+ +---------+     +-------+
             ^            ^
             |            |
        +---------+  +---------+
        | PCH-PIC |  | PCH-MSI |
        +---------+  +---------+
          ^     ^           ^
          |     |           |
  +---------+ +---------+ +---------+
  | Devices | | PCH-LPC | | Devices |
  +---------+ +---------+ +---------+
                   ^
                   |
              +---------+
              | Devices |
              +---------+

Co-developed-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Co-developed-by: Liupu Wang <wangliupu@loongson.cn>
Signed-off-by: Liupu Wang <wangliupu@loongson.cn>
Co-developed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240823104337.25577-2-zhangtianyang@loongson.cn
arch/loongarch/Kconfig
arch/loongarch/include/asm/irq.h
arch/loongarch/kernel/paravirt.c
arch/loongarch/kernel/smp.c
drivers/irqchip/Makefile
drivers/irqchip/irq-loongarch-avec.c [new file with mode: 0644]
drivers/irqchip/irq-loongarch-cpu.c
drivers/irqchip/irq-loongson-eiointc.c
drivers/irqchip/irq-loongson-pch-msi.c
drivers/irqchip/irq-loongson.h
include/linux/cpuhotplug.h