mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-25 23:58:55 +00:00
include: sbi: Remove opensbi specific reset type defines
We can now use the standard SBI SRST extension reset types instead of the opensbi specific (SBI_PLATFORM_RESET_xyz) reset types hence remove related opensbi specific defines. The "platform_" prefix of the reset type parameter of sbi_system_reset() function should also be removed. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
parent
54a7734d86
commit
c4acc60a46
5 changed files with 8 additions and 10 deletions
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
#include <sbi/sbi_ecall_interface.h>
|
||||||
#include <sbi/sbi_error.h>
|
#include <sbi/sbi_error.h>
|
||||||
#include <sbi/sbi_scratch.h>
|
#include <sbi/sbi_scratch.h>
|
||||||
#include <sbi/sbi_version.h>
|
#include <sbi/sbi_version.h>
|
||||||
|
@ -137,9 +138,6 @@ struct sbi_platform_operations {
|
||||||
int (*hart_stop)(void);
|
int (*hart_stop)(void);
|
||||||
|
|
||||||
/** Reset the platform */
|
/** Reset the platform */
|
||||||
#define SBI_PLATFORM_RESET_SHUTDOWN 0
|
|
||||||
#define SBI_PLATFORM_RESET_COLD 1
|
|
||||||
#define SBI_PLATFORM_RESET_WARM 2
|
|
||||||
int (*system_reset)(u32 reset_type);
|
int (*system_reset)(u32 reset_type);
|
||||||
|
|
||||||
/** platform specific SBI extension implementation probe function */
|
/** platform specific SBI extension implementation probe function */
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
|
|
||||||
#include <sbi/sbi_types.h>
|
#include <sbi/sbi_types.h>
|
||||||
|
|
||||||
void __noreturn sbi_system_reset(u32 platform_reset_type);
|
void __noreturn sbi_system_reset(u32 reset_type);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -103,7 +103,7 @@ static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SBI_EXT_0_1_SHUTDOWN:
|
case SBI_EXT_0_1_SHUTDOWN:
|
||||||
sbi_system_reset(SBI_PLATFORM_RESET_SHUTDOWN);
|
sbi_system_reset(SBI_SRST_RESET_TYPE_SHUTDOWN);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = SBI_ENOTSUPP;
|
ret = SBI_ENOTSUPP;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <sbi/sbi_ipi.h>
|
#include <sbi/sbi_ipi.h>
|
||||||
#include <sbi/sbi_init.h>
|
#include <sbi/sbi_init.h>
|
||||||
|
|
||||||
void __noreturn sbi_system_reset(u32 platform_reset_type)
|
void __noreturn sbi_system_reset(u32 reset_type)
|
||||||
{
|
{
|
||||||
ulong hbase = 0, hmask;
|
ulong hbase = 0, hmask;
|
||||||
u32 cur_hartid = current_hartid();
|
u32 cur_hartid = current_hartid();
|
||||||
|
@ -40,7 +40,7 @@ void __noreturn sbi_system_reset(u32 platform_reset_type)
|
||||||
/* Platform specific reset if domain allowed system reset */
|
/* Platform specific reset if domain allowed system reset */
|
||||||
if (dom->system_reset_allowed)
|
if (dom->system_reset_allowed)
|
||||||
sbi_platform_system_reset(sbi_platform_ptr(scratch),
|
sbi_platform_system_reset(sbi_platform_ptr(scratch),
|
||||||
platform_reset_type);
|
reset_type);
|
||||||
|
|
||||||
/* If platform specific reset did not work then do sbi_exit() */
|
/* If platform specific reset did not work then do sbi_exit() */
|
||||||
sbi_exit(scratch);
|
sbi_exit(scratch);
|
||||||
|
|
|
@ -24,11 +24,11 @@ int sifive_test_system_reset(u32 type)
|
||||||
* was successful so that QEMU exits
|
* was successful so that QEMU exits
|
||||||
*/
|
*/
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SBI_PLATFORM_RESET_SHUTDOWN:
|
case SBI_SRST_RESET_TYPE_SHUTDOWN:
|
||||||
writew(FINISHER_PASS, sifive_test_base);
|
writew(FINISHER_PASS, sifive_test_base);
|
||||||
break;
|
break;
|
||||||
case SBI_PLATFORM_RESET_COLD:
|
case SBI_SRST_RESET_TYPE_COLD_REBOOT:
|
||||||
case SBI_PLATFORM_RESET_WARM:
|
case SBI_SRST_RESET_TYPE_WARM_REBOOT:
|
||||||
writew(FINISHER_RESET, sifive_test_base);
|
writew(FINISHER_RESET, sifive_test_base);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue