summaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-10-18 13:16:06 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-11-26 11:09:25 +0100
commit50190edb2a56bb9efa3e2f8ca32482dbd3e42412 (patch)
treea5d181e2ff31b23c1af38e1f85982ba6b86fec11 /arch/m68k
parent017cecee99d897ae426f3948e7b970eb4f95e1f4 (diff)
m68k/amiga: Provide mach_random_get_entropy()
Use the beam position registers, which provide at least 17 bits of data changing at 1.79 MHz. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/amiga/config.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 06920e85fac..c425fa6c279 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -360,6 +360,14 @@ static void __init amiga_identify(void)
#undef AMIGAHW_ANNOUNCE
}
+
+static unsigned long amiga_random_get_entropy(void)
+{
+ /* VPOSR/VHPOSR provide at least 17 bits of data changing at 1.79 MHz */
+ return *(unsigned long *)&amiga_custom.vposr;
+}
+
+
/*
* Setup the Amiga configuration info
*/
@@ -397,6 +405,8 @@ void __init config_amiga(void)
mach_heartbeat = amiga_heartbeat;
#endif
+ mach_random_get_entropy = amiga_random_get_entropy;
+
/* Fill in the clock value (based on the 700 kHz E-Clock) */
amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */