Page MenuHomeFreeBSD

clk/broadcom: Add CPRMAN clkdev backend and peripheral clock node
AbandonedPublic

Authored by 3293789706_qq.com on Wed, Mar 18, 7:43 AM.
Tags
None
Referenced Files
F149404679: D55910.diff
Tue, Mar 24, 6:08 AM
F149370613: D55910.diff
Tue, Mar 24, 12:42 AM
Unknown Object (File)
Sun, Mar 22, 9:11 PM
Unknown Object (File)
Fri, Mar 20, 2:55 AM
Subscribers

Details

Reviewers
None
Summary

Add the shared CPRMAN clkdev backend (bcm_cprman) and the peripheral
clock node (bcm_clk_periph) for the Broadcom clock manager.

bcm_cprman provides the clkdev interface (read/write/modify/lock) on
top of a memory-mapped register window, and a generic attach routine
that iterates over a chip-supplied bcm_cprman_clk_data table to
register clocks. Chip-specific drivers inherit from bcm_cprman_driver
via DEFINE_CLASS_1 and supply only probe/attach.

bcm_clk_periph implements the fractional-N peripheral clock node:

  • init reads the SRC field to select the active parent
  • set_gate enables/disables the clock output
  • set_freq disables the clock, waits for BUSY, programs the 12.12 fixed-point divider, re-enables, and sets MASH mode
  • recalc_freq extracts the combined integer+fractional divider field with a div==0 guard to avoid division by zero

The passwd field is removed from bcm_clk_periph_def; the PASSWD token
is now applied uniformly by CPR_WRITE4 in the backend.

Signed-off-by: perdixky <3293789706@qq.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71479
Build 68362: arc lint + arc unit

Event Timeline

This appears to be a duplicate of D55907. Is there a difference?

I'm sorry, I made a mistake because I'm not familiar with the arc workflow.