From owner-svn-src-head@freebsd.org Mon Apr 24 11:06:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E734D4D451; Mon, 24 Apr 2017 11:06:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0324DB3; Mon, 24 Apr 2017 11:06:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3OB6AER022693; Mon, 24 Apr 2017 11:06:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3OB6ATg022689; Mon, 24 Apr 2017 11:06:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704241106.v3OB6ATg022689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 24 Apr 2017 11:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317361 - in head/sys: arm64/arm64 conf dev/psci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2017 11:06:12 -0000 Author: andrew Date: Mon Apr 24 11:06:10 2017 New Revision: 317361 URL: https://svnweb.freebsd.org/changeset/base/317361 Log: 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 Modified: head/sys/arm64/arm64/vm_machdep.c head/sys/conf/options.arm64 head/sys/dev/psci/psci.c head/sys/dev/psci/psci.h Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Mon Apr 24 10:21:13 2017 (r317360) +++ head/sys/arm64/arm64/vm_machdep.c Mon Apr 24 11:06:10 2017 (r317361) @@ -25,6 +25,8 @@ * */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -52,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DEV_PSCI +#include +#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"); } Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Mon Apr 24 10:21:13 2017 (r317360) +++ head/sys/conf/options.arm64 Mon Apr 24 11:06:10 2017 (r317361) @@ -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 Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Mon Apr 24 10:21:13 2017 (r317360) +++ head/sys/dev/psci/psci.c Mon Apr 24 11:06:10 2017 (r317361) @@ -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 Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Mon Apr 24 10:21:13 2017 (r317360) +++ head/sys/dev/psci/psci.h Mon Apr 24 11:06:10 2017 (r317361) @@ -36,7 +36,7 @@ typedef int (*psci_callfn_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);