diff --git a/src/arch/riscv/core/zicntr.c b/src/arch/riscv/core/zicntr.c index 7ea9f96ad..fb632b8c0 100644 --- a/src/arch/riscv/core/zicntr.c +++ b/src/arch/riscv/core/zicntr.c @@ -32,7 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include #include -#include +#include #include /** Timer increment per microsecond */ @@ -145,10 +145,10 @@ static int zicntr_probe ( void ) { } u; int rc; - /* Check if Zicntr extension is supported */ - if ( ( rc = hart_supported ( "_zicntr" ) ) != 0 ) { - DBGC ( colour, "ZICNTR not supported: %s\n", strerror ( rc ) ); - return rc; + /* Check if time CSR can be read */ + if ( ! csr_can_read ( "time" ) ) { + DBGC ( colour, "ZICNTR cannot read TIME CSR\n" ); + return -ENOTSUP; } /* Get timer frequency */ diff --git a/src/arch/riscv/core/zkr.c b/src/arch/riscv/core/zkr.c index 4b6316ea0..b27a7f076 100644 --- a/src/arch/riscv/core/zkr.c +++ b/src/arch/riscv/core/zkr.c @@ -30,7 +30,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); */ #include -#include #include #include #include @@ -53,13 +52,6 @@ struct entropy_source zkr_entropy __entropy_source ( ENTROPY_PREFERRED ); * @ret rc Return status code */ static int zkr_entropy_enable ( void ) { - int rc; - - /* Check if Zkr extension is supported */ - if ( ( rc = hart_supported ( "_zkr" ) ) != 0 ) { - DBGC ( colour, "ZKR not supported: %s\n", strerror ( rc ) ); - return rc; - } /* Check if seed CSR is accessible in S-mode */ if ( ! csr_can_write ( "seed", 0 ) ) {