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:
Anup Patel
2021-04-22 11:53:32 +05:30
committed by Anup Patel
parent dc39c7b630
commit 043d088e39
17 changed files with 148 additions and 171 deletions

View File

@@ -127,11 +127,6 @@ struct sbi_platform_operations {
*/
int (*hart_suspend)(u32 suspend_type, ulong raddr);
/* Check whether reset type and reason supported by the platform */
int (*system_reset_check)(u32 reset_type, u32 reset_reason);
/** Reset the platform */
void (*system_reset)(u32 reset_type, u32 reset_reason);
/** platform specific SBI extension implementation probe function */
int (*vendor_ext_check)(long extid);
/** platform specific SBI extension implementation provider */
@@ -572,41 +567,6 @@ static inline void sbi_platform_timer_exit(const struct sbi_platform *plat)
sbi_platform_ops(plat)->timer_exit();
}
/**
* Check whether reset type and reason supported by the platform
*
* @param plat pointer to struct sbi_platform
* @param reset_type type of reset
* @param reset_reason reason for reset
*
* @return 0 if reset type and reason not supported and 1 if supported
*/
static inline int sbi_platform_system_reset_check(
const struct sbi_platform *plat,
u32 reset_type, u32 reset_reason)
{
if (plat && sbi_platform_ops(plat)->system_reset_check)
return sbi_platform_ops(plat)->system_reset_check(reset_type,
reset_reason);
return 0;
}
/**
* Reset the platform
*
* This function will not return for supported reset type and reset reason
*
* @param plat pointer to struct sbi_platform
* @param reset_type type of reset
* @param reset_reason reason for reset
*/
static inline void sbi_platform_system_reset(const struct sbi_platform *plat,
u32 reset_type, u32 reset_reason)
{
if (plat && sbi_platform_ops(plat)->system_reset)
sbi_platform_ops(plat)->system_reset(reset_type, reset_reason);
}
/**
* Check if a vendor extension is implemented or not.
*