Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2912200iog; Mon, 27 Jun 2022 05:37:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tm1mCrW/JEuzx0C4TtKKvakJsGlmQFmkRJbTM8Ht09XON6/71JQjKaHUWMfzkNrXdZGO41 X-Received: by 2002:a05:6402:1e93:b0:435:7f3f:407f with SMTP id f19-20020a0564021e9300b004357f3f407fmr16402679edf.173.1656333443895; Mon, 27 Jun 2022 05:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333443; cv=none; d=google.com; s=arc-20160816; b=XNjF8pDk4JglfyAlO5rRDqNyy6QN6rFBSZcBmZMwz971f0fQLALbj6tW6VsQyttWh9 fO25GK2KtI8x7PEOiyKqsQtitB3mIAw5bfOVdclVfyGR/aSKt9zb5fCVQXm4rY9BmKK2 K3DfpfS+/lVNByJFVrYdGHPF6qXiUax2MkytXF3q+r7ed0E2fbDFmxgdgsDCoNKfHGD0 FZJsj6aUwXkYJGPATxjC7zAhxNccHMbzUQX6HJwnO4njtbAg8A6fmkn6NCwLm+LOfGET O9BPqlSn/a8vhMXlrWKbimBooUxX9stfV4QRejuQa+D5Mlh833BN2detF34rwoKkIr5K RAZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qkN8SQuzX1k9B8rNJ3UJntXBA9DEPkoBcM57mY0/x5w=; b=WV9Yg5TB9pCHpE4v/nq1F9/RhDZ6Cbt+Q4LTrlbtiHyDXJkTqr3tj78OIhJcUfkTvm nwiMduD4l+1DH3p2z63SBPRdJTjBqe/35LVOxg+OGKXeZi7uUNWGsutRDXJD6D6ESdbO ZZuvsnAezG+10ixndehMA4OB5qRj+vd1UgpUPhR0AlbiaVxFD4Vrrf2+YG2OaoEcSpw5 VVr3igTVd4bSD/n39f0KREBm2soHS1dtNT47BzCKYWPwemerIcVQdFz/gFDdrbFFdkVR E11+PkzNhMlyc/jKj0EY5ESBmArmWx6QsW6VgO3j9I1suojlPDv7RuKyTV8mykGVy1nI uLJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw7-20020a170906478700b00718cc1814aasi13047198ejc.845.2022.06.27.05.36.58; Mon, 27 Jun 2022 05:37:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235781AbiF0Ma5 (ORCPT + 99 others); Mon, 27 Jun 2022 08:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232906AbiF0May (ORCPT ); Mon, 27 Jun 2022 08:30:54 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF5DE766F for ; Mon, 27 Jun 2022 05:30:52 -0700 (PDT) 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 AB42C1758; Mon, 27 Jun 2022 05:30:52 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8D5C53F792; Mon, 27 Jun 2022 05:30:50 -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, etienne.carriere@linaro.org, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, tarek.el-sherbiny@arm.com, adrian.slatineanu@arm.com, souvik.chakravarty@arm.com, wleavitt@marvell.com, wbartczak@marvell.com, Cristian Marussi Subject: [PATCH v3 0/9] SCMIv3.1 Powercap protocol and driver Date: Mon, 27 Jun 2022 13:30:29 +0100 Message-Id: <20220627123038.1427067-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. New SCMI FC tracing support is added too along the way. 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 using powercap-utils, 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 754f04cac362 ("firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks") Thanks, Cristian v2 --> v3: - added and used some SCMI Fastchannel tracing support - reverted logic of Kconfig to configure usage of SCMI FC - using strscpy with new SHORT_NAME_SZ in Powercap protocol - added devm_protocol_acquire helper v1 --> v2: - fixed measurements thresholds updates to trigger notification enable update commands - added a bit more comments - usig bitfield.h macros - fixed sparse complaint about missing static on global [1]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi ---- Cristian Marussi (9): 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 include: trace: Add SCMI FastChannel tracing firmware: arm_scmi: Use FastChannel tracing 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 | 173 ++++ drivers/firmware/arm_scmi/perf.c | 225 ++--- drivers/firmware/arm_scmi/powercap.c | 866 ++++++++++++++++++ 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 | 129 +++ include/trace/events/scmi.h | 25 + 13 files changed, 1858 insertions(+), 174 deletions(-) create mode 100644 drivers/firmware/arm_scmi/powercap.c create mode 100644 drivers/powercap/arm_scmi_powercap.c -- 2.32.0