linux/drivers/char/hw_random
Andre Wolokita 1a5addfe82 hwrng: omap - Change RNG_CONFIG_REG to RNG_CONTROL_REG when checking and disabling TRNG
In omap4_rng_init(), a check of bit 10 of the RNG_CONFIG_REG is done to determine
whether the RNG is running. This is suspicious firstly due to the use of
RNG_CONTROL_ENABLE_TRNG_MASK and secondly because the same mask is written to
RNG_CONTROL_REG after configuration of the FROs. Similar suspicious logic is
repeated in omap4_rng_cleanup() when RNG_CONTROL_REG masked with
RNG_CONTROL_ENABLE_TRNG_MASK is read, the same mask bit is cleared, and then
written to RNG_CONFIG_REG. Unless the TRNG is enabled with one bit in RNG_CONTROL
and disabled with another in RNG_CONFIG and these bits are mirrored in some way,
I believe that the TRNG is not really shutting off.

Apart from the strange logic, I have reason to suspect that the OMAP4 related
code in this driver is driving an Inside Secure IP hardware RNG and strongly
suspect that bit 10 of RNG_CONFIG_REG is one of the bits configuring the
sampling rate of the FROs. This option is by default set to 0 and is not being
set anywhere in omap-rng.c. Reading this bit during omap4_rng_init() will
always return 0. It will remain 0 because ~(value of TRNG_MASK in control) will
always be 0, because the TRNG is never shut off. This is of course presuming
that the OMAP4 features the Inside Secure IP.

I'm interested in knowing what the guys at TI think about this, as only they
can confirm or deny the detailed structure of these registers.

Signed-off-by: Andre Wolokita <Andre.Wolokita@analog.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2015-03-17 22:32:04 +11:00
..
amd-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
atmel-rng.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
bcm63xx-rng.c hwrng: bcm63xx - make use of devm_hwrng_register 2015-03-16 21:45:54 +11:00
bcm2835-rng.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
core.c hwrng: add devm_* interfaces 2015-03-16 21:45:54 +11:00
exynos-rng.c hwrng: exynos - make use of devm_hwrng_register 2015-03-16 21:45:55 +11:00
geode-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
intel-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
iproc-rng200.c hwrng: iproc-rng200 - make use of devm_hwrng_register 2015-03-16 21:45:56 +11:00
ixp4xx-rng.c IXP4xx: HW pseudo-random generator is available on IXP45x/46x only. 2012-11-22 03:35:39 +00:00
Kconfig hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver 2015-03-06 22:51:34 +11:00
Makefile hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver 2015-03-06 22:51:34 +11:00
msm-rng.c hwrng: msm - make use of devm_hwrng_register 2015-03-16 21:45:55 +11:00
mxc-rnga.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
n2-asm.S sparc64: Add Niagara2 RNG driver. 2008-07-18 00:46:09 -07:00
n2-drv.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
n2rng.h n2rng: Attach on Niagara-T3. 2011-07-28 01:26:30 -07:00
nomadik-rng.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-04-03 09:28:16 -07:00
octeon-rng.c hwrng: octeon - remove incorrect __exit markups 2015-03-12 01:11:06 +11:00
omap3-rom-rng.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
omap-rng.c hwrng: omap - Change RNG_CONFIG_REG to RNG_CONTROL_REG when checking and disabling TRNG 2015-03-17 22:32:04 +11:00
pasemi-rng.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
powernv-rng.c hwrng: Add a driver for the hwrng found in power7+ systems 2013-10-11 16:50:20 +11:00
ppc4xx-rng.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
pseries-rng.c hwrng: pseries - remove incorrect __init/__exit markups 2015-03-12 01:11:06 +11:00
timeriomem-rng.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
tpm-rng.c hw_random: add support for the TPM chip as a hardware RNG source 2012-08-22 11:11:41 -05:00
tx4939-rng.c char: hw_random: drop owner assignment from platform_drivers 2014-10-20 16:20:20 +02:00
via-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
virtio-rng.c hwrng: virtio - drop extra empty line 2015-01-26 11:34:23 +11:00
xgene-rng.c hwrng: xgene - add ACPI support for APM X-Gene RNG unit 2015-03-09 21:06:19 +11:00