We're using the Optiga SLB 9665 TPM with the TBOOT module on Linux. When TBOOT is initializing the NULL hierarchy by calling _tpm20_create_primary() on the TPM_RH_NULL handle, it can take anywhere from 10 to 40 seconds,
as shown in this log snippet:

TBOOT: tboot: supported alg count = 2
TBOOT: tboot: hash alg = 00000004
TBOOT: tboot: hash alg = 0000000B
TBOOT: TPM:CreatePrimary creating hierarchy handle = 40000007
(10 to 40 seconds elapse here)
TBOOT: TPM:CreatePrimary created object handle = 80000000
TBOOT: TPM attribute:
TBOOT: extend policy: 2
TBOOT: current alg id: 0x4
TBOOT: timeout values: A: 750, B: 2000, C: 75000, D: 750

I'm puzzled as to why the time this takes varies so widely. The longer times are killing us as we have some bootup time deadlines, and the unpredictability complicates things even more. Sometimes it's fast, sometimes it's slow.
There doesn't seem to be any pattern, nor is it influenced by whether the system is starting from a powered-off state or
just a warm reboot. I suspect it may have to do with the TPM trying to gather enough entropy to generate the random number that forms the seed for the NULL hierarchy although that's just a guess. Can anyone from inside
or outside Infineon comment on why the time is so variable?