mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Carlo Caione <ccaione@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jian Hu <jian.hu@amlogic.com>, Chuan Liu <chuan.liu@amlogic.com>,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/7] dt-bindings: clock: Add Amlogic S7 SCMI clock IDs
Date: Mon, 9 Nov 2026 20:00:56 +0000	[thread overview]
Message-ID: <20261109-stature-splicing-a146b4cfaad4@spud> (raw)
In-Reply-To: <1jfqxa1jv7.fsf@starbuckisacylon.baylibre.com>

[-- Attachment #1: Type: text/plain, Size: 4190 bytes --]

On Mon, Nov 09, 2026 at 09:37:00AM +0100, Jerome Brunet wrote:
> On dim. 08 nov. 2026 at 23:21, Conor Dooley <conor@kernel.org> wrote:
> 
> > On Fri, Nov 06, 2026 at 09:30:24AM +0100, Carlo Caione wrote:
> >> The S7 firmware exposes clocks through SCMI, including sources needed
> >> by the other clock controllers.
> >> 
> >> Define their identifiers so devicetree can reference these
> >> firmware-provided clocks.
> >
> > Are SCMI clock IDs actually suitable for being bindings? Can't the IDs
> > vary here between versions of the firmware?
> > They're also not a "made up" set of indexes, like traditional clocks
> > are, they're real numbers that come from some document akin to
> > interrupts that we do not have bindings for and no driver is likely to
> > reference these definitions either right?
> 
> There is no such document available unfortunately. I'm not sure one
> exist to be honest.

The "document" in this case is the source code of the firmware then.
The info might not be printed in the TRM, but it is determined by
something, Carlo had to get the numbers from somewhere?

>  Those IDs have been stable ... so far, but sure,
> a FW change could change them.

You'd need to be stupid I think to actually change them, but I'd never
put it past a vendor to do just that.

> The IDs are totally made up, in the very same way the other
> amlogic clock driver IDs are.

I doubt that though? If I decided to add 32 to each number here, so that
PWM_J was 48 and DDR_PHY_OSC was 32, the whole thing would fall apart
because the scmi clk driver would pass that down to the firmware, right?
Don't the scmi spec/binding require that the clock cell contains the ID
used by the scmi firmware to refer to that clock? The rpmi stuff works
like that, so I can only assume that scmi is identical in that regard.
Were these bindings, I can create any elaborate scheme for coming up
with what each number means, and that often happens because you have
PLLs, gates, muxes etc all sharing a sequential numbering scheme,
whereas here you must use the numbers from the version of the firmware
that's currently running.

> Providers and consumer just need a common
> reference to desginate clocks, this is it.
> 
> >
> > Is something like this not more suitable for being included as a header
> > in the amlogic dts directory?
> 
> If you think it is more appropriate to have them there, it is fine
> by me.

IMO all these SCMI/RPMI etc IDs are not suitable to be bindings
because they can change if the firmware changes.

> 
> Carlo if you have to respin with this particular change on the DT side,
> feel free to add
> 
> Acked-by: Jerome Brunet <jbrunet@baylibre.com>
> 
> >
> >> 
> >> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> >> ---
> >>  include/dt-bindings/clock/amlogic,s7-scmi-clkc.h | 27 ++++++++++++++++++++++++
> >>  1 file changed, 27 insertions(+)
> >> 
> >> diff --git a/include/dt-bindings/clock/amlogic,s7-scmi-clkc.h b/include/dt-bindings/clock/amlogic,s7-scmi-clkc.h
> >> new file mode 100644
> >> index 000000000000..10d7caa5d1e2
> >> --- /dev/null
> >> +++ b/include/dt-bindings/clock/amlogic,s7-scmi-clkc.h
> >> @@ -0,0 +1,27 @@
> >> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> >> +/*
> >> + * Copyright (c) 2026 BayLibre, SAS.
> >> + */
> >> +
> >> +#ifndef __AMLOGIC_S7_SCMI_CLKC_H
> >> +#define __AMLOGIC_S7_SCMI_CLKC_H
> >> +
> >> +#define CLKID_DDR_PHY_OSC			0
> >> +#define CLKID_USB1_PLL_OSC			1
> >> +#define CLKID_TOP_PLL_OSC			2
> >> +#define CLKID_HDMI_PLL_OSC			3
> >> +#define CLKID_USB0_PHY_PLL_OSC			4
> >> +#define CLKID_USB1_PHY_PLL_OSC			5
> >> +#define CLKID_USB0_PLL_OSC			6
> >> +#define CLKID_ETH_PLL_OSC			7
> >> +#define CLKID_ADC_PLL_OSC			8
> >> +#define CLKID_CPU_CLK				9
> >> +#define CLKID_DSU_CLK				10
> >> +#define CLKID_GP1_PLL				11
> >> +#define CLKID_ACLKM				12
> >> +#define CLKID_PWM_G				13
> >> +#define CLKID_PWM_H				14
> >> +#define CLKID_PWM_I				15
> >> +#define CLKID_PWM_J				16
> >> +
> >> +#endif /* __AMLOGIC_S7_SCMI_CLKC_H */
> >> 
> >> -- 
> >> 2.56.0
> >> 
> 
> -- 
> Jerome

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-09 20:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  8:30 [PATCH 0/7] Add Amlogic S7 clock controllers Carlo Caione
2026-11-06  8:30 ` [PATCH 1/7] dt-bindings: clock: Add Amlogic S7 SCMI clock IDs Carlo Caione
2026-11-08 23:21   ` Conor Dooley
2026-11-09  8:37     ` Jerome Brunet
2026-11-09 20:00       ` Conor Dooley [this message]
2026-11-09  8:49     ` Carlo Caione
2026-11-06  8:30 ` [PATCH 2/7] clk: meson: pll: Support PLLs without a pre-divider Carlo Caione
2026-11-06  8:30 ` [PATCH 3/7] clk: meson: pll: Support active-low resets Carlo Caione
2026-11-06  8:30 ` [PATCH 4/7] dt-bindings: clock: Add Amlogic S7 PLL clock controller Carlo Caione
2026-11-06 17:35   ` Conor Dooley
2026-11-08 23:21     ` Conor Dooley
2026-11-06  8:30 ` [PATCH 5/7] clk: amlogic: Add S7 PLL clock controller driver Carlo Caione
2026-11-06  8:30 ` [PATCH 6/7] dt-bindings: clock: Add Amlogic S7 peripherals clock controller Carlo Caione
2026-11-06 17:34   ` Conor Dooley
2026-11-06 19:34     ` Carlo Caione
2026-11-06 20:48       ` Conor Dooley
2026-11-06 22:27         ` Carlo Caione
2026-11-08 23:17           ` Conor Dooley
2026-11-06  8:30 ` [PATCH 7/7] clk: amlogic: Add S7 peripherals clock controller driver Carlo Caione

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=20261109-stature-splicing-a146b4cfaad4@spud \
    --to=conor@kernel.org \
    --cc=bmasney+clk@redhat.com \
    --cc=ccaione@baylibre.com \
    --cc=chuan.liu@amlogic.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=jian.hu@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=krzk+dt@kernel.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=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=sboyd@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

all inboxes | Powered by JetHome®