svn commit: r319207 - in stable/11/sys: arm64/arm64 conf dev/psci

Andrew Turner andrew at FreeBSD.org
Tue May 30 13:26:39 UTC 2017


Author: andrew
Date: Tue May 30 13:26:37 2017
New Revision: 319207
URL: https://svnweb.freebsd.org/changeset/base/319207

Log:
  MFC r317361:
  
  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.

Modified:
  stable/11/sys/arm64/arm64/vm_machdep.c
  stable/11/sys/conf/options.arm64
  stable/11/sys/dev/psci/psci.c
  stable/11/sys/dev/psci/psci.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm64/arm64/vm_machdep.c
==============================================================================
--- stable/11/sys/arm64/arm64/vm_machdep.c	Tue May 30 13:21:43 2017	(r319206)
+++ stable/11/sys/arm64/arm64/vm_machdep.c	Tue May 30 13:26:37 2017	(r319207)
@@ -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");
 }

Modified: stable/11/sys/conf/options.arm64
==============================================================================
--- stable/11/sys/conf/options.arm64	Tue May 30 13:21:43 2017	(r319206)
+++ stable/11/sys/conf/options.arm64	Tue May 30 13:26:37 2017	(r319207)
@@ -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

Modified: stable/11/sys/dev/psci/psci.c
==============================================================================
--- stable/11/sys/dev/psci/psci.c	Tue May 30 13:21:43 2017	(r319206)
+++ stable/11/sys/dev/psci/psci.c	Tue May 30 13:26:37 2017	(r319207)
@@ -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)
 {

Modified: stable/11/sys/dev/psci/psci.h
==============================================================================
--- stable/11/sys/dev/psci/psci.h	Tue May 30 13:21:43 2017	(r319206)
+++ stable/11/sys/dev/psci/psci.h	Tue May 30 13:26:37 2017	(r319207)
@@ -36,7 +36,7 @@ typedef int (*psci_callfn_t)(register_t, register_t, r
 
 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);


More information about the svn-src-all mailing list