| 1028 | |
| 1029 | [=#GSC_INTERRUPT_SOURCE_1] |
| 1030 | === GSC_INTERRUPT_SOURCE_1 (Register R17): Interrupt Source 1 |
| 1031 | |
| 1032 | ||= Value =||= Name =||= Description =|| |
| 1033 | || 0 || GSP_IRQ_OVRTMP_LOCAL || When set the local temp rose above CRIT_BOARD_TEMP || |
| 1034 | || 1 || GSP_IRQ_OVRTMP_REMOTE || When set the remote temp sensor asserted its ALERTJ signal || |
| 1035 | |
| 1036 | [=#GSC_INTERRUPT_ENABLE_1] |
| 1037 | === GSC_INTERRUPT_ENABLE_1 (Register R18): Interrupt Enable 1 |
| 1038 | |
| 1039 | ||= Value =||= Name =||= Description =|| |
| 1040 | || 0 || GSP_IRQ_OVRTMP_LOCAL || Set to enable the local temp rose above CRIT_BOARD_TEMP interrupt || |
| 1041 | || 1 || GSP_IRQ_OVRTMP_REMOTE || Set to enable the remote temp sensor asserted ALERTJ signal interrupt || |
| 1042 | |
| 1050 | [=#GSC_BOOT_OPTIONS] |
| 1051 | === GSC_BOOT_OPTIONS (Register R21): Boot Control Options |
| 1052 | |
| 1053 | ||= Value =||= Name =||= Description =|| |
| 1054 | || 0 || GSC_SWITCH_BOOT_SELECT || Boot device select. Clear for primary, set for alt device. This bit is also controlled by the [#UserPushbutton user pushbutton] 5x press behavior. || |
| 1055 | |
| 1056 | [=#GSC_MEM_ACCESS_PAGE] |
| 1057 | === GSC_MEM_ACCESS_PAGE (Register R22): Direct Memory Access Page Number |
| 1058 | |
| 1059 | ||= Value =||= Name =||= Description =|| |
| 1060 | || 0-7 || GSC_PAGE_NUMBER || Page address offset when direct reading the GSC flash || |
| 1061 | |
| 1062 | This API which is implemented over I2C on address {{{0x5f}}} allows a user to do direct memory reads over the entirety of the accessible memory range ({{{0x0000-0xFFFF}}}). It is used by constructing a 16 bit address with the top byte (a.k.a. page) being set by writing to an undocumented register at address {{{0x20}}} offset {{{0x1f}}}. The bottom byte is then added on via standard I2C protocol. Memory writes are not supported with this API. In order to simplify the usage of this API, a bash script was created that will be posted on the wiki and/or given to FAE's to distribute as they see fit. The name of the script is {{{gsc_direct_mem.sh}}} and the contents are included below. |
| 1063 | |
| 1064 | [[CollapsibleStart(GSC Direct Memory Read Script)]] |
| 1065 | {{{#!bash |
| 1066 | #!/bin/bash |
| 1067 | |
| 1068 | [ "$#" -ne 2 ] && { |
| 1069 | echo "This script acts as a wrapper around I2C commands in order to do direct memory reads of the GSC." |
| 1070 | echo "It will output the i2c response in an i2cdump type format." |
| 1071 | echo |
| 1072 | echo "Usage: $0 <offset> <length>" |
| 1073 | echo |
| 1074 | echo "Example usage to read all 2000(0x7d0) peripheral register values:" |
| 1075 | echo " $0 0x100 0x7d0" |
| 1076 | exit 1 |
| 1077 | } |
| 1078 | |
| 1079 | # Store inputs |
| 1080 | BUS=0 |
| 1081 | ADDR=0x5e |
| 1082 | OFFSET=$1 |
| 1083 | LENGTH=$2 |
| 1084 | |
| 1085 | # Misc variables |
| 1086 | COUNT=0 |
| 1087 | PAGE=0 |
| 1088 | PRINTVAL=0x0000 |
| 1089 | REMAINDER=0 |
| 1090 | HIGH= |
| 1091 | RETURN= |
| 1092 | |
| 1093 | # Calculate initial page number based on passed in offset |
| 1094 | PAGE=$((OFFSET / 0x100)) |
| 1095 | OFFSET=$((OFFSET % 0x100)) |
| 1096 | |
| 1097 | echo " 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef" |
| 1098 | while [[ $COUNT -ne $LENGTH ]]; do |
| 1099 | # Set the page number accordingly |
| 1100 | i2cset -f -y 0 0x20 0x16 $PAGE |
| 1101 | |
| 1102 | # Do either a full i2cdump or specify a range if bytes aren't a 0x100 aligned block |
| 1103 | if [[ $(($LENGTH - $COUNT)) -lt 0x100 || $OFFSET -ne 0 ]]; then |
| 1104 | HIGH=$(($LENGTH - $COUNT - 1 + $OFFSET)) |
| 1105 | # Record remainder for i2c 0x100 upper range limit |
| 1106 | if [[ $HIGH -gt 0x100 ]]; then |
| 1107 | REMAINDER=$(($HIGH + 1 - 0x100)) |
| 1108 | else |
| 1109 | REMAINDER=0 |
| 1110 | fi |
| 1111 | |
| 1112 | RETURN=$(i2cdump -f -y -r ${OFFSET}-$(($HIGH - $REMAINDER)) 0 $ADDR b | grep ':') |
| 1113 | COUNT=$(($HIGH - $REMAINDER - $OFFSET + 1 + $COUNT)) |
| 1114 | OFFSET=0 |
| 1115 | else |
| 1116 | RETURN=$(i2cdump -f -y 0 $ADDR b | grep ':') |
| 1117 | COUNT=$(($COUNT + 0x100)) |
| 1118 | fi |
| 1119 | |
| 1120 | if [[ "$RETURN" ]]; then # Only print reads |
| 1121 | # Format output to be continuous and account for page increase |
| 1122 | echo "$RETURN" | while read x; do |
| 1123 | printf "%04x" "$((0x$(echo $x | cut -d':' -f1) + $((PAGE * 0x100))))" |
| 1124 | echo ":${x##*:}" |
| 1125 | done |
| 1126 | fi |
| 1127 | |
| 1128 | # Increase the page count |
| 1129 | ((++PAGE)) |
| 1130 | done |
| 1131 | }}} |
| 1132 | [[CollapsibleEnd]] |
| 1133 | |
| 1134 | [=#GSC_REGISTER_BACKUP] |
| 1135 | === GSC_REGISTER_BACKUP (Register R31): Register Backup Control |
| 1136 | This register has an upper nibble password of value {{{0xA0}}} that should be bitwise OR'd with an enumerated value in the lower nibble that will be interpreted as the command. This register will self clear when the operation has completed. |
| 1137 | |
| 1138 | ||= Value =||= Name =||= Description =|| |
| 1139 | || 1 || GSC_REG_BKP_SAVE || Save current register values to USER backup area || |
| 1140 | || 2 || GSC_REG_BKP_USER_LOAD || Load register values from USER backup || |
| 1141 | || 3 || GSC_REG_BKP_FACTORY_LOAD || Load register values from FACTORY backup || |
| 1142 | || 4-7 || GSC_REG_BKP_PASSWORD || Password for upper nibble ({{{0xA0}}}). Bitwise OR this value with lower nibble enumerated values described above || |