From patchwork Fri Feb 28 09:23:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25521 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 75FD8203C5 for ; Fri, 28 Feb 2014 09:24:38 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 131sf2391034ykp.1 for ; Fri, 28 Feb 2014 01:24:38 -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=lnLmz6P2VE+8R7YQoxc5JT7B8Z68zK4mEUfPpaXQ77A=; b=U2tfB41AtTPE55HMsNbdU9AwgClljQvHakmEhzAELgB8ggaiANuec77N8+YPLjSP5Z 6USbr8Wa1sw3cK4sO66d3TReCTxeCwhF4nSVfWQj/rXuzvsi5tHNxF3HEGRvl8+MrnVd 5139HSA/jsBpVvMmbXcnPA8i5jvS4BbDPgLnwIOacBs8PMVG20VxQWXhiOwIXDnesO9g ggAl3wU58pLm+ysJzHdH81fi6JxjULXUodGnhzD9i6u6N6pX/41K89c433ZEmlcWmyqy smZxk4DNiyPp3G6NlixukK6KFZTtPRF3CuGMR44WdlLqtyFkgbrSZpWNOOzRiwFkoasy f0RQ== X-Gm-Message-State: ALoCoQkJN2ebEaHqVEAC92f8Ct2anrrb2sA87DURcgm2+RHn4AiUJX7twE8APmZsAJEHEpUooHBY X-Received: by 10.236.108.228 with SMTP id q64mr684917yhg.36.1393579478259; Fri, 28 Feb 2014 01:24:38 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.33 with SMTP id 30ls1042562qgs.22.gmail; Fri, 28 Feb 2014 01:24:38 -0800 (PST) X-Received: by 10.220.178.73 with SMTP id bl9mr55162vcb.42.1393579478121; Fri, 28 Feb 2014 01:24:38 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id ys9si1623961vcb.92.2014.02.28.01.24.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 01:24:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so463882veb.11 for ; Fri, 28 Feb 2014 01:24:38 -0800 (PST) X-Received: by 10.58.37.232 with SMTP id b8mr1534538vek.27.1393579478016; Fri, 28 Feb 2014 01:24:38 -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 u1csp40814vcs; Fri, 28 Feb 2014 01:24:37 -0800 (PST) X-Received: by 10.68.236.9 with SMTP id uq9mr2431784pbc.10.1393579477149; Fri, 28 Feb 2014 01:24:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zj6si1306859pac.233.2014.02.28.01.24.36; Fri, 28 Feb 2014 01:24:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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 S1751524AbaB1JYd (ORCPT + 5 others); Fri, 28 Feb 2014 04:24:33 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:59093 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751240AbaB1JYb (ORCPT ); Fri, 28 Feb 2014 04:24:31 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s1S9OBi9012025; Fri, 28 Feb 2014 03:24:11 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1S9OBwr003396; Fri, 28 Feb 2014 03:24:11 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 28 Feb 2014 03:24:11 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1S9NhsG015360; Fri, 28 Feb 2014 03:24:09 -0600 From: Tero Kristo To: , , , , CC: , Subject: [PATCH 10/12] ARM: OMAP2: clock: add DT boot support for cpufreq_ck Date: Fri, 28 Feb 2014 11:23:02 +0200 Message-ID: <1393579384-23440-11-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393579384-23440-1-git-send-email-t-kristo@ti.com> References: <1393579384-23440-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@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.180 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 | 46 ++++++++++++++++++++++++++ drivers/clk/ti/clk-2xxx.c | 2 ++ include/linux/clk/ti.h | 1 + 3 files changed, 49 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..09af46c 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);