Call the PSCI reset from cpu_reset on arm64. When rebooting from DDB the

kernel calls this directly so the event handler is not called, meaning
the computer fails to reboot.

Tested by:	cognet
MFC after:	1 week
Sponsored by:	DARPA, AFRL
This commit is contained in:
Andrew Turner 2017-04-24 11:06:10 +00:00
parent 1c779b2849
commit 574a7c6c47
4 changed files with 21 additions and 2 deletions

View File

@ -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
@ -113,7 +119,11 @@ void
cpu_reset(void)
{
printf("cpu_reset");
#ifdef DEV_PSCI
psci_reset();
#endif
printf("cpu_reset failed");
while(1)
__asm volatile("wfi" ::: "memory");
}

View File

@ -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_ALLWINNER_A64 opt_soc.h
SOC_BRCM_BCM2837 opt_soc.h

View File

@ -412,6 +412,13 @@ psci_shutdown(void *xsc, int howto)
/* System reset and off do not return. */
}
void
psci_reset(void)
{
psci_shutdown(NULL, 0);
}
#ifdef FDT
/* Only support PSCI 0.1 on FDT */
static int

View File

@ -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);