Page MenuHomeFreeBSD

clk/broadcom: Add stub clock node for unimplemented clock sources
Needs ReviewPublic

Authored by 3293789706_qq.com on Mar 18 2026, 7:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 2, 1:26 PM
Unknown Object (File)
Thu, Jul 2, 9:00 AM
Unknown Object (File)
Fri, Jun 26, 8:44 PM
Unknown Object (File)
Fri, Jun 26, 6:56 PM
Unknown Object (File)
Fri, Jun 26, 7:00 AM
Unknown Object (File)
Thu, Jun 25, 7:35 PM
Unknown Object (File)
Jun 6 2026, 4:46 AM
Unknown Object (File)
Jun 6 2026, 2:42 AM
Subscribers

Details

Summary

Add bcm_clk_stub, a minimal fixed-frequency clknode used as a
placeholder for clock sources that are not yet fully modelled (e.g.
gnd, testdebug0/1, pllh_aux on BCM2835).

The stub node reports a fixed frequency supplied at registration time
and rejects any set_freq request that would change it. This allows
the peripheral clock mux to resolve all parent names at clkdom_finit()
time without requiring every source to have a real implementation.

bcm_cprman_clk_data gains a stub_clks array; bcm_cprman_attach
registers stub clocks first so they are available as parents when PLLs
and peripheral clocks are registered.

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

Diff Detail

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

Event Timeline

Can you use the existing clk_fixed class for these clocks? It seems like it. See sys/dev/clk/clk_fixed.h.

Can you use the existing clk_fixed class for these clocks? It seems like it. See sys/dev/clk/clk_fixed.h.

No, these two nodes serve different purposes. clk_fixed calls clknode_init_parent_idx(clk, 0) to initialize the parent clock, while clk_stub uses freq = 0 to indicate that it is a dummy clock.

Updating D55909: clk/broadcom: Add stub clock node for unimplemented clock sources

Updating D55909: clk/broadcom: Add stub clock node for unimplemented clock sources