mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/intc: sifive_plic: Change "priority-base" to start from interrupt source 0
At present the SiFive PLIC model "priority-base" expects interrupt priority register base starting from source 1 instead source 0, that's why on most platforms "priority-base" is set to 0x04 except 'opentitan' machine. 'opentitan' should have set "priority-base" to 0x04 too. Note the irq number calculation in sifive_plic_{read,write} is correct as the codes make up for the irq number by adding 1. Let's simply update "priority-base" to start from interrupt source 0 and add a comment to make it crystal clear. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com> Message-Id: <20221211030829.802437-14-bmeng@tinylab.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
59f74489cf
commit
5decd2c521
6 changed files with 8 additions and 7 deletions
|
@ -155,7 +155,7 @@ enum {
|
|||
|
||||
#define MICROCHIP_PFSOC_PLIC_NUM_SOURCES 187
|
||||
#define MICROCHIP_PFSOC_PLIC_NUM_PRIORITIES 7
|
||||
#define MICROCHIP_PFSOC_PLIC_PRIORITY_BASE 0x04
|
||||
#define MICROCHIP_PFSOC_PLIC_PRIORITY_BASE 0x00
|
||||
#define MICROCHIP_PFSOC_PLIC_PENDING_BASE 0x1000
|
||||
#define MICROCHIP_PFSOC_PLIC_ENABLE_BASE 0x2000
|
||||
#define MICROCHIP_PFSOC_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -65,7 +65,7 @@ enum {
|
|||
#define SHAKTI_C_PLIC_NUM_SOURCES 28
|
||||
/* Excluding Priority 0 */
|
||||
#define SHAKTI_C_PLIC_NUM_PRIORITIES 2
|
||||
#define SHAKTI_C_PLIC_PRIORITY_BASE 0x04
|
||||
#define SHAKTI_C_PLIC_PRIORITY_BASE 0x00
|
||||
#define SHAKTI_C_PLIC_PENDING_BASE 0x1000
|
||||
#define SHAKTI_C_PLIC_ENABLE_BASE 0x2000
|
||||
#define SHAKTI_C_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -89,7 +89,7 @@ enum {
|
|||
*/
|
||||
#define SIFIVE_E_PLIC_NUM_SOURCES 53
|
||||
#define SIFIVE_E_PLIC_NUM_PRIORITIES 7
|
||||
#define SIFIVE_E_PLIC_PRIORITY_BASE 0x04
|
||||
#define SIFIVE_E_PLIC_PRIORITY_BASE 0x00
|
||||
#define SIFIVE_E_PLIC_PENDING_BASE 0x1000
|
||||
#define SIFIVE_E_PLIC_ENABLE_BASE 0x2000
|
||||
#define SIFIVE_E_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -158,7 +158,7 @@ enum {
|
|||
|
||||
#define SIFIVE_U_PLIC_NUM_SOURCES 54
|
||||
#define SIFIVE_U_PLIC_NUM_PRIORITIES 7
|
||||
#define SIFIVE_U_PLIC_PRIORITY_BASE 0x04
|
||||
#define SIFIVE_U_PLIC_PRIORITY_BASE 0x00
|
||||
#define SIFIVE_U_PLIC_PENDING_BASE 0x1000
|
||||
#define SIFIVE_U_PLIC_ENABLE_BASE 0x2000
|
||||
#define SIFIVE_U_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -98,7 +98,7 @@ enum {
|
|||
#define VIRT_IRQCHIP_MAX_GUESTS_BITS 3
|
||||
#define VIRT_IRQCHIP_MAX_GUESTS ((1U << VIRT_IRQCHIP_MAX_GUESTS_BITS) - 1U)
|
||||
|
||||
#define VIRT_PLIC_PRIORITY_BASE 0x04
|
||||
#define VIRT_PLIC_PRIORITY_BASE 0x00
|
||||
#define VIRT_PLIC_PENDING_BASE 0x1000
|
||||
#define VIRT_PLIC_ENABLE_BASE 0x2000
|
||||
#define VIRT_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue