On 4 April 2017 at 14:44, Krzysztof Kozlowski <k...@kernel.org> wrote: > On Tue, Apr 04, 2017 at 01:09:08PM +0100, Peter Maydell wrote: >> On 18 March 2017 at 19:25, Krzysztof Kozlowski <k...@kernel.org> wrote: >> > Add emulation for Exynos4210 Pseudo Random Number Generator which could >> > work on fixed seeds or with seeds provided by True Random Number >> > Generator block inside the SoC. >> > >> > Implement only the fixed seeds part of it in polling mode (no >> > interrupts). Simple testing: >> > # echo "exynos" > /sys/class/misc/hw_random/rng_current >> > # dd if=/dev/hwrng of=/dev/null bs=1 count=16 >> > >> > Signed-off-by: Krzysztof Kozlowski <k...@kernel.org> >> > >> > --- >> > >> > Changes since v1: >> > 1. Use GRand-like functions to fix build on MingW32 (this adds also >> > finalize). >> > 2. Add DPRINTF macro. >> > 3. Use HWADDR_PRIx and family for printing values. >> >> Is there a data sheet that describes this RNG? I had a quick google >> but couldn't find anything in the 4210 manual you can get from Samsung. > > Official and public datasheet - I never heard about it... AFAIK, Samsung > never released any datasheet... But recently I found a copy of > Exynos4412 datasheet published on FriendlyArm website: > http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T1 > (at the bottom in "Resources"). > > Some blocks in Exynos4412, including the RNG, are the same as in > Exynos4210. However, you should not expect too much data about the RNG > in the datasheet... > >> In particular I'm not sure we want to use GRand here. > > Now, I am not sure neither. :)
The last RNG we added was hw/misc/bcm2835_rng.c, which uses qcrypto_random_bytes() to get cryptographically-random bytes from the host. On the other hand it sounds like this Exynos hardware is a PRNG without true-random input... > During the discussions about new kernel driver, I found that this RNG > module (at least on Exynos4412 board) requires seeding but it is not > following the Pseudo RNG behavior - seeding with the same value produces > different results. This means that GRand would not be needed here. That's rather odd. You're right that the datasheet is hopelessly uninformative about what's actually going on. thanks -- PMM