From patchwork Wed Feb 8 15:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 651899 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 2ABA7C05027 for ; Wed, 8 Feb 2023 15:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231414AbjBHPjj (ORCPT ); Wed, 8 Feb 2023 10:39:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231588AbjBHPjj (ORCPT ); Wed, 8 Feb 2023 10:39:39 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8449A4615D; Wed, 8 Feb 2023 07:39:36 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso1759396wmp.3; Wed, 08 Feb 2023 07:39:36 -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=IZ2CaI/V2FdeNF+FZ2q8IFjrwh7v5x9Z6pVcuoKOE+s=; b=EscWcKO9aDv4lw1VYLc1R8eMRNuuaUZo7ShY+3T4Pw+6EbHsYJoiZdLEYBkMThqH/Q mbfGF/T6Ma9vy9y2YQBmr1M0xAvjXJSW/pk/04o4TChh1j03LFrPGivnrdD31dJ4T+9M em+V5VZNSe4i/opFx/oHCRoIpQkXX4PHQkRe17STrC+p3OpHd7vfFvK0lAv70Mbgh3E1 7nvOEO7UB0+JCDpvIuLh91gPvZ0Syr36mFo3WUqsLpRnR92fsafTgC/Ffk7YgX5iai2b cclnEBdJtIQWwGAP+kict8qT+xTarUVs8f96Lp98lRkouoTjmjRiIEFKKPqHuhfraSTQ +5nA== 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=IZ2CaI/V2FdeNF+FZ2q8IFjrwh7v5x9Z6pVcuoKOE+s=; b=1bLyam4jALhfVhuZkHMxZxXgHtLt+ciGQERyJB6bvk09YudOUcNsMRZ1aqPPG7IWGj ICE0gnpwIkSqTaaAsv1+X9brO9UbwOVvDBJUbPZHGJShv7Wawzm9L8ZsvEBMmrCWDzwd vazBlgY9FVPuhb4YcEHOGQtOcwUxDP3FTEtG3SZr/3XJZI93YlsW40kTk7N/TinRFpEA xnY9L8kuF9nd554mYNlxjzhSF961Ev/oMfoIvQpNGEJTDuj/s093J14oif+N3H0KJo85 8bIg0KtvS+ZFf5ld1GVTK3Ya/rkzLU0vtgrBD2pRLfSoY7QUOBYO7SacNcfZ8NKnvm3m vbxg== X-Gm-Message-State: AO0yUKUP9oGRey+5mPskPEMppj6i8bzhMOJsbMVFXA+MkSys4y0taZR7 xyPKbEfeLmV6ieJ9Eul1lME= X-Google-Smtp-Source: AK7set8qO09YDtSj6g/rsPEetfbuIk6UE1JE0R+tTm2JERmPloHu6672cbPQGMrfz8eZQp1HeBLKZw== X-Received: by 2002:a05:600c:920:b0:3dc:5390:6499 with SMTP id m32-20020a05600c092000b003dc53906499mr6992838wmp.1.1675870774900; Wed, 08 Feb 2023 07:39:34 -0800 (PST) Received: from localhost.localdomain (93-34-91-73.ip49.fastwebnet.it. [93.34.91.73]) by smtp.googlemail.com with ESMTPSA id n2-20020a05600c3b8200b003dfe659f9b1sm6755596wms.3.2023.02.08.07.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:39:34 -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 , 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 v6 1/3] dt-bindings: cpufreq: qcom-cpufreq-nvmem: specify supported opp tables Date: Wed, 8 Feb 2023 16:39:11 +0100 Message-Id: <20230208153913.24436-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 v6: - No change 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 Wed Feb 8 15:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 651898 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 D2B17C64EC7 for ; Wed, 8 Feb 2023 15:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231588AbjBHPjn (ORCPT ); Wed, 8 Feb 2023 10:39:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbjBHPjl (ORCPT ); Wed, 8 Feb 2023 10:39:41 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9606248A26; Wed, 8 Feb 2023 07:39:37 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id bg26so13629627wmb.0; Wed, 08 Feb 2023 07:39:37 -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=HFW09DSWE151zjBNnB3HWCYqZY622+jBm6O+Jc9cnLw=; b=fhKRU/ws5vwOeH79D5Lma45fwrgAt7s1bP30GX5RUop3wYvlCJXl0c8gk74U2u4IZc +NMCNVSr2HPCjjNalcUvvQGI/aQhmP0mhU44vEeq9XogiGx/KGGNVtRdTKTynY/YdJnU v4C2Bo+5R1w11KaMVGEamNMpZLUW7Z1PRw4kDxnZYxgXXe7Ze9bDwJj7wtT8X8EqmhjP ycNq7ywfYgJjVPyik909QmQmZpoSlv6ZMO2h8BvM7SHHBGa4yaJCGq9A2BJawY1c1b1G rI18YeDIavR7n+zp9QKXO3D3y1lPWHT6Xp/RFIjR/DENhskDhDmVEFKInFsewIde7HC6 sUgQ== 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=HFW09DSWE151zjBNnB3HWCYqZY622+jBm6O+Jc9cnLw=; b=fGJCJBrqpSzLEPTgfWuFpF8jj0jII97/5V3Qp2OkeJkmYpqfJxCDpjZFtGzA3vvXT2 ERPVoTLpajqy+ubPV5ZVS2lUYhBWPA/r6cAT47swUHZa7VBtwsW7xvlHbR7Xdz341Yfx HnBKMvclT+DveiEWGXdxjqwynJOGw9LhfJZ1qZsxZPLzDDn1wf6IZ1zfVTj4G5psykWO MZO2tSHbs3pKrt0AhFiCDW2R8w1OFYVdEuvadh7oSyMUp22rCe9sPRyTQAV7yxp0c5j9 Elum0/Vr3emaHNnPBpTvNioOzqWoHKOWfGQr5kZZh4OyP1ICnJJJt1P3I/7UrX8RofZ0 sDrg== X-Gm-Message-State: AO0yUKUh/wla0oc6PEF14+2SrSfqIKlJ3wzdRfOz+iiXrxcw68bqkcXo wOyQydi9xfe8UrKM6v7kC3c= X-Google-Smtp-Source: AK7set96rabuGY8uMwxhEXRUcmw7/0nZVzyGhNGMxmTgmsTUsR8WLekTdbtlb1CdIQC4idOKMtXDRg== X-Received: by 2002:a05:600c:3417:b0:3dc:5b79:2dbb with SMTP id y23-20020a05600c341700b003dc5b792dbbmr6887685wmp.25.1675870775954; Wed, 08 Feb 2023 07:39:35 -0800 (PST) Received: from localhost.localdomain (93-34-91-73.ip49.fastwebnet.it. [93.34.91.73]) by smtp.googlemail.com with ESMTPSA id n2-20020a05600c3b8200b003dfe659f9b1sm6755596wms.3.2023.02.08.07.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:39:35 -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 , 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 v6 2/3] dt-bindings: cpufreq: qcom-cpufreq-nvmem: make cpr bindings optional Date: Wed, 8 Feb 2023 16:39:12 +0100 Message-Id: <20230208153913.24436-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208153913.24436-1-ansuelsmth@gmail.com> References: <20230208153913.24436-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. Signed-off-by: Christian Marangi Reviewed-by: Krzysztof Kozlowski --- Changes v6: - Drop Fixes tag (can't be backported due to prereq changes required) 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: