[PATCH v3 02/11] clk: k210: Rewrite to remove CCF

Leo Liang ycliang at andestech.com
Wed Jun 16 03:54:59 CEST 2021


On Fri, Jun 11, 2021 at 12:16:08PM +0800, Sean Anderson wrote:
> This is effectively a complete rewrite to remove all dependency on CCF.
> The code is now smaller, and so is the binary. It also takes up less memory
> at runtime (since we don't have to create 40 udevices). In general, I am
> much happier with this driver as much of the complexity and late binding
> has been removed.
> 
> The k210_*_params structs which were previously used to initialize CCF
> clocks are now used as the complete configuration. Since we can write our
> own division logic, we can now do away with several "half" clocks which
> only existed to provide constant factors of two.
> 
> The clock IDs have been renumbered to remove unused clocks. This may not be
> the last time they are renumbered, since we have diverged with Linux. There
> are also still a few clocks left out which may need to be added back in.
> 
> In general, I have tried to leave out behavioral changes. However, there is
> a small bugfix regarding ACLK. According to the technical reference manual,
> its mux comes *after* its divider (which is present only for PLL0). This
> would have required yet another intermediate clock to fix with CCF, but
> with the new driver it is just 2 lines of code :)
> 
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
> 
> (no changes since v1)
> 
>  drivers/clk/kendryte/Kconfig            |   2 +-
>  drivers/clk/kendryte/clk.c              | 848 +++++++++++-------------
>  drivers/clk/kendryte/pll.c              | 114 ++--
>  include/dt-bindings/clock/k210-sysctl.h |  94 ++-
>  include/kendryte/pll.h                  |  26 +-
>  5 files changed, 499 insertions(+), 585 deletions(-)

Reviewed-by: Leo Yu-Chi Liang <ycliang at andestech.com>


More information about the U-Boot mailing list