bootloader: Enable early boot RNG entropy source

This reverts commit ceb8566970.
This commit is contained in:
Angus Gratton
2017-01-04 15:36:04 +11:00
parent 83442526e0
commit 3922ce47b2
10 changed files with 569 additions and 30 deletions

View File

@@ -16,6 +16,30 @@
#include <stddef.h>
/**
* @brief Enable early entropy source for RNG
*
* Uses the SAR ADC to feed entropy into the HWRNG. The ADC is put
* into a test mode that reads the 1.1V internal reference source and
* feeds the LSB of data into the HWRNG.
*
* Can also be used from app code early during operation, if entropy
* is required before WiFi stack is initialised. Call this function
* from app code only if WiFi/BT are not yet enabled and I2S and SAR
* ADC are not in use.
*
* Call bootloader_random_disable() when done.
*/
void bootloader_random_enable(void);
/**
* @brief Disable early entropy source for RNG
*
* Disables SAR ADC source and resets the I2S hardware.
*
*/
void bootloader_random_disable(void);
/**
* @brief Fill buffer with 'length' random bytes
*