Received: by 10.223.176.5 with SMTP id f5csp2380725wra; Mon, 5 Feb 2018 03:09:06 -0800 (PST) X-Google-Smtp-Source: AH8x227xWOXXWqD+9ipir3yKfMbiBiMmm/wuAavPFYkcH7BzbybpKyMuZpe7YOJHqHyEZ8abcDdb X-Received: by 10.101.80.69 with SMTP id k5mr27475964pgo.425.1517828946501; Mon, 05 Feb 2018 03:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517828946; cv=none; d=google.com; s=arc-20160816; b=bO544FsnzzKTxSZ9geepF24vNT8YiK2Pcu5Xu1Hs4wG+IR2uSItkXcqzfxuhb+u8Lz eWAn7eU1NEccTyPCXDXkaiLOt3u20TEFVtXPN6ZTrYbQ7p23qQupEZ2flJouPlh4eCwN i33qTVHqRg7iq52OLTgFTculXzAG01Uzhhi68OimisNNqeG5vMtvIGBQ25EJedV78CA1 tJR2fgmhGiDZu9DVH+1uTHJs/9F9yjWh6ki/IhU1RKWPkRBbtx1UXKnbGnXJLygac0Z2 q5v+WbCy28xZ4JjQSsJ0tDnfKGfXlhpPEQFR5nGwbIQQxeKqu/YL+1BY0hyi3Ue/qnr9 kPMw== 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=vSnmN1tMo2FjPoGjDswgF5sTWUwKjQ54KDAobqYJ6l0=; b=yjHkE8GyUsHw0Jy0P6iiQ7fxI2odx/Hk7n1XuujkbEZ+E+X6eQotTinmmPA0FtbEik JQYVp7ZVPtzO6Pb6bLA43Lw+vqjMmb0HaejPG1GVd7R6Y6lf+avR1JFHx+Z0Xsro+ADL yskvxTBPU2ksDUQSV34is/W09y6j2K6rApNJ1fVYIseJmYhYo2bvxZI+Ifix51GC1I0i e5y258Xc9Fjt5TnDz9NuPBpE7v4nSsmKEiZx4jaAiZ3J+bGSX7naBoUBD4UtBg9raH5w DvisoYjmL4clKIauBF2AXcZCMLzuHw4mVnTpYzlwlqrUKPGZjOybF4VkbTxmzW0gxuQi UWsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZwJHiFdJ; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40-v6si6691863pla.319.2018.02.05.03.08.51; Mon, 05 Feb 2018 03:09:06 -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=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZwJHiFdJ; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752498AbeBELIR (ORCPT + 99 others); Mon, 5 Feb 2018 06:08:17 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:9230 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbeBELIL (ORCPT ); Mon, 5 Feb 2018 06:08:11 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w15B76oW009735; Mon, 5 Feb 2018 05:07:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1517828826; bh=Qgv+v9POF8QmCKsz0XB0YbLeE4XCSaLUWhKOysKQ1Uc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=ZwJHiFdJ3YKPrBLOsXhySflo0AG+Pm43p60e7Jebbom03XIlLTR4N52g3cEvqYgpx BxN5W42uA7KD0yhqZ3/QekK1rd+MpcBSShphqEaG5yD32l75fW8WPwfRx9gwXFp845 3sxqvt1GfDSQBro3HUgc/fWV7zizsGKhtR8VXW8w= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w15B75rS030375; Mon, 5 Feb 2018 05:07:06 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 5 Feb 2018 05:07:05 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 5 Feb 2018 05:07:05 -0600 Received: from [172.24.190.171] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w15B6x63015476; Mon, 5 Feb 2018 05:06:59 -0600 Subject: Re: [PATCH v6 20/41] ARM: da830: add new clock init using common clock framework To: David Lechner , , , CC: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Bartosz Golaszewski , Adam Ford , 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: Sekhar Nori Message-ID: <4fc7b926-a21f-d49a-005e-44ad7f06e2e7@ti.com> Date: Mon, 5 Feb 2018 16:36:58 +0530 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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 02 February 2018 11:33 PM, David Lechner wrote: > 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. I think it is better to more or less reflect the hardware here. We would not be doing this in the DT case, for example. I see your point on debugging. Such code can perhaps be temporarily introduced if really debugging such an issue. This will be the case with any shared clock. Thanks, Sekhar