Merge pull request #12800 from benpicco/arm7-puf_sram

cpu/arm7_common: hook up puf_sram
This commit is contained in:
Marian Buschsieweke 2019-11-25 11:10:55 +01:00 committed by GitHub
commit 20ce384f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 1 deletions

View File

@ -3,3 +3,4 @@ FEATURES_PROVIDED += arch_arm
FEATURES_PROVIDED += arch_arm7 FEATURES_PROVIDED += arch_arm7
FEATURES_PROVIDED += cpp FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_pm FEATURES_PROVIDED += periph_pm
FEATURES_PROVIDED += puf_sram

View File

@ -20,6 +20,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "thread.h" #include "thread.h"
#ifdef MODULE_PUF_SRAM
#include "puf_sram.h"
#endif
#include "log.h" #include "log.h"
@ -63,6 +66,12 @@ void bootloader(void)
/* initialize bss and data */ /* initialize bss and data */
_init_data(); _init_data();
#ifdef MODULE_PUF_SRAM
/* uninitialized heap starts after bss section */
extern unsigned int __bss_end;
puf_sram_init((uint8_t *) __bss_end, SEED_RAM_LEN);
#endif
/* cpu specific setup of clocks, peripherals */ /* cpu specific setup of clocks, peripherals */
cpu_init(); cpu_init();

View File

@ -71,6 +71,11 @@ extern "C" {
#define CC_CONF_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define CC_CONF_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
/** @} */ /** @} */
/**
* @brief Attribute for memory sections required by SRAM PUF
*/
#define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".noinit")))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -25,7 +25,7 @@ int main(void)
{ {
puts("Start: Test random number generator"); puts("Start: Test random number generator");
printf("Success: Data for puf_sram_seed: [0x%08" PRIX32 "]", puf_sram_seed); printf("Success: Data for puf_sram_seed: [0x%08" PRIX32 "]\n", puf_sram_seed);
puts("End: Test finished"); puts("End: Test finished");
return 0; return 0;