lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260209-amulet-customize-08ef8dfa1c38@thorsis.com>
Date: Mon, 9 Feb 2026 09:08:56 +0100
From: Alexander Dahl <ada@...rsis.com>
To: Claudiu Beznea <claudiu.beznea@...on.dev>
Cc: Alexander Dahl <ada@...rsis.com>,
	Nicolas Ferre <nicolas.ferre@...rochip.com>,
	Alexandre Belloni <alexandre.belloni@...tlin.com>,
	Ryan Wanner <ryan.wanner@...rochip.com>,
	linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
	Michael Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>
Subject: Re: [PATCH v3 03/19] dt-bindings: clock: at91: Allow referencing
 main rc oscillator in DT

Hello Claudiu,

Am Sat, Jan 31, 2026 at 05:44:18PM +0200 schrieb Claudiu Beznea:
> Hi, Alexander,
> 
> On 1/20/26 16:37, Alexander Dahl wrote:
> > The main rc oscillator will be needed for the OTPC to work properly.
> > 
> > The new index introduced here was not used on the four affected SoC
> > clock drivers before, but for sama5d2 only (PMC_I2S1_MUX).
> > 
> > Link: https://lore.kernel.org/linux-devicetree/20250207-jailbird-circus-bcc04ee90e05@thorsis.com/T/#u
> > Signed-off-by: Alexander Dahl <ada@...rsis.com>
> > ---
> > 
> > Notes:
> >      v3:
> >      - adapt to different base changes, added lines are the same
> >      v2:
> >      - new patch, not present in v1
> > 
> >   include/dt-bindings/clock/microchip,sam9x60-pmc.h  | 1 +
> >   include/dt-bindings/clock/microchip,sam9x7-pmc.h   | 1 +
> >   include/dt-bindings/clock/microchip,sama7d65-pmc.h | 1 +
> >   include/dt-bindings/clock/microchip,sama7g5-pmc.h  | 1 +
> >   4 files changed, 4 insertions(+)
> > 
> > diff --git a/include/dt-bindings/clock/microchip,sam9x60-pmc.h b/include/dt-bindings/clock/microchip,sam9x60-pmc.h
> > index 91f8f863ea076..1f6bb51780d09 100644
> > --- a/include/dt-bindings/clock/microchip,sam9x60-pmc.h
> > +++ b/include/dt-bindings/clock/microchip,sam9x60-pmc.h
> > @@ -10,6 +10,7 @@
> >   #define SAM9X60_PMC_MCK		1
> >   #define SAM9X60_PMC_UTMI	2
> >   #define SAM9X60_PMC_MAIN	3
> > +#define SAM9X60_PMC_MAIN_RC	6
> 
> Why 6 and not another index? In theory, now, you should be able to define
> here all the core clocks IDs (as these are known from the manuals) and
> prepare the driver to allocate memory for all of them such that the driver
> will have to be able to work with old and new device trees w/o further
> changes.

Was the first common free index for these four clocks.  Before split
up would have been nice to have a common index, because it was all
together in include/dt-bindings/clock/at91.h in one file.  After
splitup one could just use the first free index, as Krzysztof already
suggested.

>From my reading of the SAM9X60 manual, there's no such thing as core
clock IDs in the manual.  If there is a section in the manual, please
point it out.

>From my interpretation for SAM9X60 these clocks are provided by the
clock generator (section 40 in the manual):

- TD_SLCK
- MD_SLCK
- MAINCK
- UPLLCK
- PLLACK

The "main rc oscillator" clock is somewhat internal here, but for OTPC
we must be able to enable it.

MCK (not MAINCK) is generated in the Processor Clock Controller block
of the PMC (section 41 in the manual) from one of the above clocks.

So it's all mixed up from different blocks from Clock Generator and
Power Management Controller already.  These indexes are
arbitrary and just for the driver, right?  Or am I missing something?

Besides, if it is renamed now anyway:

- Why that PMC prefix? (most of these core clocks come from the
  clock controller, not the pmc)

- Why not rename PMC_UTMI to something like xyz_UPLLCK to match the
  datasheet/manual (likewise for the other definitions)?

Greets
Alex

> 
> >   #define SAM9X60_PMC_PLLACK	7
> >   #endif
> > diff --git a/include/dt-bindings/clock/microchip,sam9x7-pmc.h b/include/dt-bindings/clock/microchip,sam9x7-pmc.h
> > index e1dd41fe75046..657f32ce10071 100644
> > --- a/include/dt-bindings/clock/microchip,sam9x7-pmc.h
> > +++ b/include/dt-bindings/clock/microchip,sam9x7-pmc.h
> > @@ -10,6 +10,7 @@
> >   #define SAM9X7_PMC_MCK		1
> >   #define SAM9X7_PMC_UTMI		2
> >   #define SAM9X7_PMC_MAIN		3
> > +#define SAM9X7_PMC_MAIN_RC	6
> >   #define SAM9X7_PMC_PLLACK	7
> >   #define SAM9X7_PMC_AUDIOPMCPLL	9
> >   #define SAM9X7_PMC_AUDIOIOPLL	10
> > diff --git a/include/dt-bindings/clock/microchip,sama7d65-pmc.h b/include/dt-bindings/clock/microchip,sama7d65-pmc.h
> > index 09d152da6db44..ddcb236718978 100644
> > --- a/include/dt-bindings/clock/microchip,sama7d65-pmc.h
> > +++ b/include/dt-bindings/clock/microchip,sama7d65-pmc.h
> > @@ -12,6 +12,7 @@
> >   #define SAMA7D65_PMC_MAIN		3
> >   #define SAMA7D65_PMC_CPUPLL		4
> >   #define SAMA7D65_PMC_SYSPLL		5
> > +#define SAMA7D65_PMC_MAIN_RC		6
> 
> E.g. 6 was previously reserved for DDR and IMG PLLs.
> 
> >   #define SAMA7D65_PMC_BAUDPLL		8
> >   #define SAMA7D65_PMC_AUDIOPMCPLL	9
> >   #define SAMA7D65_PMC_AUDIOIOPLL		10
> > diff --git a/include/dt-bindings/clock/microchip,sama7g5-pmc.h b/include/dt-bindings/clock/microchip,sama7g5-pmc.h
> > index 0303cae56f849..e891715a35173 100644
> > --- a/include/dt-bindings/clock/microchip,sama7g5-pmc.h
> > +++ b/include/dt-bindings/clock/microchip,sama7g5-pmc.h
> > @@ -12,6 +12,7 @@
> >   #define SAMA7G5_PMC_MAIN	3
> >   #define SAMA7G5_PMC_CPUPLL	4
> >   #define SAMA7G5_PMC_SYSPLL	5
> > +#define SAMA7G5_PMC_MAIN_RC	6
> >   #define SAMA7G5_PMC_AUDIOPMCPLL	9
> >   #define SAMA7G5_PMC_AUDIOIOPLL	10
> >   #define SAMA7G5_PMC_MCK1	13
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ