* [PATCH v4 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver @ 2017-01-17 13:18 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: Rob Herring, Viresh Kumar, Rafael J . Wysocki Cc: linux-arm-kernel, linux-omap, linux-pm, devicetree, Tony Lindgren, Dave Gerlach, Nishanth Menon Hi, This is v4 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. Based on v4.10-rc4. History: 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 This series has two changes from v3: * Export dev_pm_opp_of_get_opp_desc_node for modules * Simplify the dt binding by just providing a "syscon" phandle and letting the driver handle offsets. * Add a patch to remove the automatic platdev creation for am335x and dra7 platforms as this driver will now do it. Note that this will *not* break existing cpufreq implementations on these platforms as the ti-cpufreq can fall back to opp v1 tables for backwards compatibility. DT patches to enable this driver will follow after the DT binding is merged. Finally, 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-v4 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 -- 2.11.0 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver @ 2017-01-17 13:18 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: linux-arm-kernel Hi, This is v4 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. Based on v4.10-rc4. History: 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 This series has two changes from v3: * Export dev_pm_opp_of_get_opp_desc_node for modules * Simplify the dt binding by just providing a "syscon" phandle and letting the driver handle offsets. * Add a patch to remove the automatic platdev creation for am335x and dra7 platforms as this driver will now do it. Note that this will *not* break existing cpufreq implementations on these platforms as the ti-cpufreq can fall back to opp v1 tables for backwards compatibility. DT patches to enable this driver will follow after the DT binding is merged. Finally, 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-v4 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 -- 2.11.0 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-17 13:18 ` Dave Gerlach -1 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: Rob Herring, Viresh Kumar, Rafael J . Wysocki Cc: Nishanth Menon, devicetree, Dave Gerlach, Tony Lindgren, linux-pm, linux-omap, linux-arm-kernel 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. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> --- v3->v4: Export dev_pm_opp_of_get_opp_desc_node for use in modules. drivers/base/power/opp/of.c | 9 +++++---- include/linux/pm_opp.h | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index 3f7d2591b173..fe14d231f1db 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -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__); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 0edd88f93904..a5b1aaeae229 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -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__ */ -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v4 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API @ 2017-01-17 13:18 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: linux-arm-kernel 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. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> --- v3->v4: Export dev_pm_opp_of_get_opp_desc_node for use in modules. drivers/base/power/opp/of.c | 9 +++++---- include/linux/pm_opp.h | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index 3f7d2591b173..fe14d231f1db 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -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__); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 0edd88f93904..a5b1aaeae229 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -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__ */ -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v4 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-18 3:14 ` Viresh Kumar -1 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:14 UTC (permalink / raw) To: Dave Gerlach Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren, Rafael J . Wysocki, Rob Herring, linux-omap, linux-arm-kernel On 17-01-17, 07:18, Dave Gerlach wrote: > 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Export dev_pm_opp_of_get_opp_desc_node for use in modules. > > drivers/base/power/opp/of.c | 9 +++++---- > include/linux/pm_opp.h | 6 ++++++ > 2 files changed, 11 insertions(+), 4 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API @ 2017-01-18 3:14 ` Viresh Kumar 0 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:14 UTC (permalink / raw) To: linux-arm-kernel On 17-01-17, 07:18, Dave Gerlach wrote: > 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Export dev_pm_opp_of_get_opp_desc_node for use in modules. > > drivers/base/power/opp/of.c | 9 +++++---- > include/linux/pm_opp.h | 6 ++++++ > 2 files changed, 11 insertions(+), 4 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-17 13:18 ` Dave Gerlach -1 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: Rob Herring, Viresh Kumar, Rafael J . Wysocki Cc: Nishanth Menon, devicetree, Dave Gerlach, Tony Lindgren, linux-pm, linux-omap, linux-arm-kernel 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. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> --- v3->v4: Update to simplify binding, only use "syscon" now to pass control module register space and let driver handle offsets. .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt diff --git a/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file mode 100644 index 000000000000..58efa4c72545 --- /dev/null +++ b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt @@ -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@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_table0 { + 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@300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <950000 931000 969000>; + opp-supported-hw = <0x06 0x0010>; + opp-suspend; + }; + + opp100@275000000 { + opp-hz = /bits/ 64 <275000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0x00FF>; + opp-suspend; + }; + + opp100@300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0020>; + opp-suspend; + }; + + opp100@500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp100@600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0040>; + }; + + opp120@600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp120@720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x06 0x0080>; + }; + + oppturbo@720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + oppturbo@800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x06 0x0100>; + }; + + oppnitro@1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <1325000 1298500 1351500>; + opp-supported-hw = <0x04 0x0200>; + }; +}; -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq @ 2017-01-17 13:18 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: linux-arm-kernel 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. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> --- v3->v4: Update to simplify binding, only use "syscon" now to pass control module register space and let driver handle offsets. .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt diff --git a/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt new file mode 100644 index 000000000000..58efa4c72545 --- /dev/null +++ b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt @@ -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_table0 { + 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>; + }; +}; -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-18 3:16 ` Viresh Kumar -1 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:16 UTC (permalink / raw) To: Dave Gerlach Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren, Rafael J . Wysocki, Rob Herring, linux-omap, linux-arm-kernel On 17-01-17, 07:18, Dave Gerlach wrote: > 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Update to simplify binding, only use "syscon" now to pass control > module register space and let driver handle offsets. > > .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ > 1 file changed, 128 insertions(+) > create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq @ 2017-01-18 3:16 ` Viresh Kumar 0 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:16 UTC (permalink / raw) To: linux-arm-kernel On 17-01-17, 07:18, Dave Gerlach wrote: > 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Update to simplify binding, only use "syscon" now to pass control > module register space and let driver handle offsets. > > .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ > 1 file changed, 128 insertions(+) > create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <20170117131808.29798-3-d-gerlach-l0cyMroinI0@public.gmane.org>]
* Re: [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-19 18:07 ` Rob Herring -1 siblings, 0 replies; 26+ messages in thread From: Rob Herring @ 2017-01-19 18:07 UTC (permalink / raw) To: Dave Gerlach Cc: Viresh Kumar, Rafael J . Wysocki, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Nishanth Menon On Tue, Jan 17, 2017 at 07:18:06AM -0600, Dave Gerlach wrote: > 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. > > Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> > --- > v3->v4: > Update to simplify binding, only use "syscon" now to pass control > module register space and let driver handle offsets. > > .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ > 1 file changed, 128 insertions(+) > create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt > > diff --git a/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt > new file mode 100644 > index 000000000000..58efa4c72545 > --- /dev/null > +++ b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt > @@ -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@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_table0 { Just "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@300000000 { What's the 50, 100, 120 in the names? > + opp-hz = /bits/ 64 <300000000>; > + opp-microvolt = <950000 931000 969000>; > + opp-supported-hw = <0x06 0x0010>; > + opp-suspend; > + }; > + > + opp100@275000000 { > + opp-hz = /bits/ 64 <275000000>; > + opp-microvolt = <1100000 1078000 1122000>; > + opp-supported-hw = <0x01 0x00FF>; > + opp-suspend; > + }; > + > + opp100@300000000 { > + opp-hz = /bits/ 64 <300000000>; > + opp-microvolt = <1100000 1078000 1122000>; > + opp-supported-hw = <0x06 0x0020>; > + opp-suspend; > + }; > + > + opp100@500000000 { > + opp-hz = /bits/ 64 <500000000>; > + opp-microvolt = <1100000 1078000 1122000>; > + opp-supported-hw = <0x01 0xFFFF>; > + }; > + > + opp100@600000000 { > + opp-hz = /bits/ 64 <600000000>; > + opp-microvolt = <1100000 1078000 1122000>; > + opp-supported-hw = <0x06 0x0040>; > + }; > + > + opp120@600000000 { > + opp-hz = /bits/ 64 <600000000>; > + opp-microvolt = <1200000 1176000 1224000>; > + opp-supported-hw = <0x01 0xFFFF>; > + }; > + > + opp120@720000000 { > + opp-hz = /bits/ 64 <720000000>; > + opp-microvolt = <1200000 1176000 1224000>; > + opp-supported-hw = <0x06 0x0080>; > + }; > + > + oppturbo@720000000 { > + opp-hz = /bits/ 64 <720000000>; > + opp-microvolt = <1260000 1234800 1285200>; > + opp-supported-hw = <0x01 0xFFFF>; > + }; > + > + oppturbo@800000000 { > + opp-hz = /bits/ 64 <800000000>; > + opp-microvolt = <1260000 1234800 1285200>; > + opp-supported-hw = <0x06 0x0100>; > + }; > + > + oppnitro@1000000000 { > + opp-hz = /bits/ 64 <1000000000>; > + opp-microvolt = <1325000 1298500 1351500>; > + opp-supported-hw = <0x04 0x0200>; > + }; > +}; > -- > 2.11.0 > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq @ 2017-01-19 18:07 ` Rob Herring 0 siblings, 0 replies; 26+ messages in thread From: Rob Herring @ 2017-01-19 18:07 UTC (permalink / raw) To: linux-arm-kernel On Tue, Jan 17, 2017 at 07:18:06AM -0600, Dave Gerlach wrote: > 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Update to simplify binding, only use "syscon" now to pass control > module register space and let driver handle offsets. > > .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ > 1 file changed, 128 insertions(+) > create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt > > diff --git a/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt > new file mode 100644 > index 000000000000..58efa4c72545 > --- /dev/null > +++ b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt > @@ -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_table0 { Just "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 { What's the 50, 100, 120 in the names? > + 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>; > + }; > +}; > -- > 2.11.0 > ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq 2017-01-19 18:07 ` Rob Herring @ 2017-01-19 18:31 ` Dave Gerlach -1 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-19 18:31 UTC (permalink / raw) To: Rob Herring Cc: Viresh Kumar, Rafael J . Wysocki, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Nishanth Menon On 01/19/2017 12:07 PM, Rob Herring wrote: > On Tue, Jan 17, 2017 at 07:18:06AM -0600, Dave Gerlach wrote: >> 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. >> >> Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> >> --- >> v3->v4: >> Update to simplify binding, only use "syscon" now to pass control >> module register space and let driver handle offsets. >> >> .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ >> 1 file changed, 128 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt >> >> diff --git a/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt >> new file mode 100644 >> index 000000000000..58efa4c72545 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt >> @@ -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@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_table0 { > > Just "opp-table {" Ok. > >> + 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@300000000 { > > What's the 50, 100, 120 in the names? Those are the names of the OPPs given in Table 5-7 of the AM335x data manual, seen here http://www.ti.com/lit/ds/symlink/am3359.pdf . I typically reference the table and document in the commit message of the actual DT patches but didn't here for the binding. Regards, Dave > >> + opp-hz = /bits/ 64 <300000000>; >> + opp-microvolt = <950000 931000 969000>; >> + opp-supported-hw = <0x06 0x0010>; >> + opp-suspend; >> + }; >> + >> + opp100@275000000 { >> + opp-hz = /bits/ 64 <275000000>; >> + opp-microvolt = <1100000 1078000 1122000>; >> + opp-supported-hw = <0x01 0x00FF>; >> + opp-suspend; >> + }; >> + >> + opp100@300000000 { >> + opp-hz = /bits/ 64 <300000000>; >> + opp-microvolt = <1100000 1078000 1122000>; >> + opp-supported-hw = <0x06 0x0020>; >> + opp-suspend; >> + }; >> + >> + opp100@500000000 { >> + opp-hz = /bits/ 64 <500000000>; >> + opp-microvolt = <1100000 1078000 1122000>; >> + opp-supported-hw = <0x01 0xFFFF>; >> + }; >> + >> + opp100@600000000 { >> + opp-hz = /bits/ 64 <600000000>; >> + opp-microvolt = <1100000 1078000 1122000>; >> + opp-supported-hw = <0x06 0x0040>; >> + }; >> + >> + opp120@600000000 { >> + opp-hz = /bits/ 64 <600000000>; >> + opp-microvolt = <1200000 1176000 1224000>; >> + opp-supported-hw = <0x01 0xFFFF>; >> + }; >> + >> + opp120@720000000 { >> + opp-hz = /bits/ 64 <720000000>; >> + opp-microvolt = <1200000 1176000 1224000>; >> + opp-supported-hw = <0x06 0x0080>; >> + }; >> + >> + oppturbo@720000000 { >> + opp-hz = /bits/ 64 <720000000>; >> + opp-microvolt = <1260000 1234800 1285200>; >> + opp-supported-hw = <0x01 0xFFFF>; >> + }; >> + >> + oppturbo@800000000 { >> + opp-hz = /bits/ 64 <800000000>; >> + opp-microvolt = <1260000 1234800 1285200>; >> + opp-supported-hw = <0x06 0x0100>; >> + }; >> + >> + oppnitro@1000000000 { >> + opp-hz = /bits/ 64 <1000000000>; >> + opp-microvolt = <1325000 1298500 1351500>; >> + opp-supported-hw = <0x04 0x0200>; >> + }; >> +}; >> -- >> 2.11.0 >> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq @ 2017-01-19 18:31 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-19 18:31 UTC (permalink / raw) To: linux-arm-kernel On 01/19/2017 12:07 PM, Rob Herring wrote: > On Tue, Jan 17, 2017 at 07:18:06AM -0600, Dave Gerlach wrote: >> 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. >> >> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> >> --- >> v3->v4: >> Update to simplify binding, only use "syscon" now to pass control >> module register space and let driver handle offsets. >> >> .../devicetree/bindings/cpufreq/ti-cpufreq.txt | 128 +++++++++++++++++++++ >> 1 file changed, 128 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt >> >> diff --git a/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt >> new file mode 100644 >> index 000000000000..58efa4c72545 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt >> @@ -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_table0 { > > Just "opp-table {" Ok. > >> + 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 { > > What's the 50, 100, 120 in the names? Those are the names of the OPPs given in Table 5-7 of the AM335x data manual, seen here http://www.ti.com/lit/ds/symlink/am3359.pdf . I typically reference the table and document in the commit message of the actual DT patches but didn't here for the binding. Regards, Dave > >> + 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>; >> + }; >> +}; >> -- >> 2.11.0 >> ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <b7d11925-879a-9be0-fdd8-45b70e642ce1-l0cyMroinI0@public.gmane.org>]
* Re: [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq 2017-01-19 18:31 ` Dave Gerlach @ 2017-01-20 18:43 ` Tony Lindgren -1 siblings, 0 replies; 26+ messages in thread From: Tony Lindgren @ 2017-01-20 18:43 UTC (permalink / raw) To: Dave Gerlach Cc: Rob Herring, Viresh Kumar, Rafael J . Wysocki, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon * Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> [170119 10:32]: > On 01/19/2017 12:07 PM, Rob Herring wrote: > > > + /* > > > + * The three following nodes are marked with opp-suspend > > > + * because they can not be enabled simultaneously on a > > > + * single SoC. > > > + */ > > > + opp50@300000000 { > > > > What's the 50, 100, 120 in the names? > > Those are the names of the OPPs given in Table 5-7 of the AM335x data > manual, seen here http://www.ti.com/lit/ds/symlink/am3359.pdf . I typically > reference the table and document in the commit message of the actual DT > patches but didn't here for the binding. If you don't need the names, you could maybe use: opp100: opp@275000000 { ... }; opp200: opp@300000000 { ... }; ... Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq @ 2017-01-20 18:43 ` Tony Lindgren 0 siblings, 0 replies; 26+ messages in thread From: Tony Lindgren @ 2017-01-20 18:43 UTC (permalink / raw) To: linux-arm-kernel * Dave Gerlach <d-gerlach@ti.com> [170119 10:32]: > On 01/19/2017 12:07 PM, Rob Herring wrote: > > > + /* > > > + * The three following nodes are marked with opp-suspend > > > + * because they can not be enabled simultaneously on a > > > + * single SoC. > > > + */ > > > + opp50 at 300000000 { > > > > What's the 50, 100, 120 in the names? > > Those are the names of the OPPs given in Table 5-7 of the AM335x data > manual, seen here http://www.ti.com/lit/ds/symlink/am3359.pdf . I typically > reference the table and document in the commit message of the actual DT > patches but didn't here for the binding. If you don't need the names, you could maybe use: opp100: opp at 275000000 { ... }; opp200: opp at 300000000 { ... }; ... Regards, Tony ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq 2017-01-20 18:43 ` Tony Lindgren @ 2017-01-23 21:48 ` Dave Gerlach -1 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-23 21:48 UTC (permalink / raw) To: Tony Lindgren Cc: Rob Herring, Viresh Kumar, Rafael J . Wysocki, linux-arm-kernel, linux-omap, linux-pm, devicetree, Nishanth Menon On 01/20/2017 12:43 PM, Tony Lindgren wrote: > * Dave Gerlach <d-gerlach@ti.com> [170119 10:32]: >> On 01/19/2017 12:07 PM, Rob Herring wrote: >>>> + /* >>>> + * The three following nodes are marked with opp-suspend >>>> + * because they can not be enabled simultaneously on a >>>> + * single SoC. >>>> + */ >>>> + opp50@300000000 { >>> >>> What's the 50, 100, 120 in the names? >> >> Those are the names of the OPPs given in Table 5-7 of the AM335x data >> manual, seen here http://www.ti.com/lit/ds/symlink/am3359.pdf . I typically >> reference the table and document in the commit message of the actual DT >> patches but didn't here for the binding. > > If you don't need the names, you could maybe use: > > opp100: opp@275000000 { > ... > }; > > opp200: opp@300000000 { > ... > }; Thanks for the suggestion, but we have duplicate frequencies that have different voltages defined for them, so the scheme opp@<freq> won't work because then we end up with duplicate nodes. OPPs are a defined by a number of parameters, not just frequency, so always naming the nodes opp@<freq> won't cover all scenarios. Regards, Dave > ... > > Regards, > > Tony > ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq @ 2017-01-23 21:48 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-23 21:48 UTC (permalink / raw) To: linux-arm-kernel On 01/20/2017 12:43 PM, Tony Lindgren wrote: > * Dave Gerlach <d-gerlach@ti.com> [170119 10:32]: >> On 01/19/2017 12:07 PM, Rob Herring wrote: >>>> + /* >>>> + * The three following nodes are marked with opp-suspend >>>> + * because they can not be enabled simultaneously on a >>>> + * single SoC. >>>> + */ >>>> + opp50 at 300000000 { >>> >>> What's the 50, 100, 120 in the names? >> >> Those are the names of the OPPs given in Table 5-7 of the AM335x data >> manual, seen here http://www.ti.com/lit/ds/symlink/am3359.pdf . I typically >> reference the table and document in the commit message of the actual DT >> patches but didn't here for the binding. > > If you don't need the names, you could maybe use: > > opp100: opp at 275000000 { > ... > }; > > opp200: opp at 300000000 { > ... > }; Thanks for the suggestion, but we have duplicate frequencies that have different voltages defined for them, so the scheme opp@<freq> won't work because then we end up with duplicate nodes. OPPs are a defined by a number of parameters, not just frequency, so always naming the nodes opp@<freq> won't cover all scenarios. Regards, Dave > ... > > Regards, > > Tony > ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <20170117131808.29798-1-d-gerlach-l0cyMroinI0@public.gmane.org>]
* [PATCH v4 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-17 13:18 ` Dave Gerlach -1 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: Rob Herring, Viresh Kumar, Rafael J . Wysocki Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Dave Gerlach, Nishanth Menon Some 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. Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> --- v3->v4: Update to use simplified binding, only use "syscon" now to pass control module register space and add offsets to relevant data for each SoC. 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 diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 920c469f3953..6d87742fc5aa 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -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 diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 1e46c3918e7a..2078a0f212d8 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -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 diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c new file mode 100644 index 000000000000..a2a4e84c6166 --- /dev/null +++ b/drivers/cpufreq/ti-cpufreq.c @@ -0,0 +1,272 @@ +/* + * TI CPUFreq/OPP hw-supported driver + * + * Copyright (C) 2016-2017 Texas Instruments, Inc. + * Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <linux/cpu.h> +#include <linux/io.h> +#include <linux/mfd/syscon.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/pm_opp.h> +#include <linux/regmap.h> +#include <linux/slab.h> + +#define REVISION_MASK 0xF +#define REVISION_SHIFT 28 + +#define AM33XX_800M_ARM_MPU_MAX_FREQ 0x1E2F +#define AM43XX_600M_ARM_MPU_MAX_FREQ 0xFFA + +#define DRA7_EFUSE_HAS_OD_MPU_OPP 11 +#define DRA7_EFUSE_HAS_HIGH_MPU_OPP 15 +#define DRA7_EFUSE_HAS_ALL_MPU_OPP 23 + +#define DRA7_EFUSE_NOM_MPU_OPP BIT(0) +#define DRA7_EFUSE_OD_MPU_OPP BIT(1) +#define DRA7_EFUSE_HIGH_MPU_OPP BIT(2) + +#define VERSION_COUNT 2 + +struct ti_cpufreq_data; + +struct ti_cpufreq_soc_data { + unsigned long (*efuse_xlate)(struct ti_cpufreq_data *opp_data, + unsigned long efuse); + unsigned long efuse_fallback; + unsigned long efuse_offset; + unsigned long efuse_mask; + unsigned long efuse_shift; + unsigned long rev_offset; +}; + +struct ti_cpufreq_data { + struct device *cpu_dev; + struct device_node *opp_node; + struct regmap *syscon; + const struct ti_cpufreq_soc_data *soc_data; +}; + +static unsigned long amx3_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + if (!efuse) + efuse = opp_data->soc_data->efuse_fallback; + /* AM335x and AM437x use "OPP disable" bits, so invert */ + return ~efuse; +} + +static unsigned long dra7_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + unsigned long calculated_efuse = DRA7_EFUSE_NOM_MPU_OPP; + + /* + * The efuse on dra7 and am57 parts contains a specific + * value indicating the highest available OPP. + */ + + switch (efuse) { + case DRA7_EFUSE_HAS_ALL_MPU_OPP: + case DRA7_EFUSE_HAS_HIGH_MPU_OPP: + calculated_efuse |= DRA7_EFUSE_HIGH_MPU_OPP; + case DRA7_EFUSE_HAS_OD_MPU_OPP: + calculated_efuse |= DRA7_EFUSE_OD_MPU_OPP; + } + + return calculated_efuse; +} + +static struct ti_cpufreq_soc_data am3x_soc_data = { + .efuse_xlate = amx3_efuse_xlate, + .efuse_fallback = AM33XX_800M_ARM_MPU_MAX_FREQ, + .efuse_offset = 0x07fc, + .efuse_mask = 0x1fff, + .rev_offset = 0x600, +}; + +static struct ti_cpufreq_soc_data am4x_soc_data = { + .efuse_xlate = amx3_efuse_xlate, + .efuse_fallback = AM43XX_600M_ARM_MPU_MAX_FREQ, + .efuse_offset = 0x0610, + .efuse_mask = 0x3f, + .rev_offset = 0x600, +}; + +static struct ti_cpufreq_soc_data dra7_soc_data = { + .efuse_xlate = dra7_efuse_xlate, + .efuse_offset = 0x020c, + .efuse_mask = 0xf80000, + .efuse_shift = 19, + .rev_offset = 0x204, +}; + +/** + * ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC + * @opp_data: pointer to ti_cpufreq_data context + * @efuse_value: Set to the value parsed from efuse + * + * Returns error code if efuse not read properly. + */ +static int ti_cpufreq_get_efuse(struct ti_cpufreq_data *opp_data, + u32 *efuse_value) +{ + struct device *dev = opp_data->cpu_dev; + u32 efuse; + int ret; + + ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset, + &efuse); + if (ret) { + dev_err(dev, + "Failed to read the efuse value from syscon: %d\n", + ret); + return ret; + } + + efuse = (efuse & opp_data->soc_data->efuse_mask); + efuse >>= opp_data->soc_data->efuse_shift; + + *efuse_value = opp_data->soc_data->efuse_xlate(opp_data, efuse); + + return 0; +} + +/** + * ti_cpufreq_get_rev() - Parse and return rev value present on SoC + * @opp_data: pointer to ti_cpufreq_data context + * @revision_value: Set to the value parsed from revision register + * + * Returns error code if revision not read properly. + */ +static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data, + u32 *revision_value) +{ + struct device *dev = opp_data->cpu_dev; + u32 revision; + int ret; + + ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset, + &revision); + if (ret) { + dev_err(dev, + "Failed to read the revision number from syscon: %d\n", + ret); + return ret; + } + + *revision_value = BIT((revision >> REVISION_SHIFT) & REVISION_MASK); + + return 0; +} + +static int ti_cpufreq_setup_syscon_register(struct ti_cpufreq_data *opp_data) +{ + struct device *dev = opp_data->cpu_dev; + struct device_node *np = opp_data->opp_node; + + opp_data->syscon = syscon_regmap_lookup_by_phandle(np, + "syscon"); + if (IS_ERR(opp_data->syscon)) { + dev_err(dev, + "\"syscon\" is missing, cannot use OPPv2 table.\n"); + return PTR_ERR(opp_data->syscon); + } + + return 0; +} + +static const struct of_device_id ti_cpufreq_of_match[] = { + { .compatible = "ti,am33xx", .data = &am3x_soc_data, }, + { .compatible = "ti,am4372", .data = &am4x_soc_data, }, + { .compatible = "ti,dra7", .data = &dra7_soc_data }, + {}, +}; + +static int ti_cpufreq_init(void) +{ + u32 version[VERSION_COUNT]; + struct device_node *np; + const struct of_device_id *match; + struct ti_cpufreq_data *opp_data; + int ret; + + np = of_find_node_by_path("/"); + match = of_match_node(ti_cpufreq_of_match, np); + if (!match) + return -ENODEV; + + opp_data = kzalloc(sizeof(*opp_data), GFP_KERNEL); + if (!opp_data) + return -ENOMEM; + + opp_data->soc_data = match->data; + + opp_data->cpu_dev = get_cpu_device(0); + if (!opp_data->cpu_dev) { + pr_err("%s: Failed to get device for CPU0\n", __func__); + return -ENODEV; + } + + opp_data->opp_node = dev_pm_opp_of_get_opp_desc_node(opp_data->cpu_dev); + if (!opp_data->opp_node) { + dev_info(opp_data->cpu_dev, + "OPP-v2 not supported, cpufreq-dt will attempt to use legacy tables.\n"); + goto register_cpufreq_dt; + } + + ret = ti_cpufreq_setup_syscon_register(opp_data); + if (ret) + goto fail_put_node; + + /* + * OPPs determine whether or not they are supported based on + * two metrics: + * 0 - SoC Revision + * 1 - eFuse value + */ + ret = ti_cpufreq_get_rev(opp_data, &version[0]); + if (ret) + goto fail_put_node; + + ret = ti_cpufreq_get_efuse(opp_data, &version[1]); + if (ret) + goto fail_put_node; + + of_node_put(opp_data->opp_node); + + ret = dev_pm_opp_set_supported_hw(opp_data->cpu_dev, version, + VERSION_COUNT); + if (ret) { + dev_err(opp_data->cpu_dev, + "Failed to set supported hardware\n"); + goto fail_put_node; + } + +register_cpufreq_dt: + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); + + return 0; + +fail_put_node: + of_node_put(opp_data->opp_node); + + return ret; +} +module_init(ti_cpufreq_init); + +MODULE_DESCRIPTION("TI CPUFreq/OPP hw-supported driver"); +MODULE_AUTHOR("Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org>"); +MODULE_LICENSE("GPL v2"); -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v4 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime @ 2017-01-17 13:18 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: linux-arm-kernel Some 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. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> --- v3->v4: Update to use simplified binding, only use "syscon" now to pass control module register space and add offsets to relevant data for each SoC. 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 diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 920c469f3953..6d87742fc5aa 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -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 diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 1e46c3918e7a..2078a0f212d8 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -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 diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c new file mode 100644 index 000000000000..a2a4e84c6166 --- /dev/null +++ b/drivers/cpufreq/ti-cpufreq.c @@ -0,0 +1,272 @@ +/* + * TI CPUFreq/OPP hw-supported driver + * + * Copyright (C) 2016-2017 Texas Instruments, Inc. + * Dave Gerlach <d-gerlach@ti.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <linux/cpu.h> +#include <linux/io.h> +#include <linux/mfd/syscon.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/pm_opp.h> +#include <linux/regmap.h> +#include <linux/slab.h> + +#define REVISION_MASK 0xF +#define REVISION_SHIFT 28 + +#define AM33XX_800M_ARM_MPU_MAX_FREQ 0x1E2F +#define AM43XX_600M_ARM_MPU_MAX_FREQ 0xFFA + +#define DRA7_EFUSE_HAS_OD_MPU_OPP 11 +#define DRA7_EFUSE_HAS_HIGH_MPU_OPP 15 +#define DRA7_EFUSE_HAS_ALL_MPU_OPP 23 + +#define DRA7_EFUSE_NOM_MPU_OPP BIT(0) +#define DRA7_EFUSE_OD_MPU_OPP BIT(1) +#define DRA7_EFUSE_HIGH_MPU_OPP BIT(2) + +#define VERSION_COUNT 2 + +struct ti_cpufreq_data; + +struct ti_cpufreq_soc_data { + unsigned long (*efuse_xlate)(struct ti_cpufreq_data *opp_data, + unsigned long efuse); + unsigned long efuse_fallback; + unsigned long efuse_offset; + unsigned long efuse_mask; + unsigned long efuse_shift; + unsigned long rev_offset; +}; + +struct ti_cpufreq_data { + struct device *cpu_dev; + struct device_node *opp_node; + struct regmap *syscon; + const struct ti_cpufreq_soc_data *soc_data; +}; + +static unsigned long amx3_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + if (!efuse) + efuse = opp_data->soc_data->efuse_fallback; + /* AM335x and AM437x use "OPP disable" bits, so invert */ + return ~efuse; +} + +static unsigned long dra7_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + unsigned long calculated_efuse = DRA7_EFUSE_NOM_MPU_OPP; + + /* + * The efuse on dra7 and am57 parts contains a specific + * value indicating the highest available OPP. + */ + + switch (efuse) { + case DRA7_EFUSE_HAS_ALL_MPU_OPP: + case DRA7_EFUSE_HAS_HIGH_MPU_OPP: + calculated_efuse |= DRA7_EFUSE_HIGH_MPU_OPP; + case DRA7_EFUSE_HAS_OD_MPU_OPP: + calculated_efuse |= DRA7_EFUSE_OD_MPU_OPP; + } + + return calculated_efuse; +} + +static struct ti_cpufreq_soc_data am3x_soc_data = { + .efuse_xlate = amx3_efuse_xlate, + .efuse_fallback = AM33XX_800M_ARM_MPU_MAX_FREQ, + .efuse_offset = 0x07fc, + .efuse_mask = 0x1fff, + .rev_offset = 0x600, +}; + +static struct ti_cpufreq_soc_data am4x_soc_data = { + .efuse_xlate = amx3_efuse_xlate, + .efuse_fallback = AM43XX_600M_ARM_MPU_MAX_FREQ, + .efuse_offset = 0x0610, + .efuse_mask = 0x3f, + .rev_offset = 0x600, +}; + +static struct ti_cpufreq_soc_data dra7_soc_data = { + .efuse_xlate = dra7_efuse_xlate, + .efuse_offset = 0x020c, + .efuse_mask = 0xf80000, + .efuse_shift = 19, + .rev_offset = 0x204, +}; + +/** + * ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC + * @opp_data: pointer to ti_cpufreq_data context + * @efuse_value: Set to the value parsed from efuse + * + * Returns error code if efuse not read properly. + */ +static int ti_cpufreq_get_efuse(struct ti_cpufreq_data *opp_data, + u32 *efuse_value) +{ + struct device *dev = opp_data->cpu_dev; + u32 efuse; + int ret; + + ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset, + &efuse); + if (ret) { + dev_err(dev, + "Failed to read the efuse value from syscon: %d\n", + ret); + return ret; + } + + efuse = (efuse & opp_data->soc_data->efuse_mask); + efuse >>= opp_data->soc_data->efuse_shift; + + *efuse_value = opp_data->soc_data->efuse_xlate(opp_data, efuse); + + return 0; +} + +/** + * ti_cpufreq_get_rev() - Parse and return rev value present on SoC + * @opp_data: pointer to ti_cpufreq_data context + * @revision_value: Set to the value parsed from revision register + * + * Returns error code if revision not read properly. + */ +static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data, + u32 *revision_value) +{ + struct device *dev = opp_data->cpu_dev; + u32 revision; + int ret; + + ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset, + &revision); + if (ret) { + dev_err(dev, + "Failed to read the revision number from syscon: %d\n", + ret); + return ret; + } + + *revision_value = BIT((revision >> REVISION_SHIFT) & REVISION_MASK); + + return 0; +} + +static int ti_cpufreq_setup_syscon_register(struct ti_cpufreq_data *opp_data) +{ + struct device *dev = opp_data->cpu_dev; + struct device_node *np = opp_data->opp_node; + + opp_data->syscon = syscon_regmap_lookup_by_phandle(np, + "syscon"); + if (IS_ERR(opp_data->syscon)) { + dev_err(dev, + "\"syscon\" is missing, cannot use OPPv2 table.\n"); + return PTR_ERR(opp_data->syscon); + } + + return 0; +} + +static const struct of_device_id ti_cpufreq_of_match[] = { + { .compatible = "ti,am33xx", .data = &am3x_soc_data, }, + { .compatible = "ti,am4372", .data = &am4x_soc_data, }, + { .compatible = "ti,dra7", .data = &dra7_soc_data }, + {}, +}; + +static int ti_cpufreq_init(void) +{ + u32 version[VERSION_COUNT]; + struct device_node *np; + const struct of_device_id *match; + struct ti_cpufreq_data *opp_data; + int ret; + + np = of_find_node_by_path("/"); + match = of_match_node(ti_cpufreq_of_match, np); + if (!match) + return -ENODEV; + + opp_data = kzalloc(sizeof(*opp_data), GFP_KERNEL); + if (!opp_data) + return -ENOMEM; + + opp_data->soc_data = match->data; + + opp_data->cpu_dev = get_cpu_device(0); + if (!opp_data->cpu_dev) { + pr_err("%s: Failed to get device for CPU0\n", __func__); + return -ENODEV; + } + + opp_data->opp_node = dev_pm_opp_of_get_opp_desc_node(opp_data->cpu_dev); + if (!opp_data->opp_node) { + dev_info(opp_data->cpu_dev, + "OPP-v2 not supported, cpufreq-dt will attempt to use legacy tables.\n"); + goto register_cpufreq_dt; + } + + ret = ti_cpufreq_setup_syscon_register(opp_data); + if (ret) + goto fail_put_node; + + /* + * OPPs determine whether or not they are supported based on + * two metrics: + * 0 - SoC Revision + * 1 - eFuse value + */ + ret = ti_cpufreq_get_rev(opp_data, &version[0]); + if (ret) + goto fail_put_node; + + ret = ti_cpufreq_get_efuse(opp_data, &version[1]); + if (ret) + goto fail_put_node; + + of_node_put(opp_data->opp_node); + + ret = dev_pm_opp_set_supported_hw(opp_data->cpu_dev, version, + VERSION_COUNT); + if (ret) { + dev_err(opp_data->cpu_dev, + "Failed to set supported hardware\n"); + goto fail_put_node; + } + +register_cpufreq_dt: + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); + + return 0; + +fail_put_node: + of_node_put(opp_data->opp_node); + + return ret; +} +module_init(ti_cpufreq_init); + +MODULE_DESCRIPTION("TI CPUFreq/OPP hw-supported driver"); +MODULE_AUTHOR("Dave Gerlach <d-gerlach@ti.com>"); +MODULE_LICENSE("GPL v2"); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v4 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-18 3:17 ` Viresh Kumar -1 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:17 UTC (permalink / raw) To: Dave Gerlach Cc: Rob Herring, Rafael J . Wysocki, linux-arm-kernel, linux-omap, linux-pm, devicetree, Tony Lindgren, Nishanth Menon On 17-01-17, 07:18, Dave Gerlach wrote: > Some 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Update to use simplified binding, only use "syscon" now to pass control > module register space and add offsets to relevant data for each SoC. > > 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 Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime @ 2017-01-18 3:17 ` Viresh Kumar 0 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:17 UTC (permalink / raw) To: linux-arm-kernel On 17-01-17, 07:18, Dave Gerlach wrote: > Some 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > v3->v4: > Update to use simplified binding, only use "syscon" now to pass control > module register space and add offsets to relevant data for each SoC. > > 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 Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-17 13:18 ` Dave Gerlach -1 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: Rob Herring, Viresh Kumar, Rafael J . Wysocki Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Dave Gerlach, Nishanth Menon Some 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. Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> --- drivers/cpufreq/cpufreq-dt-platdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index 7fcaf26e8f81..921b4a6c3d16 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -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", }, -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v4 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms @ 2017-01-17 13:18 ` Dave Gerlach 0 siblings, 0 replies; 26+ messages in thread From: Dave Gerlach @ 2017-01-17 13:18 UTC (permalink / raw) To: linux-arm-kernel Some 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. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> --- drivers/cpufreq/cpufreq-dt-platdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index 7fcaf26e8f81..921b4a6c3d16 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -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", }, -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
[parent not found: <20170117131808.29798-5-d-gerlach-l0cyMroinI0@public.gmane.org>]
* Re: [PATCH v4 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms 2017-01-17 13:18 ` Dave Gerlach @ 2017-01-18 3:17 ` Viresh Kumar -1 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:17 UTC (permalink / raw) To: Dave Gerlach Cc: Rob Herring, Rafael J . Wysocki, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Nishanth Menon On 17-01-17, 07:18, Dave Gerlach wrote: > Some 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. > > Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org> > --- > drivers/cpufreq/cpufreq-dt-platdev.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c > index 7fcaf26e8f81..921b4a6c3d16 100644 > --- a/drivers/cpufreq/cpufreq-dt-platdev.c > +++ b/drivers/cpufreq/cpufreq-dt-platdev.c > @@ -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", }, Acked-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> -- viresh -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms @ 2017-01-18 3:17 ` Viresh Kumar 0 siblings, 0 replies; 26+ messages in thread From: Viresh Kumar @ 2017-01-18 3:17 UTC (permalink / raw) To: linux-arm-kernel On 17-01-17, 07:18, Dave Gerlach wrote: > Some 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. > > Signed-off-by: Dave Gerlach <d-gerlach@ti.com> > --- > drivers/cpufreq/cpufreq-dt-platdev.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c > index 7fcaf26e8f81..921b4a6c3d16 100644 > --- a/drivers/cpufreq/cpufreq-dt-platdev.c > +++ b/drivers/cpufreq/cpufreq-dt-platdev.c > @@ -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", }, Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2017-01-23 21:48 UTC | newest] Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-01-17 13:18 [PATCH v4 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver Dave Gerlach 2017-01-17 13:18 ` Dave Gerlach 2017-01-17 13:18 ` [PATCH v4 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API Dave Gerlach 2017-01-17 13:18 ` Dave Gerlach 2017-01-18 3:14 ` Viresh Kumar 2017-01-18 3:14 ` Viresh Kumar 2017-01-17 13:18 ` [PATCH v4 2/4] Documentation: dt: add bindings for ti-cpufreq Dave Gerlach 2017-01-17 13:18 ` Dave Gerlach 2017-01-18 3:16 ` Viresh Kumar 2017-01-18 3:16 ` Viresh Kumar [not found] ` <20170117131808.29798-3-d-gerlach-l0cyMroinI0@public.gmane.org> 2017-01-19 18:07 ` Rob Herring 2017-01-19 18:07 ` Rob Herring 2017-01-19 18:31 ` Dave Gerlach 2017-01-19 18:31 ` Dave Gerlach [not found] ` <b7d11925-879a-9be0-fdd8-45b70e642ce1-l0cyMroinI0@public.gmane.org> 2017-01-20 18:43 ` Tony Lindgren 2017-01-20 18:43 ` Tony Lindgren 2017-01-23 21:48 ` Dave Gerlach 2017-01-23 21:48 ` Dave Gerlach [not found] ` <20170117131808.29798-1-d-gerlach-l0cyMroinI0@public.gmane.org> 2017-01-17 13:18 ` [PATCH v4 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime Dave Gerlach 2017-01-17 13:18 ` Dave Gerlach 2017-01-18 3:17 ` Viresh Kumar 2017-01-18 3:17 ` Viresh Kumar 2017-01-17 13:18 ` [PATCH v4 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms Dave Gerlach 2017-01-17 13:18 ` Dave Gerlach [not found] ` <20170117131808.29798-5-d-gerlach-l0cyMroinI0@public.gmane.org> 2017-01-18 3:17 ` Viresh Kumar 2017-01-18 3:17 ` Viresh Kumar
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.