04-30-2020 08:03 AM - edited 05-05-2020 04:36 AM
I am trying to set up the tamper monitoring unit on an ZynqMP UltraScale+ device (XCZU5EV-2SFVC784I). I set up the temperature window in the system management wizard in Vivado according to following picture. I want that the system goes to secure lockdown 0 if the device temperature is not in the window defined (35-85°C).
Therefore, I also set the response in the Zynq UltraScale+ MPSoC block. The following picture shows my settings.
The generated bitstreams then is exported to petalinux, where I generate my boot image.
When my device is under 35°C I normally would expect, that it goes into secure lockdown, right after loading the FSBL. According to Figure 7-1 in the software development guide(https://www.xilinx.com/support/documentation/user_guides/ug1137-zynq-ultrascale-mpsoc-swdev.pdf) the tamper monitoring unit should be active right after loading the FSBL. Though the system boots into Linux where it gets stuck (see timestamps at 3.735681), until the chip reaches the 35°C, and continuous booting afterward. Right after logging into Linux I checked the temperature registers and got between 36 to 40 °C, which enforces my theory. To get the temperature I used the AMS driver and read `/sys/bus/iio/devices/iio:device0/in_temp0_ps_temp_raw` to get the ADC value and converted it with the equation 2-11 given in the sysmon user guide (https://www.xilinx.com/support/documentation/user_guides/ug580-ultrascale-sysmon.pdf). The log output of the cold boot described above is attached. If the system rebooted before cooling down the system boots as expected.
The other scenario I went through was cooling the device below 35 °C during runtime. I wrote a small program, which constantly prints the temperature to be sure I am under the 35 °C. In this case nothing happens. The system runs as before. I decreased the temperature until about 25 °C.
Further I tested the tamper unit with the tamper trigger register. By activating it in Linux using the sysfs the system goes straight to secure lockdown. Thus, I do not understand why it reacts different with a temperature alarm. Recently I successfully triggering a tamper event with the JTAG port.
What am I missing? Thanks for any suggestions and solutions.
I am using the latest software tools (version 2019.2).
05-17-2020 10:33 AM
Did you check the temperature values just after loading the FSBL? If not read the value after loading the FSBL before loading the Linux image and see if booting hangs for some time.
Another point to configure the temperature lower and upper values through the AMS registers and check.
We will discuss further steps depending up on the results, let me know for further queries on the above steps.
07-10-2020 01:06 AM - edited 07-10-2020 01:20 AM
Hi @abhinayp ,
Thank you for the answer. Finally I got time to look into it. As you suggested, I checked the AMS registers and saw, that the according temperature alarm registers are set to 0x0. See the appended file with the memory display of the whole AMS register. I am sure, that the bitstream is loaded before uboot starts (the regsiters where checked in uboot).
After checking the values I wanted to set the threshold values directly in the AMS registers and proceed with booting, to test if the device goes to secure lock down when I decrease the temperature. But following question arised, when I wanted to set the ALARM_TEMP_FPD_LOWER and the ALARM_TEMP_LPD_LOWER values. According to the Device Register Reference (https://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html) the 16 bit register is splitted in bit 15:1 for the temperature value and bit 0 for the threshold mode. Now the biggest number in this register I can enter is 2^15=32768. If I calculate this back to the maximum temperature I can enter with the formula 2-11 given in the sysmon user guide (https://www.xilinx.com/support/documentation/user_guides/ug580-ultrascale-sysmon.pdf), I get (32768*509.3140064/2^16)-280.23087870=-25.5738755°C. I am certain, that higher values are also possible, but actually I do not see how? Can you help me out?