From patchwork Tue Jan 31 15:18:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 649024 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 6086CC636CC for ; Tue, 31 Jan 2023 15:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233196AbjAaPVB (ORCPT ); Tue, 31 Jan 2023 10:21:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbjAaPUg (ORCPT ); Tue, 31 Jan 2023 10:20:36 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5DAE5866F; Tue, 31 Jan 2023 07:18:32 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so12708689wma.1; Tue, 31 Jan 2023 07:18:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bBwrI8hKmSv5gQ7N7D3hIfQL3dVj+xe6qEN98lCdCy0=; b=KUvk6pa+U6ArxTo3fM5DG3JpjKo5Mparu+2/mk+iCDI/peBaxA3PK9rAFfvRCUXu57 kS6KKtIfsB5+4KDeLjxkUqzowUynUK6Bggov5so9huUjuB8vxtXaylHXdP9YeSHzt7tx 9Rmk6bn88UuIjtj63z/UaEyg0XCx7lxEYHS64Ulhv8bqk2KhIYBGAOYBYowTAlPDYEiu OQ53w+e3VH2C0NOAQmDH15haFVFBqsOU+BmdaIq3ZG4PItdg7kzy+QpQt1H+WoWwsfle Brbx9uW1Z2/pjU1oX93aoRVkElmYBJaqeWPOd3wUAVTHJCZQ72d3FtbyROAH+yDL3voH 4Big== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bBwrI8hKmSv5gQ7N7D3hIfQL3dVj+xe6qEN98lCdCy0=; b=UgpC9zeGEF/tKv+TCTCXPEfW8sVqz/OpWCjdkZiSKDXcWMjBkH8C1VVjpanVWufFxR qibvClZNhWtXUdTdEZize5quw0riwKBPRMcRqAV+l5EKKjTi4jkAEdSwrvVszRE+p5bF lpfnhOFLzA8bogdQUHz0wFxfMDQPcTiaB0MUE7RsYPHn1FjglVpNlzIHpmoeHyj4VI39 c6z5koFvnguBFNeNToUdedghyRJ5vJx2AjrdzS6XGlYpIwvh+jv5P+Qs97yobj9IDQmo QXgUUPr66w+qibf7Ha3utZLC1zlvXXiqIeuZ+n5aQDc4TT21cw82Z2QG6AshgFd6Zx8I 5luw== X-Gm-Message-State: AO0yUKXRqMLnkVoKWXmNFWL+AWWftVRCHeBz1bbjAFVS3TL8QVovHLOZ toibGtwrFVBc0tSld4MFVlhDKziyvtk= X-Google-Smtp-Source: AK7set+VVu+M+aULp66owrhILnZtcngXHdXkQ2pADm4UZQdos1fjvbwnPnM2kpyojLmxxTWfqCzXpg== X-Received: by 2002:a05:600c:3492:b0:3dc:de85:5007 with SMTP id a18-20020a05600c349200b003dcde855007mr5985854wmq.21.1675178311223; Tue, 31 Jan 2023 07:18:31 -0800 (PST) Received: from localhost.localdomain (93-34-88-241.ip49.fastwebnet.it. [93.34.88.241]) by smtp.googlemail.com with ESMTPSA id x9-20020a05600c21c900b003dc434b39c7sm2854861wmj.0.2023.01.31.07.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 07:18:30 -0800 (PST) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Nishanth Menon , Stephen Boyd , Yassine Oudjana , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v5 1/3] dt-bindings: cpufreq: qcom-cpufreq-nvmem: specify supported opp tables Date: Tue, 31 Jan 2023 16:18:17 +0100 Message-Id: <20230131151819.16612-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add additional info on what opp tables the defined devices in this schema supports (operating-points-v2-kryo-cpu and operating-points-v2-qcom-level) and reference them. Signed-off-by: Christian Marangi --- Changes v5: - Swap patch 1 and patch 2 to fix dt_check_warning on single patch bisecting Changes v4: - Add patch split from patch 1 .../bindings/cpufreq/qcom-cpufreq-nvmem.yaml | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml index 9c086eac6ca7..7c42d9439abd 100644 --- a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml +++ b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml @@ -55,15 +55,32 @@ properties: patternProperties: '^opp-table(-[a-z0-9]+)?$': - if: - properties: - compatible: - const: operating-points-v2-kryo-cpu - then: - patternProperties: - '^opp-?[0-9]+$': - required: - - required-opps + allOf: + - if: + properties: + compatible: + const: operating-points-v2-kryo-cpu + then: + $ref: /schemas/opp/opp-v2-kryo-cpu.yaml# + + - if: + properties: + compatible: + const: operating-points-v2-kryo-cpu + then: + patternProperties: + '^opp-?[0-9]+$': + required: + - required-opps + + - if: + properties: + compatible: + const: operating-points-v2-qcom-level + then: + $ref: /schemas/opp/opp-v2-qcom-level.yaml# + + unevaluatedProperties: false additionalProperties: true From patchwork Tue Jan 31 15:18:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 649023 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 4C963C636D4 for ; Tue, 31 Jan 2023 15:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbjAaPVN (ORCPT ); Tue, 31 Jan 2023 10:21:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232810AbjAaPUn (ORCPT ); Tue, 31 Jan 2023 10:20:43 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762575899D; Tue, 31 Jan 2023 07:18:34 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso10862872wmq.5; Tue, 31 Jan 2023 07:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=61P/AQP6e8qbPwaNBBQNHhtlwmhRTV3BxORPGqurYw8=; b=RO/xvZjMj7JOTLyABWFwig5zlh9Qldz/0fnJvM6ywngfSYFAB3v6JizCWkwluhOP/a xdSNcij0eODr9LSiDLkEH0uQUlaUf1niOi9mQQ6i3hjlmE1se2aiuvVkLtTAOs2teMSt v2atCY4WiQJ54xV701ortRE72dD8vat9WVsFvU2MbCq0Bcix42Z4xAJbjYzDrK3bF06J HxCD1gK4Cdqf+dAV+ZvskfjQynZHkG0JuO6tuUSlei91KzpCzD1HLn/zva23859HUD5q QVagFNM3M6BAuAmvA8lH56P5Tut3STbPYF7Y3dWKF8Wse9iAvpeaGCGywVdhzRvE/r2c Hnbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=61P/AQP6e8qbPwaNBBQNHhtlwmhRTV3BxORPGqurYw8=; b=q4LweHgEo4ZBg5rycHzOZgBD1+beNuE8pbrEgD9Jk/Lvt0HkbhMo10oQclP2bNQuLO cJ5/gEcQGB14p65dZYTRgY+ekRpNqsNC0QoMVi4tx9TxJrqducNz5y7ZGAL0RTsOxnZO XpGaDiFgRxJ7cr0DbUKfeshEMQvA7rOgwrmip6qW5jOq82wJrTurnzt/fWhL7e/GUcGq T4ImAcqUxRFndlRv4B4AqUUiqKEpDuTQ5Uw+UuHbrjwD9fz3LL5t8cd5KSOQE7lDlKQ1 GaQAFloqMtOzHdZwWKQiqHEcL9UOBsxjoCyXRCzLMKoNrYgTNUtN1JU7pPwzJJYZPtrW /XYw== X-Gm-Message-State: AFqh2kpnA4foRusdNW6VF/Gcq8s7mbxBqZzFOIonf27X2wobq6WAh+G0 dxXl26+IFLk6vVpPERc+Vnw= X-Google-Smtp-Source: AMrXdXviE1Wy0drAiW0KG0aFSWLWSEX+CTvlLOgTAVi0tbRMMae92F+MXMutJAp6P47lnh9ThCE7WA== X-Received: by 2002:a05:600c:3495:b0:3db:a3a:4594 with SMTP id a21-20020a05600c349500b003db0a3a4594mr56382645wmq.28.1675178312473; Tue, 31 Jan 2023 07:18:32 -0800 (PST) Received: from localhost.localdomain (93-34-88-241.ip49.fastwebnet.it. [93.34.88.241]) by smtp.googlemail.com with ESMTPSA id x9-20020a05600c21c900b003dc434b39c7sm2854861wmj.0.2023.01.31.07.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 07:18:32 -0800 (PST) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Nishanth Menon , Stephen Boyd , Yassine Oudjana , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v5 2/3] dt-bindings: cpufreq: qcom-cpufreq-nvmem: make cpr bindings optional Date: Tue, 31 Jan 2023 16:18:18 +0100 Message-Id: <20230131151819.16612-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230131151819.16612-1-ansuelsmth@gmail.com> References: <20230131151819.16612-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The qcom-cpufreq-nvmem driver supports 2 kind of devices: - pre-cpr that doesn't have power-domains and base everything on nvmem cells and multiple named microvolt bindings. Doesn't need required-opp binding in the opp nodes as they are only used for genpd based devices. - cpr-based that require power-domain in the cpu nodes and use various source to decide the correct voltage and freq Require required-opp binding since they need to be linked to the related opp-level. When the schema was introduced, it was wrongly set to always require these binding but this is not the case for pre-cpr devices. Make the power-domain and the required-opp optional and set them required only for qcs404 based devices. Fixes: ec24d1d55469 ("dt-bindings: opp: Convert qcom-nvmem-cpufreq to DT schema") Signed-off-by: Christian Marangi --- Changes v5: - Swap patch 1 and patch 2 to fix dt_check_warning on single Changes v4: - Explain why required-opp needs to be conditional - Split additional ref part Changes v3: - No change Changes v2: - Reword commit description - Fix condition order - Add allOf .../bindings/cpufreq/qcom-cpufreq-nvmem.yaml | 74 +++++++++++-------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml index 7c42d9439abd..6f5e7904181f 100644 --- a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml +++ b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml @@ -17,6 +17,9 @@ description: | on the CPU OPP in use. The CPUFreq driver sets the CPR power domain level according to the required OPPs defined in the CPU OPP tables. + For old implementation efuses are parsed to select the correct opp table and + voltage and CPR is not supported/used. + select: properties: compatible: @@ -33,26 +36,6 @@ select: required: - compatible -properties: - cpus: - type: object - - patternProperties: - '^cpu@[0-9a-f]+$': - type: object - - properties: - power-domains: - maxItems: 1 - - power-domain-names: - items: - - const: cpr - - required: - - power-domains - - power-domain-names - patternProperties: '^opp-table(-[a-z0-9]+)?$': allOf: @@ -63,16 +46,6 @@ patternProperties: then: $ref: /schemas/opp/opp-v2-kryo-cpu.yaml# - - if: - properties: - compatible: - const: operating-points-v2-kryo-cpu - then: - patternProperties: - '^opp-?[0-9]+$': - required: - - required-opps - - if: properties: compatible: @@ -82,6 +55,47 @@ patternProperties: unevaluatedProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,qcs404 + + then: + properties: + cpus: + type: object + + patternProperties: + '^cpu@[0-9a-f]+$': + type: object + + properties: + power-domains: + maxItems: 1 + + power-domain-names: + items: + - const: cpr + + required: + - power-domains + - power-domain-names + + patternProperties: + '^opp-table(-[a-z0-9]+)?$': + if: + properties: + compatible: + const: operating-points-v2-kryo-cpu + then: + patternProperties: + '^opp-?[0-9]+$': + required: + - required-opps + additionalProperties: true examples: