From patchwork Thu Feb 13 09:00:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 24578 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 959DF202B2 for ; Thu, 13 Feb 2014 09:01:41 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id p5sf21943501vbn.6 for ; Thu, 13 Feb 2014 01:01:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=FPAYHv40/vrmZleURcxUwtsKzBzHmYq57R2H/lZwLiw=; b=df0pOvhoiUbKNswtkhSUUfcJsEiu5FpEXh2V3MTuhIVyMzEdICQ98qanTeum+uOKv2 6EUgrR4N+NiZA8tycoHfEAfTilT/rc9MTQxXKqWBRkYskBBHGht8U6WLfLoAnReJFtX4 nBTb+kL9qTRX1009lzoN1RzC2S6YckynUmKm7WFSVwx/JYN5EDW7DN0h4gvSd2b8jfq9 /1M7qlwxvQcOro2O1125/c71FK8WBpWzmhJHwdmSTyY9NDs0LU8LDDac4pMG0mTr0N+P ZTZqfy74fpj7XjeCfBR/FSCpTQZJT+sEmGrC7JIN3IvLwXNZcqHHHO6V8hytAdHhmgUG ENoQ== X-Gm-Message-State: ALoCoQnu1k9GGXO/IDjqlJjCfDj736jn08Wc9SELMwCDItPJAm98GlCcAc5A/0TGbkPYc8onstL0 X-Received: by 10.58.57.137 with SMTP id i9mr126753veq.20.1392282100577; Thu, 13 Feb 2014 01:01:40 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.134 with SMTP id i6ls3405434qge.2.gmail; Thu, 13 Feb 2014 01:01:40 -0800 (PST) X-Received: by 10.58.172.132 with SMTP id bc4mr102730vec.45.1392282100406; Thu, 13 Feb 2014 01:01:40 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id g4si424049vch.148.2014.02.13.01.01.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Feb 2014 01:01:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id jw12so1079501veb.18 for ; Thu, 13 Feb 2014 01:01:40 -0800 (PST) X-Received: by 10.58.255.233 with SMTP id at9mr156558ved.20.1392282100309; Thu, 13 Feb 2014 01:01:40 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp10104vcz; Thu, 13 Feb 2014 01:01:39 -0800 (PST) X-Received: by 10.68.201.163 with SMTP id kb3mr410646pbc.168.1392282099376; Thu, 13 Feb 2014 01:01:39 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gz8si1352577pac.56.2014.02.13.01.01.38; Thu, 13 Feb 2014 01:01:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753444AbaBMJBi (ORCPT + 9 others); Thu, 13 Feb 2014 04:01:38 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:34518 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753475AbaBMJBh (ORCPT ); Thu, 13 Feb 2014 04:01:37 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s1D91AJB028647; Thu, 13 Feb 2014 03:01:10 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1D91A2F031985; Thu, 13 Feb 2014 03:01:10 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Thu, 13 Feb 2014 03:01:09 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1D911bm021319; Thu, 13 Feb 2014 03:01:08 -0600 From: Tero Kristo To: , CC: , Subject: [PATCH 4/4] clk: ti: omap4: set default-parents and default-rates using DT Date: Thu, 13 Feb 2014 11:00:48 +0200 Message-ID: <1392282048-6284-5-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392282048-6284-1-git-send-email-t-kristo@ti.com> References: <1392282048-6284-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Setup dpll_usb_ck and dpll_abe_ck using DT properties instead of hardcoding the parents and rates in kernel. Signed-off-by: Tero Kristo --- arch/arm/boot/dts/omap4.dtsi | 12 ++++++++++++ drivers/clk/ti/clk-44xx.c | 42 ------------------------------------------ 2 files changed, 12 insertions(+), 42 deletions(-) diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index d3f8a6e..282ce66 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -761,3 +761,15 @@ }; /include/ "omap44xx-clocks.dtsi" + +&dpll_usb_ck { + default-rate = <960000000>; +}; + +&dpll_abe_ck { + default-rate = <98304000>; +}; + +&abe_dpll_refclk_mux_ck { + ti,default-parent = <&sys_32k_ck>; +}; diff --git a/drivers/clk/ti/clk-44xx.c b/drivers/clk/ti/clk-44xx.c index ae00218..bc14a49 100644 --- a/drivers/clk/ti/clk-44xx.c +++ b/drivers/clk/ti/clk-44xx.c @@ -16,21 +16,6 @@ #include #include -/* - * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section - * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK - * must be set to 196.608 MHz" and hence, the DPLL locked frequency is - * half of this value. - */ -#define OMAP4_DPLL_ABE_DEFFREQ 98304000 - -/* - * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section - * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred - * locked frequency for the USB DPLL is 960MHz. - */ -#define OMAP4_DPLL_USB_DEFFREQ 960000000 - static struct ti_dt_clk omap44xx_clks[] = { DT_CLK(NULL, "extalt_clkin_ck", "extalt_clkin_ck"), DT_CLK(NULL, "pad_clks_src_ck", "pad_clks_src_ck"), @@ -281,36 +266,9 @@ static struct ti_dt_clk omap44xx_clks[] = { int __init omap4xxx_dt_clk_init(void) { - int rc; - struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll; - ti_dt_clocks_register(omap44xx_clks); omap2_clk_disable_autoidle_all(); - /* - * Lock USB DPLL on OMAP4 devices so that the L3INIT power - * domain can transition to retention state when not in use. - */ - usb_dpll = clk_get_sys(NULL, "dpll_usb_ck"); - rc = clk_set_rate(usb_dpll, OMAP4_DPLL_USB_DEFFREQ); - if (rc) - pr_err("%s: failed to configure USB DPLL!\n", __func__); - - /* - * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power - * state when turning the ABE clock domain. Workaround this by - * locking the ABE DPLL on boot. - * Lock the ABE DPLL in any case to avoid issues with audio. - */ - abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_refclk_mux_ck"); - sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck"); - rc = clk_set_parent(abe_dpll_ref, sys_32k_ck); - abe_dpll = clk_get_sys(NULL, "dpll_abe_ck"); - if (!rc) - rc = clk_set_rate(abe_dpll, OMAP4_DPLL_ABE_DEFFREQ); - if (rc) - pr_err("%s: failed to configure ABE DPLL!\n", __func__); - return 0; }