1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 23:41:18 +01:00

cpu/arm7_common: hook up puf_sram

puf_sram only relies on an uninitialized chunk of memory.
This means to enable it we just have to hook up puf_sram_init().

All memory after __bss_end should be uninitialized at startup, so
just use that.
This commit is contained in:
Benjamin Valentin 2019-11-25 01:34:38 +01:00
parent ce1f383f90
commit 8337ab111e
3 changed files with 15 additions and 0 deletions

View File

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

View File

@ -20,6 +20,9 @@
#include <stdio.h>
#include <stdlib.h>
#include "thread.h"
#ifdef MODULE_PUF_SRAM
#include "puf_sram.h"
#endif
#include "log.h"
@ -63,6 +66,12 @@ void bootloader(void)
/* initialize bss and 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_init();

View File

@ -71,6 +71,11 @@ extern "C" {
#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
}
#endif