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:
parent
ce1f383f90
commit
8337ab111e
@ -3,3 +3,4 @@ FEATURES_PROVIDED += arch_arm
|
||||
FEATURES_PROVIDED += arch_arm7
|
||||
FEATURES_PROVIDED += cpp
|
||||
FEATURES_PROVIDED += periph_pm
|
||||
FEATURES_PROVIDED += puf_sram
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user