Re: RFC: RZ/N1 clock architecture...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michel,

On Tue, Apr 10, 2018 at 11:56 AM, Michel Pollet
<michel.pollet@xxxxxxxxxxxxxx> wrote:
> In the current SDK for the RZ/N1, we made a clock architecture that is entirely device-tree based.
> The clock hierarchy is quite complex and was machine generated from design documents, and
> some exceptions and grouping were added to the 'main' family rzn1.dtsi...
>
> Apart from a few fixed-clock nodes, all of the other nodes are 'special' and require a driver. All
> of these drivers are sub-drivers to a 'main' clock driver. That has been working for 2 years already.
>
> One extra note: we don't 'own' all of these clocks, part of the clocks/dividers can be
> enable/disabled by the CM3 core.
>
> Now, For upstreaming, I'm going to have to change that, since already the 'clock' bits are going
> to go under the MFD sysctrl node. However I'm trying to figure out if we can still use our
> rzn1-clocks.dtsi in some form, as well as my drivers, or so I have to convert it to a C table in
> some way.
>
> Also note that all the clock refer to SYSCTRL registers/bits using constant names from a header
> file, not hex constants etc.
>
> I would appreciate any ideas/suggestions before I commit blindly to a path...
>
> Here is the main autogenerated clock file:
> https://github.com/renesas-rz/rzn1_linux/blob/rzn1-stable/arch/arm/boot/dts/rzn1-clocks.dtsi
> Here's the extra clock{} node in the main rzn1.dtsi
> https://github.com/renesas-rz/rzn1_linux/blob/89d6c9be056a462b95d5217221d70d6e5c25dfc2/arch/arm/boot/dts/rzn1.dtsi#L70

Describing the full clock hierarchy in DT is no longer recommended.
The modern way is to have a single clock provider node in DT, and have the
driver register all clocks.

Compare e.g. the single clock-controller node in arch/arm/boot/dts/r8a7791.dtsi
in v4.15 (used with the {r8a7791,renesas}-cpg-mssr.c driver, with the complex
clocks node in v4.14, used with a lot of subdrivers, and requiring continuous
maintenance.

So I think you're best of creating (generating) a C table instead, and
keep the DT
simple and obviously correct.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux