From owner-svn-src-head@freebsd.org Wed Jun 13 12:33:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395801006338; Wed, 13 Jun 2018 12:33:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E187B801A2; Wed, 13 Jun 2018 12:33:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C29FC197E8; Wed, 13 Jun 2018 12:33:47 +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 w5DCXl6w008479; Wed, 13 Jun 2018 12:33:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCXldN008477; Wed, 13 Jun 2018 12:33:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131233.w5DCXldN008477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 12:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335056 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335056 X-SVN-Commit-Repository: base 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.26 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: Wed, 13 Jun 2018 12:33:48 -0000 Author: andrew Date: Wed Jun 13 12:33:47 2018 New Revision: 335056 URL: https://svnweb.freebsd.org/changeset/base/335056 Log: Add a handler for the PSCI_FEATURES function. This needs PSCI 1.0, so check for this, returning an error if the version is too old. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c head/sys/dev/psci/psci.h Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Wed Jun 13 12:32:04 2018 (r335055) +++ head/sys/dev/psci/psci.c Wed Jun 13 12:33:47 2018 (r335056) @@ -414,6 +414,20 @@ psci_find_callfn(psci_callfn_t *callfn) return (PSCI_RETVAL_SUCCESS); } +int32_t +psci_features(uint32_t psci_func_id) +{ + + if (psci_softc == NULL) + return (PSCI_RETVAL_NOT_SUPPORTED); + + /* The feature flags were added to PSCI 1.0 */ + if (PSCI_VER_MAJOR(psci_softc->psci_version) < 1) + return (PSCI_RETVAL_NOT_SUPPORTED); + + return (psci_call(PSCI_FNID_FEATURES, psci_func_id, 0, 0)); +} + int psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) { Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Wed Jun 13 12:32:04 2018 (r335055) +++ head/sys/dev/psci/psci.h Wed Jun 13 12:33:47 2018 (r335056) @@ -36,12 +36,15 @@ typedef int (*psci_callfn_t)(register_t, register_t, r extern int psci_present; -void psci_reset(void); int psci_cpu_on(unsigned long, unsigned long, unsigned long); +void psci_reset(void); +int32_t psci_features(uint32_t); +int psci_get_version(void); + +/* One of these handlers will be selected during the boot */ int psci_hvc_despatch(register_t, register_t, register_t, register_t); int psci_smc_despatch(register_t, register_t, register_t, register_t); -int psci_get_version(void); /* * PSCI return codes.