From patchwork Tue Mar 4 09:18:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25669 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 94BE120540 for ; Tue, 4 Mar 2014 09:19:53 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf670105pab.9 for ; Tue, 04 Mar 2014 01:19:52 -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=we7aDT4hFDx4DiaM3A8ECpXuZ/x6kAP7lGRm4MOrudM=; b=iC/UL0TTwWvcgDx8cBCAPh5wNHRTxYPmsA1pDFLQTqKgLeksWcuud4AU1cccP9N5sv VOJpoKhAutJk9aUuweVWESznoFBSfby4Nu+t6mckoMjeSFjlQpqzRx5/mxVGqpSYmvv9 RCc4R1m4h6LzYrEYjulahBtG4uJEHa/1/3U0B5mLStvofK1/NiD43bvqcU5EBYFJG5zF 7oYFD5GbBEmf58nP8WYsT0qMrwfnctwJ3aKuF8tSnnoJspD8KGdYdHIGq2t+FSjOuHB1 xtOyLvN+YQIC39XqZIp6dsfmmn9H9jQ02SNBHr16+tF5gEghnwDdqyTYIDghu6PUcrUA 6flg== X-Gm-Message-State: ALoCoQlqiaUXyNISDiuacG4MfKfGZBKJh7fWil3JtliRrCYaqznDDR3NTHYKPunariAl5rv053lt X-Received: by 10.66.66.109 with SMTP id e13mr1980179pat.1.1393924792611; Tue, 04 Mar 2014 01:19:52 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.225 with SMTP id r88ls98675qgr.2.gmail; Tue, 04 Mar 2014 01:19:52 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr21681341vcb.0.1393924792522; Tue, 04 Mar 2014 01:19:52 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id qi7si4088068veb.110.2014.03.04.01.19.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 01:19:52 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 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.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so4463755veb.33 for ; Tue, 04 Mar 2014 01:19:52 -0800 (PST) X-Received: by 10.220.178.73 with SMTP id bl9mr50857vcb.42.1393924792415; Tue, 04 Mar 2014 01:19:52 -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.130.193 with SMTP id u1csp113783vcs; Tue, 4 Mar 2014 01:19:51 -0800 (PST) X-Received: by 10.68.49.228 with SMTP id x4mr24907301pbn.50.1393924791526; Tue, 04 Mar 2014 01:19:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si13499024pav.333.2014.03.04.01.19.50; Tue, 04 Mar 2014 01:19:50 -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 S1756758AbaCDJTt (ORCPT + 9 others); Tue, 4 Mar 2014 04:19:49 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:44036 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756658AbaCDJTs (ORCPT ); Tue, 4 Mar 2014 04:19:48 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s249JIej017422; Tue, 4 Mar 2014 03:19:18 -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 s249JIdT017799; Tue, 4 Mar 2014 03:19:18 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 03:19:18 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s249Il4I024729; Tue, 4 Mar 2014 03:19:16 -0600 From: Tero Kristo To: , , , , CC: , Subject: [PATCHv2 11/14] ARM: OMAP2: clock: add DT boot support for cpufreq_ck Date: Tue, 4 Mar 2014 11:18:17 +0200 Message-ID: <1393924700-6510-12-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393924700-6510-1-git-send-email-t-kristo@ti.com> References: <1393924700-6510-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.174 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: , The clock and clkdev for this are added manually. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 53 ++++++++++++++++++++++++++ drivers/clk/ti/clk-2xxx.c | 2 + include/linux/clk/ti.h | 1 + 3 files changed, 56 insertions(+) diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index b935ed2..85e0b0c0 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -208,3 +208,56 @@ void omap2xxx_clkt_vps_late_init(void) clk_put(c); } } + +#ifdef CONFIG_OF +#include +#include + +static const struct clk_ops virt_prcm_set_ops = { + .recalc_rate = &omap2_table_mpu_recalc, + .set_rate = &omap2_select_table_rate, + .round_rate = &omap2_round_to_table_rate, +}; + +/** + * omap2xxx_clkt_vps_init - initialize virt_prcm_set clock + * + * Does a manual init for the virtual prcm DVFS clock for OMAP2. This + * function is called only from omap2 DT clock init, as the virtual + * node is not modelled in the DT clock data. + */ +void omap2xxx_clkt_vps_init(void) +{ + struct clk_init_data init = { NULL }; + struct clk_hw_omap *hw = NULL; + struct clk *clk; + const char *parent_name = "mpu_ck"; + struct clk_lookup *lookup = NULL; + + omap2xxx_clkt_vps_late_init(); + omap2xxx_clkt_vps_check_bootloader_rates(); + + hw = kzalloc(sizeof(*hw), GFP_KERNEL); + lookup = kzalloc(sizeof(*lookup), GFP_KERNEL); + if (!hw || !lookup) + goto cleanup; + init.name = "virt_prcm_set"; + init.ops = &virt_prcm_set_ops; + init.parent_names = &parent_name; + init.num_parents = 1; + + hw->hw.init = &init; + + clk = clk_register(NULL, &hw->hw); + + lookup->dev_id = NULL; + lookup->con_id = "cpufreq_ck"; + lookup->clk = clk; + + clkdev_add(lookup); + return; +cleanup: + kfree(hw); + kfree(lookup); +} +#endif diff --git a/drivers/clk/ti/clk-2xxx.c b/drivers/clk/ti/clk-2xxx.c index f6400fb..c808ab3 100644 --- a/drivers/clk/ti/clk-2xxx.c +++ b/drivers/clk/ti/clk-2xxx.c @@ -229,6 +229,8 @@ static int __init omap2xxx_dt_clk_init(int soc_type) else ti_dt_clocks_register(omap2430_clks); + omap2xxx_clkt_vps_init(); + omap2_clk_disable_autoidle_all(); omap2_clk_enable_init_clocks(enable_init_clks, diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index a5aec68..03decc2 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h @@ -279,6 +279,7 @@ unsigned long omap2_dpllcore_recalc(struct clk_hw *hw, int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate, unsigned long parent_rate); void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); +void omap2xxx_clkt_vps_init(void); void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index); void ti_dt_clocks_register(struct ti_dt_clk *oclks);