Changes between Version 56 and Version 57 of gsc


Ignore:
Timestamp:
07/29/2020 04:41:06 AM (4 years ago)
Author:
Bobby Jones
Comment:

Add GSCv3 v57 register descriptions

Legend:

Unmodified
Added
Removed
Modified
  • gsc

    v56 v57  
    2727 * 0x52 - 24c04 emulated 256 byte EEPROM (common industry standard EEPROM device) (some models only)
    2828 * 0x53 - 24c04 emulated 256 byte EEPROM (common industry standard EEPROM device) (some models only)
     29 * 0x5e - Direct memory access read register
    2930 * 0x68 - DS1672 emulated RTC (common industry standard device)
    3031
     
    916917|| 15           || GSC_WRITE_PROTECT    || Write Protection                              || All ||
    917918|| 16           || GSC_RESET_CAUSE      || Reset Cause                                   || GSCv3 ||
     919|| 17           || GSC_INTERRUPT_SOURCE_1 || Interrupt Source 1                          || GSCv3 ||
     920|| 18           || GSC_INTERRUPT_ENABLE_1 || Interrupt Enable 1                          || GSCv3 ||
    918921|| 19           || GSC_THERMAL_PROTECT  || Thermal Protection                            || GSCv3 ||
    919 
     922|| 20           || GSC_CPU_SPEED_CTRL   || CPU Speed Control                             || GSCv3 ||
     923|| 21           || GSC_BOOT_OPTIONS     || Boot Control Options                          || GSCv3 ||
     924|| 22           || GSC_MEM_ACCESS_PAGE  || Direct Memory Access Page Number              || GSCv3 ||
     925|| 23           || GSC_CTRL_2           || Pushbutton Switch, Misc.                      || GSCv3 ||
     926|| 31           || GSC_REGISTER_BACKUP  || Thermal Protection                            || GSCv3 ||
    920927
    921928[=#gsc_ctrl_0]
     
    10191026|| 9  || RST_CAUSE_SOFT_PWR        || Button press from soft power control ||
    10201027
     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
    10211043[=#gsc_thermal_protect]
    10221044=== GSC_THERMAL_PROTECT (Register R19): Thermal Protection Configuration
    10231045Supported on GSCv3 (v53: 20181107 and later firmware), the GSC_THERMAL_PROTECT register configures the thermal protection feature.
    10241046
    1025 ||= Bit =||= Name =||= Description                                                                                      =||
     1047||= Bit =||= Name =||= Description =||
    10261048|| 0     || GSC_TP_ENABLE || 1 = Enable Thermal protection ||                                     
    10271049
     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
     1062This 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
     1080BUS=0
     1081ADDR=0x5e
     1082OFFSET=$1
     1083LENGTH=$2
     1084
     1085# Misc variables
     1086COUNT=0
     1087PAGE=0
     1088PRINTVAL=0x0000
     1089REMAINDER=0
     1090HIGH=
     1091RETURN=
     1092
     1093# Calculate initial page number based on passed in offset
     1094PAGE=$((OFFSET / 0x100))
     1095OFFSET=$((OFFSET % 0x100))
     1096
     1097echo "      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f     0123456789abcdef"
     1098while [[ $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))
     1130done
     1131}}}
     1132[[CollapsibleEnd]]
     1133
     1134[=#GSC_REGISTER_BACKUP]
     1135=== GSC_REGISTER_BACKUP (Register R31): Register Backup Control
     1136This 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 ||
    10281143
    10291144== Code Examples