[PATCH v6 3/7] tpm: Add the RNG child device
Ilias Apalodimas
ilias.apalodimas at linaro.org
Fri Jul 8 10:23:56 CEST 2022
Hi Simon,
[...]
> > +
> > UCLASS_DRIVER(tpm) = {
> > - .id = UCLASS_TPM,
> > - .name = "tpm",
> > - .flags = DM_UC_FLAG_SEQ_ALIAS,
> > + .id = UCLASS_TPM,
> > + .name = "tpm",
> > + .flags = DM_UC_FLAG_SEQ_ALIAS,
> > #if CONFIG_IS_ENABLED(OF_REAL)
> > - .post_bind = dm_scan_fdt_dev,
> > + .post_bind = dm_scan_fdt_dev,
> > #endif
> > + .post_probe = tpm_uclass_post_probe,
> > .per_device_auto = sizeof(struct tpm_chip_priv),
> > };
> > --
> > 2.25.1
> >
>
> The driver needs a compatible string so it can be in the device tree.
Why? I've tried to hint this on the previous iteration of the patch.
The RNG here is not a *device*. The TPM is the device and you are
guaranteed to have an RNG. The way to get a random number is send a
special command to the TPM. So all that we should do here is leverage
the fact that the TPM is already in the device tree.
And fwiw we should stick to try to stick to what the DT spec defines
as much as possible. I personally don't see this as a special usecase
were deviating from the spec is justified.
Regards
/Ilias
>
> Regards,
> Simon
More information about the U-Boot
mailing list