Changes:
- lib/rand.c: add call to hw_rand() (depends on CONFIG_RAND_HW_ACCEL)
- include/common.h: add hw_rand() declaration.

Signed-off-by: Przemyslaw Marczak <p.marc...@samsung.com>
cc: Michael Walle <mich...@walle.cc>
cc: Tom Rini <tr...@ti.com>
---
 include/common.h |    3 +++
 lib/rand.c       |    4 ++++
 2 files changed, 7 insertions(+)

diff --git a/include/common.h b/include/common.h
index 96a45a6..58e2fbc 100644
--- a/include/common.h
+++ b/include/common.h
@@ -836,6 +836,9 @@ void srand(unsigned int seed);
 unsigned int rand(void);
 unsigned int rand_r(unsigned int *seedp);
 #endif
+#ifdef CONFIG_RAND_HW_ACCEL
+unsigned int hw_rand(void);
+#endif
 
 /* common/console.c */
 int    console_init_f(void);   /* Before relocation; uses the serial  stuff    
*/
diff --git a/lib/rand.c b/lib/rand.c
index 5c367e1..f534635 100644
--- a/lib/rand.c
+++ b/lib/rand.c
@@ -23,7 +23,11 @@ unsigned int rand_r(unsigned int *seedp)
 
 unsigned int rand(void)
 {
+#ifdef CONFIG_RAND_HW_ACCEL
+       return hw_rand();
+#else
        return rand_r(&y);
+#endif
 }
 
 void srand(unsigned int seed)
-- 
1.7.9.5

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to