/* By default, the TRNG runs for 200 clocks per sample; 1200 clocks per sample generates better entropy.  */
static void kick_trng(int ent_delay, uint8_t sec_idx)
/* By default, the TRNG runs for 200 clocks per sample; 1200 clocks per sample generates better entropy.  */
static void kick_trng(int ent_delay, uint8_t sec_idx)
{
	ccsr_sec_t __iomem *sec = (ccsr_sec_t __iomem *)SEC_ADDR(sec_idx);
	struct rng4tst __iomem *rng =
			(struct rng4tst __iomem *)&sec->rng;
	u32 val;
	sec_setbits32(&rng->rtmctl, RTMCTL_PRGM);
	val = sec_in32(&rng->rtsdctl);
	val = (val & ~RTSDCTL_ENT_DLY_MASK) |
	      (ent_delay << RTSDCTL_ENT_DLY_SHIFT);
	sec_out32(&rng->rtsdctl, val);
	sec_out32(&rng->rtfreqmin, ent_delay >> 2);
	sec_out32(&rng->rtfreqmax, RTFRQMAX_DISABLE);
	sec_setbits32(&rng->rtmctl, RTMCTL_SAMP_MODE_RAW_ES_SC);
	sec_clrbits32(&rng->rtmctl, RTMCTL_PRGM);
}