From: TravisYang <zhiyuan.plct@isrc.iscas.ac.cn>
To: Palmer Dabbelt <palmer@dabbelt.com>,
Alistair Francis <alistair.francis@wdc.com>,
Weiwei Li <liwei1518@gmail.com>,
Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
Cc: TravisYang <zhiyuan.plct@isrc.iscas.ac.cn>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Subject: [PATCH v1] target/riscv:Add support for RV64 Sifive U74 CPU
Date: Fri, 21 Nov 2025 09:08:48 +0000 [thread overview]
Message-ID: <20251121090849.1353917-1-zhiyuan.plct@isrc.iscas.ac.cn> (raw)
Add a CPU entry for the RV64 SiFive U74 CPU .It is available in
single-core and dual-core configurations,and features advanced power
management and AIA compliance.More details can be found at
https://www.sifive.com/document-file/sifive-essential-u7-product-brief
Signed-off-by: TravisYang <zhiyuan.plct@isrc.iscas.ac.cn>
---
target/riscv/cpu-qom.h | 1 +
target/riscv/cpu.c | 44 ++++++++++++++++++++++++++++++++++++------
2 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h
index 1fc8140190..f17390d072 100644
--- a/target/riscv/cpu-qom.h
+++ b/target/riscv/cpu-qom.h
@@ -57,6 +57,7 @@
#define TYPE_RISCV_CPU_XIANGSHAN_NANHU RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
#define TYPE_RISCV_CPU_XIANGSHAN_KMH RISCV_CPU_TYPE_NAME("xiangshan-kunminghu")
#define TYPE_RISCV_CPU_THEAD_C910 RISCV_CPU_TYPE_NAME("thead-c910")
+#define TYPE_RISCV_CPU_SIFIVE_U74 RISCV_CPU_TYPE_NAME("sifive-u74")
#define TYPE_RISCV_CPU_HOST RISCV_CPU_TYPE_NAME("host")
OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index ea9e6eb6a5..aa2fc59804 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -3284,10 +3284,10 @@ static const TypeInfo riscv_cpu_type_infos[] = {
.cfg.pmp = true,
.cfg.max_satp_mode = VM_1_10_SV48,
),
-
+
DEFINE_RISCV_CPU(TYPE_RISCV_CPU_THEAD_C910, TYPE_RISCV_VENDOR_CPU,
.misa_mxl_max = MXL_RV64,
- .misa_ext = RVG | RVC | RVS | RVU,
+ .misa_ext = RVG | RVC | RVS | RVU,
.priv_spec = PRIV_VERSION_1_12_0,
.cfg.ext_zcf = true,
@@ -3297,9 +3297,9 @@ static const TypeInfo riscv_cpu_type_infos[] = {
.cfg.ext_zfhmin = true,
.cfg.mmu = true,
- .cfg.ext_xtheadba = true,
- .cfg.ext_xtheadbb = true,
- .cfg.ext_xtheadbs = true,
+ .cfg.ext_xtheadba = true,
+ .cfg.ext_xtheadbb = true,
+ .cfg.ext_xtheadbs = true,
.cfg.ext_xtheadcmo = true,
.cfg.ext_xtheadcondmov = true,
.cfg.ext_xtheadfmemidx = true,
@@ -3328,9 +3328,41 @@ static const TypeInfo riscv_cpu_type_infos[] = {
.cfg.max_satp_mode = VM_1_10_SV39,
#ifndef CONFIG_USER_ONLY
.custom_csrs = th_csr_list,
-#endif
+#endif
),
+ DEFINE_RISCV_CPU(TYPE_RISCV_CPU_SIFIVE_U74, TYPE_RISCV_CPU_SIFIVE_U,
+ .misa_mxl_max = MXL_RV64,
+ .misa_ext = RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU | RVH,
+ .priv_spec = PRIV_VERSION_1_12_0,
+
+ .cfg.mmu = true,
+ .cfg.pmp_regions = 16,
+
+ .cfg.ext_zba = true,
+ .cfg.ext_zbb = true,
+ .cfg.ext_zbs = true,
+ .cfg.ext_zic64b = true,
+
+ .cfg.ext_zicbom = true,
+ .cfg.ext_zicboz = true,
+ .cfg.ext_zicbop = true,
+
+ .cfg.ext_svinval = true,
+ .cfg.ext_svadu = true,
+
+ .cfg.ext_zfh = true,
+ .cfg.ext_zfhmin = true,
+ .cfg.ext_zfa = true,
+
+ .cfg.ext_smaia = true,
+ .cfg.ext_ssaia = true,
+
+ .cfg.ext_sscofpmf = true,
+ .cfg.ext_sstc = true,
+
+ .cfg.max_satp_mode = VM_1_10_SV39,
+ ),
#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
DEFINE_RISCV_CPU(TYPE_RISCV_CPU_BASE128, TYPE_RISCV_DYNAMIC_CPU,
--
2.34.1
reply other threads:[~2025-11-21 9:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251121090849.1353917-1-zhiyuan.plct@isrc.iscas.ac.cn \
--to=zhiyuan.plct@isrc.iscas.ac.cn \
--cc=alistair.francis@wdc.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).