From patchwork Thu May 23 17:31:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 17172 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A27C82395B for ; Thu, 23 May 2013 17:33:39 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hr14sf2582309wib.9 for ; Thu, 23 May 2013 10:32:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=rsVhUzsQq3AwoE9MDaJ+xV8Vx0wTw6dctj+o9hJiD20=; b=jTuP5eiGWWMDnr1LLwgmc0wW4qH/rLYJCTjBjvtzz2Ie478C+N68orNQ7V6Ul1bB90 uzPi75VHhVaryjUkTMwFbaGZj4SNNNUNeT148MNAmfZ88wvMGIeUcl9NOBGrW3SGw3DM tdLSW/yrwvKxzueRjBHkTAwbjZdTap+kNfGbyq3bDyf/GAlstbqncwyVKH8+L5bP7jYJ PCbLVsmS/MS9o5crOzN3ro5PZctEYM4nQNAN8xC8c3hwHoT5JAmKMh2oFinfOw0CJPuq x1h1IK8kIH8UysUe/XeXMonxKZ4mLFwcwj2czpwrxKn7jhfwOwPIyPf4FniA5CEXCgGy Ehyw== X-Received: by 10.180.11.239 with SMTP id t15mr6430735wib.3.1369330363140; Thu, 23 May 2013 10:32:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.187.244 with SMTP id fv20ls13950wic.31.canary; Thu, 23 May 2013 10:32:43 -0700 (PDT) X-Received: by 10.180.189.136 with SMTP id gi8mr45440435wic.11.1369330362930; Thu, 23 May 2013 10:32:42 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id j2si15148793wiv.2.2013.05.23.10.32.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 10:32:42 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id cz11so2662798veb.34 for ; Thu, 23 May 2013 10:32:41 -0700 (PDT) X-Received: by 10.52.163.207 with SMTP id yk15mr5083826vdb.42.1369330361728; Thu, 23 May 2013 10:32:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp62546vcs; Thu, 23 May 2013 10:32:41 -0700 (PDT) X-Received: by 10.15.10.4 with SMTP id f4mr33364775eet.33.1369330360438; Thu, 23 May 2013 10:32:40 -0700 (PDT) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com [207.126.144.145]) by mx.google.com with SMTP id 43si17202548eel.143.2013.05.23.10.31.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 10:32:40 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.145; Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKUZ5SgLwHMHRWiBWNK80CdWP0gEEvOEcJ@postini.com; Thu, 23 May 2013 17:32:14 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 53093DE; Thu, 23 May 2013 17:31:41 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B8C075E5; Thu, 23 May 2013 17:31:40 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id F0A1624C2C0; Thu, 23 May 2013 19:31:30 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Thu, 23 May 2013 19:31:39 +0200 From: Linus Walleij To: , Rob Herring , Mike Turquette Cc: , Arnd Bergmann , Linus Walleij Subject: [PATCH 3/6] clk: move the U300 fixed and fixed-factor to DT Date: Thu, 23 May 2013 19:31:25 +0200 Message-ID: <1369330288-14856-4-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1369330288-14856-1-git-send-email-linus.walleij@stericsson.com> References: <1369330288-14856-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQluXajNzto+hI67PadLLZSUbAL5E30P8aHDjBwh3RVwwAi8LLK2xPsy4+wn5LxhkKR4eEgB X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij This converts the fixed and fixed-factor clocks in the U300 platform to register themselves from the device tree. Cc: Mike Turquette Signed-off-by: Linus Walleij --- Hi Mike, seeking an ACK on this to take the series through ARM SoC. --- arch/arm/boot/dts/ste-u300.dts | 44 ++++++++++++++++++++++++++++++++++++++++++ drivers/clk/clk-u300.c | 33 +++++++++++++------------------ 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts index 0530095..c51a8c7 100644 --- a/arch/arm/boot/dts/ste-u300.dts +++ b/arch/arm/boot/dts/ste-u300.dts @@ -33,6 +33,49 @@ syscon: syscon@c0011000 { compatible = "stericsson,u300-syscon"; reg = <0xc0011000 0x1000>; + clk32: app_32_clk@32k { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; + }; + pll13: pll13@13M { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <13000000>; + }; + pll208: pll208@208M { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <208000000>; + }; + app208: app_208_clk@208M { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <1>; + clock-mult = <1>; + clocks = <&pll208>; + }; + app104: app_104_clk@104M { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <2>; + clock-mult = <1>; + clocks = <&pll208>; + }; + app52: app_52_clk@52M { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <4>; + clock-mult = <1>; + clocks = <&pll208>; + }; + app26: app_26_clk@26M { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <2>; + clock-mult = <1>; + clocks = <&app52>; + }; }; timer: timer@c0014000 { @@ -65,6 +108,7 @@ reg = <0xc0012000 0x1000>; interrupt-parent = <&vicb>; interrupts = <3>; + clocks = <&clk32>; }; rtc: rtc@c0017000 { diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c index a41e42e..bebd6c9 100644 --- a/drivers/clk/clk-u300.c +++ b/drivers/clk/clk-u300.c @@ -11,6 +11,7 @@ #include #include #include +#include /* APP side SYSCON registers */ /* CLK Control Register 16bit (R/W) */ @@ -931,6 +932,17 @@ mclk_clk_register(struct device *dev, const char *name, return clk; } +static const __initconst struct of_device_id u300_clk_match[] = { + { + .compatible = "fixed-clock", + .data = of_fixed_clk_setup, + }, + { + .compatible = "fixed-factor-clock", + .data = of_fixed_factor_clk_setup, + }, +}; + void __init u300_clk_init(void __iomem *base) { u16 val; @@ -951,26 +963,7 @@ void __init u300_clk_init(void __iomem *base) val |= U300_SYSCON_PMCR_PWR_MGNT_ENABLE; writew(val, syscon_vbase + U300_SYSCON_PMCR); - /* These are always available (RTC and PLL13) */ - clk = clk_register_fixed_rate(NULL, "app_32_clk", NULL, - CLK_IS_ROOT, 32768); - /* The watchdog sits directly on the 32 kHz clock */ - clk_register_clkdev(clk, NULL, "coh901327_wdog"); - clk = clk_register_fixed_rate(NULL, "pll13", NULL, - CLK_IS_ROOT, 13000000); - - /* These derive from PLL208 */ - clk = clk_register_fixed_rate(NULL, "pll208", NULL, - CLK_IS_ROOT, 208000000); - clk = clk_register_fixed_factor(NULL, "app_208_clk", "pll208", - 0, 1, 1); - clk = clk_register_fixed_factor(NULL, "app_104_clk", "pll208", - 0, 1, 2); - clk = clk_register_fixed_factor(NULL, "app_52_clk", "pll208", - 0, 1, 4); - /* The 52 MHz is divided down to 26 MHz */ - clk = clk_register_fixed_factor(NULL, "app_26_clk", "app_52_clk", - 0, 1, 2); + of_clk_init(u300_clk_match); /* Directly on the AMBA interconnect */ clk = syscon_clk_register(NULL, "cpu_clk", "app_208_clk", 0, true,