Re: [PATCH 1/2] hwrng: Add support for ASPEED RNG

From: Andrew Jeffery
Date: Sun Feb 02 2020 - 23:07:45 EST


On Wed, 29 Jan 2020, at 10:56, linux@xxxxxxxxxxxxxxx wrote:
> On 2020-01-27 18:53, Andrew Jeffery wrote:
> > Not that I've looked, but is it feasible to augment timeriomem-rng with
> > the ability to configure the RNG rather than implement a new driver?
> > Why
> > didn't you go that route?
> >
>
> I decided to wrote the Aspeed-RNG driver because was under the
> impression that the community would prefer dedicated drivers over
> generic ones for these SOCs.

I think we should leverage existing work where we can. Lets not make
more extra for ourselves :)

> However, enhancing timeriomem-rng module
> is not hard at all. As I matter of fact, I'm currently testing changes
> to timeriomem-rng and so far so good. If you would like to have a quick
> look to my changes, I just pushed patches to the same repo a couple of
> hours ago:
> https://github.com/operezmuena/aspeed-rng-testing/tree/master/patches

I think this is a good approach so long as we can create a clean interface
to the control MMIO(s) inside the driver, i.e. we shouldn't be baking any
Aspeed-specific information into generic sections of code. Usually this
means sticking a pointer to an ops struct in the data member of the
matching OF ID struct.

Input from the RNG maintainers will be helpful here.

Andrew