mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
RISC-V: Replace hardcoded constants with enum values
The RISC-V device-tree code has a number of hard-coded constants and this change moves them into header enums. Cc: Sagar Karandikar <sagark@eecs.berkeley.edu> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
c8b7e627b4
commit
2a8756ed7d
8 changed files with 31 additions and 12 deletions
|
@ -47,4 +47,8 @@ enum {
|
|||
SIFIVE_TIME_BASE = 0xBFF8
|
||||
};
|
||||
|
||||
enum {
|
||||
SIFIVE_CLINT_TIMEBASE_FREQ = 10000000
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -50,6 +50,10 @@ enum {
|
|||
SIFIVE_U_UART1_IRQ = 4
|
||||
};
|
||||
|
||||
enum {
|
||||
SIFIVE_U_CLOCK_FREQ = 1000000000
|
||||
};
|
||||
|
||||
#define SIFIVE_U_PLIC_HART_CONFIG "MS"
|
||||
#define SIFIVE_U_PLIC_NUM_SOURCES 127
|
||||
#define SIFIVE_U_PLIC_NUM_PRIORITIES 7
|
||||
|
|
|
@ -42,6 +42,10 @@ enum {
|
|||
SPIKE_DRAM
|
||||
};
|
||||
|
||||
enum {
|
||||
SPIKE_CLOCK_FREQ = 1000000000
|
||||
};
|
||||
|
||||
#if defined(TARGET_RISCV32)
|
||||
#define SPIKE_V1_09_1_CPU TYPE_RISCV_CPU_RV32GCSU_V1_09_1
|
||||
#define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_RV32GCSU_V1_10_0
|
||||
|
|
|
@ -55,6 +55,10 @@ enum {
|
|||
VIRTIO_NDEV = 10
|
||||
};
|
||||
|
||||
enum {
|
||||
VIRT_CLOCK_FREQ = 1000000000
|
||||
};
|
||||
|
||||
#define VIRT_PLIC_HART_CONFIG "MS"
|
||||
#define VIRT_PLIC_NUM_SOURCES 127
|
||||
#define VIRT_PLIC_NUM_PRIORITIES 7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue