All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Rabeeh Khoury <rabeeh@solid-run.com>,
	Ian Molton <ian.molton@codethink.co.uk>,
	Maen Suleiman <maen@marvell.com>, Olof Johansson <olof@lixom.net>
Subject: [PATCH v3 1/6] ARM: dove: unify clock setup
Date: Wed, 15 Aug 2012 19:07:30 +0200	[thread overview]
Message-ID: <1345050455-32643-2-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1345050455-32643-1-git-send-email-sebastian.hesselbarth@gmail.com>

This patch synchronizes the clock setup of dove with other orion-based
platforms.

In dove_find_tclk there was a note about DOVE_SAMPLE_HI/LO register to
detect tclk. While it might be possible to set a different tclk frequency
with reset strapping the Dove datasheets don't tell anything about tclk
frequency here. Therefore, I removed that comment.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Ian Molton <ian.molton@codethink.co.uk>
Cc: Maen Suleiman <maen@marvell.com>
Cc: Olof Johansson <olof@lixom.net>
---
 arch/arm/mach-dove/common.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

v2: remove useless clk_prepare_enable for fixed rate tclk

diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 4db5de5..b6f092c 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -33,8 +33,6 @@
 #include <plat/addr-map.h>
 #include "common.h"
 
-static int get_tclk(void);
-
 /*****************************************************************************
  * I/O Address Mapping
  ****************************************************************************/
@@ -70,12 +68,13 @@ void __init dove_map_io(void)
 /*****************************************************************************
  * CLK tree
  ****************************************************************************/
+static int dove_tclk;
 static struct clk *tclk;
 
-static void __init clk_init(void)
+static void __init dove_clk_init(void)
 {
 	tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT,
-				       get_tclk());
+				       dove_tclk);
 
 	orion_clkdev_init(tclk);
 }
@@ -187,16 +186,16 @@ void __init dove_init_early(void)
 	orion_time_set_base(TIMER_VIRT_BASE);
 }
 
-static int get_tclk(void)
+static int __init dove_find_tclk(void)
 {
-	/* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
 	return 166666667;
 }
 
 static void __init dove_timer_init(void)
 {
+	dove_tclk = dove_find_tclk();
 	orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
-			IRQ_DOVE_BRIDGE, get_tclk());
+			IRQ_DOVE_BRIDGE, dove_tclk);
 }
 
 struct sys_timer dove_timer = {
@@ -284,8 +283,8 @@ void __init dove_sdio1_init(void)
 
 void __init dove_init(void)
 {
-	printk(KERN_INFO "Dove 88AP510 SoC, ");
-	printk(KERN_INFO "TCLK = %dMHz\n", (get_tclk() + 499999) / 1000000);
+	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
+		(dove_tclk + 499999) / 1000000);
 
 #ifdef CONFIG_CACHE_TAUROS2
 	tauros2_init();
@@ -293,7 +292,7 @@ void __init dove_init(void)
 	dove_setup_cpu_mbus();
 
 	/* Setup root of clk tree */
-	clk_init();
+	dove_clk_init();
 
 	/* internal devices that every board has */
 	dove_rtc_init();
-- 
1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/6] ARM: dove: unify clock setup
Date: Wed, 15 Aug 2012 19:07:30 +0200	[thread overview]
Message-ID: <1345050455-32643-2-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1345050455-32643-1-git-send-email-sebastian.hesselbarth@gmail.com>

This patch synchronizes the clock setup of dove with other orion-based
platforms.

In dove_find_tclk there was a note about DOVE_SAMPLE_HI/LO register to
detect tclk. While it might be possible to set a different tclk frequency
with reset strapping the Dove datasheets don't tell anything about tclk
frequency here. Therefore, I removed that comment.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Ian Molton <ian.molton@codethink.co.uk>
Cc: Maen Suleiman <maen@marvell.com>
Cc: Olof Johansson <olof@lixom.net>
---
 arch/arm/mach-dove/common.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

v2: remove useless clk_prepare_enable for fixed rate tclk

diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 4db5de5..b6f092c 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -33,8 +33,6 @@
 #include <plat/addr-map.h>
 #include "common.h"
 
-static int get_tclk(void);
-
 /*****************************************************************************
  * I/O Address Mapping
  ****************************************************************************/
@@ -70,12 +68,13 @@ void __init dove_map_io(void)
 /*****************************************************************************
  * CLK tree
  ****************************************************************************/
+static int dove_tclk;
 static struct clk *tclk;
 
-static void __init clk_init(void)
+static void __init dove_clk_init(void)
 {
 	tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT,
-				       get_tclk());
+				       dove_tclk);
 
 	orion_clkdev_init(tclk);
 }
@@ -187,16 +186,16 @@ void __init dove_init_early(void)
 	orion_time_set_base(TIMER_VIRT_BASE);
 }
 
-static int get_tclk(void)
+static int __init dove_find_tclk(void)
 {
-	/* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
 	return 166666667;
 }
 
 static void __init dove_timer_init(void)
 {
+	dove_tclk = dove_find_tclk();
 	orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
-			IRQ_DOVE_BRIDGE, get_tclk());
+			IRQ_DOVE_BRIDGE, dove_tclk);
 }
 
 struct sys_timer dove_timer = {
@@ -284,8 +283,8 @@ void __init dove_sdio1_init(void)
 
 void __init dove_init(void)
 {
-	printk(KERN_INFO "Dove 88AP510 SoC, ");
-	printk(KERN_INFO "TCLK = %dMHz\n", (get_tclk() + 499999) / 1000000);
+	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
+		(dove_tclk + 499999) / 1000000);
 
 #ifdef CONFIG_CACHE_TAUROS2
 	tauros2_init();
@@ -293,7 +292,7 @@ void __init dove_init(void)
 	dove_setup_cpu_mbus();
 
 	/* Setup root of clk tree */
-	clk_init();
+	dove_clk_init();
 
 	/* internal devices that every board has */
 	dove_rtc_init();
-- 
1.7.10.4

  reply	other threads:[~2012-08-15 17:10 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-06 12:23 [PATCH 0/6] ARM: dove: DT support for Marvell Dove Sebastian Hesselbarth
2012-08-06 12:23 ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 1/6] ARM: dove: unify clock setup Sebastian Hesselbarth
2012-08-06 12:23   ` Sebastian Hesselbarth
2012-08-11  9:12   ` Andrew Lunn
2012-08-11  9:12     ` Andrew Lunn
2012-08-11  9:38     ` Sebastian Hesselbarth
2012-08-11  9:38       ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 2/6] ARM: dove: add clock gating control Sebastian Hesselbarth
2012-08-06 12:23   ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 3/6] ARM: dove: add crypto engine Sebastian Hesselbarth
2012-08-06 12:23   ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 4/6] ARM: dove: add device tree based machine descriptor Sebastian Hesselbarth
2012-08-06 12:23   ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 5/6] ARM: dove: add device tree descriptors Sebastian Hesselbarth
2012-08-06 12:23   ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 6/6] ARM: dove: SolidRun CuBox DT Sebastian Hesselbarth
2012-08-06 12:23   ` Sebastian Hesselbarth
2012-08-06 14:02 ` [PATCH 0/6] ARM: dove: DT support for Marvell Dove Arnd Bergmann
2012-08-06 14:02   ` Arnd Bergmann
2012-08-06 14:16   ` Sebastian Hesselbarth
2012-08-06 14:16     ` Sebastian Hesselbarth
2012-08-06 14:23     ` Arnd Bergmann
2012-08-06 14:23       ` Arnd Bergmann
2012-08-07 16:53     ` Russell King - ARM Linux
2012-08-07 16:53       ` Russell King - ARM Linux
2012-08-07 19:32       ` Sebastian Hesselbarth
2012-08-07 19:32         ` Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 " Sebastian Hesselbarth
2012-08-11 10:35   ` Sebastian Hesselbarth
2012-08-11 10:35   ` [PATCH v2 1/6] ARM: dove: unify clock setup Sebastian Hesselbarth
2012-08-11 10:35     ` Sebastian Hesselbarth
2012-08-11 10:35   ` [PATCH v2 2/6] ARM: dove: add clock gating control Sebastian Hesselbarth
2012-08-11 10:35     ` Sebastian Hesselbarth
2012-08-12 15:22     ` Andrew Lunn
2012-08-12 15:22       ` Andrew Lunn
2012-08-11 10:35   ` [PATCH v2 3/6] ARM: dove: add crypto engine Sebastian Hesselbarth
2012-08-11 10:35     ` Sebastian Hesselbarth
2012-08-11 10:35   ` [PATCH v2 4/6] ARM: dove: add device tree based machine descriptor Sebastian Hesselbarth
2012-08-11 10:35     ` Sebastian Hesselbarth
2012-08-11 10:35   ` [PATCH v2 5/6] ARM: dove: add device tree descriptors Sebastian Hesselbarth
2012-08-11 10:35     ` Sebastian Hesselbarth
2012-08-11 10:35   ` [PATCH v2 6/6] ARM: dove: SolidRun CuBox DT Sebastian Hesselbarth
2012-08-11 10:35     ` Sebastian Hesselbarth
2012-08-15 17:07   ` [PATCH v3 0/6] ARM: dove: DT support for Marvell Dove Sebastian Hesselbarth
2012-08-15 17:07     ` Sebastian Hesselbarth
2012-08-15 17:07     ` Sebastian Hesselbarth [this message]
2012-08-15 17:07       ` [PATCH v3 1/6] ARM: dove: unify clock setup Sebastian Hesselbarth
2012-08-15 17:07     ` [PATCH v3 2/6] ARM: dove: add clock gating control Sebastian Hesselbarth
2012-08-15 17:07       ` Sebastian Hesselbarth
2012-08-15 17:07     ` [PATCH v3 3/6] ARM: dove: add crypto engine Sebastian Hesselbarth
2012-08-15 17:07       ` Sebastian Hesselbarth
2012-08-15 17:07     ` [PATCH v3 4/6] ARM: dove: add device tree based machine descriptor Sebastian Hesselbarth
2012-08-15 17:07       ` Sebastian Hesselbarth
2012-08-15 17:07     ` [PATCH v3 5/6] ARM: dove: add device tree descriptors Sebastian Hesselbarth
2012-08-15 17:07       ` Sebastian Hesselbarth
2012-08-15 17:07     ` [PATCH v3 6/6] ARM: dove: SolidRun CuBox DT Sebastian Hesselbarth
2012-08-15 17:07       ` Sebastian Hesselbarth
2012-09-10  2:41     ` [PATCH v3 0/6] ARM: dove: DT support for Marvell Dove Jason Cooper
2012-09-10  2:41       ` Jason Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345050455-32643-2-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=ian.molton@codethink.co.uk \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maen@marvell.com \
    --cc=olof@lixom.net \
    --cc=rabeeh@solid-run.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.