cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257F-EV1 Tamper logging in Linux userspace

rossU
Associate II

I'm trying to somehow pass information about tampering event from OP-TEE to Linux userspace by means of Tamper Backup registers but I seem to have a problem.

I added this to kernel dts:

&nvram {
	my_free_backup_register: tamp-bkp@c4 {
		reg = <0xC4 0x4>;
	};
};

&usart2 {
    // Other stuff before nvmem
	nvmem-cells = <&my_free_backup_register>;
	nvmem-cell-names = "my_backup_register"; 
};

I tried to write to that register from OP-TEE function stm32_tamp_etamper_action using io_write32 function. Then I'm trying to read that register from OP-TEE immediately after the write and looks like the register has not been written to.

Also, in Linux userspace in /sys/bus/nvmem/devices/ I can see stm32-tamp-nvram0 but when I hexdump its nvmem file it's just a bunch of zeroes. I can't seem to find that nvmem-cells in usart2 either.

0 REPLIES 0