From 12aeca6d4dfb76d8c1087f6fdf5a7f8e7aff0a45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Fri, 9 Jan 2015 11:49:49 +0100 Subject: [PATCH] karo: tx28: improve random init code --- board/karo/tx28/tx28.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/board/karo/tx28/tx28.c b/board/karo/tx28/tx28.c index c64755ecb6..cf64c5392f 100644 --- a/board/karo/tx28/tx28.c +++ b/board/karo/tx28/tx28.c @@ -109,9 +109,11 @@ static inline void random_init(void) int i; for (i = 0; i < MAX_LOOPS; i++) { - unsigned int usec = readl(&digctl_regs->hw_digctl_microseconds); + u32 hclk = readl(&digctl_regs->hw_digctl_hclkcount); + u32 entropy = readl(&digctl_regs->hw_digctl_entropy); + u32 usec = readl(&digctl_regs->hw_digctl_microseconds); - seed = get_timer(usec + random + seed); + seed = get_timer(hclk ^ entropy ^ usec ^ random ^ seed); srand(seed); random = rand(); } -- 2.39.2