clk: tegra: Add custom CCLK implementation
authorDmitry Osipenko <digetx@gmail.com>
Thu, 19 Mar 2020 19:02:18 +0000 (22:02 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 12 May 2020 20:48:42 +0000 (22:48 +0200)
commit1641567920fc363be971f9059f3e7afc58a0dda6
tree08412659ed24b1958c239086079afcafdef5d570
parent1d3e3c4e129eeab578c61a9d9a3afea23aec14e6
clk: tegra: Add custom CCLK implementation

CCLK stands for "CPU Clock", CPU core is running off CCLK. CCLK supports
multiple parents, it has internal clock divider and a clock skipper.
PLLX is the main CCLK parent that provides clock rates above 1GHz and it
has special property such that the CCLK's internal divider is set into
bypass mode when PLLX is selected as a parent for CCLK.

This patch forks generic Super Clock into CCLK implementation which takes
into account all CCLK specifics. The proper CCLK implementation is needed
by the upcoming Tegra20 CPUFreq driver update that will allow to utilize
the generic cpufreq-dt driver by moving intermediate clock selection into
the clock driver.

Note that technically this patch could be squashed into clk-super.c, but
it is cleaner to have a separate source file. Also note that currently all
CCLKLP bits are left in the clk-super.c and only CCLKG is supported by
clk-tegra-super-cclk. It shouldn't be difficult to move the CCLKLP bits,
but CCLKLP is not used by anything in kernel and thus better not to touch
it for now.

Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Tested-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Marcel Ziswiler <marcel@ziswiler.com>
Tested-by: Jasper Korten <jja2000@gmail.com>
Tested-by: David Heidelberg <david@ixit.cz>
Tested-by: Nicolas Chauvet <kwizart@gmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/clk/tegra/Makefile
drivers/clk/tegra/clk-tegra-super-cclk.c [new file with mode: 0644]
drivers/clk/tegra/clk.h