From patchwork Mon Jul 31 17:46:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Dai X-Patchwork-Id: 708659 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E60A2C001DE for ; Mon, 31 Jul 2023 17:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbjGaRrf (ORCPT ); Mon, 31 Jul 2023 13:47:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbjGaRr3 (ORCPT ); Mon, 31 Jul 2023 13:47:29 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54DF710FB for ; Mon, 31 Jul 2023 10:47:28 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d064a458dd5so3620280276.1 for ; Mon, 31 Jul 2023 10:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690825647; x=1691430447; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=29q5zpqm1sVKYKxPJsQaRRpmMiHeYyJj4drlphLmlkQ=; b=hwEb13s7+A9pBueuQ3rroSatU3nWY/lO8w09G6GXlc7x3SiqZLJlP2JcyL/IDoJ1MX NgYmDilk277H9IKIh5UOL8v74p/ocQzRTC6+rFy4dqxgNljaxXaWMSSdgxH/oJL0/cA/ GZ1tKxmnRWbX/uLKGhTahYuivm/NfuZY1cYdfvBhJn2VO7LdVeWg+G05tUP+UWRMXtGn eHelP8aOiakqz9xlSVRrzk16oXMzDXebxIduGRM3ab1tj5JgcL1M1IAS1jSkiMXd0HO1 oos96CN7+O7NwQEQc2KjSns0Q+2ZmTQf3VRyvdTgWa0chYzIzgiJhIjNZOn5U7mhxg+L egAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690825647; x=1691430447; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=29q5zpqm1sVKYKxPJsQaRRpmMiHeYyJj4drlphLmlkQ=; b=A3W8Le2U8QjuufQmplPAnxD02p8ksHAGPm2+TB8nHWaFHwXzeDUPlv3fs1p8C9IMhN CtVuyJ4VykQpX7k8Tx2hz50Sr414zlYEAtuY8qlDkj73dWTUzbDLaRXkStUMILHLzxsa u69Qi6ZiM0hRm8heEo/rbiSDQYcgmGULpeW1aBJ1QqJ8zjV8h4pJOmWyDzePWdWu8YO6 REhDvSeieG9SgxwFewPI9ito4QgRV1yg15NqwVN7rxZqg0NFG+K+np2sqSsB8egiiqL1 IvheijjrGxTmaGD32QxbRqAW/fczkOH9PIt/xH+LlRAOt/7yelfplSyqrVsL98TjNdEC Lj/g== X-Gm-Message-State: ABy/qLayrreZ2JjGRhFB4i3K5vml+783KFFZFBdc0z9RzoFB9WlfdG5H d6EoxPxyi7yI6k/RpiOEgvQ20rNA40W0 X-Google-Smtp-Source: APBJJlHz42b6PJnJOh48NjPJ5CKFWKtztoQBOqDGPxi3dJJ70RKSFu+5UsyDmMz8pN0M4F4S9Xd7TKEsXtRM X-Received: from davidai2.mtv.corp.google.com ([2620:15c:211:201:4949:e05:91e:bd74]) (user=davidai job=sendgmr) by 2002:a25:424e:0:b0:d01:60ec:d0e with SMTP id p75-20020a25424e000000b00d0160ec0d0emr65044yba.9.1690825647620; Mon, 31 Jul 2023 10:47:27 -0700 (PDT) Date: Mon, 31 Jul 2023 10:46:08 -0700 In-Reply-To: <20230731174613.4133167-1-davidai@google.com> Mime-Version: 1.0 References: <20230731174613.4133167-1-davidai@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230731174613.4133167-2-davidai@google.com> Subject: [PATCH v3 1/2] dt-bindings: cpufreq: add bindings for virtual cpufreq From: David Dai To: "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , David Dai , Saravana Kannan Cc: Quentin Perret , Masami Hiramatsu , Will Deacon , Peter Zijlstra , Vincent Guittot , Marc Zyngier , Oliver Upton , Dietmar Eggemann , Pavan Kondeti , Gupta Pankaj , Mel Gorman , kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Adding bindings to represent a virtual cpufreq device. Virtual machines may expose MMIO regions for a virtual cpufreq device for guests to read frequency information or to request frequency selection. The virtual cpufreq device has an individual controller for each CPU. Co-developed-by: Saravana Kannan Signed-off-by: Saravana Kannan Signed-off-by: David Dai --- .../bindings/cpufreq/cpufreq-virtual.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.yaml diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.yaml b/Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.yaml new file mode 100644 index 000000000000..f377cfc972ca --- /dev/null +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.yaml @@ -0,0 +1,89 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/cpufreq/cpufreq-virtual.yaml# +$schema: http://devicetree.org/meta-schemas/core.yamll# + +title: Virtual CPUFreq + +maintainers: + - David Dai + - Saravana Kannan + +description: + Virtual CPUFreq is a virtualized driver in guest kernels that sends frequency + selection of its vCPUs as a hint to the host through MMIO regions. The host + uses the hint to schedule vCPU threads and select physical CPU frequency. It + enables accurate Per-Entity Load Tracking for tasks running in the guest by + querying host CPU frequency unless a virtualized FIE (ex. AMU) exists. + +properties: + compatible: + const: virtual,cpufreq + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,arm-v8"; + device_type = "cpu"; + reg = <0x0>; + operating-points-v2 = <&opp_table0>; + }; + + cpu@1 { + compatible = "arm,arm-v8"; + device_type = "cpu"; + reg = <0x0>; + operating-points-v2 = <&opp_table1>; + }; + }; + + opp_table0: opp-table-0 { + compatible = "operating-points-v2"; + + opp1098000000 { + opp-hz = /bits/ 64 <1098000000>; + opp-level = <1>; + }; + + opp1197000000 { + opp-hz = /bits/ 64 <1197000000>; + opp-level = <2>; + }; + }; + + opp_table1: opp-table-1 { + compatible = "operating-points-v2"; + + opp1106000000 { + opp-hz = /bits/ 64 <1106000000>; + opp-level = <1>; + }; + + opp1277000000 { + opp-hz = /bits/ 64 <1277000000>; + opp-level = <2>; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + cpufreq { + reg = <0x1040000 0x10>; + compatible = "virtual,cpufreq"; + }; + };