mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 15:51:41 +01:00
lib: sbi: Simplify system reset platform operations
Instead of having system_reset_check() and system_reset() callbacks in platform operations, it will be much simpler for reset driver to directly register these operations as a device to the sbi_system implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
@@ -12,6 +12,22 @@
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
/** System reset hardware device */
|
||||
struct sbi_system_reset_device {
|
||||
/** Name of the system reset device */
|
||||
char name[32];
|
||||
|
||||
/* Check whether reset type and reason supported by the device */
|
||||
int (*system_reset_check)(u32 reset_type, u32 reset_reason);
|
||||
|
||||
/** Reset the system */
|
||||
void (*system_reset)(u32 reset_type, u32 reset_reason);
|
||||
};
|
||||
|
||||
const struct sbi_system_reset_device *sbi_system_reset_get_device(void);
|
||||
|
||||
void sbi_system_reset_set_device(const struct sbi_system_reset_device *dev);
|
||||
|
||||
bool sbi_system_reset_supported(u32 reset_type, u32 reset_reason);
|
||||
|
||||
void __noreturn sbi_system_reset(u32 reset_type, u32 reset_reason);
|
||||
|
Reference in New Issue
Block a user