[PATCH 1/1] rng: detect RISC-V Zkr RNG device in bind method

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sun Nov 5 04:47:19 CET 2023


On 11/4/23 21:42, Simon Glass wrote:
> Hi Heinrich,
> 
> On Sat, 4 Nov 2023 at 06:51, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
>>
>> The existence of devices should be checked in the bind method and not in
>> the probe method. Adjust the RISC-V Zkr RNG driver accordingly.
>>
>> Use ENOENT (and not ENODEV) to signal that the device is not available.
>>
>> Fixes: ceec977ba1a9 ("rng: Provide a RNG based on the RISC-V Zkr ISA extension")
>> Reported-by: Andre Przywara <andre.przywara at arm.com>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>> ---
>>   drivers/rng/riscv_zkr_rng.c | 34 ++++++++++++++++++++++++++--------
>>   1 file changed, 26 insertions(+), 8 deletions(-)
> 
> This device should be in the DT, so you have some control over which
> RNG is used.

The device-tree provided by QEMU does not contain such a device as Zkr 
is an ISA extension and not a device. This device-tree is not under the 
control of the U-Boot project.

Best regards

Heinrich


More information about the U-Boot mailing list