Page MenuHomeFreeBSD

Add clkng driver for Allwinner SoC
ClosedPublic

Authored by manu on Feb 9 2017, 4:24 PM.
Tags
Referenced Files
Unknown Object (File)
Sat, Mar 9, 8:26 PM
Unknown Object (File)
Feb 22 2024, 5:42 PM
Unknown Object (File)
Jan 31 2024, 1:58 PM
Unknown Object (File)
Jan 18 2024, 4:28 AM
Unknown Object (File)
Dec 29 2023, 8:33 AM
Unknown Object (File)
Dec 28 2023, 7:37 AM
Unknown Object (File)
Dec 22 2023, 9:59 PM
Unknown Object (File)
Dec 15 2023, 12:22 PM
Subscribers

Details

Reviewers
jmcneill
Group Reviewers
ARM
Commits
rS314303: Add clkng driver for Allwinner SoC
Summary

This adds the ccung driver for Allwinner SoC.
Since Linux 4.9-4.10 DTS doesn't have clocks under /clocks but only a ccu node.
Currently only H3 is supported with almost the same state as HEAD. (video pll aren't supported for now but we don't support video).
This driver and clocks will also be used for other SoC (A64, A31, H5, H2 etc ...)

Test Plan

Tested on OrangePi One
cpufreq OK, ethernet OK, Thermal OK.
Audio isn't tested (no headphone on OrangePi).

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7328
Build 7495: arc lint + arc unit

Event Timeline

manu retitled this revision from to Add clkng driver for Allwinner SoC.
manu updated this object.
manu edited the test plan for this revision. (Show Details)
manu added reviewers: ARM, jmcneill.
manu set the repository for this revision to rS FreeBSD src repository - subversion.
manu added a project: ARM.
manu removed rS FreeBSD src repository - subversion as the repository for this revision.

Only include ccu_h3.c is H3 SoC was selected.

PLL_AUDIO factor n is 7 bit wide, not 6.

Fix a few more mistakes in width of some factors.
It has been checked two times now but might need another pair of eyes.

sys/arm/allwinner/clkng/aw_ccung.c
287

We're going to need a way to make the SoC specific bits compile time options. No sense in having H3 support in a 64-bit kernel, for example.

sys/arm/allwinner/clkng/aw_clk_nkmp.c
159

This looks to be H3 specific.

233
if ((flags & CLK_SET_DRYRUN) != 0) {

and a few more below..

sys/arm/allwinner/clkng/aw_clk_nm.c
191
if ((sc->flags & AW_CLK_REPARENT) != 0) {
sys/arm/allwinner/clkng/aw_ccung.c
287

RIght, I'll make it depend on ALLWINNER_SOC_XXX

sys/arm/allwinner/clkng/aw_clk_nkmp.c
159

I haven't finished/tested A31 but since I had the same lock problem when implementing cpufreq it might be needed there.

233

Yup sorry will correct that.

Fix a few style(9) errors and only include H3 clk if SOC_ALLWINNER_H3 is selected.

manu marked 5 inline comments as done.Feb 23 2017, 5:03 AM
manu marked 2 inline comments as done.Feb 23 2017, 6:39 AM
manu added inline comments.
sys/arm/allwinner/clkng/aw_clk_nkmp.c
159

Confirmed, this is needed on A31 for cpufreq.

sys/arm/allwinner/clkng/aw_clk_nkmp.c
159

Are there plans for a10- and a23-style pll1 on clkng? According to arm/allwinner/clk/aw_pll.c these use nkmp style registers but do not require this change sequence.

manu marked an inline comment as done.Feb 25 2017, 5:21 PM
manu added inline comments.
sys/arm/allwinner/clkng/aw_clk_nkmp.c
159

Then just don't set AW_CLK_SCALE_CHANGE and this will do the job.

jmcneill edited edge metadata.
This revision is now accepted and ready to land.Feb 25 2017, 7:23 PM
This revision was automatically updated to reflect the committed changes.