Lines Matching refs:rng_base
130 vaddr_t rng_base = get_base(); in conceal_seed_error_cond_reset() local
133 uint32_t sr = io_read32(rng_base + RNG_SR); in conceal_seed_error_cond_reset()
137 io_setbits32(rng_base + RNG_CR, RNG_CR_CONDRST); in conceal_seed_error_cond_reset()
138 io_clrbits32(rng_base + RNG_CR, RNG_CR_CONDRST); in conceal_seed_error_cond_reset()
146 io_clrbits32(rng_base + RNG_SR, RNG_SR_SEIS); in conceal_seed_error_cond_reset()
153 if (io_read32(rng_base + RNG_CR) & RNG_CR_CONDRST) { in conceal_seed_error_cond_reset()
162 if (io_read32(rng_base + RNG_SR) & RNG_SR_SEIS) in conceal_seed_error_cond_reset()
166 if (io_read32(rng_base + RNG_SR) & RNG_SR_SECS) { in conceal_seed_error_cond_reset()
195 vaddr_t rng_base = get_base(); in conceal_seed_error_sw_reset() local
198 io_clrbits32(rng_base + RNG_SR, RNG_SR_SEIS); in conceal_seed_error_sw_reset()
201 (void)io_read32(rng_base + RNG_DR); in conceal_seed_error_sw_reset()
203 if (io_read32(rng_base + RNG_SR) & RNG_SR_SEIS) in conceal_seed_error_sw_reset()
215 static TEE_Result read_available(vaddr_t rng_base, uint8_t *out, size_t *size) in read_available() argument
222 if (dev->error_conceal || io_read32(rng_base + RNG_SR) & RNG_SR_SEIS) in read_available()
225 if (!(io_read32(rng_base + RNG_SR) & RNG_SR_DRDY)) { in read_available()
230 if (io_read32(rng_base + RNG_SR) & RNG_SR_SEIS) { in read_available()
244 if (!(io_read32(rng_base + RNG_SR) & RNG_SR_DRDY)) in read_available()
246 data32 = io_read32(rng_base + RNG_DR); in read_available()
308 vaddr_t rng_base = get_base(); in stm32_rng_init() local
332 io_write32(rng_base + RNG_SR, 0); in stm32_rng_init()
342 stm32_rng->rng_config = io_read32(rng_base + RNG_CR) & in stm32_rng_init()
351 io_clrsetbits32(rng_base + RNG_CR, RNG_CONFIG_MASK, in stm32_rng_init()
361 io_write32(rng_base + RNG_NSCR, in stm32_rng_init()
365 io_write32(rng_base + RNG_HTCR, in stm32_rng_init()
368 io_clrsetbits32(rng_base + RNG_CR, RNG_CR_CONDRST, in stm32_rng_init()
371 if (IO_READ32_POLL_TIMEOUT(rng_base + RNG_CR, value, in stm32_rng_init()
377 io_read32(rng_base + RNG_CR)); in stm32_rng_init()
379 io_read32(rng_base + RNG_NSCR)); in stm32_rng_init()
381 io_read32(rng_base + RNG_HTCR)); in stm32_rng_init()
383 io_setbits32(rng_base + RNG_CR, RNG_CR_RNGEN | cr_ced_mask); in stm32_rng_init()
386 if (IO_READ32_POLL_TIMEOUT(rng_base + RNG_SR, value, in stm32_rng_init()
406 vaddr_t rng_base = 0; in stm32_rng_read() local
418 rng_base = get_base(); in stm32_rng_read()
430 rc = read_available(rng_base, out_ptr, &sz); in stm32_rng_read()
530 vaddr_t rng_base = get_base(); in stm32_rng_pm_suspend() local
532 stm32_rng->pm_cr = io_read32(rng_base + RNG_CR); in stm32_rng_pm_suspend()
535 stm32_rng->pm_health = io_read32(rng_base + RNG_HTCR); in stm32_rng_pm_suspend()
536 stm32_rng->pm_noise_ctrl = io_read32(rng_base + RNG_NSCR); in stm32_rng_pm_suspend()
546 io_setbits32(rng_base + RNG_CR, RNG_CR_POWER_OPTIM | in stm32_rng_pm_suspend()
548 io_clrbits32(rng_base + RNG_CR, RNG_CR_CONDRST); in stm32_rng_pm_suspend()
551 while (io_read32(rng_base + RNG_CR) & RNG_CR_CONDRST) in stm32_rng_pm_suspend()
554 if (io_read32(rng_base + RNG_CR) & RNG_CR_CONDRST) in stm32_rng_pm_suspend()
557 io_clrbits32(rng_base + RNG_CR, RNG_CR_RNGEN); in stm32_rng_pm_suspend()