From f477f1ce04faf5ea7b3fcf0195ac26f2a9e02551 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 29 Sep 2012 20:34:25 +0000 Subject: [PATCH] Implementation of /dev/random using the STM32 Random Number Generator (RNG) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5207 42af7a65-404d-4744-a932-0658087f49c3 --- configs/stm3240g-eval/README.txt | 11 ++++++++++- configs/stm3240g-eval/nsh/defconfig | 4 ++-- configs/stm3240g-eval/src/Makefile | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/configs/stm3240g-eval/README.txt b/configs/stm3240g-eval/README.txt index df98f087d5..b536097a88 100644 --- a/configs/stm3240g-eval/README.txt +++ b/configs/stm3240g-eval/README.txt @@ -1110,7 +1110,16 @@ Where is one of the following: nsh> umount /mnt/stuff - 11. This configuration requires that jumper JP22 be set to enable RS-232 + 11. By default, this configuration supports /dev/random using the STM32's + RNG hardware. This can be disabled as follows: + + -CONFIG_STM32_RNG=y + +CONFIG_STM32_RNG=n + + -CONFIG_DEV_RANDOM=y + +CONFIG_DEV_RANDOM=n + + 12. This configuration requires that jumper JP22 be set to enable RS-232 operation. nsh2: diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index 80f5ec167c..653538b45a 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -69,7 +69,6 @@ CONFIG_STM32_BUILDROOT=n # # JTAG Enable settings (by default JTAG-DP and SW-DP are disabled): # -CONFIG_STM32_DFU=y CONFIG_STM32_JTAG_FULL_ENABLE=y CONFIG_STM32_JTAG_NOJNTRST_ENABLE=n CONFIG_STM32_JTAG_SW_ENABLE=n @@ -100,7 +99,7 @@ CONFIG_STM32_OTGHS=n CONFIG_STM32_DCMI=n CONFIG_STM32_CRYP=n CONFIG_STM32_HASH=n -CONFIG_STM32_RNG=n +CONFIG_STM32_RNG=y CONFIG_STM32_OTGFS=n # AHB3: CONFIG_STM32_FSMC=n @@ -306,6 +305,7 @@ CONFIG_SCHED_WORKSTACKSIZE=2048 CONFIG_SIG_SIGWORK=4 CONFIG_SCHED_WAITPID=y CONFIG_SCHED_ATEXIT=n +CONFIG_DEV_RANDOM=y # # System Logging diff --git a/configs/stm3240g-eval/src/Makefile b/configs/stm3240g-eval/src/Makefile index 80225ea1fb..ffcf719aba 100644 --- a/configs/stm3240g-eval/src/Makefile +++ b/configs/stm3240g-eval/src/Makefile @@ -100,8 +100,8 @@ OBJS = $(AOBJS) $(COBJS) ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src ifeq ($(WINTOOL),y) CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" + -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" else CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m endif