From patchwork Sat Aug 11 10:35:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 1308071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id D9F08DF2D2 for ; Sat, 11 Aug 2012 10:39:39 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T093J-0005Sc-GU; Sat, 11 Aug 2012 10:36:17 +0000 Received: from mail-bk0-f49.google.com ([209.85.214.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T0933-0005Mq-FP for linux-arm-kernel@lists.infradead.org; Sat, 11 Aug 2012 10:36:02 +0000 Received: by bkcji2 with SMTP id ji2so951699bkc.36 for ; Sat, 11 Aug 2012 03:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=I2zJlNtR7DWw5+/jOOq5DVj1an684+/zpEx2ZTzaRZQ=; b=cjDXLwRrLvZDYMOnaj8shoXLq4liskLNWEpy+LqEpV2B8Stujw+fHoHhqWDplLd/J4 cWRIiz22IzVG1QU4gKwhz103w2fb7kbk8SxlxngV5fIQdAAb8FJLfeji70nWdetKDis9 RP8EAFCISAsDCq2q2CMcaofPq21uKFj3mHlNxQ2+hZz6ksF3x5bmvqVyOLbsGFppSp9I 5X+b/v+gG48nm/9bJTO39X6khdumMZ5v8KoNnTWdwG5wLQ+ZjldbSXXGCHyLaRzEKXVc rJHFkuoBBlWnAqfzJTKHKJ5kVScYBGj/iQCGMybZdvYtN2gbdUHws2ZJIEsepoDGegaG oG4A== Received: by 10.204.146.82 with SMTP id g18mr2103464bkv.126.1344681360192; Sat, 11 Aug 2012 03:36:00 -0700 (PDT) Received: from localhost.localdomain (dslc-082-083-232-154.pools.arcor-ip.net. [82.83.232.154]) by mx.google.com with ESMTPS id hs2sm461922bkc.1.2012.08.11.03.35.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Aug 2012 03:35:58 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH v2 1/6] ARM: dove: unify clock setup Date: Sat, 11 Aug 2012 12:35:21 +0200 Message-Id: <1344681326-17946-2-git-send-email-sebastian.hesselbarth@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1344681326-17946-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1344255815-4457-1-git-send-email-sebastian.hesselbarth@gmail.com> <1344681326-17946-1-git-send-email-sebastian.hesselbarth@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sebastian.hesselbarth[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Andrew Lunn , Russell King , Jason Cooper , Arnd Bergmann , linux-kernel@vger.kernel.org, Rabeeh Khoury , Maen Suleiman , Olof Johansson , Ian Molton , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- Cc: Russell King Cc: Jason Cooper Cc: Andrew Lunn Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Rabeeh Khoury Cc: Ian Molton Cc: Arnd Bergmann Cc: Maen Suleiman Cc: Olof Johansson v2: remove useless clk_prepare_enable for fixed rate tclk --- arch/arm/mach-dove/common.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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 #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();