[riscv] Add support for checking CPU extensions reported via device tree
RISC-V seems to allow for direct discovery of CPU features only from M-mode (e.g. by setting up a trap handler and then attempting to access a CSR), with S-mode code expected to read the resulting constructed ISA description from the device tree. Add the ability to check for the presence of named extensions listed in the "riscv,isa" property of the device tree node corresponding to the boot hart. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -15,6 +15,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
*/
|
||||
|
||||
#define ERRFILE_sbi_reboot ( ERRFILE_ARCH | ERRFILE_CORE | 0x00000000 )
|
||||
#define ERRFILE_hart ( ERRFILE_ARCH | ERRFILE_CORE | 0x00010000 )
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef _IPXE_HART_H
|
||||
#define _IPXE_HART_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* Hardware threads (harts)
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
extern unsigned long boot_hart;
|
||||
|
||||
extern int hart_supported ( const char *ext );
|
||||
|
||||
#endif /* _IPXE_HART_H */
|
||||
Reference in New Issue
Block a user