[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/18] target/riscv: cpu: Add a new 'resetvec' property
From: |
Bin Meng |
Subject: |
[PATCH 01/18] target/riscv: cpu: Add a new 'resetvec' property |
Date: |
Sat, 15 Aug 2020 00:40:39 +0800 |
From: Bin Meng <bin.meng@windriver.com>
Currently the reset vector address is hard-coded in a RISC-V CPU's
instance_init() routine. In a real world we can have 2 exact same
CPUs except for the reset vector address, which is pretty common in
the RISC-V core IP licensing business.
Normally reset vector address is a configurable parameter. Let's
create a 64-bit property to store the reset vector address which
covers both 32-bit and 64-bit CPUs.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
target/riscv/cpu.c | 1 +
target/riscv/cpu.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 228b9bd..8067a26 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -518,6 +518,7 @@ static Property riscv_cpu_properties[] = {
DEFINE_PROP_UINT16("elen", RISCVCPU, cfg.elen, 64),
DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
+ DEFINE_PROP_UINT64("resetvec", RISCVCPU, cfg.resetvec, DEFAULT_RSTVEC),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index a804a5d..d34bcfa 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -291,6 +291,7 @@ typedef struct RISCVCPU {
uint16_t elen;
bool mmu;
bool pmp;
+ uint64_t resetvec;
} cfg;
} RISCVCPU;
--
2.7.4
- [PATCH 00/18] hw/riscv: Add Microchip PolarFire SoC Icicle Kit board support, Bin Meng, 2020/08/14
- [PATCH 01/18] target/riscv: cpu: Add a new 'resetvec' property,
Bin Meng <=
- [PATCH 02/18] hw/riscv: hart: Add a new 'resetvec' property, Bin Meng, 2020/08/14
- [PATCH 03/18] target/riscv: cpu: Set reset vector based on the configured property value, Bin Meng, 2020/08/14
- [PATCH 04/18] hw/riscv: Initial support for Microchip PolarFire SoC Icicle Kit board, Bin Meng, 2020/08/14
- [PATCH 05/18] hw/char: Add Microchip PolarFire SoC MMUART emulation, Bin Meng, 2020/08/14
- [PATCH 06/18] hw/riscv: microchip_pfsoc: Connect 5 MMUARTs, Bin Meng, 2020/08/14