]> git.baikalelectronics.ru Git - uboot.git/commit
clk: k210: Re-add support for setting rate
authorSean Anderson <seanga2@gmail.com>
Fri, 11 Jun 2021 04:16:11 +0000 (00:16 -0400)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 17 Jun 2021 01:40:57 +0000 (09:40 +0800)
commit8f1c808c6d6a8c03782416c4c89be8dc90702f75
tree0f8b5a133d9e01a13f30e1b5151e4f97aec2b463
parent0e8e7b14086c70915854de056254f616220e5a95
clk: k210: Re-add support for setting rate

This adds support for setting clock rates, which was left out of the
initial CCF expunging. There are several tricky bits here, mostly related
to the PLLS:

* The PLL's bypass is broken. If the PLL is reconfigured, any child clocks
  will be stopped.
* PLL0 is the parent of ACLK which is the CPU and SRAM's clock. To prevent
  stopping the CPU while we configure PLL0's rate, ACLK is reparented
  to IN0 while PLL0 is disabled.
* PLL1 is the parent of the AISRAM clock. This clock cannot be reparented,
  so we instead just disallow changing PLL1's rate after relocation (when
  we are using the AISRAM).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
drivers/clk/kendryte/clk.c