cpufreq: Introduce TI CPUFreq/OPP Driver
Subsystems (7)
v5 cover cpufreq: Introduce TI CPUFreq/OPP Driver
Hi,
This is v5 of the series to introduce the ti-cpufreq driver which parses SoC data and provides opp-supported-hw data to the OPP core in order to enable the proper OPPs for the silicon in use.
History:
v4: http://www.spinics.net/lists/linux-omap/msg134629.html
v3: http://www.spinics.net/lists/linux-omap/msg132733.html
v2: http://www.spinics.net/lists/linux-omap/msg131601.html
v1: http://www.spinics.net/lists/linux-omap/msg129089.html
Very minor changes from v4:
* In patch 2 change "opp_table0" to "opp_table" in example
* Add acks on all patches (he approved change in patch 2) from Viresh
DT patches to enable this driver will follow after the DT binding is merged. Branch for testing, with updated DT nodes, pushed here [1].
Regards,
Dave
[1] https://github.com/dgerlach/linux-pm/commits/upstream/ti-cpufreq-driver-new-v5
Dave Gerlach (4):
PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API
Documentation: dt: add bindings for ti-cpufreq
cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime
cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms
.../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 ++++++++++ drivers/base/power/opp/of.c | 9 +- drivers/cpufreq/Kconfig.arm | 11 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/cpufreq-dt-platdev.c | 2 - drivers/cpufreq/ti-cpufreq.c | 272 +++++++++++++++++++++ include/linux/pm_opp.h | 6 + 7 files changed, 423 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt create mode 100644 drivers/cpufreq/ti-cpufreq.c
Signature · 1 line
2.11.0
PATCH v5 1/4 PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API
Rename _of_get_opp_desc_node to dev_pm_opp_of_get_opp_desc_node and add it to include/linux/pm_opp.h to allow other drivers, such as platform OPP and cpufreq drivers, to make use of it.
--- drivers/base/power/opp/of.c | 9 +++++---- include/linux/pm_opp.h | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/base/power/opp/of.c +5 -4
@@ -243,7 +243,7 @@ void dev_pm_opp_of_remove_table(struct device *dev)EXPORT_SYMBOL_GPL (dev_pm_opp_of_remove_table);/* Returns opp descriptor node for a device, caller must do of_node_put() */ -static struct device_node *_of_get_opp_desc_node (struct device *dev) +struct device_node *dev_pm_opp_of_get_opp_desc_node (struct device *dev) {/* * TODO: Support for multiple OPP tables.
@@ -254,6 +254,7 @@ static struct device_node *_of_get_opp_desc_node(struct device *dev)return of_parse_phandle (dev->of_node,"operating-points-v2" ,0 ); } +EXPORT_SYMBOL_GPL (dev_pm_opp_of_get_opp_desc_node);/** * _opp_add_static_v2() - Allocate static OPPs (As per 'v2' DT bindings)
@@ -495,7 +496,7 @@ int dev_pm_opp_of_add_table(struct device *dev)* OPPs have two version of bindings now. The older one is deprecated, * try for the new binding first. */ - opp_np =_of_get_opp_desc_node (dev); + opp_np =dev_pm_opp_of_get_opp_desc_node (dev);if (!opp_np) {/* * Try old-deprecated bindings for backward compatibility with
@@ -605,7 +606,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,int cpu, ret =0 ;/* Get OPP descriptor node */ - np =_of_get_opp_desc_node (cpu_dev); + np =dev_pm_opp_of_get_opp_desc_node (cpu_dev);if (!np) {dev_dbg (cpu_dev,"%s: Couldn't find opp node.\n" , __func__);return -ENOENT ;
@@ -630,7 +631,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, }/* Get OPP descriptor node */ - tmp_np =_of_get_opp_desc_node (tcpu_dev); + tmp_np =dev_pm_opp_of_get_opp_desc_node (tcpu_dev);if (!tmp_np) {dev_err (tcpu_dev,"%s: Couldn't find opp node.\n" , __func__);
include/linux/pm_opp.h +6 -0
@@ -270,6 +270,7 @@ void dev_pm_opp_of_remove_table(struct device *dev);int dev_pm_opp_of_cpumask_add_table (const struct cpumask *cpumask);void dev_pm_opp_of_cpumask_remove_table (const struct cpumask *cpumask);int dev_pm_opp_of_get_sharing_cpus (struct device *cpu_dev,struct cpumask *cpumask); +struct device_node *dev_pm_opp_of_get_opp_desc_node (struct device *dev);#else static inline int dev_pm_opp_of_add_table (struct device *dev) {
@@ -293,6 +294,11 @@ static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct {return -ENOTSUPP ; } + +static inline struct device_node *dev_pm_opp_of_get_opp_desc_node (struct device *dev) +{ +return NULL ; +}#endif #endif /* __LINUX_OPP_H__ */
Signature · 1 line
2.11.0
PATCH v5 2/4 Documentation: dt: add bindings for ti-cpufreq
In reply to Dave GerlachAdd the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
--- .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file +128 -0
@@ -0,0 +1,128 @@ +TI CPUFreq and OPP bindings +================================ + +Certain TI SoCs, like those in the am335x, am437x, am57xx, and dra7xx +families support different OPPs depending on the silicon variant in use. +The ti-cpufreq driver can use revision and an efuse value from the SoC to +provide the OPP framework with supported hardware information. This is +used to determine which OPPs from the operating-points-v2 table get enabled +when it is parsed by the OPP framework. + +Required properties: +-------------------- +In 'cpus' nodes: +- operating-points-v2: Phandle to the operating-points-v2 table to use. + +In 'operating-points-v2' table: +- compatible: Should be + - 'operating-points-v2-ti-cpu' for am335x, am43xx, and dra7xx/am57xx SoCs +- syscon: A phandle pointing to a syscon node representing the control module + register space of the SoC. + +Optional properties: +-------------------- +For each opp entry in 'operating-points-v2' table: +- opp-supported-hw: Two bitfields indicating: + 1. Which revision of the SoC the OPP is supported by + 2. Which eFuse bits indicate this OPP is available + + A bitwise AND is performed against these values and if any bit + matches, the OPP gets enabled. + +Example: +-------- + +/* From arch/arm/boot/dts/am33xx.dtsi */ +cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu at 0 { + compatible = "arm,cortex-a8"; + device_type = "cpu"; + reg = <0>; + + operating-points-v2 = <&cpu0_opp_table>; + + clocks = <&dpll_mpu_ck>; + clock-names = "cpu"; + + clock-latency = <300000>; /* From omap-cpufreq driver */ + }; +}; + +/* + * cpu0 has different OPPs depending on SoC revision and some on revisions + * 0x2 and 0x4 have eFuse bits that indicate if they are available or not + */ +cpu0_opp_table: opp_table { + compatible = "operating-points-v2-ti-cpu"; + syscon = <&scm_conf>; + + /* + * The three following nodes are marked with opp-suspend + * because they can not be enabled simultaneously on a + * single SoC. + */ + opp50 at 300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <950000 931000 969000>; + opp-supported-hw = <0x06 0x0010>; + opp-suspend; + }; + + opp100 at 275000000 { + opp-hz = /bits/ 64 <275000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0x00FF>; + opp-suspend; + }; + + opp100 at 300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0020>; + opp-suspend; + }; + + opp100 at 500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp100 at 600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0040>; + }; + + opp120 at 600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp120 at 720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x06 0x0080>; + }; + + oppturbo at 720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + oppturbo at 800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x06 0x0100>; + }; + + oppnitro at 1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <1325000 1298500 1351500>; + opp-supported-hw = <0x04 0x0200>; + }; +};
Signature · 1 line
2.11.0
PATCH v5 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 11 lines · Dave Gerlach
Add the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
Acked-by Viresh Kumar <[email protected]>Signed-off-by Dave Gerlach <[email protected]>---
[...]
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file +5
-0+/* + * cpu0 has different OPPs depending on SoC revision and some on revisions + * 0x2 and 0x4 have eFuse bits that indicate if they are available or not + */ +cpu0_opp_table: opp_table {
One step closer, but as I showed last time, use a '-', not '_'.
Rob
PATCH v5 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 15 lines · Rob Herring
Quoted 11 lines · Dave Gerlach
Add the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
Acked-by Viresh Kumar <[email protected]>Signed-off-by Dave Gerlach <[email protected]>---
[...]
Quoted 7 lines
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file +5
-0+/* + * cpu0 has different OPPs depending on SoC revision and some on revisions + * 0x2 and 0x4 have eFuse bits that indicate if they are available or not + */ +cpu0_opp_table: opp_table {One step closer, but as I showed last time, use a '-', not '_'.
I apologize I thought the comment was only about the 0, completely missed the underscore, you are correct, thanks.
Regards,
Dave
Quoted 3 lines
Rob
PATCH v5 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 24 lines · Dave Gerlach
Quoted 15 lines · Rob Herring
Quoted 11 lines · Dave Gerlach
Add the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
Acked-by Viresh Kumar <[email protected]>Signed-off-by Dave Gerlach <[email protected]>---
[...]
Quoted 7 lines
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file +5
-0+/* + * cpu0 has different OPPs depending on SoC revision and some on revisions + * 0x2 and 0x4 have eFuse bits that indicate if they are available or not + */ +cpu0_opp_table: opp_table {One step closer, but as I showed last time, use a '-', not '_'.
Quoted 2 lines
I apologize I thought the comment was only about the 0, completely missed the underscore, you are correct, thanks.
Please send an update of this patch, then.
Thanks,
Rafael
PATCH v5 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 25 lines · Rafael J. Wysocki
Quoted 24 lines · Dave Gerlach
Quoted 22 lines · Rob Herring
Quoted 11 lines · Dave Gerlach
Add the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
Acked-by Viresh Kumar <[email protected]>Signed-off-by Dave Gerlach <[email protected]>---
[...]
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file +5
-0+/* + * cpu0 has different OPPs depending on SoC revision and some on revisions + * 0x2 and 0x4 have eFuse bits that indicate if they are available or not + */ +cpu0_opp_table: opp_table {One step closer, but as I showed last time, use a '-', not '_'.
Quoted 4 lines
Quoted 2 lines
I apologize I thought the comment was only about the 0, completely missed the underscore, you are correct, thanks.
Please send an update of this patch, then.
Yes, sent an update of just this patch in reply to the original patch email, thanks.
Regards,
Dave
Quoted 4 lines
Thanks,
Rafael
PATCH v6 2/4 Documentation: dt: add bindings for ti-cpufreq
In reply to Dave GerlachAdd the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
--- .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file +128 -0
@@ -0,0 +1,128 @@ +TI CPUFreq and OPP bindings +================================ + +Certain TI SoCs, like those in the am335x, am437x, am57xx, and dra7xx +families support different OPPs depending on the silicon variant in use. +The ti-cpufreq driver can use revision and an efuse value from the SoC to +provide the OPP framework with supported hardware information. This is +used to determine which OPPs from the operating-points-v2 table get enabled +when it is parsed by the OPP framework. + +Required properties: +-------------------- +In 'cpus' nodes: +- operating-points-v2: Phandle to the operating-points-v2 table to use. + +In 'operating-points-v2' table: +- compatible: Should be + - 'operating-points-v2-ti-cpu' for am335x, am43xx, and dra7xx/am57xx SoCs +- syscon: A phandle pointing to a syscon node representing the control module + register space of the SoC. + +Optional properties: +-------------------- +For each opp entry in 'operating-points-v2' table: +- opp-supported-hw: Two bitfields indicating: + 1. Which revision of the SoC the OPP is supported by + 2. Which eFuse bits indicate this OPP is available + + A bitwise AND is performed against these values and if any bit + matches, the OPP gets enabled. + +Example: +-------- + +/* From arch/arm/boot/dts/am33xx.dtsi */ +cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu at 0 { + compatible = "arm,cortex-a8"; + device_type = "cpu"; + reg = <0>; + + operating-points-v2 = <&cpu0_opp_table>; + + clocks = <&dpll_mpu_ck>; + clock-names = "cpu"; + + clock-latency = <300000>; /* From omap-cpufreq driver */ + }; +}; + +/* + * cpu0 has different OPPs depending on SoC revision and some on revisions + * 0x2 and 0x4 have eFuse bits that indicate if they are available or not + */ +cpu0_opp_table: opp-table { + compatible = "operating-points-v2-ti-cpu"; + syscon = <&scm_conf>; + + /* + * The three following nodes are marked with opp-suspend + * because they can not be enabled simultaneously on a + * single SoC. + */ + opp50 at 300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <950000 931000 969000>; + opp-supported-hw = <0x06 0x0010>; + opp-suspend; + }; + + opp100 at 275000000 { + opp-hz = /bits/ 64 <275000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0x00FF>; + opp-suspend; + }; + + opp100 at 300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0020>; + opp-suspend; + }; + + opp100 at 500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp100 at 600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0040>; + }; + + opp120 at 600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp120 at 720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x06 0x0080>; + }; + + oppturbo at 720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + oppturbo at 800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x06 0x0100>; + }; + + oppnitro at 1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <1325000 1298500 1351500>; + opp-supported-hw = <0x04 0x0200>; + }; +};
Signature · 1 line
2.11.0
PATCH v6 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 8 lines · Dave Gerlach
Add the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
Quoted 6 lines
Acked-by Viresh Kumar <[email protected]>Signed-off-by Dave Gerlach <[email protected]>--- .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt
Rob
Rafael J. Wysocki
maintainerPATCH v6 2/4 Documentation: dt: add bindings for ti-cpufreq
In reply to Dave GerlachQuoted 11 lines · Dave Gerlach
Add the device tree bindings document for the TI CPUFreq/OPP driver on AM33xx, AM43xx, DRA7xx, and AM57xx SoCs. The operating-points-v2 binding allows us to provide an opp-supported-hw property for each OPP to define when it is available. This driver is responsible for reading and parsing registers to determine which OPPs can be selectively enabled based on the specific SoC in use by matching against the opp-supported-hw data.
Acked-by Viresh Kumar <[email protected]>Signed-off-by Dave Gerlach <[email protected]>---
I applied this (with the Rob's ACK) along with the rest of the series and I fixed up things that didn't apply and didn't build and I was not amused by that at all.
In particular, Viresh, if you ACK something, please make sure that it doesn't conflict with your own patches.
Thanks,
Rafael
Viresh Kumar
maintainerPATCH v6 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 2 lines · Rafael J. Wysocki
In particular, Viresh, if you ACK something, please make sure that it doesn't conflict with your own patches.
I hope you are talking about the patch 3/4 for which Arnd also sent a fix. I acked it back on 18th of January and Dave has been carrying my Ack since then. When he posted again, I didn't went into reviewing it again as I saw my Ack being there.
Yes, he ended up using an API which just got updated after 18th of Jan and yes both me and Dave missed that. But I feel it is difficult to take care of scenarios like this. Perhaps he should have made sure that he base it of pm/linux-next and nothing would have gone wrong.
Signature · 1 line
viresh
PATCH v6 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 8 lines · Viresh Kumar
Quoted 2 lines · Rafael J. Wysocki
In particular, Viresh, if you ACK something, please make sure that it doesn't conflict with your own patches.
I hope you are talking about the patch 3/4 for which Arnd also sent a fix. I acked it back on 18th of January and Dave has been carrying my Ack since then. When he posted again, I didn't went into reviewing it again as I saw my Ack being there.
Well, OK, but you did know that the OPP API had changed in the meantime, so it wouldn't have hurt to double check I suppose?
Quoted 4 lines
Yes, he ended up using an API which just got updated after 18th of Jan and yes both me and Dave missed that. But I feel it is difficult to take care of scenarios like this. Perhaps he should have made sure that he base it of pm/linux-next and nothing would have gone wrong.
Yes, that would help, but then how to enforce that?
Thanks,
Rafael
PATCH v6 2/4 Documentation: dt: add bindings for ti-cpufreq
Quoted 13 lines · Rafael J. Wysocki
Quoted 8 lines · Viresh Kumar
Quoted 2 lines · Rafael J. Wysocki
In particular, Viresh, if you ACK something, please make sure that it doesn't conflict with your own patches.
I hope you are talking about the patch 3/4 for which Arnd also sent a fix. I acked it back on 18th of January and Dave has been carrying my Ack since then. When he posted again, I didn't went into reviewing it again as I saw my Ack being there.
Well, OK, but you did know that the OPP API had changed in the meantime, so it wouldn't have hurt to double check I suppose?
Quoted 6 lines
Quoted 4 lines
Yes, he ended up using an API which just got updated after 18th of Jan and yes both me and Dave missed that. But I feel it is difficult to take care of scenarios like this. Perhaps he should have made sure that he base it of pm/linux-next and nothing would have gone wrong.
Yes, that would help, but then how to enforce that?
I apologize, I was unaware of the conflicting series. I'm not sure of a good way to enforce it but I do agree I will make sure to rebase and test against pm/linux-next before sending in the future.
Regards,
Dave
Quoted 4 lines
Thanks,
Rafael
PATCH v5 3/4 cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime
In reply to Dave GerlachSome TI SoCs, like those in the AM335x, AM437x, DRA7x, and AM57x families, have different OPPs available for the MPU depending on which specific variant of the SoC is in use. This can be determined through use of the revision and an eFuse register present in the silicon. Introduce a ti-cpufreq driver that can read the aformentioned values and provide them as version matching data to the opp framework. Through this the opp-supported-hw dt binding that is part of the operating-points-v2 table can be used to indicate availability of OPPs for each device.
This driver also creates the "cpufreq-dt" platform_device after passing the version matching data to the OPP framework so that the cpufreq-dt handles the actual cpufreq implementation. Even without the necessary data to pass the version matching data the driver will still create this device to maintain backwards compatibility with operating-points v1 tables.
--- drivers/cpufreq/Kconfig.arm | 11 ++ drivers/cpufreq/Makefile | 1 + drivers/cpufreq/ti-cpufreq.c | 272 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 284 insertions(+) create mode 100644 drivers/cpufreq/ti-cpufreq.c
drivers/cpufreq/Kconfig.arm +11 -0
@@ -247,6 +247,17 @@ config ARM_TEGRA124_CPUFREQ help This adds the CPUFreq driver support for Tegra124 SOCs. +config ARM_TI_CPUFREQ + bool "Texas Instruments CPUFreq support" + depends on ARCH_OMAP2PLUS + help + This driver enables valid OPPs on the running platform based on + values contained within the SoC in use. Enable this in order to + use the cpufreq-dt driver on all Texas Instruments platforms that + provide dt based operating-points-v2 tables with opp-supported-hw + data provided. Required for cpufreq support on AM335x, AM437x, + DRA7x, and AM57x platforms. + config ARM_PXA2xx_CPUFREQ tristate "Intel PXA2xx CPUfreq driver" depends on PXA27x || PXA25x
drivers/cpufreq/Makefile +1 -0
@@ -77,6 +77,7 @@ obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o obj-$(CONFIG_ARM_STI_CPUFREQ) += sti-cpufreq.o obj-$(CONFIG_ARM_TEGRA20_CPUFREQ) += tegra20-cpufreq.o obj-$(CONFIG_ARM_TEGRA124_CPUFREQ) += tegra124-cpufreq.o +obj-$(CONFIG_ARM_TI_CPUFREQ) += ti-cpufreq.o obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o obj-$(CONFIG_ACPI_CPPC_CPUFREQ) += cppc_cpufreq.o obj-$(CONFIG_MACH_MVEBU_V7) += mvebu-cpufreq.o
drivers/cpufreq/ti-cpufreq.c new file +272 -0
272 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v5 4/4 cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms
In reply to Dave GerlachSome TI platforms, specifically those in the am33xx, am43xx, dra7xx, and am57xx families of SoCs can make use of the ti-cpufreq driver to selectively enable OPPs based on the exact configuration in use. The ti-cpufreq is given the responsibility of creating the cpufreq-dt platform device when the driver is in use so drop am33xx and dra7xx from the cpufreq-dt-platdev driver so it is not created twice.
--- drivers/cpufreq/cpufreq-dt-platdev.c | 2 -- 1 file changed, 2 deletions(-)
drivers/cpufreq/cpufreq-dt-platdev.c +0 -2
@@ -87,8 +87,6 @@ static const struct of_device_id machines[] __initconst = { { .compatible = "socionext,uniphier-ld11", }, { .compatible = "socionext,uniphier-ld20", }, - { .compatible = "ti,am33xx", }, - { .compatible = "ti,dra7", }, { .compatible = "ti,omap2", }, { .compatible = "ti,omap3", }, { .compatible = "ti,omap4", },
Signature · 1 line
2.11.0
v5 cover cpufreq: Introduce TI CPUFreq/OPP Driver
In reply to Dave GerlachHi Dave,
Quoted 16 lines
Hi,
This is v5 of the series to introduce the ti-cpufreq driver which parses SoC data and provides opp-supported-hw data to the OPP core in order to enable the proper OPPs for the silicon in use.History:
v4: http://www.spinics.net/lists/linux-omap/msg134629.html
v3: http://www.spinics.net/lists/linux-omap/msg132733.html
v2: http://www.spinics.net/lists/linux-omap/msg131601.html
v1: http://www.spinics.net/lists/linux-omap/msg129089.htmlVery minor changes from v4:
* In patch 2 change "opp_table0" to "opp_table" in example
* Add acks on all patches (he approved change in patch 2)
from Viresh
Quoted 8 lines
DT patches to enable this driver will follow after the DT binding is merged. Branch for testing, with updated DT nodes, pushed here [1].
Regards,
Dave[1]
https://github.com/dgerlach/linux-pm/commits/upstream/ti-cpufreq-driver-new-v5
For the whole series:
(code backported to v4.9)
Test HW: AM5718 and AM5728.
Quoted 14 lines
Dave Gerlach (4):
PM / OPP: Expose_of_get_opp_desc_nodeasdev_pm_oppAPI
Documentation: dt: add bindings for ti-cpufreq
cpufreq: ti: Add cpufreq driver to determine available OPPs at
runtime cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms.../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 ++++++++++ drivers/base/power/opp/of.c | 9 +- drivers/cpufreq/Kconfig.arm | 11 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/cpufreq-dt-platdev.c | 2 - drivers/cpufreq/ti-cpufreq.c | 272
Quoted 6 lines
+++++++++++++++++++++
include/linux/pm_opp.h| 6 + 7 files
changed, 423 insertions(+), 6 deletions(-) create mode 100644Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txtcreate mode 100644drivers/cpufreq/ti-cpufreq.c
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de