From owner-svn-src-all@freebsd.org Tue Aug 11 13:42:59 2015 Return-Path: Delivered-To: svn-src-all@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 7A0E399EA3A; Tue, 11 Aug 2015 13:42:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 64F81F5; Tue, 11 Aug 2015 13:42:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7BDgxh6051405; Tue, 11 Aug 2015 13:42:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7BDgxYI051404; Tue, 11 Aug 2015 13:42:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508111342.t7BDgxYI051404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 11 Aug 2015 13:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286630 - head/sys/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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 13:42:59 -0000 Author: andrew Date: Tue Aug 11 13:42:58 2015 New Revision: 286630 URL: https://svnweb.freebsd.org/changeset/base/286630 Log: Start to support PSCI 1.0. For all the functions we currently support this can be seen as the same as 0.2. There are changes with the data passed to CPU_SUSPEND, however we don't yet use this call. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Tue Aug 11 12:38:54 2015 (r286629) +++ head/sys/dev/psci/psci.c Tue Aug 11 13:42:58 2015 (r286630) @@ -288,20 +288,21 @@ psci_v0_2_init(device_t dev) if (version == PSCI_RETVAL_NOT_SUPPORTED) return (1); - if ((PSCI_VER_MAJOR(version) != 0) && (PSCI_VER_MINOR(version) != 2)) { - device_printf(dev, "PSCI version number mismatched with DT\n"); - return (1); - } + if ((PSCI_VER_MAJOR(version) == 0 && PSCI_VER_MINOR(version) == 2) || + (PSCI_VER_MAJOR(version) == 1 && PSCI_VER_MINOR(version) == 0)) { + if (bootverbose) + device_printf(dev, "PSCI version 0.2 available\n"); - if (bootverbose) - device_printf(dev, "PSCI version 0.2 available\n"); + /* + * We only register this for v0.2 since v0.1 doesn't support + * system_reset. + */ + EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, + SHUTDOWN_PRI_LAST); - /* - * We only register this for v0.2 since v0.1 doesn't support - * system_reset. - */ - EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, - SHUTDOWN_PRI_LAST); + return (0); + } - return (0); + device_printf(dev, "PSCI version number mismatched with DT\n"); + return (1); }