Merge branch 'cpufreq/cppc-fie' into cpufreq/arm/linux-next
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 1 Jul 2021 02:02:37 +0000 (07:32 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 1 Jul 2021 02:02:37 +0000 (07:32 +0530)
Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek.txt
Documentation/devicetree/bindings/dvfs/performance-domain.yaml [new file with mode: 0644]
drivers/cpufreq/cpufreq-dt-platdev.c
drivers/cpufreq/mediatek-cpufreq.c
drivers/cpufreq/scmi-cpufreq.c
include/dt-bindings/clock/mt8173-clk.h

index f3c7249..9a2432a 100644 (file)
@@ -257,6 +257,13 @@ properties:
 
       where voltage is in V, frequency is in MHz.
 
+  performance-domains:
+    maxItems: 1
+    description:
+      List of phandles and performance domain specifiers, as defined by
+      bindings of the performance domain provider. See also
+      dvfs/performance-domain.yaml.
+
   power-domains:
     description:
       List of phandles and PM domain specifiers, as defined by bindings of the
index ea4994b..ef68711 100644 (file)
@@ -202,11 +202,11 @@ Example 2 (MT8173 SoC):
 
        cpu2: cpu@100 {
                device_type = "cpu";
-               compatible = "arm,cortex-a57";
+               compatible = "arm,cortex-a72";
                reg = <0x100>;
                enable-method = "psci";
                cpu-idle-states = <&CPU_SLEEP_0>;
-               clocks = <&infracfg CLK_INFRA_CA57SEL>,
+               clocks = <&infracfg CLK_INFRA_CA72SEL>,
                         <&apmixedsys CLK_APMIXED_MAINPLL>;
                clock-names = "cpu", "intermediate";
                operating-points-v2 = <&cpu_opp_table_b>;
@@ -214,11 +214,11 @@ Example 2 (MT8173 SoC):
 
        cpu3: cpu@101 {
                device_type = "cpu";
-               compatible = "arm,cortex-a57";
+               compatible = "arm,cortex-a72";
                reg = <0x101>;
                enable-method = "psci";
                cpu-idle-states = <&CPU_SLEEP_0>;
-               clocks = <&infracfg CLK_INFRA_CA57SEL>,
+               clocks = <&infracfg CLK_INFRA_CA72SEL>,
                         <&apmixedsys CLK_APMIXED_MAINPLL>;
                clock-names = "cpu", "intermediate";
                operating-points-v2 = <&cpu_opp_table_b>;
diff --git a/Documentation/devicetree/bindings/dvfs/performance-domain.yaml b/Documentation/devicetree/bindings/dvfs/performance-domain.yaml
new file mode 100644 (file)
index 0000000..c8b9120
--- /dev/null
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dvfs/performance-domain.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic performance domains
+
+maintainers:
+  - Sudeep Holla <sudeep.holla@arm.com>
+
+description: |+
+  This binding is intended for performance management of groups of devices or
+  CPUs that run in the same performance domain. Performance domains must not
+  be confused with power domains. A performance domain is defined by a set
+  of devices that always have to run at the same performance level. For a given
+  performance domain, there is a single point of control that affects all the
+  devices in the domain, making it impossible to set the performance level of
+  an individual device in the domain independently from other devices in
+  that domain. For example, a set of CPUs that share a voltage domain, and
+  have a common frequency control, is said to be in the same performance
+  domain.
+
+  This device tree binding can be used to bind performance domain consumer
+  devices with their performance domains provided by performance domain
+  providers. A performance domain provider can be represented by any node in
+  the device tree and can provide one or more performance domains. A consumer
+  node can refer to the provider by a phandle and a set of phandle arguments
+  (so called performance domain specifiers) of length specified by the
+  \#performance-domain-cells property in the performance domain provider node.
+
+select: true
+
+properties:
+  "#performance-domain-cells":
+    description:
+      Number of cells in a performance domain specifier. Typically 0 for nodes
+      representing a single performance domain and 1 for nodes providing
+      multiple performance domains (e.g. performance controllers), but can be
+      any value as specified by device tree binding documentation of particular
+      provider.
+    enum: [ 0, 1 ]
+
+  performance-domains:
+    $ref: '/schemas/types.yaml#/definitions/phandle-array'
+    maxItems: 1
+    description:
+      A phandle and performance domain specifier as defined by bindings of the
+      performance controller/provider specified by phandle.
+
+additionalProperties: true
+
+examples:
+  - |
+    performance: performance-controller@12340000 {
+        compatible = "qcom,cpufreq-hw";
+        reg = <0x12340000 0x1000>;
+        #performance-domain-cells = <1>;
+    };
+
+    // The node above defines a performance controller that is a performance
+    // domain provider and expects one cell as its phandle argument.
+
+    cpus {
+        #address-cells = <2>;
+        #size-cells = <0>;
+
+        cpu@0 {
+            device_type = "cpu";
+            compatible = "arm,cortex-a57";
+            reg = <0x0 0x0>;
+            performance-domains = <&performance 1>;
+        };
+    };
index 5e07065..bef7528 100644 (file)
@@ -15,7 +15,7 @@
  * Machines for which the cpufreq device is *always* created, mostly used for
  * platforms using "operating-points" (V1) property.
  */
-static const struct of_device_id whitelist[] __initconst = {
+static const struct of_device_id allowlist[] __initconst = {
        { .compatible = "allwinner,sun4i-a10", },
        { .compatible = "allwinner,sun5i-a10s", },
        { .compatible = "allwinner,sun5i-a13", },
@@ -100,7 +100,7 @@ static const struct of_device_id whitelist[] __initconst = {
  * Machines for which the cpufreq device is *not* created, mostly used for
  * platforms using "operating-points-v2" property.
  */
-static const struct of_device_id blacklist[] __initconst = {
+static const struct of_device_id blocklist[] __initconst = {
        { .compatible = "allwinner,sun50i-h6", },
 
        { .compatible = "arm,vexpress", },
@@ -126,6 +126,7 @@ static const struct of_device_id blacklist[] __initconst = {
        { .compatible = "mediatek,mt8173", },
        { .compatible = "mediatek,mt8176", },
        { .compatible = "mediatek,mt8183", },
+       { .compatible = "mediatek,mt8365", },
        { .compatible = "mediatek,mt8516", },
 
        { .compatible = "nvidia,tegra20", },
@@ -137,6 +138,7 @@ static const struct of_device_id blacklist[] __initconst = {
        { .compatible = "qcom,msm8996", },
        { .compatible = "qcom,qcs404", },
        { .compatible = "qcom,sc7180", },
+       { .compatible = "qcom,sc7280", },
        { .compatible = "qcom,sdm845", },
 
        { .compatible = "st,stih407", },
@@ -177,13 +179,13 @@ static int __init cpufreq_dt_platdev_init(void)
        if (!np)
                return -ENODEV;
 
-       match = of_match_node(whitelist, np);
+       match = of_match_node(allowlist, np);
        if (match) {
                data = match->data;
                goto create_pdev;
        }
 
-       if (cpu0_node_has_opp_v2_prop() && !of_match_node(blacklist, np))
+       if (cpu0_node_has_opp_v2_prop() && !of_match_node(blocklist, np))
                goto create_pdev;
 
        of_node_put(np);
index f2e491b..87019d5 100644 (file)
@@ -537,6 +537,7 @@ static const struct of_device_id mtk_cpufreq_machines[] __initconst = {
        { .compatible = "mediatek,mt8173", },
        { .compatible = "mediatek,mt8176", },
        { .compatible = "mediatek,mt8183", },
+       { .compatible = "mediatek,mt8365", },
        { .compatible = "mediatek,mt8516", },
 
        { }
index c8a4364..ec9a87c 100644 (file)
@@ -174,7 +174,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
                nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
                if (nr_opp <= 0) {
                        dev_err(cpu_dev, "%s: No OPPs for this device: %d\n",
-                               __func__, ret);
+                               __func__, nr_opp);
 
                        ret = -ENODEV;
                        goto out_free_opp;
index 3acebe9..3d00c98 100644 (file)
 #define CLK_INFRA_PMICWRAP             11
 #define CLK_INFRA_CLK_13M              12
 #define CLK_INFRA_CA53SEL               13
-#define CLK_INFRA_CA57SEL               14 /* Deprecated. Don't use it. */
 #define CLK_INFRA_CA72SEL               14
 #define CLK_INFRA_NR_CLK                15