Lines Matching refs:rng
86 RNG_TypeDef *rng; member
104 .rng = (RNG_TypeDef *)DT_INST_REG_ADDR(0),
112 RNG_TypeDef *rng = dev_data->rng; in entropy_stm32_suspend() local
119 LL_RNG_Disable(rng); in entropy_stm32_suspend()
155 RNG_TypeDef *rng = dev_data->rng; in entropy_stm32_resume() local
160 LL_RNG_Enable(rng); in entropy_stm32_resume()
161 LL_RNG_EnableIT(rng); in entropy_stm32_resume()
168 RNG_TypeDef *rng = entropy_stm32_rng_data.rng; in configure_rng() local
183 cur_nist_cfg = READ_BIT(rng->CR, in configure_rng()
194 cur_htcr = LL_RNG_GetHealthConfig(rng); in configure_rng()
198 MODIFY_REG(rng->CR, cur_nist_cfg, (desired_nist_cfg | RNG_CR_CONDRST)); in configure_rng()
202 LL_RNG_SetHealthConfig(rng, DT_INST_PROP(0, health_test_magic)); in configure_rng()
204 LL_RNG_SetHealthConfig(rng, desired_htcr); in configure_rng()
207 LL_RNG_DisableCondReset(rng); in configure_rng()
209 while (LL_RNG_IsEnabledCondReset(rng) == 1) { in configure_rng()
214 LL_RNG_Enable(rng); in configure_rng()
215 LL_RNG_EnableIT(rng); in configure_rng()
237 static int entropy_stm32_got_error(RNG_TypeDef *rng) in entropy_stm32_got_error() argument
239 __ASSERT_NO_MSG(rng != NULL); in entropy_stm32_got_error()
241 if (LL_RNG_IsActiveFlag_CECS(rng)) { in entropy_stm32_got_error()
245 if (LL_RNG_IsActiveFlag_SEIS(rng)) { in entropy_stm32_got_error()
254 static int recover_seed_error(RNG_TypeDef *rng) in recover_seed_error() argument
258 LL_RNG_EnableCondReset(rng); in recover_seed_error()
259 LL_RNG_DisableCondReset(rng); in recover_seed_error()
264 while (LL_RNG_IsEnabledCondReset(rng) || in recover_seed_error()
265 LL_RNG_IsActiveFlag_SEIS(rng) || in recover_seed_error()
266 LL_RNG_IsActiveFlag_SECS(rng)) { in recover_seed_error()
278 static int recover_seed_error(RNG_TypeDef *rng) in recover_seed_error() argument
280 LL_RNG_ClearFlag_SEIS(rng); in recover_seed_error()
283 LL_RNG_ReadRandData32(rng); in recover_seed_error()
286 if (LL_RNG_IsActiveFlag_SEIS(rng) != 0) { in recover_seed_error()
298 RNG_TypeDef *rng = entropy_stm32_rng_data.rng; in random_byte_get() local
306 __ASSERT(LL_RNG_IsActiveFlag_CECS(rng) == 0, in random_byte_get()
311 if (LL_RNG_IsActiveFlag_SEIS(rng) && (recover_seed_error(rng) < 0)) { in random_byte_get()
316 if ((LL_RNG_IsActiveFlag_DRDY(rng) == 1)) { in random_byte_get()
317 if (entropy_stm32_got_error(rng)) { in random_byte_get()
322 retval = LL_RNG_ReadRandData32(rng); in random_byte_get()
352 if (LL_RNG_IsActiveFlag_SECS(entropy_stm32_rng_data.rng) || in generate_from_isr()
353 LL_RNG_IsActiveFlag_SEIS(entropy_stm32_rng_data.rng)) { in generate_from_isr()
371 entropy_stm32_rng_data.rng) != 1) { in generate_from_isr()
733 LL_RNG_SetHealthConfig(dev_data->rng, DT_INST_PROP(0, health_test_magic)); in entropy_stm32_rng_pm_action()
735 if (LL_RNG_GetHealthConfig(dev_data->rng) != in entropy_stm32_rng_pm_action()