| | 1032 | 1. Note, do not attempt to read R10 interrupt status register directly with i2c commands. The Linux Gateworks GSC driver is servicing the interrupt immediately and clearing the pending bits before a manual read occurs. |
| | 1033 | |
| | 1034 | To see interrupts, for example, you can use the command: |
| | 1035 | {{{ |
| | 1036 | cat /proc/interrupts |
| | 1037 | }}} |
| | 1038 | |
| | 1039 | Examine the tamper in the output below increase every time you release the grounding (below example shows a tamper event 10 times): |
| | 1040 | {{{ |
| | 1041 | root@noble-venice:~# cat /proc/interrupts | grep gsc |
| | 1042 | 65: 10 0 0 0 gpio-mxc 6 Level gateworks-gsc |
| | 1043 | 194: 0 0 0 0 gateworks-gsc 4 Edge 0-0023 |
| | 1044 | 212: 0 0 0 0 gateworks-gsc 0 Edge user_pb1x |
| | 1045 | 213: 10 0 0 0 gateworks-gsc 1 Edge key_erased |
| | 1046 | 214: 0 0 0 0 gateworks-gsc 2 Edge eeprom_wp |
| | 1047 | 215: 10 0 0 0 gateworks-gsc 5 Edge tamper |
| | 1048 | 216: 0 0 0 0 gateworks-gsc 7 Edge switch_hold |
| | 1049 | Root@noble-venice:~# |
| | 1050 | }}} |
| | 1051 | |
| | 1052 | To verify if the tamper is working, check to see if the secure key in the EEPROM is being erased. |
| | 1053 | |
| | 1054 | Write something fake to the secure eeprom area: |
| | 1055 | {{{ |
| | 1056 | i2cset -f -y 0 0x51 0x80 0xaa |
| | 1057 | }}} |
| | 1058 | |
| | 1059 | Then run your tamper exercise and do a i2cget and you will see it was erased to 0xff: |
| | 1060 | {{{ |
| | 1061 | i2cget -f -y 0 0x51 0x80 |
| | 1062 | }}} |
| | 1063 | |
| | 1064 | Another useful tool is to use evtest to see the tamper happening, as shown in the below example: |
| | 1065 | |
| | 1066 | * Ground tamper pin for a couple of seconds to arm it then release and verify you see BTN_4 assert/deassert indicating a tamper event and BTN_2 assert/deassert indicating a secure key erase event |
| | 1067 | |
| | 1068 | {{{ |
| | 1069 | ~# evtest /dev/input/event0 |
| | 1070 | Input driver version is 1.0.1 |
| | 1071 | Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100 |
| | 1072 | Input device name: "gpio-keys" |
| | 1073 | Supported events: |
| | 1074 | Event type 0 (EV_SYN) |
| | 1075 | Event type 1 (EV_KEY) |
| | 1076 | Event code 256 (BTN_0) |
| | 1077 | Event code 257 (BTN_1) |
| | 1078 | Event code 258 (BTN_2) |
| | 1079 | Event code 259 (BTN_3) |
| | 1080 | Event code 260 (BTN_4) |
| | 1081 | Event code 261 (BTN_5) |
| | 1082 | Properties: |
| | 1083 | Testing ... (interrupt to exit) |
| | 1084 | Event: time 1657317863.042611, type 1 (EV_KEY), code 258 (BTN_2), value 1 |
| | 1085 | Event: time 1657317863.042611, -------------- SYN_REPORT ------------ |
| | 1086 | Event: time 1657317863.042631, type 1 (EV_KEY), code 260 (BTN_4), value 1 |
| | 1087 | Event: time 1657317863.042631, -------------- SYN_REPORT ------------ |
| | 1088 | Event: time 1657317863.053418, type 1 (EV_KEY), code 260 (BTN_4), value 0 |
| | 1089 | Event: time 1657317863.053418, -------------- SYN_REPORT ------------ |
| | 1090 | Event: time 1657317863.053426, type 1 (EV_KEY), code 258 (BTN_2), value 0 |
| | 1091 | Event: time 1657317863.053426, -------------- SYN_REPORT ------------ |
| | 1092 | }}} |