File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 102
102
103
103
#define RV_ISA_EXTENSIONS_MASK 0x03ffffffU
104
104
105
+ #define RV_VENDOR_JEP106_CONT_MASK 0x7fffff80U
106
+ #define RV_VENDOR_JEP106_CODE_MASK 0x7fU
107
+
105
108
#define RV_DCSR_STEP 0x00000004U
106
109
#define RV_DCSR_CAUSE_MASK 0x000001c0U
107
110
#define RV_DCSR_STEPIE 0x00000800U
@@ -303,7 +306,12 @@ static uint8_t riscv_isa_address_width(const uint32_t isa)
303
306
304
307
static void riscv_hart_read_ids (riscv_hart_s * const hart )
305
308
{
309
+ /* Read out the vendor ID */
306
310
riscv_csr_read (hart , RV_VENDOR_ID | RV_CSR_FORCE_32_BIT , & hart -> vendorid );
311
+ /* Adjust the value to fit our view of JEP-106 codes */
312
+ hart -> vendorid =
313
+ ((hart -> vendorid & RV_VENDOR_JEP106_CONT_MASK ) << 1U ) | (hart -> vendorid & RV_VENDOR_JEP106_CODE_MASK );
314
+ /* Depending on the bus width, read out the other IDs suitably */
307
315
if (hart -> access_width == 32U ) {
308
316
riscv_csr_read (hart , RV_ARCH_ID , & hart -> archid );
309
317
riscv_csr_read (hart , RV_IMPL_ID , & hart -> implid );
You can’t perform that action at this time.
0 commit comments