Changes between Version 140 and Version 141 of gsc


Ignore:
Timestamp:
11/30/2026 08:20:55 PM (3 days ago)
Author:
Ryan Erb
Comment:

add more info to tamper section for testing

Legend:

Unmodified
Added
Removed
Modified
  • gsc

    v140 v141  
    10271027For these boards you can enable the GSC's ''Tamper Detect'' feature by setting [#gsc_ctrl_0 TAMPER_DETECT (R0.5)] and the accompanying interrupt enable register bit [#gsc_interrupt_enable IRQ_TAMPER_DETECT (R11.5)]. Once these bits are set any tamper event produced by a switch opening and the signal not conducting to board ground will do the following:
    10281028 1. Set [#gsc_interrupt_status IRQ_TAMPER_DETECT (R10.5)] interrupt status bit
     1029  1. By setting this, the driver will automatically enable tamper interrupts via R11. R11 should not be adjusted manually.
    10291030 2. Erase the '''Secure Key''' EEPROM section
    10301031 3. Produce a GSC interrupt if board is powered (see [#gsc-interrupts gsc-interrupts])
     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
     1034To see interrupts, for example, you can use the command:
     1035{{{
     1036cat /proc/interrupts
     1037}}}
     1038
     1039Examine the tamper in the output below increase every time you release the grounding (below example shows a tamper event 10 times):
     1040{{{
     1041root@noble-venice:~# cat /proc/interrupts  | grep gsc
     1042 65:         10          0          0          0 gpio-mxc   6 Level     gateworks-gsc
     1043194:          0          0          0          0 gateworks-gsc   4 Edge      0-0023
     1044212:          0          0          0          0 gateworks-gsc   0 Edge      user_pb1x
     1045213:         10          0          0          0 gateworks-gsc   1 Edge      key_erased
     1046214:          0          0          0          0 gateworks-gsc   2 Edge      eeprom_wp
     1047215:         10          0          0          0 gateworks-gsc   5 Edge      tamper
     1048216:          0          0          0          0 gateworks-gsc   7 Edge      switch_hold
     1049Root@noble-venice:~#
     1050}}}
     1051
     1052To verify if the tamper is working, check to see if the secure key in the EEPROM is being erased.
     1053
     1054Write something fake to the secure eeprom area:
     1055{{{
     1056i2cset -f -y 0 0x51 0x80 0xaa
     1057}}}
     1058
     1059Then run your tamper exercise and do a i2cget and you will see it was erased to 0xff:
     1060{{{
     1061i2cget -f -y 0 0x51 0x80
     1062}}}
     1063
     1064Another 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
     1070Input driver version is 1.0.1
     1071Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
     1072Input device name: "gpio-keys"
     1073Supported 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)
     1082Properties:
     1083Testing ... (interrupt to exit)
     1084Event: time 1657317863.042611, type 1 (EV_KEY), code 258 (BTN_2), value 1
     1085Event: time 1657317863.042611, -------------- SYN_REPORT ------------
     1086Event: time 1657317863.042631, type 1 (EV_KEY), code 260 (BTN_4), value 1
     1087Event: time 1657317863.042631, -------------- SYN_REPORT ------------
     1088Event: time 1657317863.053418, type 1 (EV_KEY), code 260 (BTN_4), value 0
     1089Event: time 1657317863.053418, -------------- SYN_REPORT ------------
     1090Event: time 1657317863.053426, type 1 (EV_KEY), code 258 (BTN_2), value 0
     1091Event: time 1657317863.053426, -------------- SYN_REPORT ------------
     1092}}}
    10311093
    10321094* Note: Older revision Ventana models may require a modification for this feature ([wiki:ventana/errata#HW4Tamperswitchnon-functional Errata HW4]), please contact factory at support@gateworks.com