diff options
-rw-r--r-- | sys/arm64/arm64/vm_machdep.c | 12 | ||||
-rw-r--r-- | sys/conf/options.arm64 | 2 | ||||
-rw-r--r-- | sys/dev/psci/psci.c | 7 | ||||
-rw-r--r-- | sys/dev/psci/psci.h | 2 |
4 files changed, 21 insertions, 2 deletions
diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 1f8466d..acce93c 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -25,6 +25,8 @@ * */ +#include "opt_platform.h" + #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -52,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include <machine/vfp.h> #endif +#ifdef DEV_PSCI +#include <dev/psci/psci.h> +#endif + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -112,7 +118,11 @@ void cpu_reset(void) { - printf("cpu_reset"); +#ifdef DEV_PSCI + psci_reset(); +#endif + + printf("cpu_reset failed"); while(1) __asm volatile("wfi" ::: "memory"); } diff --git a/sys/conf/options.arm64 b/sys/conf/options.arm64 index f5c276c..7bdf96e 100644 --- a/sys/conf/options.arm64 +++ b/sys/conf/options.arm64 @@ -7,6 +7,8 @@ SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h +DEV_PSCI opt_platform.h + # SoC Support SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c index c5fe0fb..23e67fc 100644 --- a/sys/dev/psci/psci.c +++ b/sys/dev/psci/psci.c @@ -221,6 +221,13 @@ psci_shutdown(void *xsc, int howto) /* System reset and off do not return. */ } +void +psci_reset(void) +{ + + psci_shutdown(NULL, 0); +} + static int psci_v0_1_init(device_t dev) { diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h index 58f1e79..d727966 100644 --- a/sys/dev/psci/psci.h +++ b/sys/dev/psci/psci.h @@ -36,7 +36,7 @@ typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t); extern int psci_present; -void psci_system_reset(void); +void psci_reset(void); int psci_cpu_on(unsigned long, unsigned long, unsigned long); int psci_hvc_despatch(register_t, register_t, register_t, register_t); int psci_smc_despatch(register_t, register_t, register_t, register_t); |