From 3976a3e2f214c1be279e332ae34e3815a7e3ec67 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 10 Mar 2016 14:35:55 -0700 Subject: [PATCH] K64F RNGA register --- wolfcrypt/src/random.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index f407949d3..e889bf50b 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1160,7 +1160,13 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int i; /* turn on RNGA module */ - SIM_SCGC3 |= SIM_SCGC3_RNGA_MASK; + #if defined(SIM_SCGC3_RNGA_MASK) + SIM_SCGC3 |= SIM_SCGC3_RNGA_MASK; + #endif + #if defined(SIM_SCGC6_RNGA_MASK) + /* additionally needed for at least K64F */ + SIM_SCGC6 |= SIM_SCGC6_RNGA_MASK; + #endif /* set SLP bit to 0 - "RNGA is not in sleep mode" */ RNG_CR &= ~RNG_CR_SLP_MASK;