From patchwork Mon Sep 7 17:46:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11761827 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 46CBB59D for ; Mon, 7 Sep 2020 17:49:05 +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 C9604208C7 for ; Mon, 7 Sep 2020 17:49:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nPS3DG7l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9604208C7 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=FHh8rKFkftOLFE1amzuF24qhrkjWXagB2tnHTQoOP/8=; b=nPS3DG7lHSRn5zi4ntdw54Moob VSLc6/dJFPOBOXnIZOXk33V9aUsRKapKK1TSSIQ2g7wHEHRYyzRAcoPiObWv376qbtSSlMpPJ4XkB k8ygyaGT8NUkAyYNf9dlGdlIdAu4V3YKSwhxdPRFS6id4Os/xf3raR7O6610M9+O+PBb577qZIwfH /DuyadwaXpkrDIhvfdDHbmGYhTQ0zdyYEE+sj2IAomxW1+zcaswvd+d0X7mSiROXeoeBAGYD1su85 ozqOGdaRhqfShSVB85GUC8dL593FIgGByO7wWmflF93LaMJzywEAGwvc6YBNsh9i0ZMl9U+tXgDIp /W+iynCQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFLEw-0003Ri-JX; Mon, 07 Sep 2020 17:47:38 +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 1kFLEs-0003Pf-CA for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2020 17:47:35 +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 89CEA31B; Mon, 7 Sep 2020 10:47:32 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7EE903F66E; Mon, 7 Sep 2020 10:47:31 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 0/3] SCMI System Power Support Date: Mon, 7 Sep 2020 18:46:54 +0100 Message-Id: <20200907174657.32466-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-20200907_134734_521256_B8B3FBAE X-CRM114-Status: GOOD ( 14.34 ) 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, 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]. Patch [2/3] simply adds a new System Power device name to the core driver. 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 [3/3]. Based on v5.9-rc4 (which now includes needed SCMI Notifications Core Support) Thanks Cristian ---- v5 --> v6 - rebased on v5.9-rc4 - removed DEBUG Juno dts example - split out "syspower" device definition from System Power Control driver into its own patch - fixe ret usage in syspower_control _probe/_remove v4 --> v5 - rebased on v5.9-rc1 Cristian Marussi (3): firmware: arm_scmi: Add System Power Protocol support firmware: arm_scmi: add SCMI System Power devname firmware: arm_scmi: Add SCMI System Power Control driver drivers/firmware/Kconfig | 12 + drivers/firmware/arm_scmi/Makefile | 3 +- drivers/firmware/arm_scmi/driver.c | 1 + .../firmware/arm_scmi/scmi_power_control.c | 387 ++++++++++++++++++ drivers/firmware/arm_scmi/system.c | 136 ++++++ include/linux/scmi_protocol.h | 18 + 6 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 drivers/firmware/arm_scmi/scmi_power_control.c create mode 100644 drivers/firmware/arm_scmi/system.c