ARM: dts: omap34xx & omap36xx: replace opp-v1 tables by opp-v2 for
authorH. Nikolaus Schaller <hns@goldelico.com>
Wed, 11 Sep 2019 17:47:08 +0000 (19:47 +0200)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 10 Oct 2019 10:41:50 +0000 (16:11 +0530)
With the driver installed, we can change the opp-v1 table format
to opp-v2.

In addition, move omap3 from whitelist to blacklist in cpufreq-dt-platdev
in the same patch, because doing either first breaks operation and
may make trouble in bisect.

We also can remove opp-v1 table for omap3-n950-n9 since its 1GHz
capability is now automatically detected.

We also fix a wrong OPP4 voltage for omap3430 which must be
0.6V + 54*12.5mV = 1275mV. Otherwise the twl4030 driver will reject
this OPP.

Note: the high speed OPPs that were not available in the opp-v1 tables
are tagged "turbo-mode;" which means they are not automatically
activated by the govenors or cpu-freq.

To enable you have to write

echo 1 >/sys/devices/system/cpu/cpufreq/boost

Note: to hard disable an OPP in a board.dts file use e.g.

&cpu0_opp_table: {
/delete-node/ opp1g-1000000000; /* do not use */
};

or alternatively:

&cpu0_opp_table: {
opp1g-1000000000 {
status = "disabled"; /* do not use */
};
};

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Tested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
arch/arm/boot/dts/omap3-n950-n9.dtsi
arch/arm/boot/dts/omap34xx.dtsi
arch/arm/boot/dts/omap36xx.dtsi
drivers/cpufreq/cpufreq-dt-platdev.c

index 6681d4519e97f06d3b26acffe01736a816500aff..a075b63f3087d110a709d3dbfbe3186e513dfb4e 100644 (file)
        cpus {
                cpu@0 {
                        cpu0-supply = <&vcc>;
-                       operating-points = <
-                               /* kHz    uV */
-                               300000  1012500
-                               600000  1200000
-                               800000  1325000
-                               1000000 1375000
-                       >;
                };
        };
 
index 7b09cbee8bb8b515387c6f787c97324d0b410f98..c4dd9801840d6fc08f0798caaa543d03292f19ce 100644 (file)
 / {
        cpus {
                cpu: cpu@0 {
-                       /* OMAP343x/OMAP35xx variants OPP1-5 */
-                       operating-points = <
-                               /* kHz    uV */
-                               125000   975000
-                               250000  1075000
-                               500000  1200000
-                               550000  1270000
-                               600000  1350000
-                       >;
+                       /* OMAP343x/OMAP35xx variants OPP1-6 */
+                       operating-points-v2 = <&cpu0_opp_table>;
+
                        clock-latency = <300000>; /* From legacy driver */
                };
        };
 
+       /* see Documentation/devicetree/bindings/opp/opp.txt */
+       cpu0_opp_table: opp-table {
+               compatible = "operating-points-v2-ti-cpu";
+               syscon = <&scm_conf>;
+
+               opp1-125000000 {
+                       opp-hz = /bits/ 64 <125000000>;
+                       /*
+                        * we currently only select the max voltage from table
+                        * Table 3-3 of the omap3530 Data sheet (SPRS507F).
+                        * Format is: <target min max>
+                        */
+                       opp-microvolt = <975000 975000 975000>;
+                       /*
+                        * first value is silicon revision bit mask
+                        * second one 720MHz Device Identification bit mask
+                        */
+                       opp-supported-hw = <0xffffffff 3>;
+               };
+
+               opp2-250000000 {
+                       opp-hz = /bits/ 64 <250000000>;
+                       opp-microvolt = <1075000 1075000 1075000>;
+                       opp-supported-hw = <0xffffffff 3>;
+                       opp-suspend;
+               };
+
+               opp3-500000000 {
+                       opp-hz = /bits/ 64 <500000000>;
+                       opp-microvolt = <1200000 1200000 1200000>;
+                       opp-supported-hw = <0xffffffff 3>;
+               };
+
+               opp4-550000000 {
+                       opp-hz = /bits/ 64 <550000000>;
+                       opp-microvolt = <1275000 1275000 1275000>;
+                       opp-supported-hw = <0xffffffff 3>;
+               };
+
+               opp5-600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <1350000 1350000 1350000>;
+                       opp-supported-hw = <0xffffffff 3>;
+               };
+
+               opp6-720000000 {
+                       opp-hz = /bits/ 64 <720000000>;
+                       opp-microvolt = <1350000 1350000 1350000>;
+                       /* only high-speed grade omap3530 devices */
+                       opp-supported-hw = <0xffffffff 2>;
+                       turbo-mode;
+               };
+       };
+
        ocp@68000000 {
                omap3_pmx_core2: pinmux@480025d8 {
                        compatible = "ti,omap3-padconf", "pinctrl-single";
index 1e552f08f120ed2b1fc3966e9dec2aca83b783d3..2fcd0c5d72baa6c72e0c449a9eb794dc24a27250 100644 (file)
        };
 
        cpus {
-               /* OMAP3630/OMAP37xx 'standard device' variants OPP50 to OPP130 */
+               /* OMAP3630/OMAP37xx variants OPP50 to OPP130 and OPP1G */
                cpu: cpu@0 {
-                       operating-points = <
-                               /* kHz    uV */
-                               300000  1012500
-                               600000  1200000
-                               800000  1325000
-                       >;
-                       clock-latency = <300000>; /* From legacy driver */
+                       operating-points-v2 = <&cpu0_opp_table>;
+
+                       clock-latency = <300000>; /* From omap-cpufreq driver */
+               };
+       };
+
+       /* see Documentation/devicetree/bindings/opp/opp.txt */
+       cpu0_opp_table: opp-table {
+               compatible = "operating-points-v2-ti-cpu";
+               syscon = <&scm_conf>;
+
+               opp50-300000000 {
+                       opp-hz = /bits/ 64 <300000000>;
+                       /*
+                        * we currently only select the max voltage from table
+                        * Table 4-19 of the DM3730 Data sheet (SPRS685B)
+                        * Format is: <target min max>
+                        */
+                       opp-microvolt = <1012500 1012500 1012500>;
+                       /*
+                        * first value is silicon revision bit mask
+                        * second one is "speed binned" bit mask
+                        */
+                       opp-supported-hw = <0xffffffff 3>;
+                       opp-suspend;
+               };
+
+               opp100-600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <1200000 1200000 1200000>;
+                       opp-supported-hw = <0xffffffff 3>;
+               };
+
+               opp130-800000000 {
+                       opp-hz = /bits/ 64 <800000000>;
+                       opp-microvolt = <1325000 1325000 1325000>;
+                       opp-supported-hw = <0xffffffff 3>;
+               };
+
+               opp1g-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-microvolt = <1375000 1375000 1375000>;
+                       /* only on am/dm37x with speed-binned bit set */
+                       opp-supported-hw = <0xffffffff 2>;
+                       turbo-mode;
                };
        };
 
index bca8d1f47fd2c0dd8fd496604466a58dd34e2492..54bc76743b1fcf38023d34d5eeae9687d3a34361 100644 (file)
@@ -86,7 +86,6 @@ static const struct of_device_id whitelist[] __initconst = {
        { .compatible = "st-ericsson,u9540", },
 
        { .compatible = "ti,omap2", },
-       { .compatible = "ti,omap3", },
        { .compatible = "ti,omap4", },
        { .compatible = "ti,omap5", },
 
@@ -137,6 +136,7 @@ static const struct of_device_id blacklist[] __initconst = {
        { .compatible = "ti,am33xx", },
        { .compatible = "ti,am43", },
        { .compatible = "ti,dra7", },
+       { .compatible = "ti,omap3", },
 
        { }
 };