From patchwork Mon Oct 1 21:12:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 1532671 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 E9A5FDFE80 for ; Mon, 1 Oct 2012 21:14:59 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TInIJ-0004SN-57; Mon, 01 Oct 2012 21:12:51 +0000 Received: from mail.free-electrons.com ([88.190.12.23]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TInI9-0004RS-AJ for linux-arm-kernel@lists.infradead.org; Mon, 01 Oct 2012 21:12:42 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 2E54E153; Mon, 1 Oct 2012 23:11:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham version=3.3.1 Received: from localhost (tra42-5-83-152-246-54.fbx.proxad.net [83.152.246.54]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5E952187; Mon, 1 Oct 2012 23:11:36 +0200 (CEST) From: Gregory CLEMENT To: Mike Turquette , Jason Cooper , Andrew Lunn , Gregory Clement Subject: [PATCH V2 2/3] clk: armada-370-xp: add support for clock framework Date: Mon, 1 Oct 2012 23:12:05 +0200 Message-Id: <1349125926-16144-3-git-send-email-gregory.clement@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349125926-16144-1-git-send-email-gregory.clement@free-electrons.com> References: <1349125926-16144-1-git-send-email-gregory.clement@free-electrons.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.0 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -2.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Lior Amsalem , Ike Pan , Nadav Haklai , Ian Molton , David Marlin , Yehuda Yitschak , Jani Monoses , Tawfik Bayouk , Dan Frazier , Eran Ben-Avi , Li Li , Leif Lindholm , Sebastian Hesselbarth , Arnd Bergmann , Jon Masters , devicetree-discuss@lists.ozlabs.org, Ben Dooks , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Chris Van Hoof , Nicolas Pitre , Maen Suleiman , Shadi Ammouri , Olof Johansson 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 Signed-off-by: Gregory CLEMENT --- arch/arm/boot/dts/armada-370.dtsi | 12 +++++++++ arch/arm/boot/dts/armada-xp.dtsi | 48 +++++++++++++++++++++++++++++++++++ arch/arm/mach-mvebu/Kconfig | 5 ++++ arch/arm/mach-mvebu/armada-370-xp.c | 8 +++++- arch/arm/mach-mvebu/common.h | 1 + 5 files changed, 73 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi index 3228ccc..9bfc904 100644 --- a/arch/arm/boot/dts/armada-370.dtsi +++ b/arch/arm/boot/dts/armada-370.dtsi @@ -31,5 +31,17 @@ compatible = "marvell,armada-370-xp-system-controller"; reg = <0xd0018200 0x100>; }; + coreclk: mvebu-sar@d0018230 { + #clock-cells = <1>; + reg = <0xd0018230 0x08>; + compatible = "marvell,armada-370-core-clockctrl"; + clock-output-names = + "tclk", /* 0 */ + "pclk", /* 1 */ + "nbclk", /* 2 */ + "hclk", /* 3 */ + "dramclk", /* 4 */ + }; + }; }; diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi index 71d6b5d..e75f3a2 100644 --- a/arch/arm/boot/dts/armada-xp.dtsi +++ b/arch/arm/boot/dts/armada-xp.dtsi @@ -27,6 +27,35 @@ <0xd0021870 0x58>; }; + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "marvell,sheeva-v7"; + reg = <0>; + clocks = <&cpuclk 0>; + }; + + cpu@1 { + compatible = "marvell,sheeva-v7"; + reg = <1>; + clocks = <&cpuclk 1>; + }; + + cpu@2 { + compatible = "marvell,sheeva-v7"; + reg = <2>; + clocks = <&cpuclk 2>; + }; + + cpu@3 { + compatible = "marvell,sheeva-v7"; + reg = <3>; + clocks = <&cpuclk 3>; + }; + }; + soc { serial@d0012200 { compatible = "ns16550"; @@ -47,6 +76,25 @@ marvell,timer-25Mhz; }; + coreclk: mvebu-sar@d0018230 { + #clock-cells = <1>; + reg = <0xd0018230 0x08>; + compatible = "marvell,armada-xp-core-clockctrl"; + clock-output-names = + "tclk", /* 0 */ + "pclk", /* 1 */ + "nbclk", /* 2 */ + "hclk", /* 3 */ + "dramclk", /* 4 */ + }; + + cpuclk: clock-complex@d0018700 { + #clock-cells = <1>; + compatible = "marvell,armada-xp-cpu-clockctrl"; + reg = <0xd0018700 0xA0>; + clocks = <&coreclk 1>; + }; + system-controller@d0018200 { compatible = "marvell,armada-370-xp-system-controller"; reg = <0xd0018200 0x500>; diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index caa2c5e..0370af9 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -2,10 +2,15 @@ if ARCH_MVEBU menu "Marvell SOC with device tree" +config MVEBU_CLK_CPU + bool + config MACH_ARMADA_370_XP bool "Marvell Armada 370 and Aramada XP boards" select ARMADA_370_XP_TIMER select CPU_V7 + select CLKDEV_LOOKUP + select MVEBU_CLK_CPU help Say 'Y' here if you want your kernel to support boards based on diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index 4ef923b..612e2c2 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c @@ -37,8 +37,14 @@ void __init armada_370_xp_map_io(void) iotable_init(armada_370_xp_io_desc, ARRAY_SIZE(armada_370_xp_io_desc)); } +void __init armada_370_xp_timer_and_clk_init(void) +{ + mvebu_clocks_init(); + armada_370_xp_timer_init(); +} + struct sys_timer armada_370_xp_timer = { - .init = armada_370_xp_timer_init, + .init = armada_370_xp_timer_and_clk_init, }; static void __init armada_370_xp_dt_init(void) diff --git a/arch/arm/mach-mvebu/common.h b/arch/arm/mach-mvebu/common.h index 02f89ea..281fab3 100644 --- a/arch/arm/mach-mvebu/common.h +++ b/arch/arm/mach-mvebu/common.h @@ -16,6 +16,7 @@ #define __ARCH_MVEBU_COMMON_H void mvebu_restart(char mode, const char *cmd); +void mvebu_clocks_init(void); void armada_370_xp_init_irq(void); void armada_370_xp_handle_irq(struct pt_regs *regs);