From patchwork Mon Jun 22 15:18:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11618169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00FBD14B7 for ; Mon, 22 Jun 2020 15:20:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB076206D7 for ; Mon, 22 Jun 2020 15:20:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jIGN59ZB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VWQXTcQo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB076206D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=VPLt+WORLbQYUm2qzo4+D6DUbM6M75rAPUdeIwkYsiY=; b=jIGN59ZBJCMjHIiaPnWNcLHwcD oSRHBNzdiW9sV7UxK5C0RZQBmmWVdLg+PzWVbEClDN2qWE+zrVQOa9BVfmv+6TkrepF8IiRHEstqu LyKu+Q6yxWLgJOs6ys6dmnGTRCc3xEHW0ROr2/ad54bMqfi7TkMK1G6yHVLBRCFgkaGb28ujjmBAh JWKopQs2aEDJCD6Dtwj48qFRnMDpmiLGajuRSaCR+n7aUv6K+hP5LjWc88bd9EZwFIjfx80wOR/Eo mJK127xdflZA5W8LWcCZeVh2dO7qieh9Nci6w4svzBfdCP2FHRZBGT6NNbF5I+/IsuBkQ5tGbTkLN wXLcL9sg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnODV-0008CP-0I; Mon, 22 Jun 2020 15:18:37 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnODS-0008BZ-4R for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 15:18:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=6no3HlsiQ1BE2hqeiczXCVJroKk2GEM1hpeSTE8XszQ=; b=VWQXTcQoxMQJQougYBx2hJ4fbu jHELxtieVXrF/FtGNy8lt5n9pWH+Fbw+47JXpyRHchMPIzFwSZa0FXQrBsDh1f2BZKtCB8Q5gwi4Y buZ4OZ4RACbXla6ixWO8UNgr2hTj4skrCjSF12Q2NSvuSrUbzYhmNTgalpWJCVtb15bsI7LTH8LpW 3UIIiby2ZiGH5Wglkk17bzAlNIYcct+JmgSVLGwnM97nWyykuELveRSxHEge+16tJKxp/AOJf3gKJ FqoGnDkuKX5qaP7pTOivmH84cn752Wc3xzeUEsARVtjBVtkQGMwHEe3RVIoLhoan2MQ28702ek1Nq mEgNefOQ==; Received: from foss.arm.com ([217.140.110.172]) by casper.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnODO-0002i8-Ka for linux-arm-kernel@lists.infradead.org; Mon, 22 Jun 2020 15:18:33 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4098631B; Mon, 22 Jun 2020 08:18:29 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 36C383F6CF; Mon, 22 Jun 2020 08:18:28 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 0/3] SCMI System Power Support Date: Mon, 22 Jun 2020 16:18:13 +0100 Message-Id: <20200622151816.15491-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_161830_891757_7F4F34FC X-CRM114-Status: GOOD ( 14.21 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-4.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonathan.Cameron@Huawei.com, cristian.marussi@arm.com, james.quinlan@broadcom.com, lukasz.luba@arm.com, sudeep.holla@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi all, this series wants to add the core SCMI System Power support and related events' handling logic: the protocol support itself is trivial and boils down to some bare initializations and supporting one SCMI System Power notification event meant to carry platform-originated System transition requests. This is patch [1/3]. On top of this a new SCMI driver has been developed which registers for such System Power notification and acts accordingly to satisfy such plaform system-state transition requests that can be of forceful or graceful kind. In order to comply with such graceful requests, and co-operate with userspace entities to drive a clean shutdown/reboot, the logic of the driver relies on the same orderly_* API methods used by ACPI when handling ACPI Shutdown bus events. As an alternative method to tunnel graceful requests to userspace it is possible to configure, via available module parameters, a specific signal to be sent to CAD pid. This is patch [2/3]. Patch [3/3] is a mere JUNO example of the minimal DT bindings needed to enable the protocol at the DT level and is NOT meant to be upstream as of now. The series is based on SCMI Notifications Core V10 [1] (only posted not merged) which in turn is based on top of scmi-for-next 5.8-rc1 Thanks Cristian ---- [1] https://lore.kernel.org/linux-arm-kernel/20200619133834.18497-1-cristian.marussi@arm.com/ Cristian Marussi (3): firmware: arm_scmi: Add System Power Protocol support firmware: arm_scmi: Add SCMI System Power Control driver arm64: dts: juno: add SCMI SystemPower Protocol support arch/arm64/boot/dts/arm/juno-base.dtsi | 4 + drivers/firmware/Kconfig | 12 + drivers/firmware/arm_scmi/Makefile | 3 +- drivers/firmware/arm_scmi/driver.c | 1 + .../firmware/arm_scmi/scmi_power_control.c | 389 ++++++++++++++++++ drivers/firmware/arm_scmi/system.c | 136 ++++++ include/linux/scmi_protocol.h | 18 + 7 files changed, 562 insertions(+), 1 deletion(-) create mode 100644 drivers/firmware/arm_scmi/scmi_power_control.c create mode 100644 drivers/firmware/arm_scmi/system.c