]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
irqchip/sifive-plic: Add support for UltraRISC DP1000 PLIC
authorCharles Mirabile <cmirabil@redhat.com>
Fri, 24 Oct 2025 08:36:43 +0000 (09:36 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 27 Oct 2025 11:11:56 +0000 (12:11 +0100)
commit539d147ef69c3e2f9817de0fcf1dc8ba12938909
tree2fabf1911c3746247d3597a82ff4d52d18ecc6eb
parent14ff9e54dd14339776afff78e2d29e0edb3a4402
irqchip/sifive-plic: Add support for UltraRISC DP1000 PLIC

Add a new compatible for the plic found in UltraRISC DP1000 with a quirk to
work around a known hardware bug with IRQ claiming in the UR-CP100 cores.

When claiming an interrupt on UR-CP100 cores, all other interrupts must be
disabled before the claim register is accessed to prevent incorrect
handling of the interrupt. This is a hardware bug in the CP100 core
implementation, not specific to the DP1000 SoC.

When the PLIC_QUIRK_CP100_CLAIM_REGISTER_ERRATUM flag is present, a
specialized handler (plic_handle_irq_cp100) disables all interrupts except
for the first pending one before reading the claim register, and then
restores the interrupts before further processing of the claimed interrupt
continues.

This implementation leverages the enable_save optimization, which maintains
the current interrupt enable state in memory, avoiding additional register
reads during the workaround.

The driver matches on "ultrarisc,cp100-plic" to apply the quirk to all
SoCs using UR-CP100 cores, regardless of the specific SoC implementation.
This has no impact on other platforms.

[ tglx: Condensed the code a bit, massaged change log and comments ]

Co-developed-by: Zhang Xincheng <zhangxincheng@ultrarisc.com>
Signed-off-by: Zhang Xincheng <zhangxincheng@ultrarisc.com>
Signed-off-by: Charles Mirabile <cmirabil@redhat.com>
Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://patch.msgid.link/20251024083647.475239-5-lzampier@redhat.com
drivers/irqchip/irq-sifive-plic.c