All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver
@ 2017-02-03 17:29 ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon, Dave Gerlach,
	Lukasz Majewski

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

-- 
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] 32+ messages in thread

* [PATCH v5 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver
@ 2017-02-03 17:29 ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 UTC (permalink / raw)
  To: linux-arm-kernel

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

-- 
2.11.0

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v5 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API
  2017-02-03 17:29 ` Dave Gerlach
@ 2017-02-03 17:29     ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon, Dave Gerlach,
	Lukasz Majewski

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.

Acked-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org>
---
 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

--
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] 32+ messages in thread

* [PATCH v5 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API
@ 2017-02-03 17:29     ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 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] 32+ messages in thread

* [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-03 17:29 ` Dave Gerlach
@ 2017-02-03 17:29   ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren
  Cc: Nishanth Menon, devicetree, Dave Gerlach, linux-pm,
	Lukasz Majewski, 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 .../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..d35b87a2e33f
--- /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_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 {
+		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] 32+ messages in thread

* [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-03 17:29   ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 .../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..d35b87a2e33f
--- /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_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>;
+	};
+};
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v5 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime
  2017-02-03 17:29 ` Dave Gerlach
@ 2017-02-03 17:29     ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon, Dave Gerlach,
	Lukasz Majewski

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.

Acked-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org>
---
 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] 32+ messages in thread

* [PATCH v5 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime
@ 2017-02-03 17:29     ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 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] 32+ messages in thread

* [PATCH v5 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms
  2017-02-03 17:29 ` Dave Gerlach
@ 2017-02-03 17:29   ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren
  Cc: linux-arm-kernel, linux-omap, linux-pm, devicetree,
	Nishanth Menon, Dave Gerlach, Lukasz Majewski

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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
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] 32+ messages in thread

* [PATCH v5 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms
@ 2017-02-03 17:29   ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-03 17:29 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
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] 32+ messages in thread

* Re: [PATCH v5 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver
  2017-02-03 17:29 ` Dave Gerlach
@ 2017-02-03 23:23   ` Lukasz Majewski
  -1 siblings, 0 replies; 32+ messages in thread
From: Lukasz Majewski @ 2017-02-03 23:23 UTC (permalink / raw)
  To: Dave Gerlach
  Cc: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren,
	linux-arm-kernel, linux-omap, linux-pm, devicetree,
	Nishanth Menon

Hi Dave,

> 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

For the whole series:

Tested-by: Lukasz Majewski <lukma@denx.de>

(code backported to v4.9)
Test HW: AM5718 and AM5728.


> 
> 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
> 




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@denx.de

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v5 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver
@ 2017-02-03 23:23   ` Lukasz Majewski
  0 siblings, 0 replies; 32+ messages in thread
From: Lukasz Majewski @ 2017-02-03 23:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Dave,

> 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

For the whole series:

Tested-by: Lukasz Majewski <lukma@denx.de>

(code backported to v4.9)
Test HW: AM5718 and AM5728.


> 
> 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
> 




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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-03 17:29   ` Dave Gerlach
@ 2017-02-08 14:44     ` Rob Herring
  -1 siblings, 0 replies; 32+ messages in thread
From: Rob Herring @ 2017-02-08 14:44 UTC (permalink / raw)
  To: Dave Gerlach
  Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren,
	Viresh Kumar, Rafael J . Wysocki, Lukasz Majewski, linux-omap,
	linux-arm-kernel

On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---

[...]

> +/*
> + * 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-08 14:44     ` Rob Herring
  0 siblings, 0 replies; 32+ messages in thread
From: Rob Herring @ 2017-02-08 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---

[...]

> +/*
> + * 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-08 14:44     ` Rob Herring
@ 2017-02-08 14:45       ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-08 14:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren,
	Viresh Kumar, Rafael J . Wysocki, Lukasz Majewski, linux-omap,
	linux-arm-kernel

On 02/08/2017 08:44 AM, Rob Herring wrote:
> On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>>
>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>> ---
>
> [...]
>
>> +/*
>> + * 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

>
> Rob
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-08 14:45       ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-08 14:45 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/08/2017 08:44 AM, Rob Herring wrote:
> On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>>
>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>> ---
>
> [...]
>
>> +/*
>> + * 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

>
> Rob
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-08 14:45       ` Dave Gerlach
@ 2017-02-09  0:02         ` Rafael J. Wysocki
  -1 siblings, 0 replies; 32+ messages in thread
From: Rafael J. Wysocki @ 2017-02-09  0:02 UTC (permalink / raw)
  To: Dave Gerlach
  Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren,
	Viresh Kumar, Lukasz Majewski, Rob Herring, linux-omap,
	linux-arm-kernel

On Wednesday, February 08, 2017 08:45:55 AM Dave Gerlach wrote:
> On 02/08/2017 08:44 AM, Rob Herring wrote:
> > On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
> >>
> >> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> >> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> >> ---
> >
> > [...]
> >
> >> +/*
> >> + * 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.

Please send an update of this patch, then.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-09  0:02         ` Rafael J. Wysocki
  0 siblings, 0 replies; 32+ messages in thread
From: Rafael J. Wysocki @ 2017-02-09  0:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, February 08, 2017 08:45:55 AM Dave Gerlach wrote:
> On 02/08/2017 08:44 AM, Rob Herring wrote:
> > On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
> >>
> >> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> >> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> >> ---
> >
> > [...]
> >
> >> +/*
> >> + * 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.

Please send an update of this patch, then.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-03 17:29   ` Dave Gerlach
@ 2017-02-09 15:35     ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-09 15:35 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J . Wysocki, Rob Herring, Tony Lindgren
  Cc: Nishanth Menon, devicetree, Dave Gerlach, linux-pm,
	Lukasz Majewski, 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 .../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..ba0e15ad5bd9
--- /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-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 {
+		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] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-09 15:35     ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-09 15:35 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.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 .../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..ba0e15ad5bd9
--- /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-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>;
+	};
+};
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-09  0:02         ` Rafael J. Wysocki
@ 2017-02-09 15:36           ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-09 15:36 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren,
	Viresh Kumar, Lukasz Majewski, Rob Herring, linux-omap,
	linux-arm-kernel

On 02/08/2017 06:02 PM, Rafael J. Wysocki wrote:
> On Wednesday, February 08, 2017 08:45:55 AM Dave Gerlach wrote:
>> On 02/08/2017 08:44 AM, Rob Herring wrote:
>>> On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>>>>
>>>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>>>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>>>> ---
>>>
>>> [...]
>>>
>>>> +/*
>>>> + * 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.
>
> 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

>
> Thanks,
> Rafael
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-09 15:36           ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-09 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/08/2017 06:02 PM, Rafael J. Wysocki wrote:
> On Wednesday, February 08, 2017 08:45:55 AM Dave Gerlach wrote:
>> On 02/08/2017 08:44 AM, Rob Herring wrote:
>>> On Fri, Feb 3, 2017 at 11:29 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>>>>
>>>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>>>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>>>> ---
>>>
>>> [...]
>>>
>>>> +/*
>>>> + * 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.
>
> 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

>
> Thanks,
> Rafael
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-09 15:35     ` Dave Gerlach
@ 2017-02-09 16:01       ` Rob Herring
  -1 siblings, 0 replies; 32+ messages in thread
From: Rob Herring @ 2017-02-09 16:01 UTC (permalink / raw)
  To: Dave Gerlach
  Cc: Nishanth Menon, devicetree, linux-pm, Tony Lindgren,
	Viresh Kumar, Rafael J . Wysocki, Lukasz Majewski, linux-omap,
	linux-arm-kernel

On Thu, Feb 9, 2017 at 9:35 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  .../devicetree/bindings/cpufreq/ti-cpufreq.txt     | 128 +++++++++++++++++++++
>  1 file changed, 128 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt

Acked-by: Rob Herring <robh@kernel.org>

Rob

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-09 16:01       ` Rob Herring
  0 siblings, 0 replies; 32+ messages in thread
From: Rob Herring @ 2017-02-09 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 9, 2017 at 9:35 AM, Dave Gerlach <d-gerlach@ti.com> 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.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  .../devicetree/bindings/cpufreq/ti-cpufreq.txt     | 128 +++++++++++++++++++++
>  1 file changed, 128 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt

Acked-by: Rob Herring <robh@kernel.org>

Rob

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-09 15:35     ` Dave Gerlach
@ 2017-02-09 22:03       ` Rafael J. Wysocki
  -1 siblings, 0 replies; 32+ messages in thread
From: Rafael J. Wysocki @ 2017-02-09 22:03 UTC (permalink / raw)
  To: Dave Gerlach, Viresh Kumar
  Cc: Nishanth Menon, devicetree, Linux PM, Tony Lindgren,
	Rafael J . Wysocki, Lukasz Majewski, Rob Herring,
	Linux OMAP Mailing List, linux-arm-kernel

On Thu, Feb 9, 2017 at 4:35 PM, Dave Gerlach <d-gerlach@ti.com> 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.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-09 22:03       ` Rafael J. Wysocki
  0 siblings, 0 replies; 32+ messages in thread
From: Rafael J. Wysocki @ 2017-02-09 22:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 9, 2017 at 4:35 PM, Dave Gerlach <d-gerlach@ti.com> 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.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-09 22:03       ` Rafael J. Wysocki
@ 2017-02-10  3:13         ` Viresh Kumar
  -1 siblings, 0 replies; 32+ messages in thread
From: Viresh Kumar @ 2017-02-10  3:13 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Nishanth Menon, devicetree, Dave Gerlach, Tony Lindgren,
	Linux PM, Rafael J . Wysocki, Lukasz Majewski, Rob Herring,
	Linux OMAP Mailing List, linux-arm-kernel

On 09-02-17, 23:03, Rafael J. Wysocki wrote:
> 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.

-- 
viresh

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-10  3:13         ` Viresh Kumar
  0 siblings, 0 replies; 32+ messages in thread
From: Viresh Kumar @ 2017-02-10  3:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 09-02-17, 23:03, Rafael J. Wysocki wrote:
> 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.

-- 
viresh

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-10  3:13         ` Viresh Kumar
@ 2017-02-10 12:28           ` Rafael J. Wysocki
  -1 siblings, 0 replies; 32+ messages in thread
From: Rafael J. Wysocki @ 2017-02-10 12:28 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Nishanth Menon, devicetree, Dave Gerlach, Tony Lindgren,
	Linux PM, Rafael J. Wysocki, Lukasz Majewski, Rob Herring,
	Linux OMAP Mailing List, linux-arm-kernel

On Friday, February 10, 2017 08:43:49 AM Viresh Kumar wrote:
> On 09-02-17, 23:03, Rafael J. Wysocki wrote:
> > 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?

> 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-10 12:28           ` Rafael J. Wysocki
  0 siblings, 0 replies; 32+ messages in thread
From: Rafael J. Wysocki @ 2017-02-10 12:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday, February 10, 2017 08:43:49 AM Viresh Kumar wrote:
> On 09-02-17, 23:03, Rafael J. Wysocki wrote:
> > 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?

> 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
  2017-02-10 12:28           ` Rafael J. Wysocki
@ 2017-02-10 20:55               ` Dave Gerlach
  -1 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-10 20:55 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: Rafael J. Wysocki, Rob Herring, Tony Lindgren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Linux OMAP Mailing List, Linux PM,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon,
	Lukasz Majewski

On 02/10/2017 06:28 AM, Rafael J. Wysocki wrote:
> On Friday, February 10, 2017 08:43:49 AM Viresh Kumar wrote:
>> On 09-02-17, 23:03, Rafael J. Wysocki wrote:
>>> 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?
>
>> 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

>
> Thanks,
> Rafael
>

--
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] 32+ messages in thread

* [PATCH v6 2/4] Documentation: dt: add bindings for ti-cpufreq
@ 2017-02-10 20:55               ` Dave Gerlach
  0 siblings, 0 replies; 32+ messages in thread
From: Dave Gerlach @ 2017-02-10 20:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/10/2017 06:28 AM, Rafael J. Wysocki wrote:
> On Friday, February 10, 2017 08:43:49 AM Viresh Kumar wrote:
>> On 09-02-17, 23:03, Rafael J. Wysocki wrote:
>>> 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?
>
>> 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

>
> Thanks,
> Rafael
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2017-02-10 20:55 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03 17:29 [PATCH v5 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver Dave Gerlach
2017-02-03 17:29 ` Dave Gerlach
     [not found] ` <20170203172929.23940-1-d-gerlach-l0cyMroinI0@public.gmane.org>
2017-02-03 17:29   ` [PATCH v5 1/4] PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API Dave Gerlach
2017-02-03 17:29     ` Dave Gerlach
2017-02-03 17:29   ` [PATCH v5 3/4] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime Dave Gerlach
2017-02-03 17:29     ` Dave Gerlach
2017-02-03 17:29 ` [PATCH v5 2/4] Documentation: dt: add bindings for ti-cpufreq Dave Gerlach
2017-02-03 17:29   ` Dave Gerlach
2017-02-08 14:44   ` Rob Herring
2017-02-08 14:44     ` Rob Herring
2017-02-08 14:45     ` Dave Gerlach
2017-02-08 14:45       ` Dave Gerlach
2017-02-09  0:02       ` Rafael J. Wysocki
2017-02-09  0:02         ` Rafael J. Wysocki
2017-02-09 15:36         ` Dave Gerlach
2017-02-09 15:36           ` Dave Gerlach
2017-02-09 15:35   ` [PATCH v6 " Dave Gerlach
2017-02-09 15:35     ` Dave Gerlach
2017-02-09 16:01     ` Rob Herring
2017-02-09 16:01       ` Rob Herring
2017-02-09 22:03     ` Rafael J. Wysocki
2017-02-09 22:03       ` Rafael J. Wysocki
2017-02-10  3:13       ` Viresh Kumar
2017-02-10  3:13         ` Viresh Kumar
2017-02-10 12:28         ` Rafael J. Wysocki
2017-02-10 12:28           ` Rafael J. Wysocki
     [not found]           ` <3046998.7dExGlRDb3-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org>
2017-02-10 20:55             ` Dave Gerlach
2017-02-10 20:55               ` Dave Gerlach
2017-02-03 17:29 ` [PATCH v5 4/4] cpufreq: dt: Don't use generic platdev driver for ti-cpufreq platforms Dave Gerlach
2017-02-03 17:29   ` Dave Gerlach
2017-02-03 23:23 ` [PATCH v5 0/4] cpufreq: Introduce TI CPUFreq/OPP Driver Lukasz Majewski
2017-02-03 23:23   ` Lukasz Majewski

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.