Received: by 10.223.176.5 with SMTP id f5csp1038798wra; Fri, 2 Feb 2018 10:06:54 -0800 (PST) X-Google-Smtp-Source: AH8x225yKfbgeCiGQku/JgxqTH3Y3MV7AZJ6vGtLNxQWNu6Vu2DYWkWCR28guqCA9idDL/KP/Won X-Received: by 10.98.10.25 with SMTP id s25mr2647602pfi.155.1517594814676; Fri, 02 Feb 2018 10:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517594814; cv=none; d=google.com; s=arc-20160816; b=hNIkS3AtDanHsXfVTe3ImKyUJZrav9WAmsM8AtjPX7xq3EWGS0qTqZPKstl33LmU5X eoYygOBnWmE03mh4hlCZtLh99r/nmTdJSEt89EkA3Ii46xbO7j3Ng/LIx23ho1YL1tWM fcN3UWsejaoy5tC+ix/EL40HsbN3LAxIo4ajzX/qNvhEwb2DyNcUBwTCRNhUUs7UklLj hAUzOVFyR6RugFBwIzIjqnt8fZR5kU5q/oGuMlGtN46QJDeUuqWkWaWr6LOdowsTFLH9 wxmaUo0b0FtC1ezY8cjhUXtYYBCSSGnfQAkCXjU/uRuWsobaQbJJWzAjWZH6b319XyDC gPKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=1wExWbRg9gKGZ50hNstBPzPZs3xmS65j88XdfahCj3k=; b=Lz0PhHS9p5WxOWVVJBpddKQmAo1GHEresFGlGVH17GUoa6xgLD1s1R1bNrnh7Z22WJ ZpokHj0ao4STzVSkTxDiGEsVdK9oN0z2mwYjkhD1p49YsvBWc+Dgz0LQSK9XQC16qo54 syxX2uWzMcOr0nE6EzGlOqPRGnq6b1O4xIdOzgS+e0uUpEzQKtrnz6RDjAWrxZZXHCmh 4UImDbyMZJqakc+fP/o/hqOF+7APsScKTb+4O+W8c9fw81mA7R0VUZmXoIuRu3FMcC8K DVi+xi0/5msropUAoeaB0uy3HknD5pfxPZ09CeBLH7YU3ZhX47s70nfZPd7SYNPK445B G+ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=frPCbxEQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si1428pgc.386.2018.02.02.10.06.39; Fri, 02 Feb 2018 10:06:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=frPCbxEQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772AbeBBSES (ORCPT + 99 others); Fri, 2 Feb 2018 13:04:18 -0500 Received: from vern.gendns.com ([206.190.152.46]:48475 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753828AbeBBSDf (ORCPT ); Fri, 2 Feb 2018 13:03:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1wExWbRg9gKGZ50hNstBPzPZs3xmS65j88XdfahCj3k=; b=frPCbxEQMUozUrIVF2jbFz3Pgk xvcKxRJlcpumcC6wnAiqAZWJVxWLjCA4Z4aMDkmHLEFs7KWa9fcMdKYHmwJcsP2B5PLPgEjxrSoTa XCGjBK+KHcIVIioBslM7uFjPQx4aJBHq8JrwcbvRY9oeYemj+5hGYREHLaohCKTcFx8hCNCDVd4B9 dTIO5ZxL9Ve+JoVUswRAzcHM5s/MVk2LNoqWXreqaJ8IhfD+WZDLUwdwIjxQqjFetKXHmyJ134hvv 6qIIQuryEVpJJGt43eQ3/ROgiAwUjbz20Twvpk1v1SVuk+Dray+3WzdwQgsps8d2xHVU+y4lhxOAs EHSfN32g==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:57032 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ehfff-001msf-13; Fri, 02 Feb 2018 13:02:43 -0500 Subject: Re: [PATCH v6 20/41] ARM: da830: add new clock init using common clock framework To: Sekhar Nori , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Bartosz Golaszewski , Adam Ford , linux-kernel@vger.kernel.org References: <1516468460-4908-1-git-send-email-david@lechnology.com> <1516468460-4908-21-git-send-email-david@lechnology.com> <4b2f45f5-7f0d-f0e6-6854-9992e19f45f2@ti.com> From: David Lechner Message-ID: Date: Fri, 2 Feb 2018 12:03:36 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <4b2f45f5-7f0d-f0e6-6854-9992e19f45f2@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2018 08:12 AM, Sekhar Nori wrote: > On Saturday 20 January 2018 10:43 PM, David Lechner wrote: >> void __init da830_init_time(void) >> { >> +#ifdef CONFIG_COMMON_CLK >> + void __iomem *pll0, *psc0, *psc1; >> + struct clk *clk; >> + >> + pll0 = ioremap(DA8XX_PLL0_BASE, SZ_4K); >> + psc0 = ioremap(DA8XX_PSC0_BASE, SZ_4K); >> + psc1 = ioremap(DA8XX_PSC1_BASE, SZ_4K); >> + >> + da8xx_register_cfgchip(); >> + >> + clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA830_REF_FREQ); >> + >> + da830_pll_clk_init(pll0); >> + >> + da830_psc_clk_init(psc0, psc1); >> + > >> + clk = clk_register_fixed_factor(NULL, "i2c0", "pll0_aux_clk", 0, 1, 1); >> + clk_register_clkdev(clk, NULL, "i2c_davinci.1"); >> + >> + clk = clk_register_fixed_factor(NULL, "timer0", "pll0_aux_clk", 0, 1, 1); >> + clk_register_clkdev(clk, "timer0", NULL); >> + >> + clk = clk_register_fixed_factor(NULL, "timer1", "pll0_aux_clk", 0, 1, 1); >> + clk_register_clkdev(clk, NULL, "davinci-wdt"); > > Isn't this better done in da830_pll_clk_init() ? I think we can get rid > of the dummy fixed factor clock too and directly use the pll0_auxclk. I considered it, but I kind of like keeping the fixed factor clocks for debugging purposes. If you just have "pll0_auxclk" the enable count is not helpful because you don't know which driver did the enabling. On the other hand, once things are working, you don't really need to do any debugging. > That reminds me, is "pll0_aux_clk" above correct, or should it be > "pll0_auxclk" like in da830_pll_clk_init()? Yes, it should be "pll0_auxclk". > >> + >> + clk = clk_register_fixed_factor(NULL, "rmii", "pll0_sysclk7", 0, 1, 1); >> + clk_register_clkdev(clk, "rmii", NULL); > > I don't see any driver looking for this clock using con_id "rmii". I > know this came from existing code. But its most likely a vestige and can > be dropped. > > Thanks, > Sekhar >