Page MenuHomeFreeBSD

arm64: rockchip, implement the two rk808 clocks
Needs ReviewPublic

Authored by bz on Oct 19 2020, 8:55 PM.

Details

Reviewers
mmel
manu
Summary

While the xin32k clk was implemented in rk3399_cru as a fixed rate
clock, migrate it to rk805 as we will also need the 2nd clock
'rtc_clko_wifi' for SDIO and BT.
Both clocks remain fixed rate, and while the 1st one is always on
(though that is not expressed in the clk framework), the 2nd one
we can toggle on/off.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 34266
Build 31409: arc lint + arc unit

Event Timeline

bz requested review of this revision.Oct 19 2020, 8:55 PM
sys/arm64/rockchip/rk805.c
642

You should be able to subclass the first clock def no ?

665

No need for this comment.

668

RK808 datasheet name this clock clk32kout1

668

clock-output-names could have only one clock, we should always use the name if provided.

680

RK808 datasheet name this clock clk32kout2

763

Looking at the rk805 datasheet it seems that it have the same clocks, we should always export them unconditionally.

766

We should fail here, if the xin32k clock isn't exported not a lot of thing would work (and we would panic later when we finish the clock domains I think anyway).
Not attaching would be clearer of the problem IMHO.

sys/arm64/rockchip/rk805.c
668

Can we always rely on the DTS to get this one right. Is we don't have an "xin32k" more things get cranky. That's the reason I did in the end not name it clk32kout1. We never did in rk3399_cru.c either; so there is some inconsistency somewhere?

sys/arm64/rockchip/rk805.c
668

Yes we should rely on it.
We didn't have it in rk3399_cru either as we needed to have the xin32k name used.
Note that it doesn't not really matter, there is not real situation where the rk805/rk808 node wouldn't export the clock as xin32k.