[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230713193812.px7q4sdfdppuywsg@mercury.elektranox.org>
Date: Thu, 13 Jul 2023 21:38:12 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Jagan Teki <jagan@...eble.ai>
Cc: Heiko Stuebner <heiko@...ech.de>,
linux-rockchip@...ts.infradead.org,
Peter Geis <pgwipeout@...il.com>,
Elaine Zhang <zhangqing@...k-chips.com>,
Finley Xiao <finley.xiao@...k-chips.com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Boris Brezillon <boris.brezillon@...labora.com>,
linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, kernel@...labora.com,
Vincent Legoll <vincent.legoll@...il.com>
Subject: Re: [PATCHv2 1/2] clk: rockchip: rk3588: make gate linked clocks
ignore unused
Hello Jagan,
On Thu, Jul 13, 2023 at 08:25:03PM +0530, Jagan Teki wrote:
> On Tue, 4 Apr 2023 at 01:03, Sebastian Reichel
> <sebastian.reichel@...labora.com> wrote:
> [...]
> > + * Recent Rockchip SoCs have a new hardware block called Native Interface
> > + * Unit (NIU), which gates clocks to devices behind them. These effectively
> > + * need two parent clocks.
> > + *
> > + * Downstream enables the linked clock via runtime PM whenever the gate is
> > + * enabled. This implementation uses separate clock nodes for each of the
> > + * linked gate clocks, which leaks parts of the clock tree into DT.
> > + *
> > + * The GATE_LINK macro instead takes the second parent via 'linkname', but
> > + * ignores the information. Once the clock framework is ready to handle it, the
> > + * information should be passed on here. But since these clocks are required to
> > + * access multiple relevant IP blocks, such as PCIe or USB, we mark all linked
> > + * clocks critical until a better solution is available. This will waste some
> > + * power, but avoids leaking implementation details into DT or hanging the
> > + * system.
> > */
>
> Does it mean the clk-link topology in the downstream kernel can be
> reused the same as normal clock notation?
Yes.
> For example, I'm trying to add HCLK_VO1 directly to VO1 syscon instead
> of routing to pclk_vo1_grf(done downstream)
> vo1_grf: syscon@...a8000 {
> compatible = "rockchip,rk3588-vo-grf", "syscon";
> reg = <0x0 0xfd5a8000 0x0 0x100>;
> clocks = <&cru HCLK_VO1>;
You need PCLK_VO1 (which is currently not exposed; I somehow missed
it).
> };
>
> This seems breaking syscon for vo1_grf and observed a bus error
> while accessing regmap.
I investigated the issue you are seeing some weeks ago when my
co-workers started to work on HDMI RX and TX. You are probably
just missing this patch:
https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux/-/commit/ecc6415344957fa88356cec10f8b75a9da603a7b
> I remember in one of the RKDC discussion that the double parenting
> of these clocks is mandatory while accessing associated IP blocks.
Yes, it is necessary.
> Any thoughts?
The upstream workaround/hack is to have the second parent always
enabled. This obviously wastes power, but means that the hardware
description in the DT is correct. Once the clock framework supports
two parents the kernel can be updated without touching the DT,
which is considered ABI.
Greetings,
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists