CAAM failed to instantiate RNG based on Temperature

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAAM failed to instantiate RNG based on Temperature

1,305 Views
gonzalo_ruiz
Contributor II

Hello,

I am facing an issue with a i.MX6UL based module where, after closing the devices and booting Linux (kernel v4.9.81) there is a range of temperature where the CAAM iterates, increasing the entropy delay sequentially in order to initialize the State Handlers but failing eventually, making the CAAM unusable until we reset the device outside of this temperature range, which is Room temperature around 31-32º Celsius.

Can you tell us how can there be correlation between the CAAM initialization and the Temperature of the device and what can we do to avoid this issue?

Following you can see how the correct CAAM initialization looks like:

caam 2140000.caam: ERA source: CCBVID.
caam 2140000.caam: Deinstantiated RNG4 SH0
caam 2140000.caam: Deinstantiated RNG4 SH1
caam 2140000.caam: Entropy delay = 3200
caam 2140000.caam: Instantiated RNG4 SH0
caam 2140000.caam: Instantiated RNG4 SH1
caam 2140000.caam: device ID = 0x0a16030000000000 (Era 8)
caam 2140000.caam: job rings = 3, qi = 0
caam algorithms registered in /proc/crypto
caam_jr 2141000.jr0: registering rng-caam
random: crng init done
caam 2140000.caam: caam pkc algorithms registered in /proc/crypto
snvs-secvio 20cc000.caam-snvs: can't get snvs clock
snvs-secvio 20cc000.caam-snvs: violation handlers armed - trusted state
caam_keyblob caam-keyblob: caam keyblob initialize

And this is what we are experiencing:

caam 2140000.caam: ERA source: CCBVID.
caam 2140000.caam: Deinstantiated RNG4 SH0
caam 2140000.caam: Deinstantiated RNG4 SH1
caam 2140000.caam: Entropy delay = 3200
caam 2140000.caam: Instantiated RNG4 SH0
caam 2140000.caam: Entropy delay = 3600
caam 2140000.caam: Entropy delay = 4000
caam 2140000.caam: Entropy delay = 4400
caam 2140000.caam: Entropy delay = 4800
caam 2140000.caam: Entropy delay = 5200
caam 2140000.caam: Entropy delay = 5600
caam 2140000.caam: Entropy delay = 6000
caam 2140000.caam: Entropy delay = 6400
caam 2140000.caam: Entropy delay = 6800
caam 2140000.caam: Entropy delay = 7200
caam 2140000.caam: Entropy delay = 7600
caam 2140000.caam: Entropy delay = 8000
caam 2140000.caam: Entropy delay = 8400
caam 2140000.caam: Entropy delay = 8800
caam 2140000.caam: Entropy delay = 9200
caam 2140000.caam: Entropy delay = 9600
caam 2140000.caam: Entropy delay = 10000
caam 2140000.caam: Entropy delay = 10400
caam 2140000.caam: Entropy delay = 10800
caam 2140000.caam: Entropy delay = 11200
caam 2140000.caam: Entropy delay = 11600
caam 2140000.caam: Entropy delay = 12000
caam 2140000.caam: Entropy delay = 12400
caam 2140000.caam: failed to instantiate RNG
caam: probe of 2140000.caam failed with error -11
snvs-secvio 20cc000.caam-snvs: can't get snvs clock
snvs-secvio 20cc000.caam-snvs: violation handlers armed - trusted state
caam_keyblob caam-keyblob: caam keyblob initialized

 

Thanks

Gonzalo

Labels (1)
Tags (1)
0 Kudos
3 Replies

1,275 Views
Yuri
NXP Employee
NXP Employee

@gonzalo_ruiz 
Hello,

  please check if the RNG is not init-ed in U-boot.

Regards,
Yuri.

0 Kudos

1,258 Views
gonzalo_ruiz
Contributor II

@Yuri,

I checked and I saw that RNG SH0 is initialized in U-Boot.

Then in the kernel driver 'caam_probe', I deinstantiate SH0 and immediately afterwards I initialize both SH0 and SH1. The problem is that SH1 fails initialization on a limited range of temperature.

How can that be possible?

Also, after SH0 has been correctly initialized I read RDSTA register and IF0 field is '1'. When I fail to instantiate SH1 after that, I read RDSTA and both IF1 and IF0 fields are '0'. Isn't SH0 correctly initialized anymore? What should I do with it?

Is there a flag in any registers that I can check to know when is it safe to instantiate the SH?

Regards,
Gonzalo

0 Kudos

1,269 Views
gonzalo_ruiz
Contributor II

Hello @Yuri ,

I added the following section to the CSF when I signed the U-Boot file:

[Unlock]
    Engine = CAAM
    Features = RNG

Can you tell me a way to verify the RNG is working in U-Boot?

Also, note that this is working most of the time, it is just a little range of temperature that makes the CAAM fail to initialize. How could this be related to the temperature?

Thanks,
Gonzalo

0 Kudos