From patchwork Wed Aug 19 16:09:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11724571 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 3CEB1618 for ; Wed, 19 Aug 2020 16:11:24 +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 F157120888 for ; Wed, 19 Aug 2020 16:11:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KB6R6iQw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F157120888 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=rbDY6f6zn7eGJ5JiHFuUpyagH9C2FDNB4wpo4VPQHQ4=; b=KB6R6iQwKndHdKCHeddeufFJei NysJySwvgRC3/AzIK1rd+hADfx1QzNlcuq/+EUt5XA9rM7ZWmUCm6DNKXA1KjIg/y7dyp2/UtVwVZ yLtLRSACwqQSAFOQrCEc2FiIfGb8NeUDBTyB8qixwHDqrXl4OZkGl/04nkqjSh2jHP4kKg3xT6q40 +ThdkGdRIgsrOcypaoxgvb/xzkzGy+p9H8xMA2QuGMeBoCO/q/L3Or/DcjW204GjMCGCdOznD2IWq 4p4oTTiJNqjRqaBp0y3xauSYm7dNthy5WqoFIVvl3CbgAjbyAbjIx8ahUrglqfvz/su9N1zIpj1fm GCRLK2VA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8QgC-0003q9-9N; Wed, 19 Aug 2020 16:11:12 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8Qg1-0003nZ-Au for linux-arm-kernel@lists.infradead.org; Wed, 19 Aug 2020 16:11:03 +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 B0A3712FC; Wed, 19 Aug 2020 09:11:00 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 685383F6CF; Wed, 19 Aug 2020 09:10:54 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 0/3] SCMI System Power Support Date: Wed, 19 Aug 2020 17:09:59 +0100 Message-Id: <20200819161002.26637-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-20200819_121101_436624_69DE43D5 X-CRM114-Status: GOOD ( 15.76 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) 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] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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, 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. Based on v5.9-rc1 (which now includes needed SCMI Notifications Core Support) Thanks Cristian ---- v4 --> v5 - rebased on v5.9-rc1 v3 --> v4 - rebased on top of scmi-next/for-next/scmi 5.8-rc3 - fixed some strict checkpatch issues V2 --> V3 - changed Kconfig to fix naming and defaulting System Power Control driver to n - fixes related to changes in SCMI Notifications core support V10 V1 --> V2 - use common event enums - introduced optional alternative signal based comms 2 userspace Cristian Marussi (3): firmware: arm_scmi: Add System Power Protocol support firmware: arm_scmi: Add SCMI System Power Control driver [DEBUG] 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