Lines Matching +full:conf +full:- +full:clk
61 #define RNG_JCLK_BYP_DIV_CNT 0x0000ff00 /* Jitter clk bypass divider
64 #define RNG_JCLK_BYP_SRC 0x00000020 /* Jitter clk bypass source */
65 #define RNG_JCLK_BYP_SEL 0x00000010 /* Jitter clk bypass select */
144 struct bcm_rng_conf const* conf; member
153 {"broadcom,bcm2835-rng", (uintptr_t)&bcm2835_rng_conf},
154 {"brcm,bcm2835-rng", (uintptr_t)&bcm2835_rng_conf},
156 {"brcm,bcm2711-rng200", (uintptr_t)&bcm2838_rng_conf},
157 {"brcm,bcm2838-rng", (uintptr_t)&bcm2838_rng_conf},
158 {"brcm,bcm2838-rng200", (uintptr_t)&bcm2838_rng_conf},
159 {"brcm,bcm7211-rng", (uintptr_t)&bcm2838_rng_conf},
160 {"brcm,bcm7278-rng", (uintptr_t)&bcm2838_rng_conf},
161 {"brcm,iproc-rng200", (uintptr_t)&bcm2838_rng_conf},
169 atomic_add_long(&sc->sc_underrun, 1); in bcm2835_rng_stat_inc_underrun()
176 return bus_read_4(sc->sc_mem_res, off); in bcm2835_rng_read4()
184 bus_read_multi_4(sc->sc_mem_res, off, datap, count); in bcm2835_rng_read_multi4()
191 bus_write_4(sc->sc_mem_res, off, val); in bcm2835_rng_write4()
200 if (!sc->conf->can_diagnose) in bcm2835_rng_dump_registers()
205 val = bcm2835_rng_read4(sc, sc->conf->control_reg); in bcm2835_rng_dump_registers()
241 val = bcm2835_rng_read4(sc, sc->conf->status_reg); in bcm2835_rng_dump_registers()
244 (val >> sc->conf->count_value_shift) & sc->conf->count_value_mask); in bcm2835_rng_dump_registers()
245 sbuf_printf(sbp, " RND_WARM_CNT: %05x\n", val & sc->conf->warmup_count); in bcm2835_rng_dump_registers()
252 val = bcm2835_rng_read4(sc, sc->conf->intr_mask_reg); in bcm2835_rng_dump_registers()
254 ((val & sc->conf->intr_disable_bit) != 0) ? "disabled" : "enabled"); in bcm2835_rng_dump_registers()
263 mask = bcm2835_rng_read4(sc, sc->conf->intr_mask_reg); in bcm2835_rng_disable_intr()
264 mask |= sc->conf->intr_disable_bit; in bcm2835_rng_disable_intr()
265 bcm2835_rng_write4(sc, sc->conf->intr_mask_reg, mask); in bcm2835_rng_disable_intr()
274 if (sc->conf->intr_mask_reg) in bcm2835_rng_start()
278 if (sc->conf->warmup_count > 0) in bcm2835_rng_start()
279 bcm2835_rng_write4(sc, sc->conf->status_reg, in bcm2835_rng_start()
280 sc->conf->warmup_count); in bcm2835_rng_start()
283 ctrl = bcm2835_rng_read4(sc, sc->conf->control_reg); in bcm2835_rng_start()
285 if (sc->sc_rbg2x && sc->conf->allow_2x_mode) in bcm2835_rng_start()
287 bcm2835_rng_write4(sc, sc->conf->control_reg, ctrl); in bcm2835_rng_start()
296 ctrl = bcm2835_rng_read4(sc, sc->conf->control_reg); in bcm2835_rng_stop()
298 bcm2835_rng_write4(sc, sc->conf->control_reg, ctrl); in bcm2835_rng_stop()
308 chunk_size = sizeof(((struct harvest_event *)0)->he_entropy); in bcm2835_rng_enqueue_harvest()
310 sc_buf_chunk = (void*)sc->sc_buf; in bcm2835_rng_enqueue_harvest()
320 cnt -= size; in bcm2835_rng_enqueue_harvest()
333 dest = sc->sc_buf; in bcm2835_rng_harvest()
337 for (cnt = sizeof(sc->sc_buf) / sizeof(uint32_t); cnt > 0; in bcm2835_rng_harvest()
338 cnt -= num_words) { in bcm2835_rng_harvest()
340 hwcount = bcm2835_rng_read4(sc, sc->conf->count_reg); in bcm2835_rng_harvest()
341 num_avail = (hwcount >> sc->conf->count_value_shift) & in bcm2835_rng_harvest()
342 sc->conf->count_value_mask; in bcm2835_rng_harvest()
347 if (++seen_underrun >= sc->sc_stall_count) { in bcm2835_rng_harvest()
349 device_printf(sc->sc_dev, in bcm2835_rng_harvest()
354 device_printf(sc->sc_dev, in bcm2835_rng_harvest()
366 device_get_nameunit(sc->sc_dev), num_avail); in bcm2835_rng_harvest()
370 bcm2835_rng_read_multi4(sc, sc->conf->data_reg, dest, in bcm2835_rng_harvest()
378 callout_reset(&sc->sc_rngto, RNG_CALLOUT_TICKS, bcm2835_rng_harvest, sc); in bcm2835_rng_harvest()
387 rbg2x = sc->sc_rbg2x; in sysctl_bcm2835_rng_2xspeed()
391 if (req->newptr == NULL) in sysctl_bcm2835_rng_2xspeed()
393 if (rbg2x == sc->sc_rbg2x) in sysctl_bcm2835_rng_2xspeed()
398 sc->sc_rbg2x = rbg2x; in sysctl_bcm2835_rng_2xspeed()
430 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in bcm2835_rng_probe()
448 sc->sc_dev = dev; in bcm2835_rng_attach()
450 sc->conf = (void const*)ofw_bus_search_compatible(dev, compat_data)->ocd_data; in bcm2835_rng_attach()
451 KASSERT(sc->conf != NULL, ("bcm2835_rng_attach: sc->conf == NULL")); in bcm2835_rng_attach()
453 sc->sc_stall_count = RNG_STALL_COUNT_DEFAULT; in bcm2835_rng_attach()
456 callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); in bcm2835_rng_attach()
458 TUNABLE_INT_FETCH("bcmrng.stall_count", &sc->sc_stall_count); in bcm2835_rng_attach()
459 if (sc->conf->allow_2x_mode) in bcm2835_rng_attach()
460 TUNABLE_INT_FETCH("bcmrng.2xspeed", &sc->sc_rbg2x); in bcm2835_rng_attach()
464 sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in bcm2835_rng_attach()
466 if (sc->sc_mem_res == NULL) { in bcm2835_rng_attach()
491 "underrun", CTLFLAG_RD, &sc->sc_underrun, in bcm2835_rng_attach()
493 if (sc->conf->allow_2x_mode) in bcm2835_rng_attach()
498 "stall_count", CTLFLAG_RW, &sc->sc_stall_count, in bcm2835_rng_attach()
510 callout_reset(&sc->sc_rngto, hz, bcm2835_rng_harvest, sc); in bcm2835_rng_attach()
526 callout_drain(&sc->sc_rngto); in bcm2835_rng_detach()
529 if (sc->sc_mem_res != NULL) in bcm2835_rng_detach()
530 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); in bcm2835_rng_detach()