From patchwork Thu May 16 19:46:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 2579731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 624704020A for ; Thu, 16 May 2013 19:47:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud48n-000150-FW; Thu, 16 May 2013 19:47:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud48k-00049E-JS; Thu, 16 May 2013 19:47:02 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud48h-00048k-5a for linux-arm-kernel@lists.infradead.org; Thu, 16 May 2013 19:47:00 +0000 Received: by mail-pd0-f174.google.com with SMTP id u10so2650508pdi.19 for ; Thu, 16 May 2013 12:46:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:content-type:mime-version:content-transfer-encoding:to :from:in-reply-to:cc:references:message-id:user-agent:subject:date :x-gm-message-state; bh=Azfiyoese0Qa9Ye/zF8VjYzPnJthY8du5lT/uOnlT60=; b=fnI3YNDxawWmgJ5nrqfBPTq8FcdrepltXo00htoTJVp1GaKhg4gXChqwUZiMjtVNiQ cP2wcA5juVGOOb/VwN2OqFzbo0i+2Krz8uJ3b4mu0sdCDkphkWL7kw1WJgsgkD06IkOt ZBz50b0wKgFeKlLzlPGPVM2Hy3G8zcV1swNb20n7FD+dIyIRDKd4q+XymhIGJoOGkX1O MG8VG7MPAgEQADQn+alxxuxT3Uyi+fWvpCTqhxiXz9nhXLfqUzbhQr07noU04RYetZk1 MylK1FLkSc9IYB+gFGVJwY1fsVQhsnbzeF8yIrtXuY2oKb/QZ7AsH9LA4BRU8H6hxnsX 5xEQ== X-Received: by 10.66.144.136 with SMTP id sm8mr45021963pab.115.1368733596038; Thu, 16 May 2013 12:46:36 -0700 (PDT) Received: from localhost ([2601:9:3700:78:ca60:ff:fe0a:8a36]) by mx.google.com with ESMTPSA id b7sm7906777pba.39.2013.05.16.12.46.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 May 2013 12:46:35 -0700 (PDT) MIME-Version: 1.0 To: Tony Lindgren , From: Mike Turquette In-Reply-To: <20130516174355.GB5600@atomide.com> References: <1368039976-29648-1-git-send-email-nm@ti.com> <1368039976-29648-2-git-send-email-nm@ti.com> <20130513235119.10068.47040@quantum> <20130516174355.GB5600@atomide.com> Message-ID: <20130516194632.12127.59935@quantum> User-Agent: alot/0.3.4 Subject: Re: [PATCH V5 1/6] clk: OMAP: introduce device tree binding to kernel clock data Date: Thu, 16 May 2013 12:46:32 -0700 X-Gm-Message-State: ALoCoQlf97PaUQ/QmLufwn2o8IbMbeHq692G2b/bc07x2ZkcHoJVpi4Ona2DuA7QKpUfxJUvzWK3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130516_154659_402511_97C1DE50 X-CRM114-Status: GOOD ( 26.12 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.174 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Nishanth Menon , Paul Walmsley , Benoit Cousson , linux-doc@vger.kernel.org, Kevin Hilman , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Quoting Tony Lindgren (2013-05-16 10:43:56) > * Mike Turquette [130513 16:56]: > > Quoting Nishanth Menon (2013-05-08 12:06:11) > > > > > Overall strategy introduced here is simple: a clock node described in > > > device tree blob is used to identify the exact clock provided in the > > > SoC specific data. This is then linked back using of_clk_add_provider > > > to the device node to be accessible by of_clk_get. > > > > > > > FYI, I'm working on moving the OMAP clocks over to DT which is a better > > alternative than this patch. I'll share what I have on the list, > > hopefully next week. > > That's good news! What's your plan on using the indexing the clocks? > > I'd rather avoid indexing as that's basically same as the old IRQ > numbering and GPIO numbering schemes that don't work well in the long > term. > > We already have quite a few sets of clocks for omaps, so the indexing > is already an issue. My thinking is that indexing should only be used > if the same physical clock has multiple outputs. > At present I am actually describing the clock hardware in DT. Each clock is a node (not a device) using the established clock binding in Documentation/devicetree/bindings/clocks/clock-bindings.txt. To do this I am introducing new bindings for the common types: gate, mux & divider. These are the ones I am migrating to DT first. Eventually I'll create bindings for the OMAP-specifc clocks after this. I currently have this DT approach co-existing with the static data. As a start I have used the fixed-clock and mux-clock bindings to put all of the root clocks and sys_clk into arch/arm/boot/dts/omap4-clocks.dtsi. This file is included by arch/arm/boot/dts/omap4.dtsi. The DT clocks are parsed prior to the static clock registration: Ideally dt_omap_clk_init() will go away and instead by replaced by the probe from drivers/clk/omap/clk.c (new omap clock driver). However I still need to register the root clocks before the PLLs and other dividers for now to avoid many issues (divide by zero errors, failed reparent operations, etc). And furthermore I don't think the hwmod code will work if the clock tree is not populated before module_init. So for now the omap clock driver does not properly probe or call module_init, but some day that might be fixed. I know that putting all of the data into DT is not a popular idea with everybody. I also know that I am not a DT expert, so I'm sure there are some better approaches to the some of the decisions I'm making. I'll post an RFC to the list next week with cleaned-up patches and then we can all take it from there. Regards, Mike > Regards, > > Tony diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c index 88e37a4..7cc4cae 100644 --- a/arch/arm/mach-omap2/cclock44xx_data.c +++ b/arch/arm/mach-omap2/cclock44xx_data.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "soc.h" #include "iomap.h" @@ -1442,27 +1443,11 @@ static struct omap_clk omap443x_clks[] = { * clocks common to omap44xx */ static struct omap_clk omap44xx_clks[] = { - CLK(NULL, "extalt_clkin_ck", &extalt_clkin_ck), CLK(NULL, "pad_clks_src_ck", &pad_clks_src_ck), CLK(NULL, "pad_clks_ck", &pad_clks_ck), - CLK(NULL, "pad_slimbus_core_clks_ck", &pad_slimbus_core_clks_ck), - CLK(NULL, "secure_32k_clk_src_ck", &secure_32k_clk_src_ck), CLK(NULL, "slimbus_src_clk", &slimbus_src_clk), CLK(NULL, "slimbus_clk", &slimbus_clk), CLK(NULL, "sys_32k_ck", &sys_32k_ck), - CLK(NULL, "virt_12000000_ck", &virt_12000000_ck), - CLK(NULL, "virt_13000000_ck", &virt_13000000_ck), - CLK(NULL, "virt_16800000_ck", &virt_16800000_ck), - CLK(NULL, "virt_19200000_ck", &virt_19200000_ck), - CLK(NULL, "virt_26000000_ck", &virt_26000000_ck), - CLK(NULL, "virt_27000000_ck", &virt_27000000_ck), - CLK(NULL, "virt_38400000_ck", &virt_38400000_ck), - CLK(NULL, "sys_clkin_ck", &sys_clkin_ck), - CLK(NULL, "tie_low_clock_ck", &tie_low_clock_ck), - CLK(NULL, "utmi_phy_clkout_ck", &utmi_phy_clkout_ck), - CLK(NULL, "xclk60mhsp1_ck", &xclk60mhsp1_ck), - CLK(NULL, "xclk60mhsp2_ck", &xclk60mhsp2_ck), - CLK(NULL, "xclk60motg_ck", &xclk60motg_ck), CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck), CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck), CLK(NULL, "dpll_abe_ck", &dpll_abe_ck), @@ -1690,6 +1675,9 @@ int __init omap4xxx_clk_init(void) { int rc; + /* FIXME register clocks from DT first */ + dt_omap_clk_init(); + if (cpu_is_omap443x()) { cpu_mask = RATE_IN_4430; omap_clocks_register(omap443x_clks, ARRAY_SIZE(omap443x_clks));