From patchwork Wed May 4 09:36:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12837579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE7A2C433F5 for ; Wed, 4 May 2022 09:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=DLgaL2kIK45no4xTHdUgxEEMF1iNcYRDFZHPizRqCIU=; b=gszh2PkAB+8yvn VenKH6/lClu+g/MYv9VifGMw7mQN36Tk8g5Sb+JqCvZRpSm65yNQSy4S1z4tP6o6SFhq6p+MIQsAu /3mClYFYKKVDwX8SZndrqzOmuHmRd+hr7xKFd4iHd/7gx1XSYYjYM4iynlIoiCS7mxlcoL8Ljdl+t Wpk8SSN2HpFdsrXEu3FZvl3voF7qY9PtI78VugF1irLLYYg63epaT01goSPWiXkmRddcHKyv1KwY7 NZPACnl8CKdt7Su53NWomtuPetgMh0Gf1qjs8DST3cp2CrJrCBVnrWggG6rDCuoM9snrt7hr4QgGf iZ8dw2DsYlIaoJbPv2vA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmBcx-00A2TS-I8; Wed, 04 May 2022 09:49:00 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmBR4-009w4B-D1 for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 09:36:44 +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 7C4BFED1; Wed, 4 May 2022 02:36:40 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF68A3FA50; Wed, 4 May 2022 02:36:38 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, tarek.el-sherbiny@arm.com, adrian.slatineanu@arm.com, souvik.chakravarty@arm.com, Cristian Marussi Subject: [PATCH 0/7] SCMIv3.1 Powercap protocol and driver Date: Wed, 4 May 2022 10:36:02 +0100 Message-Id: <20220504093609.3077646-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_023642_512171_A998244F X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, this short series introduces the last missing bit of SCMIv3.1, Powercap protocol. Along the series, there is a small refactoring around the SCMI FastChannels handling routines so as to reuse as much as possible the pre-existent (and tested) FastChannel code from the Perf protocol. As a last step in the series an ARM SCMI based powercap driver is added, which takes care to expose via the Powercap framework all the SCMI Powercap zones that have been discovered asking the SCMI platform firmware. Basic testing has been performed against an emulated SCMI platform supporting SCMIv3.1 Powercap protocol, with the exclusion of the FCs bits whose generalization has been only tested for regression on a JUNO platform sporting a regular SCP/SCMI v2.10 fw. The series is based on sudeep/for-next/scmi [1] on top of: commit c7f8852d4216 ("firmware: arm_scmi: Fix late checks on pointer dereference") Thanks, Cristian [1]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi ---- Cristian Marussi (7): dt-bindings: firmware: arm,scmi: Add powercap protocol firmware: arm_scmi: Add SCMIv3.1 Powercap protocol basic support firmware: arm_scmi: Generalize FastChannel support firmware: arm_scmi: Add SCMIv3.1 Powercap FastChannels support firmware: arm_scmi: Make use of FastChannels configurable firmware: arm_scmi: Add scmi_driver optional setup/teardown callbacks powercap: arm_scmi: Add SCMI Powercap based driver .../bindings/firmware/arm,scmi.yaml | 10 + drivers/firmware/arm_scmi/Kconfig | 13 + drivers/firmware/arm_scmi/Makefile | 2 +- drivers/firmware/arm_scmi/bus.c | 15 +- drivers/firmware/arm_scmi/driver.c | 167 ++++ drivers/firmware/arm_scmi/perf.c | 218 +---- drivers/firmware/arm_scmi/powercap.c | 809 ++++++++++++++++++ drivers/firmware/arm_scmi/protocols.h | 23 + drivers/powercap/Kconfig | 13 + drivers/powercap/Makefile | 1 + drivers/powercap/arm_scmi_powercap.c | 537 ++++++++++++ include/linux/scmi_protocol.h | 124 +++ 12 files changed, 1757 insertions(+), 175 deletions(-) create mode 100644 drivers/firmware/arm_scmi/powercap.c create mode 100644 drivers/powercap/arm_scmi_powercap.c