MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bcm_get_sifreq

Function bcm_get_sifreq

freebsd/mips/broadcom/bcm_pmu.c:254–278  ·  view source on GitHub ↗

Backplane clock frequency (in Hz) */

Source from the content-addressed store, hash-verified

252
253/** Backplane clock frequency (in Hz) */
254uint64_t
255bcm_get_sifreq(struct bcm_platform *bp)
256{
257 uint32_t fixed_hz;
258 uint32_t n, m;
259 bus_size_t mreg;
260 uint8_t pll_type;
261
262 /* PMU support */
263 if (bcm_has_pmu(bp))
264 return (bhnd_pmu_si_clock(bcm_get_pmu(bp)));
265
266 /*
267 * PWRCTL support
268 */
269 pll_type = CHIPC_GET_BITS(bp->cc_caps, CHIPC_CAP_PLL);
270 mreg = bhnd_pwrctl_si_clkreg_m(&bp->cid, pll_type, &fixed_hz);
271 if (mreg == 0)
272 return (fixed_hz);
273
274 n = BCM_CHIPC_READ_4(bp, CHIPC_CLKC_N);
275 m = BCM_CHIPC_READ_4(bp, mreg);
276
277 return (bhnd_pwrctl_si_clock_rate(&bp->cid, pll_type, n, m));
278}
279
280static uint32_t
281bcm_pmu_read4(bus_size_t reg, void *ctx) {

Callers 1

bcm_get_uart_clkcfgFunction · 0.85

Calls 2

bcm_has_pmuFunction · 0.85
bcm_get_pmuFunction · 0.85

Tested by

no test coverage detected