How to test tamper detection on imx6sx platform

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

How to test tamper detection on imx6sx platform

601 Views
kevi49
Contributor II

I am working on the tamper detection feature and following is the changes done in "imx6sx.dtsi" file to enable tamper feature.

snvs: snvs@020cc000 {
compatible = "fsl,sec-v4.0-mon", "syscon", "simple-mfd";
reg = <0x020cc000 0x4000>;
status = "okay";

snvs_rtc: snvs-rtc-lp {
compatible = "fsl,sec-v4.0-mon-rtc-lp";
regmap = <&snvs>;
offset = <0x34>;
interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
status = "okay";
};

snvs_poweroff: snvs-poweroff {
compatible = "syscon-poweroff";
regmap = <&snvs>;
offset = <0x38>;
value = <0x61>;
mask = <0x61>;
status = "okay";
};

snvs_pwrkey: snvs-powerkey {
compatible = "fsl,sec-v4.0-pwrkey";
regmap = <&snvs>;
interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
linux,keycode = <KEY_POWER>;
wakeup-source;
status = "okay";
};
};

Also RTC is enabled successfully, after disconnecting board from main power supply SNVS_LP is taking power from the coin cell.

Getting following logs in the dmesg

dmesg| grep -i "snvs"
[ 2.364479] input: 20cc000.snvs:snvs-powerkey as /devices/soc0/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 2.386428] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[ 4.318644] caam-snvs 20cc000.caam-snvs: can't get snvs clock
[ 4.324477] caam-snvs 20cc000.caam-snvs: Unhandled Security Violation Interrupt 5 = External Tamper Detect
[ 4.334230] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state
[ 5.440229] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 2022-05-30 09:46:20 UTC (1653903980)
[ 16.179486] evbug: Connected device: input0 (20cc000.snvs:snvs-powerkey at snvs-pwrkey/input0)

 

dmesg| grep -i "caam"
[ 2.727280] caam 2100000.caam: ERA source: CAAMVID.
[ 2.734196] caam 2100000.caam: device ID = 0x0a16010000000200 (Era 4)
[ 2.740736] caam 2100000.caam: job rings = 2, qi = 0, dpaa2 = no
[ 2.762607] caam_jr 2101000.jr0: Entropy delay = 3200
[ 2.889266] caam_jr 2101000.jr0: Entropy delay = 3600
[ 3.031175] caam_jr 2101000.jr0: Entropy delay = 4000
[ 3.188154] caam_jr 2101000.jr0: Entropy delay = 4400
[ 3.360251] caam_jr 2101000.jr0: Instantiated RNG4 SH0.
[ 3.443741] caam_jr 2101000.jr0: Instantiated RNG4 SH1.
[ 3.456882] caam algorithms registered in /proc/crypto
[ 3.466603] caam_jr 2101000.jr0: registering rng-caam
[ 3.473288] platform caam_sm: blkkey_ex: 8 keystore units available

[ 4.318644] caam-snvs 20cc000.caam-snvs: can't get snvs clock
[ 4.324477] caam-snvs 20cc000.caam-snvs: Unhandled Security Violation Interrupt 5 = External Tamper Detect
[ 4.334230] caam-snvs 20cc000.caam-snvs: violation handlers armed - non-secure state

 

Now, here I have few questions.

1) Does SNVS tamper detection feature successfully enabled?

2) SNVS_TAMPER pin have connected the switch to trigger it, But after pressing it nothing is happening(How to verify after pressing this switch tamper is working fine)

3) What is the way to verify end to end tamper feature is working fine? 

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

578 Views
kevi49
Contributor II

@Yuri 

 

It would be great if you can check my queries and provide resolution.

0 Kudos