Lines Matching refs:rng
82 vaddr_t rng = (vaddr_t)phys_to_virt(RNG_BASE, MEM_AREA_IO_SEC, in hw_get_random_byte() local
91 while (!(io_read32(rng + RNG_STATUS) & RNG_READY)) { in hw_get_random_byte()
93 if (io_read32(rng + RNG_STATUS) & SHUTDOWN_OFLO) { in hw_get_random_byte()
94 uint32_t alarm = io_read32(rng + RNG_ALARMSTOP); in hw_get_random_byte()
95 uint32_t tune = io_read32(rng + RNG_FRODETUNE); in hw_get_random_byte()
98 io_write32(rng + RNG_ALARMMASK, 0x0); in hw_get_random_byte()
99 io_write32(rng + RNG_ALARMSTOP, 0x0); in hw_get_random_byte()
101 io_write32(rng + RNG_FRODETUNE, tune ^ alarm); in hw_get_random_byte()
103 io_write32(rng + RNG_FROENABLE, RNG_FRO_MASK); in hw_get_random_byte()
105 io_write32(rng + RNG_INTACK, SHUTDOWN_OFLO); in hw_get_random_byte()
111 random.val[0] = io_read32(rng + RNG_OUTPUT_L); in hw_get_random_byte()
112 random.val[1] = io_read32(rng + RNG_OUTPUT_H); in hw_get_random_byte()
114 io_write32(rng + RNG_INTACK, RNG_READY); in hw_get_random_byte()
129 vaddr_t rng = (vaddr_t)phys_to_virt(RNG_BASE, MEM_AREA_IO_SEC, in dra7_rng_init() local
134 io_write32(rng + RNG_SOFT_RESET_REG, RNG_SOFT_RESET); in dra7_rng_init()
137 while (io_read32(rng + RNG_SOFT_RESET_REG) & RNG_SOFT_RESET) in dra7_rng_init()
141 io_write32(rng + RNG_SYS_CONFIG_REG, RNG_AUTOIDLE); in dra7_rng_init()
154 io_write32(rng + RNG_CONFIG, val); in dra7_rng_init()
157 io_write32(rng + RNG_FRODETUNE, 0x0); in dra7_rng_init()
160 io_write32(rng + RNG_FROENABLE, 0xffffff); in dra7_rng_init()
174 io_write32(rng + RNG_ALARMCNT, val); in dra7_rng_init()
179 io_write32(rng + RNG_CONTROL, val); in dra7_rng_init()