]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
clk: sunxi-ng: a80: Remodel CPU cluster PLLs as N-type multiplier clocks
authorChen-Yu Tsai <wens@csie.org>
Wed, 5 Apr 2017 06:37:43 +0000 (14:37 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 5 Apr 2017 07:02:56 +0000 (09:02 +0200)
commit25eb035c3f22bde1eff43fe5c59b207d54a3d520
tree3dd6609bdbcb9d740d5d2e65a7ebf467c3400972
parentcf719012b23278c65d0bca4975a7ea46e5bb75be
clk: sunxi-ng: a80: Remodel CPU cluster PLLs as N-type multiplier clocks

The CPU cluster PLLs on the A80 are NP clocks that are atypical in two ways:

  - The P factor is 1 bit wide, and translates to a /1 or /4 divider.

  - The P factor should only be used for output frequencies lower than
    288 MHz. The N factor has a lower limit of 12, which likely contributed
    to this extra divider.

According to the user manual, the clocks can only go as low as 200 MHz.
The vendor BSP kernel does not even define operating points below 360
MHz for these clocks. The lower end for cpufreq in the vendor kernel is
even higher. The mainline Linux kernel doesn't support cpufreq for the
A80 at the moment. This means the lower frequencies are untested, and
will likely remain unused.

The new sunxi-ng style clocks don't support the quirks listed above.
Instead of trying to work the quirks in for something of little usage,
we re-model the clocks into N-type multipler clocks, with P fixed at 1.
At probe time we check if P is set to 4, and fix it up if needed. This
is highly unlikely though.

Fixes: b8eb71dcdd08 ("clk: sunxi-ng: Add A80 CCU")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi-ng/ccu-sun9i-a80.c