All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Sugar Zhang <sugar.zhang@rock-chips.com>,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	kernel@collabora.com, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Subject: Re: [PATCH 2/7] clk: rockchip: add support for GRF gated clocks
Date: Wed, 05 Mar 2025 23:21:12 +0100	[thread overview]
Message-ID: <4964374.GXAFRqVoOG@phil> (raw)
In-Reply-To: <20250305-rk3576-sai-v1-2-64e6cf863e9a@collabora.com>

Hey,

Am Mittwoch, 5. März 2025, 22:24:22 MEZ schrieb Nicolas Frattaroli:
> Certain Rockchip SoCs, the RK3576 in particular, have some clocks that
> are essentially gated behind an additional GRF write. Downstream uses an
> additional entirely separate clock driver that maps over the same
> address range as ioc_grf in the DT.
> 
> Instead, this implementation introduces a new gate type, GRF gates.
> These gates function quite like regular gates. In effect, this means
> they'll only be enabled if the clock is used, which I feel is a more
> appropriate way to describe this compared to doing it in, say, pinctrl,
> or even in the drivers of the respective clock consumers such as SAI.
> 
> It should be noted that RK3588 has similar GRF-gated clocks, but has
> gotten away with not having to deal with any of this because the clocks
> are ungated by the hardware's register reset value by default. The
> RK3576 is not so lucky, and the hardware's reset value gates them
> instead, which means we'll have to ungate them somewhere.
> 
> In order to facilitate the GRF gating on RK3576, we introduce the
> concept of auxiliary GRFs. The RK3576 has several defined GRF nodes, and
> so far it could get away with just using one for MUXGRF by reassigning
> the clock provider's grf member.
> 
> However, with the IOC GRF gated clocks, we now also need access to the
> IOC GRF, so we can't get away with this anymore. Instead, we add a
> hashtable to the clock provider struct, keyed by a grf type enum. The
> clock branches can then specify through the use of a new member of that
> enum's type (with corresponding changes to relevant macros) which GRF
> range they would like to use.
> 
> The SoC-specific clk_init can then populate the hashtable with the GRFs
> that it needs. This way, GRF-dependent clock branches don't have to be
> registered in a different step than everything else, as they would need
> to be had I extended the branch struct to instead take a pointer to a
> GRF, which isn't available at the time most of our branches are defined.
> 
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

I only did a short look through the patch and didn't see anything
glaringly wrong, but this wants to be at least 3 patches:
- add the handling (hash-table etc) for multiple grfs
  (including adapting the grf-mux)
- adding the grf-gate clock-type
- adding the rk3576 grf-gates


Heiko




WARNING: multiple messages have this Message-ID (diff)
From: Heiko Stuebner <heiko@sntech.de>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Sugar Zhang <sugar.zhang@rock-chips.com>,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: devicetree@vger.kernel.org,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rockchip@lists.infradead.org, kernel@collabora.com,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/7] clk: rockchip: add support for GRF gated clocks
Date: Wed, 05 Mar 2025 23:21:12 +0100	[thread overview]
Message-ID: <4964374.GXAFRqVoOG@phil> (raw)
In-Reply-To: <20250305-rk3576-sai-v1-2-64e6cf863e9a@collabora.com>

Hey,

Am Mittwoch, 5. März 2025, 22:24:22 MEZ schrieb Nicolas Frattaroli:
> Certain Rockchip SoCs, the RK3576 in particular, have some clocks that
> are essentially gated behind an additional GRF write. Downstream uses an
> additional entirely separate clock driver that maps over the same
> address range as ioc_grf in the DT.
> 
> Instead, this implementation introduces a new gate type, GRF gates.
> These gates function quite like regular gates. In effect, this means
> they'll only be enabled if the clock is used, which I feel is a more
> appropriate way to describe this compared to doing it in, say, pinctrl,
> or even in the drivers of the respective clock consumers such as SAI.
> 
> It should be noted that RK3588 has similar GRF-gated clocks, but has
> gotten away with not having to deal with any of this because the clocks
> are ungated by the hardware's register reset value by default. The
> RK3576 is not so lucky, and the hardware's reset value gates them
> instead, which means we'll have to ungate them somewhere.
> 
> In order to facilitate the GRF gating on RK3576, we introduce the
> concept of auxiliary GRFs. The RK3576 has several defined GRF nodes, and
> so far it could get away with just using one for MUXGRF by reassigning
> the clock provider's grf member.
> 
> However, with the IOC GRF gated clocks, we now also need access to the
> IOC GRF, so we can't get away with this anymore. Instead, we add a
> hashtable to the clock provider struct, keyed by a grf type enum. The
> clock branches can then specify through the use of a new member of that
> enum's type (with corresponding changes to relevant macros) which GRF
> range they would like to use.
> 
> The SoC-specific clk_init can then populate the hashtable with the GRFs
> that it needs. This way, GRF-dependent clock branches don't have to be
> registered in a different step than everything else, as they would need
> to be had I extended the branch struct to instead take a pointer to a
> GRF, which isn't available at the time most of our branches are defined.
> 
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

I only did a short look through the patch and didn't see anything
glaringly wrong, but this wants to be at least 3 patches:
- add the handling (hash-table etc) for multiple grfs
  (including adapting the grf-mux)
- adding the grf-gate clock-type
- adding the rk3576 grf-gates


Heiko



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2025-03-05 23:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 21:24 [PATCH 0/7] Add RK3576 SAI Audio Controller Support Nicolas Frattaroli
2025-03-05 21:24 ` Nicolas Frattaroli
2025-03-05 21:24 ` [PATCH 1/7] dt-bindings: clock: rk3576: add IOC gated clocks Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli
2025-03-06  7:38   ` Krzysztof Kozlowski
2025-03-06  7:38     ` Krzysztof Kozlowski
2025-03-05 21:24 ` [PATCH 2/7] clk: rockchip: add support for GRF " Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli
2025-03-05 22:21   ` Heiko Stuebner [this message]
2025-03-05 22:21     ` Heiko Stuebner
2025-03-05 21:24 ` [PATCH 3/7] ASoC: dt-bindings: add schema for rockchip SAI controllers Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli
2025-03-06  7:42   ` Krzysztof Kozlowski
2025-03-06  7:42     ` Krzysztof Kozlowski
2025-03-06 13:13     ` Nicolas Frattaroli
2025-03-06 13:13       ` Nicolas Frattaroli
2025-03-06 13:43       ` Krzysztof Kozlowski
2025-03-06 13:43         ` Krzysztof Kozlowski
2025-03-06 14:38         ` Nicolas Frattaroli
2025-03-06 14:38           ` Nicolas Frattaroli
2025-03-07 20:56   ` Rob Herring
2025-03-07 20:56     ` Rob Herring
2025-03-05 21:24 ` [PATCH 4/7] ASoC: rockchip: add Serial Audio Interface (SAI) driver Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli
2025-03-06  7:37   ` Krzysztof Kozlowski
2025-03-06  7:37     ` Krzysztof Kozlowski
2025-03-06 13:23     ` Nicolas Frattaroli
2025-03-06 13:23       ` Nicolas Frattaroli
2025-03-05 21:24 ` [PATCH 5/7] arm64: dts: rockchip: Add RK3576 SAI nodes Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli
2025-03-05 21:24 ` [PATCH 6/7] arm64: dts: rockchip: Add analog audio on RK3576 Sige5 Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli
2025-03-05 21:24 ` [PATCH 7/7] arm64: defconfig: Enable Rockchip SAI Nicolas Frattaroli
2025-03-05 21:24   ` Nicolas Frattaroli

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=4964374.GXAFRqVoOG@phil \
    --to=heiko@sntech.de \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=sugar.zhang@rock-chips.com \
    --cc=tiwai@suse.com \
    --cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.