hw/intc/armv7m_nvic: add "num-prio-bits" property
commitd09923ad19fc3d653693ee81f1742fb8d29c5730
authorSamuel Tardieu <sam@rfc1149.net>
Sat, 6 Jan 2024 18:15:01 +0000 (6 19:15 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:42:40 +0000 (9 14:42 +0000)
tree13744d2cfb0219ca45f4a4232a112df876a4ac41
parent41581f13619d0d66593a75c5299c8d546710cc9e
hw/intc/armv7m_nvic: add "num-prio-bits" property

Cortex-M NVIC can have a different number of priority bits.
Cortex-M0/M0+/M1 devices must use 2 or more bits, while devices based
on ARMv7m and up must use 3 or more bits.

This adds a "num-prio-bits" property which will get sensible default
values if unset (2 or 8 depending on the device). Unless a SOC
specifies the number of bits to use, the previous behavior is
maintained for backward compatibility.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20240106181503.1746200-2-sam@rfc1149.net
Suggested-by: Anton Kochkov <anton.kochkov@proton.me>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1122
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/armv7m_nvic.c