Hello,
I am using a P2041 QorIQ RDB board, and testing secure boot and tamper functionality on it. I am intending to simulate the tamper detection on this RDB board using the Switch 3.6 present on it. I could see the tamper evidence on U-boot, by accessing the register FE314018, wherethe value changes to 00000008 when a tamper occurs. I am intending to access this register using a module inserted in to the kernel, and activate tamper enable/disable selection from the linux prompt. As a newbie to kernel programming, I have tried to access the register as such using offset as given in the reference manual. I am getting a segmentation fault. Are there any macros available that can be used for accesing the security monitor registers in P2041 board? If yes, where might I find the details of them?
Thank you,
The "offset as given in the reference manual" is not the same as an effective address that you can dereference. In a Linux driver you need to use ioremap() to map a physical address to an effective address -- or better, use of_iomap() to map a resource from the device tree.