[PATCH] clocksource: arm_global_timer: Detect if gt is usable with CPU_FREQ

2015-04-13 Thread Ola Jeppsson
Some Cortex A9 CPU:s (e.g. zynq) have the tick tied to the CPU
frequency. On those CPU:s we cannot use the global-timer as a reliable
clocksource with CPU frequency scaling enabled since this is not
currently taken into account by the driver.

Add a tied-to-cpu-freq boolean to the global-timer dt node indicate
this condition.

When the global-timer register function sees this property return
immediately and don't register the clocksource.

Signed-off-by: Ola Jeppsson o...@adapteva.com
---
 Documentation/devicetree/bindings/arm/global_timer.txt | 4 
 drivers/clocksource/arm_global_timer.c | 7 +++
 2 files changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt 
b/Documentation/devicetree/bindings/arm/global_timer.txt
index bdae3a818793..465e02c17b5b 100644
--- a/Documentation/devicetree/bindings/arm/global_timer.txt
+++ b/Documentation/devicetree/bindings/arm/global_timer.txt
@@ -17,6 +17,10 @@
 
 - clocks : Should be phandle to a clock.
 
+** Timer node optional properties:
+
+- tied-to-cpu-freq : indicates that the timer scales with the CPU frequency.
+
 Example:
 
timer@2c000600 {
diff --git a/drivers/clocksource/arm_global_timer.c 
b/drivers/clocksource/arm_global_timer.c
index e6833771a716..8913ebda3f09 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -268,6 +268,13 @@ static void __init global_timer_of_register(struct 
device_node *np)
return;
}
 
+#ifdef CONFIG_CPU_FREQ
+   if (of_property_read_bool(np, tied-to-cpu-freq)) {
+   pr_warn(global-timer: tied to cpu frequency, not supported 
with scaling\n);
+   return;
+   }
+#endif
+
gt_clk = of_clk_get(np, 0);
if (!IS_ERR(gt_clk)) {
err = clk_prepare_enable(gt_clk);
-- 
2.3.3

--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] ARM: dts: zynq: Split off Parallella Microserver device tree

2015-02-12 Thread Ola Jeppsson

On 2015-02-12 01:55, Andreas Färber wrote:

The Microserver edition has neither HDMI nor USB.

Cc: Ola Jeppsson o...@adapteva.com
Signed-off-by: Andreas Färber afaer...@suse.de
---
  arch/arm/boot/dts/Makefile|  1 +
  arch/arm/boot/dts/zynq-parallella-microserver.dts | 19 +++
  2 files changed, 20 insertions(+)
  create mode 100644 arch/arm/boot/dts/zynq-parallella-microserver.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a1c776b8dcec..42c75eeba584 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -606,6 +606,7 @@ dtb-$(CONFIG_ARCH_VT8500) += \
wm8850-w70v2.dtb
  dtb-$(CONFIG_ARCH_ZYNQ) += \
zynq-parallella.dtb \
+   zynq-parallella-microserver.dtb \
zynq-zc702.dtb \
zynq-zc706.dtb \
zynq-zed.dtb \
diff --git a/arch/arm/boot/dts/zynq-parallella-microserver.dts 
b/arch/arm/boot/dts/zynq-parallella-microserver.dts
new file mode 100644
index ..1f3bd2d27a93
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-parallella-microserver.dts
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2014 SUSE LINUX Products GmbH
+ * Copyright (c) 2015 SUSE Linux GmbH
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ */
+/dts-v1/;
+#include zynq-parallella1.dtsi
+
+/ {
+   model = Adapteva Parallella Microserver Board;
+};

To me it would make more sense to use the model number in the file name.
I.e., p1600 instead of microserver.

http://www.digikey.com/product-search/en?v=1554FV=fff40028%2Cfff8014d


// Ola

--
Phone: +46.733208642
Skype: olajep
Email: o...@adapteva.com

--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html