Skip to content

Commit

Permalink
DEBUG PATCH to test individiual ISA extension
Browse files Browse the repository at this point in the history
** DO NOT MERGE **

Signed-off-by: Atish Patra <atishp@rivosinc.com>
  • Loading branch information
atishp04 committed Feb 15, 2022
1 parent bef05c0 commit e9e240c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/riscv/include/asm/hwcap.h
Expand Up @@ -51,6 +51,11 @@ extern unsigned long elf_hwcap;
* available logical extension id.
*/
enum riscv_isa_ext_id {
RISCV_ISA_EXT_SSTC = RISCV_ISA_EXT_BASE,
RISCV_ISA_EXT_SSCOFPMF,
RISCV_ISA_EXT_SVINVAL,
RISCV_ISA_EXT_SVPBMT,
RISCV_ISA_EXT_SVNAPOT,
RISCV_ISA_EXT_ID_MAX = RISCV_ISA_EXT_MAX,
};

Expand Down
4 changes: 4 additions & 0 deletions arch/riscv/kernel/cpu.c
Expand Up @@ -71,6 +71,10 @@ int riscv_of_parent_hartid(struct device_node *node)
}

static struct riscv_isa_ext_data isa_ext_arr[] = {
__RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC),
__RISCV_ISA_EXT_DATA(svpbmt, RISCV_ISA_EXT_SVPBMT),
__RISCV_ISA_EXT_DATA(svnapot, RISCV_ISA_EXT_SVNAPOT),
__RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL),
__RISCV_ISA_EXT_DATA("", RISCV_ISA_EXT_MAX),
};

Expand Down
6 changes: 6 additions & 0 deletions arch/riscv/kernel/cpufeature.c
Expand Up @@ -187,6 +187,12 @@ void __init riscv_fill_hwcap(void)
if (!ext_long) {
this_hwcap |= isa2hwcap[(unsigned char)(*ext)];
set_bit(*ext - 'a', this_isa);
} else {
SET_ISA_EXT_MAP("sstc", RISCV_ISA_EXT_SSTC);
SET_ISA_EXT_MAP("sscofpmf", RISCV_ISA_EXT_SSCOFPMF);
SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT);
SET_ISA_EXT_MAP("svnapot", RISCV_ISA_EXT_SVNAPOT);
SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_SVINVAL);
}
#undef SET_ISA_EXT_MAP
}
Expand Down

0 comments on commit e9e240c

Please sign in to comment.