1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/riscv_common: add puf_sram feature

This commit is contained in:
PeterKietzmann 2022-02-16 10:59:14 +01:00
parent 992e09b07b
commit 6215b7e630
5 changed files with 22 additions and 0 deletions

View File

@ -12,6 +12,7 @@ config CPU_ARCH_RISCV
select HAS_NEWLIB
select HAS_PERIPH_CORETIMER
select HAS_PICOLIBC if '$(RIOT_CI_BUILD)' != '1'
select HAS_PUF_SRAM
select HAS_RUST_TARGET
select HAS_SSP

View File

@ -8,6 +8,7 @@ FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += libstdcpp
FEATURES_PROVIDED += newlib
FEATURES_PROVIDED += periph_coretimer
FEATURES_PROVIDED += puf_sram
FEATURES_PROVIDED += rust_target
FEATURES_PROVIDED += ssp

View File

@ -37,6 +37,11 @@
#endif
/** @} */
/**
* @brief Attribute for memory sections required by SRAM PUF
*/
#define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".noinit")))
/**
* @brief Declare the heap_stats function as available
*/

View File

@ -21,6 +21,17 @@
#include "cpu_conf_common.h"
#include "periph_cpu_common.h"
#ifdef MODULE_PUF_SRAM
#include "puf_sram.h"
extern unsigned _sheap;
void riscv_puf_sram_init(void)
{
puf_sram_init((uint8_t *)&_sheap, SEED_RAM_LEN);
}
#endif /* MODULE_PUF_SRAM */
void riscv_fpu_init(void)
{
/* Enable FPU if present */

View File

@ -27,6 +27,10 @@ _start_real:
.option pop
la sp, _sp
#ifdef MODULE_PUF_SRAM
/* PUF */
call riscv_puf_sram_init
#endif
/* Load data section */
la a0, _data_lma