Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp553506iob; Wed, 11 May 2022 22:27:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztbGamTw9uax/3+aQnx8g8H2SVjL1uy/yW6jUAXgpjxKF80VZ4aEIGzjr0Fs+vf9eA9Zn4 X-Received: by 2002:a17:903:124a:b0:154:c7a4:9374 with SMTP id u10-20020a170903124a00b00154c7a49374mr28767003plh.68.1652333278892; Wed, 11 May 2022 22:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652333278; cv=none; d=google.com; s=arc-20160816; b=eCkPdnPnSuTlwMN+3gCuLS2SXQg/Y0nTzsHpLSAJMsago52KSGZOfgzqCtatjVVuC7 m36hvOKpIINp2InUYuwwjykfRa1pOBzXQ5nW9v/yMqjwoHTShN46Gu3iEhUKQL9oK4Wt Fz9pk8FQ8709LMZInU2Hv5kQ52a3NC7sMrmUhDXeOwBKXvX5Fgu+jiiAd3gzVUZt7L4Q 963i3ZA08jT+0FIqmmx1yZRFdd1wM/nLrayoIc+WtpOkFaw0OqR3jsWi2LcRmdSejZFo FlcMsuD5Usphi7iKaAK8EjbWlM94cVNIW5Su1QKPYBCkwa58v9H/j8myBlqwu1G8af3e RtBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=drfygkTowvuBLUYKKqSn7wnL9G7tj7fcltIt86mentk=; b=R5uC+Pg6gUtM8yvOVw8lijfUruETPBnaB1dUkoKbtAWgI0o9imLkaqmnbDvDUIi/R1 YJCOoQ98NU9eMUcdHVh0uhqa2TxLLxJPXZAtrnLgMgCZq2tWoAGq/VVjmzOozccYRPn4 FIWd+AIun18BbC7jy5YjRlPsE2qZ0+0724tDE/7b2dgRMlvvdpL0wpa2x0oj1WSnYNs2 hx6NCeB7xyswk7peoq5ONkw8mKpmz2g7jT9T2ZdCa0FLttvVbt4e0TRg6syQkfEcjrgj QI/P2rluQtBJuzqVQELgVLBr10WQWr3B/A94iqjI9Da2KOEkKq3F6tzew29fx52vufFR yz0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U0Z5PRza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a655646000000b003c62fa22fd8si2486997pgs.71.2022.05.11.22.27.47; Wed, 11 May 2022 22:27:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U0Z5PRza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbiEKKsW (ORCPT + 99 others); Wed, 11 May 2022 06:48:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbiEKKsT (ORCPT ); Wed, 11 May 2022 06:48:19 -0400 Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6B454BB8E for ; Wed, 11 May 2022 03:48:17 -0700 (PDT) Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-2f7ca2ce255so15832857b3.7 for ; Wed, 11 May 2022 03:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=drfygkTowvuBLUYKKqSn7wnL9G7tj7fcltIt86mentk=; b=U0Z5PRzaDD8HlY7u+vcRl3tjjLWmlEi4zx9guX+v+HnsRNi1BsPtGOFeWg7v/H8I/n v8vG/2LxavvFpGWW5BtLREFEtxUtULs9eeO/YBB3EKYbe7VGIk6aT6klVarI5nC8mODC 7nHyamuW4M6cY0v2L3Jr6ofjaRUER+LJwoBuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=drfygkTowvuBLUYKKqSn7wnL9G7tj7fcltIt86mentk=; b=r3ejJIeDK93EU1uDjHClZrrXIfmCj+riKWjaujgwZ4BjKkrABJfWgArB+Yp8ulCIbh rvJPySZhGdG7JwEmsINAGp4v+WmvM2SQv4kNhhimiSx3eKcVTVjWKSD+u/HakfIhliQB QPY04XFYT/wNnr8c6cRHCjQE5Ox8fhvDRSe06Nw9CrloItMCpcSRtL0LfpC1ossqgc26 5QH3pB5aiYKsOcBHJP/mq8UpGF7Heo/XfnZxU9ZKbuL0m+XRMrXplAPu5gj3WI/0W0Xy Jk504zDa6lrmvNcw/lUjG1iL1cDbUJSOrWpbv7bJjIACcp4aWXxKGRkZEs0nL6txh5Zn RtUw== X-Gm-Message-State: AOAM5311LqyPcx4IUfT/sbIXjveMP7J8TWNOmg/MLFz79iKHV09cqObC JSFWplx8n6872MUi6i8Loqe2UIBr4tzTVsE18caOtg== X-Received: by 2002:a81:23cc:0:b0:2f8:1a60:a215 with SMTP id j195-20020a8123cc000000b002f81a60a215mr24030993ywj.295.1652266097218; Wed, 11 May 2022 03:48:17 -0700 (PDT) MIME-Version: 1.0 References: <20220425125546.4129-1-johnson.wang@mediatek.com> <20220425125546.4129-2-johnson.wang@mediatek.com> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 11 May 2022 18:48:06 +0800 Message-ID: Subject: Re: [PATCH v3 1/2] dt-bindings: interconnect: Add MediaTek CCI dt-bindings To: Johnson Wang Cc: krzk+dt@kernel.org, cw00.choi@samsung.com, robh+dt@kernel.org, kyungmin.park@samsung.com, khilman@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, jia-wei.chang@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 9, 2022 at 8:14 PM Johnson Wang wrote: > > Hi Chen-Yu, > > On Tue, 2022-04-26 at 11:18 +0800, Chen-Yu Tsai wrote: > > On Mon, Apr 25, 2022 at 8:56 PM Johnson Wang < > > johnson.wang@mediatek.com> wrote: > > > > > > Add devicetree binding of MediaTek CCI on MT8183 and MT8186. > > > > > > Signed-off-by: Johnson Wang > > > Signed-off-by: Jia-Wei Chang > > > --- > > > .../bindings/interconnect/mediatek,cci.yaml | 139 > > > ++++++++++++++++++ > > > 1 file changed, 139 insertions(+) > > > create mode 100644 > > > Documentation/devicetree/bindings/interconnect/mediatek,cci.yaml > > > > > > diff --git > > > a/Documentation/devicetree/bindings/interconnect/mediatek,cci.yaml > > > b/Documentation/devicetree/bindings/interconnect/mediatek,cci.yaml > > > new file mode 100644 > > > index 000000000000..e5221e17d11b > > > --- /dev/null > > > +++ > > > b/Documentation/devicetree/bindings/interconnect/mediatek,cci.yaml > > > @@ -0,0 +1,139 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: > > > https://urldefense.com/v3/__http://devicetree.org/schemas/interconnect/mediatek,cci.yaml*__;Iw!!CTRNKA9wMg0ARbw!zuufEcqpKbditY3eqLTHpL8P8humMCyh4D4QWsximmw124tJUPE3ZBUyBqBtDlQ9pSDO$ > > > > > > +$schema: > > > https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!zuufEcqpKbditY3eqLTHpL8P8humMCyh4D4QWsximmw124tJUPE3ZBUyBqBtDoE9YHyu$ > > > > > > + > > > +title: MediaTek Cache Coherent Interconnect (CCI) frequency and > > > voltage scaling > > > + > > > +maintainers: > > > + - Jia-Wei Chang > > > + > > > +description: | > > > + MediaTek Cache Coherent Interconnect (CCI) is a hardware engine > > > used by > > > + MT8183 and MT8186 SoCs to scale the frequency and adjust the > > > voltage in > > > + hardware. It can also optimize the voltage to reduce the power > > > consumption. > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - mediatek,mt8183-cci > > > + - mediatek,mt8186-cci > > > + > > > + clocks: > > > + items: > > > + - description: > > > + The multiplexer for clock input of CPU cluster. > > > > of the bus, not CPU cluster. > > Thanks for your suggestion. > I will correct it in the next version. > > > > > > + - description: > > > + A parent of "cpu" clock which is used as an intermediate > > > clock source > > > + when the original CPU is under transition and not stable > > > yet. > > > > This really should be handled in the clk controller, and not by every > > device > > that happens to take a clock from a mux with upstream PLLs that can > > change > > in clock rate. The end device hardware only takes one clock input. > > That's it. > > > > To make this intermediate clock works properly, this driver is also > responsible for handling the Vproc voltage and ensures the voltage is > high enough to support intermediate clock rate. > > If we move intermediate clock rate control to clock driver, then > intermediate voltage control may be handled by the clock driver itself > as well. > > We believe that is not reasonable because clock driver shouldn't handle > voltage control. On the other hand, DVFS driver is more suitable for > doing this job. Either way the DVFS driver handles the voltage change. Right now the driver is doing: 1. Raise voltage if scaling up 2. Mux CCI clock over to stable clock 3. Set rate for CCI PLL 4. Mux CCI clock back to CCI PLL 5. Drop voltage if scaling down I'm saying that the clock driver should handle 2+4 transparently when any driver requests a rate change on the CCI clock. So instead the driver would do: 1. Raise voltage if scaling up 2. Set rate for CCI _clock_ Here the clock driver would do: a. Mux CCI clock over to stable clock b. Change clock rate for original parent, i.e. the CCI PLL c. Mux CCI clock back to original parent, i.e. the CCI PLL and back to the devfreq driver ... 3. Drop voltage if scaling down Does that make sense? Regards ChenYu