aspeed_scu: Implement RNG register
commitacd9575e59da1bfc21a1feccb00c5dddd45328f7
authorJoel Stanley <joel@jms.id.au>
Fri, 15 Jun 2018 13:57:15 +0000 (15 14:57 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Jun 2018 14:23:34 +0000 (15 15:23 +0100)
tree38d5dfee59be8fcecd839cb8b85c7c55dc46680b
parent29b80469dc51ae4064e9ef9223967882d2610523
aspeed_scu: Implement RNG register

The ASPEED SoCs contain a single register that returns random data when
read. This models that register so that guests can use it.

The random number data register has a corresponding control register,
however it returns data regardless of the state of the enabled bit, so
the model follows this behaviour.

When the qcrypto call fails we exit as the guest uses the random number
device to feed it's entropy pool, which is used for cryptographic
purposes.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Message-id: 20180613114836.9265-1-joel@jms.id.au
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/aspeed_scu.c