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)
Sat, May 30, 6:45 PM
Unknown Object (File)
Wed, May 20, 9:54 AM
Unknown Object (File)
Fri, May 15, 1:34 PM
Unknown Object (File)
Fri, May 15, 1:34 PM
Unknown Object (File)
Fri, May 15, 2:15 AM
Unknown Object (File)
Fri, May 15, 12:42 AM
Unknown Object (File)
Thu, May 14, 10:47 PM
Unknown Object (File)
Tue, May 12, 1:36 PM
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 71518
Build 68401: 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