Received: by 2002:ac8:6d01:0:b0:423:7e07:f8e4 with SMTP id o1csp6620925qtt; Mon, 18 Dec 2023 01:39:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNJgCo3JQPg3rx0LSk6/PJtOpsuanEJd3fIt+8OcCVOADiTicVP6U7rPNNTXQBZ8Lr8s/w X-Received: by 2002:ac8:5f49:0:b0:423:8f37:fb08 with SMTP id y9-20020ac85f49000000b004238f37fb08mr22096303qta.32.1702892392514; Mon, 18 Dec 2023 01:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702892392; cv=none; d=google.com; s=arc-20160816; b=rQv9+3MPm9rhYtkVS6lk+23qLWOSwk/jYfj05b4r5qezNwcnvl6hHV9XyKYj1MrvLJ eL0l5caFQMq1DmYtQzOc75Ja3+a7vWuUmCEPiK97lch9j/D5c9O45ph4oNBCXhLPnXkq E8MpLyvxMOmjwraJPFtS0/SIbVfuTj4iwzHMHG/Wi8HgylT51JC/FoE84pygHV9exvKO /kJetjU8ynumg6pNkx4FXe+WA+LQEAC72eyhOeox3DjGL6RrRL7gvbzjk4O+JhKfCKdS 3Eg5aLpCzzmVv7aBEjh8Jy4QSodNXIbfYjsLjd1Vm8qSV+ix+UawYkJ7YOcXAfR1QIl+ PI7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=BTYEtunIedVhrIrUbrN5OGHL/0lewttUjOiPfnpbhG4=; fh=wqdHvIatbyxkd7XfF+StLu50G2XTzaTXYELsUfoeUCM=; b=OarYxuI9Cf5E8o48tu7oKfzcxWqTWs4xtBacMTmMSb70PChGNXsS5VQmj2rHQF16qS vXkooZbF8rKT3iPv9gX2s7cDBWpPCBLDihTpTBOiMRn4mQNwYJaKqvAAiHRCPTsJixRa FebfteO9/WC9YWRv4rMh6qOZOG5mcWuJea2rAW6eddZTcp0CR+WZaUpcOoQwZJW4nmKE QQLGQDaA7L5CfiwKrd+L36iuMFyU+n8Y2uQIxqL7ax/yMHlxxBH89mFvKXpHrZy4x08H qQa6hYOvpnXnlwAidNOHtoSe9aeOczolInOUUffRfpKyFBXscLf0XBFSjr26jlaBp+t3 6slQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m+Jdg4Pq; spf=pass (google.com: domain of linux-kernel+bounces-3257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3257-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fv14-20020a05622a4a0e00b00425814dac1asi26810695qtb.246.2023.12.18.01.39.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 01:39:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m+Jdg4Pq; spf=pass (google.com: domain of linux-kernel+bounces-3257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3257-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 10B9D1C22789 for ; Mon, 18 Dec 2023 09:39:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F91C11CB2; Mon, 18 Dec 2023 09:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="m+Jdg4Pq" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8B08125AD for ; Mon, 18 Dec 2023 09:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6d47bb467a9so903847b3a.1 for ; Mon, 18 Dec 2023 01:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702892381; x=1703497181; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=BTYEtunIedVhrIrUbrN5OGHL/0lewttUjOiPfnpbhG4=; b=m+Jdg4Pqa3KDO8JRupZ6tkl5k3/Jt03n+UEIpevEeTp+GWpZCDVjpZber2RoIODSwX 1BiHGKp7s2b4jleJcEWhMkm5XFOF+6RI/4A0/QEExdiSMXfK9+z5o2XM7r7PflsZpFfu +gpF6AszArOKAGLXwgqnHkoEPUAoG4Txl2syQdTMOG7VqzfzTeKrRHSdVjytiLJ/Sm+k CcGqLgHTd0xmbK9W8t4gewtKuhAPmtND+A9FC27W6d1JOttqMnZEbbcgRBFCFiXVm9uk BTmLIGB5qtdfrd1R4xfdayECrvc1pFx9LR7z6RfWh7hlfoFMgq1dz06ZAJ8q35q1PgJc 9jrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702892381; x=1703497181; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=BTYEtunIedVhrIrUbrN5OGHL/0lewttUjOiPfnpbhG4=; b=mdoJaHrkToR5N3CZWK8FZNyWhTj/1QnZLwRB7d+BYP8I0ZWsoRZORGwXGP5anUs9YP jNdF9G2U5JLhcUdiJbwdH4gBN5pl9MGBl3TdYx8B+FbBZ2EbFiXxJvIyFhkdSy/fd+tg /0DMBLGw2b3sQIUU+gJWsdBLQpcVN4bjCuuuGL2CtU4mA80ylrj1eYDtPEudDvS+BYWd aSc1YKWy+RJTqGDJ/egsfJ1VAsmiDADJ+YB6oBePQNU7GKL8m7VqGFOq3IJqAB23QGGY nKcV5erKwidP8eiAY2casNrWKLCZ4jZriNV8lVGFknvFipyCRdgVpNXzpR+q17XbiAlv Nofg== X-Gm-Message-State: AOJu0YxWZzyZpsGdmBrcTqGOe6TZdW9VJLKrYa+iomBv2dmhnBJ0uwPy JdFExd3h8aIH6uI3cLzJfXGIvA== X-Received: by 2002:a05:6a20:3712:b0:194:341e:8f5c with SMTP id t18-20020a056a20371200b00194341e8f5cmr1602230pze.50.1702892381093; Mon, 18 Dec 2023 01:39:41 -0800 (PST) Received: from ?IPV6:2a01:e0a:982:cbb0:b425:da5d:c0cf:a505? ([2a01:e0a:982:cbb0:b425:da5d:c0cf:a505]) by smtp.gmail.com with ESMTPSA id e10-20020aa798ca000000b006d7bfb2f30csm1333167pfm.148.2023.12.18.01.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Dec 2023 01:39:40 -0800 (PST) Message-ID: Date: Mon, 18 Dec 2023 10:39:28 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: neil.armstrong@linaro.org Reply-To: neil.armstrong@linaro.org Subject: Re: [PATCH v9 08/12] clk: meson: g12a: make VCLK2 and ENCL clock path configurable by CCF Content-Language: en-US, fr To: Jerome Brunet Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , Martin Blumenstingl , David Airlie , Daniel Vetter , Jagan Teki , Nicolas Belin , Vinod Koul , Kishon Vijay Abraham I , Remi Pommarel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org, Rob Herring References: <20231124-amlogic-v6-4-upstream-dsi-ccf-vim3-v9-0-95256ed139e6@linaro.org> <20231124-amlogic-v6-4-upstream-dsi-ccf-vim3-v9-8-95256ed139e6@linaro.org> <1jbkbjdxk8.fsf@starbuckisacylon.baylibre.com> <1j34wvdtux.fsf@starbuckisacylon.baylibre.com> <41a1246e-c885-460a-8208-16844e95e1ae@linaro.org> <1jjzq3zhaw.fsf@starbuckisacylon.baylibre.com> Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8V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6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro Developer Services In-Reply-To: <1jjzq3zhaw.fsf@starbuckisacylon.baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 27/11/2023 09:38, Jerome Brunet wrote: > >>> >>>> >>>> I suspect mipi_dsi_pxclk_div was added to achieve fractional vclk/bitclk ratios, >>>> since it doesn't exist on AXG. Not sure we would ever need it... and none >>>> of the other upstream DSI drivers supports such setups. >>>> >>>> The main reasons I set only mipi_dsi_pxclk in DT is because : >>>> 1) the DSI controller requires a bitclk to respond, pclk is not enough >>>> 2) GP0 is disabled with an invalid config at cold boot, thus we cannot >>>> rely on a default/safe rate on an initial prepare_enable(). >>>> This permits setting initial valid state for the DSI controller, while >>>> the actual bitclk and vclk are calculated dynamically with panel/bridge >>>> runtime parameters. >>> Nothing against setting rate in DT when it is static. Setting it then >>> overriding it is not easy to follow. >> >> Yup, would be simpler to only have parenting set in DT, since it must >> stay static, I'm fine trying to move rate setup to code. >> >>> To work around GP0 not being set, assuming you want to keep rate >>> propagation as it is, you could call clk_set_rate() on cts_encl (possibly w/o >>> enabling it) to force a setup on gp0 then clk_prepare_enable() on >>> pxclk. You'd get a your safe rate on GP0 and the clock you need on pxclk. >>> It is a bit hackish. Might be better to claim gp0 in your driver to >>> manage it directly, cutting rate propagation above it to control each >>> branch of the subtree as you need. It seems you need to have control over >>> that anyway and it would be clear GP0 is expected to belong to DSI. >> >> Controlling the PLL from the DSI controller seems violating too much layers, >> DSI controller driver is not feed directly by the PLL so it's a non-sense >> regarding DT properties. > > Not sure what you mean by this. You have shown in your the commit > message that the DSI clocks make significant subtree. I don't see a > problem if you need to manage the root of that subtree. I'd be great if > you didn't need to, but it is what it is ... I really think the choice of PLL should not be done by the DSI controller, but by the Video pipeline driver or statically until we can do this. My point is that we should only define the clocks that are related to each hardware, for example the whole VCLK/VCLK2 clocks should be defined for the VPU HW, then only the few endpoint clocks should be defined for the HDMI or DSI controllers, PHY clock and ENCI/ENCP for HDMI, DSI and ENCL for DSI. The big plan is to entirely switch to CCF for VPU, but first I want to have DSI working, and since DSI needs GP0, we need CCF for that so the intermediate plan is to have partial CCF handling only for DSI with fixed clock tree in DT, then in the future the Meson DRM driver would set up the appropriate clock tree for HDMI, DSI, Composite and perhaps DP for T7 SoCs then the controller bridge will call the clk_set_rate() in the same design I did for DSI. Here's the tracked item: https://gitlab.com/amlogic-foss/mainline-linux-issues-tracker/-/issues/9 CCF clock control is a mandatory item to solved dual-head display: https://gitlab.com/amlogic-foss/mainline-linux-issues-tracker/-/issues/6 > >> >> Setting a safe clock from the DSI controller probe is an idea, but again I >> don't know which value I should use... > > You mentionned that the problem comes DSI bridges that needs to change > at runtime. I don't know much about those TBH, but is there > anyway you can come up with a static GP0 rate that would then be able to > divide to serve all the rates bridge would need in your use case ? No, there's no such things in the DSI world, MIPI only specifies the electrical and transport layer, everything else is custom per vendor. > > GP0 can go a lot higher than ~100MHz and there are dividers unused in the > tree it seems. > > I suppose there is a finite number of required rate for each use case ? > If there are not too many and there is a common divider that allows a > common rate GP0 can do, it would solve your problem. It's a lot of if > but It is worth checking. > > This is how audio works and DT assigned rate is a good match in this case. Yeah I know, but I would love it but no... > >> >> I'll review the clk parenting flags and try to hack something. >> >> Thanks, >> Neil >> >> Thanks, Neil