From: neil.armstrong@linaro.org
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Kevin Hilman <khilman@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Jagan Teki <jagan@amarulasolutions.com>,
Nicolas Belin <nbelin@baylibre.com>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Remi Pommarel <repk@triplefau.lt>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
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 <robh@kernel.org>
Subject: Re: [PATCH v9 08/12] clk: meson: g12a: make VCLK2 and ENCL clock path configurable by CCF
Date: Mon, 18 Dec 2023 10:39:28 +0100 [thread overview]
Message-ID: <db90068a-8eac-458e-bc22-aceb59870f5d@linaro.org> (raw)
In-Reply-To: <1jjzq3zhaw.fsf@starbuckisacylon.baylibre.com>
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
next prev parent reply other threads:[~2023-12-18 9:39 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 8:41 [PATCH v9 00/12] drm/meson: add support for MIPI DSI Display Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 01/12] dt-bindings: clk: g12a-clkc: add CTS_ENCL clock ids Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 02/12] dt-bindings: soc: amlogic,meson-gx-hhi-sysctrl: add example covering meson-axg-hhi-sysctrl Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 03/12] dt-bindings: phy: amlogic,meson-axg-mipi-pcie-analog: drop text about parent syscon and drop example Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 04/12] dt-bindings: phy: amlogic,g12a-mipi-dphy-analog: drop unneeded reg property and example Neil Armstrong
2023-11-24 12:36 ` Conor Dooley
2023-11-24 13:50 ` Neil Armstrong
2023-11-24 14:41 ` Conor Dooley
2023-11-24 14:43 ` Neil Armstrong
2023-11-26 19:30 ` Rob Herring
2023-11-24 8:41 ` [PATCH v9 05/12] dt-bindings: arm: amlogic: Document the MNT Reform 2 CM4 adapter with a BPI-CM4 Module Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 06/12] clk: meson: g12a: add CTS_ENCL & CTS_ENCL_SEL clocks Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 07/12] clk: meson: add vclk driver Neil Armstrong
2023-11-24 14:41 ` Jerome Brunet
2023-11-27 8:22 ` Neil Armstrong
2023-11-27 16:14 ` Neil Armstrong
2023-11-27 16:24 ` Jerome Brunet
2024-02-05 17:27 ` neil.armstrong
2023-11-24 8:41 ` [PATCH v9 08/12] clk: meson: g12a: make VCLK2 and ENCL clock path configurable by CCF Neil Armstrong
2023-11-24 14:12 ` Jerome Brunet
2023-11-24 15:15 ` Neil Armstrong
2023-11-24 15:32 ` Jerome Brunet
2023-11-27 8:28 ` neil.armstrong
2023-11-27 8:38 ` Jerome Brunet
2023-12-18 9:39 ` neil.armstrong [this message]
2023-11-24 8:41 ` [PATCH v9 09/12] drm/meson: gate px_clk when setting rate Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 10/12] arm64: meson: g12-common: add the MIPI DSI nodes Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 11/12] DONOTMERGE: arm64: meson: khadas-vim3l: add DSI panel Neil Armstrong
2023-11-24 10:52 ` Maxime Ripard
2023-11-24 14:45 ` Neil Armstrong
2023-11-24 8:41 ` [PATCH v9 12/12] arm64: dts: amlogic: meson-g12b-bananapi-cm4: add support for MNT Reform2 with CM4 adaper Neil Armstrong
2023-11-24 16:42 ` (subset) [PATCH v9 00/12] drm/meson: add support for MIPI DSI Display Jerome Brunet
2023-11-27 8:19 ` Neil Armstrong
2023-11-27 8:21 ` Neil Armstrong
2023-11-27 13:22 ` (subset) " Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=db90068a-8eac-458e-bc22-aceb59870f5d@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jagan@amarulasolutions.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=kishon@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=nbelin@baylibre.com \
--cc=repk@triplefau.lt \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tzimmermann@suse.de \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox