Page MenuHomeFreeBSD

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

Authored by 3293789706_qq.com on Mar 21 2026, 1:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 18, 11:58 AM
Unknown Object (File)
Sat, Jul 18, 3:16 AM
Unknown Object (File)
Sun, Jul 12, 5:12 PM
Unknown Object (File)
Sun, Jul 5, 6:30 AM
Unknown Object (File)
Sat, Jul 4, 8:33 PM
Unknown Object (File)
Sat, Jun 27, 5:22 PM
Unknown Object (File)
Thu, Jun 25, 3:41 PM
Unknown Object (File)
May 29 2026, 1:29 PM
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 71606
Build 68489: arc lint + arc unit