|
| 1 | +From c9481f6ba0050a53411193b5a49bde6f2c4158b3 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Corey Wharton < [email protected]> |
| 3 | +Date: Thu, 12 Mar 2020 16:43:02 -0700 |
| 4 | +Subject: [PATCH v2 2/2] target/riscv: Add a sifive-e34 cpu type |
| 5 | + |
| 6 | +The sifive-e34 cpu type is the same as the sifive-e31 with the |
| 7 | +single precision floating-point extension enabled. |
| 8 | + |
| 9 | +Signed-off-by: Corey Wharton < [email protected]> |
| 10 | +--- |
| 11 | +v2: Added missing RVU flag |
| 12 | + |
| 13 | + target/riscv/cpu.c | 10 ++++++++++ |
| 14 | + target/riscv/cpu.h | 1 + |
| 15 | + 2 files changed, 11 insertions(+) |
| 16 | + |
| 17 | +diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c |
| 18 | +index c0b7023100..1ae9d085b8 100644 |
| 19 | +--- a/target/riscv/cpu.c |
| 20 | ++++ b/target/riscv/cpu.c |
| 21 | +@@ -164,6 +164,15 @@ static void rv32imacu_nommu_cpu_init(Object *obj) |
| 22 | + set_feature(env, RISCV_FEATURE_PMP); |
| 23 | + } |
| 24 | + |
| 25 | ++static void rv32imafcu_nommu_cpu_init(Object *obj) |
| 26 | ++{ |
| 27 | ++ CPURISCVState *env = &RISCV_CPU(obj)->env; |
| 28 | ++ set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVC | RVU); |
| 29 | ++ set_priv_version(env, PRIV_VERSION_1_10_0); |
| 30 | ++ set_resetvec(env, DEFAULT_RSTVEC); |
| 31 | ++ set_feature(env, RISCV_FEATURE_PMP); |
| 32 | ++} |
| 33 | ++ |
| 34 | + #elif defined(TARGET_RISCV64) |
| 35 | + |
| 36 | + static void riscv_base64_cpu_init(Object *obj) |
| 37 | +@@ -609,6 +618,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { |
| 38 | + #if defined(TARGET_RISCV32) |
| 39 | + DEFINE_CPU(TYPE_RISCV_CPU_BASE32, riscv_base32_cpu_init), |
| 40 | + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31, rv32imacu_nommu_cpu_init), |
| 41 | ++ DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34, rv32imafcu_nommu_cpu_init), |
| 42 | + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34, rv32gcsu_priv1_10_0_cpu_init), |
| 43 | + /* Depreacted */ |
| 44 | + DEFINE_CPU(TYPE_RISCV_CPU_RV32IMACU_NOMMU, rv32imacu_nommu_cpu_init), |
| 45 | +diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h |
| 46 | +index 3dcdf92227..ae5a1d9dce 100644 |
| 47 | +--- a/target/riscv/cpu.h |
| 48 | ++++ b/target/riscv/cpu.h |
| 49 | +@@ -36,6 +36,7 @@ |
| 50 | + #define TYPE_RISCV_CPU_BASE32 RISCV_CPU_TYPE_NAME("rv32") |
| 51 | + #define TYPE_RISCV_CPU_BASE64 RISCV_CPU_TYPE_NAME("rv64") |
| 52 | + #define TYPE_RISCV_CPU_SIFIVE_E31 RISCV_CPU_TYPE_NAME("sifive-e31") |
| 53 | ++#define TYPE_RISCV_CPU_SIFIVE_E34 RISCV_CPU_TYPE_NAME("sifive-e34") |
| 54 | + #define TYPE_RISCV_CPU_SIFIVE_E51 RISCV_CPU_TYPE_NAME("sifive-e51") |
| 55 | + #define TYPE_RISCV_CPU_SIFIVE_U34 RISCV_CPU_TYPE_NAME("sifive-u34") |
| 56 | + #define TYPE_RISCV_CPU_SIFIVE_U54 RISCV_CPU_TYPE_NAME("sifive-u54") |
| 57 | +-- |
| 58 | +2.21.1 |
| 59 | + |
0 commit comments