[PATCH v3 03/19] dt-bindings: clock: at91: Allow referencing main rc oscillator in DT
Claudiu Beznea
claudiu.beznea at tuxon.dev
Sun Mar 8 09:43:46 PDT 2026
Hi, Alexander,
Sorry for the late reply.
On 2/9/26 10:08, Alexander Dahl wrote:
> 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 at thorsis.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.
OK, sounds good.
>
> 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.
There is no such section, AFAIK.
>
> 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?
If I got your question, some are only internally (currently), some are also used
by DT (e.g. the PLL ones).
>
> Besides, if it is renamed now anyway:
>
> - Why that PMC prefix? (most of these core clocks come from the
> clock controller, not the pmc)
The control interface for all of them are on PMC. So, they are all considered to
be part of the PMC. From manual, chapter "Description" of "Clock generator":
The Clock Generator user interface is embedded within the Power Management
Controller and is described in the
>
> - Why not rename PMC_UTMI to something like xyz_UPLLCK to match the
> datasheet/manual (likewise for the other definitions)?
That could be done for the SoCs where this applies.
Thank you,
Claudiu
More information about the linux-arm-kernel
mailing list