Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp680468imm; Fri, 31 Aug 2018 10:17:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbBCsKVypGg+qjekII2pSRXVkdt6rVvRdTZ5sHs3bRdSRUXlHL2DgU4HGtYvZ+SQL1/zfKG X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr14960249pgj.356.1535735843396; Fri, 31 Aug 2018 10:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535735843; cv=none; d=google.com; s=arc-20160816; b=Nn8jTpz3lGw/HRCiA3FORt/JrxVTNBiuMA/NAWoA5imNbCeWRJAlz6v1Bzn/oTRfuz NLDQaVKT9LcuqbBmBtN4uASL4rjVbmkOVm5aPK3prALeXAC87avcqnyOUHiFTGLqesgQ Hoz6D0B5vjlqe8eXGX/AsauzRQcAuBLS+emhQWBMXr96F9MtMommen1ptWDrfJHotHI9 WEk8J5ri6VKxCyDlSY5wifFylCscrNi4YQohUxSM2bMQQBnYy+cdexwqAOUe/ayCcTfX JYzRCjh0rOkZTvJ0gxjIwhnrHAssmALssO2ndzng62nqF5T7XsEvaklOAOAxDlCc9T9x XEOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=fgcUMigADdUgU1OVYTli0RRNbI/xTBPEJrwg7yZre48=; b=L08SliQkjTHMY59MLFaVEuG5AtMoNjxHpziNl9LoiYLpn2bS4fAuNfm9YsgO1iicoF 9rb2VXxNiyqsR/+wLIOqZmOwmxlZX99BUqilUikJVa7jIJOt8QUNyt4XK5KAncl2YP3g Jh51NJQwxvy89qSaJy1+GDpDNBIGebsBdwZJaJcUi3dn7Uxr+6h/++dtZo0hL0rn0n1X iySX8J+ouVxXNfxx3L4n7FgBJTlQdi5PHgJIoPWjYLhwiATlF9nRsTKDn1GyNiTQ8HbT AF53zy/ERYoMu30/VJYK1HPkZqcSSPr+Ua1y41ZsTREW7c77oBa/HQZYgwO0mZq5FxiI i/Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lWjb7d+v; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8-v6si9288653pgp.548.2018.08.31.10.17.08; Fri, 31 Aug 2018 10:17:23 -0700 (PDT) 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=@kernel.org header.s=default header.b=lWjb7d+v; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728025AbeHaVTR (ORCPT + 99 others); Fri, 31 Aug 2018 17:19:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:54978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727301AbeHaVTR (ORCPT ); Fri, 31 Aug 2018 17:19:17 -0400 Received: from localhost (unknown [104.132.0.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA29A2077C; Fri, 31 Aug 2018 17:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535735451; bh=iH/NUpWAL2KzPw5+WIgYN/3DxV/vH7lcrlVQGccgC+w=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=lWjb7d+vqzWIG7poiUr+R6VcDGoL8TlHP+K71Pts/PRSxJGitTkYQLujSX/xqhcKe zqJ2NJA+a2CDvapaMsK/8UU0yxYzajRJNc2dNAgCZCNoet44eiyeBQINw3nsZ0y8/7 ip0OImIYLuUQtJyoSJDrAVwqV5TcmaGe1M3L/cFU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: "Zhu, Yi Xin" , Songjun Wu , chuanhua.lei@linux.intel.com, hua.ma@linux.intel.com, qi-ming.wu@intel.com From: Stephen Boyd In-Reply-To: <75f8313b-42e6-e741-196d-af27ad1e4f9b@linux.intel.com> Cc: linux-mips@linux-mips.org, linux-clk@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, Michael Turquette , linux-kernel@vger.kernel.org, Rob Herring , Mark Rutland References: <20180803030237.3366-1-songjun.wu@linux.intel.com> <20180803030237.3366-3-songjun.wu@linux.intel.com> <153370742214.220756.2039365625963765922@swboyd.mtv.corp.google.com> <571d2d40-8728-fa7c-5d89-73d2a7b6293b@linux.intel.com> <153539697928.129321.2605078315090527674@swboyd.mtv.corp.google.com> <75f8313b-42e6-e741-196d-af27ad1e4f9b@linux.intel.com> Message-ID: <153573545028.93865.1832322708533849519@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v2 02/18] clk: intel: Add clock driver for Intel MIPS SoCs Date: Fri, 31 Aug 2018 10:10:50 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Zhu, Yi Xin (2018-08-28 23:56:22) > = > On 8/28/2018 3:09 AM, Stephen Boyd wrote: > > Quoting yixin zhu (2018-08-08 01:52:20) > >> On 8/8/2018 1:50 PM, Stephen Boyd wrote: > >>>> +/* clock flags definition */ > >>>> +#define CLOCK_FLAG_VAL_INIT BIT(16) > >>>> +#define GATE_CLK_HW BIT(17) > >>>> +#define GATE_CLK_SW BIT(18) > >>>> +#define GATE_CLK_VT BIT(19) > >>> What does VT mean? Virtual? > >> Yes. VT means virtual here. > >> Will change to GATE_CLK_VIRT. > >> > > Is it a hardware concept? Or virtualization with hypervisor? > = > Some peripheral drivers want to use same code cross platforms. > = > But not all platforms provide HW gate clock.=C2=A0 So in this case, clock = > driver creates > = > a virtual gate clock to make it work if no HW gate clock in the SoC. That's not how things are supposed to work. If a clk isn't there in the hardware we don't make them up in software so that the consumer software drivers can keep requesting clks on different platforms. On a different platform, the driver needs to know that the clks aren't there with a different compatible string. > = > = > > > >>>> +} > >>>> + > >>>> +CLK_OF_DECLARE(intel_grx500_cgu, "intel,grx500-cgu", grx500_clk_ini= t); > >>> Any reason a platform driver can't be used instead of CLK_OF_DECLARE(= )? > >> It provides CPU clock which is used in early boot stage. > >> > > Ok. What is the CPU clock doing in early boot stage? Some sort of timer > > frequency? If the driver can be split into two pieces, one to handle the > > really early stuff that must be in place to get timers up and running > > and the other to register the rest of the clks that aren't critical from > > a regular platform driver it would be good. That's preferred model if > > something is super critical. > = > Yes, CPU clock is providing CPU frequency in the early boot stage. > = > Will put the non-critical clocks in the platform driver. > = > = Sure the CPU clock is handling frequency, but does that matter for early boot to get going? If timers aren't involved here then it doesn't sound like this needs CLK_OF_DECLARE.