[PATCH 03/16] target/riscv: tt-ascalon: Add Tenstorrent mvendorid

Joel Stanley posted 16 patches 1 month ago
There is a newer version of this series
[PATCH 03/16] target/riscv: tt-ascalon: Add Tenstorrent mvendorid
Posted by Joel Stanley 1 month ago
JEP106 has two vendor IDs for Tenstorrent. We will use Bank 16, hex 0xa1:

 ((16 - 1) << 7) | (0xa1 & ~0x80) = 0x7a1

Add it to the Ascalon CPU definition as the mvendorid CSR.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 target/riscv/cpu_vendorid.h | 2 ++
 target/riscv/cpu.c          | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/target/riscv/cpu_vendorid.h b/target/riscv/cpu_vendorid.h
index 96b6b9c2cb58..6a5c2491b923 100644
--- a/target/riscv/cpu_vendorid.h
+++ b/target/riscv/cpu_vendorid.h
@@ -7,4 +7,6 @@
 #define VEYRON_V1_MIMPID        0x111
 #define VEYRON_V1_MVENDORID     0x61f
 
+#define TENSTORRENT_VENDOR_ID   0x7a1
+
 #endif /*  TARGET_RISCV_CPU_VENDORID_H */
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 01bd522f9189..b8b64284a281 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -3187,6 +3187,8 @@ static const TypeInfo riscv_cpu_type_infos[] = {
         .cfg.ext_svnapot = true,
         .cfg.ext_svpbmt = true,
 
+        .cfg.mvendorid = TENSTORRENT_VENDOR_ID,
+
         .cfg.max_satp_mode = VM_1_10_SV57,
     ),
 
-- 
2.47.3