Tegra2 Embedded Controller Interface Specification 20111117
Tegra2 Embedded Controller Interface Specification 20111117
Tegra2 Embedded Controller Interface Specification 20111117
October6,2009
DA_04649001_11
Notice
ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS,
DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, "MATERIALS")
ARE BEING PROVIDED "AS IS." NVIDIA MAKES NO WARRANTIES, EXPRESS, IMPLIED,
STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND ALL EXPRESS OR
IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
WARRANTY OR CONDITION OF TITLE, MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS
FOR A PARTICULAR PURPOSE AND ON-INFRINGEMENT, ARE HEREBY EXCLUDED TO THE
MAXIMUM EXTENT PERMITTED BY LAW. NVIDIA RETAIN ALL TITLE, RIGHTS AND INTERESTS
(INCLUDING WITHOUT LIMITATION, ALL INTELLECTUAL PROPERTY RIGHTS) IN ALL MATERIALS.
Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation
assumes no responsibility for the consequences of use of such information or for any
infringement of patents or other rights of third parties that may result from its use. No license is
granted by implication or otherwise under any patent or patent rights of NVIDIA Corporation.
Specifications mentioned in this publication are subject to change without notice. This
publication supersedes and replaces all information previously supplied. NVIDIA Corporation
products are not authorized for use as critical components in life support devices or systems
without express written approval of NVIDIA Corporation.
Trademarks
NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in
the United States and other countries. Other company and product names may be trademarks of
the respective companies with which they are associated.
Copyright
2009byNVIDIACorporation.Allrightsreserved.
NVIDIACorporation
2701SanTomasExpressway
SantaClara,CA95050
www.nvidia.com
ii
DA_04649001_11
6October2009
Table of Contents
1.Introduction ............................................................................................................................. 11
2.SystemConnectivity ............................................................................................................... 12
3.SMBusOverview..................................................................................................................... 13
4.Packets ...................................................................................................................................... 14
4.1.PacketFields.................................................................................................................... 14
4.1.1.CommandField...................................................................................................... 14
4.1.2.SubcommandField............................................................................................... 16
4.1.3.PacketLengthField ............................................................................................... 16
4.1.4.StatusField.............................................................................................................. 16
4.1.5.PayloadField .......................................................................................................... 17
5.SMBusMessages ..................................................................................................................... 18
5.1.RequestPacketFormat................................................................................................... 18
5.2.ResponsePacketFormat................................................................................................ 20
5.3.EventPacketFormat ...................................................................................................... 22
6.RequestandResponsePackets.............................................................................................. 25
6.1.SystemStatus .................................................................................................................. 26
6.1.1.GetSystemStatusResponse................................................................................. 28
6.1.2.AcknowledgeSystemStatusRequest ................................................................. 30
6.1.3.AcknowledgeSystemStatusResponse............................................................... 30
6.1.4.ConfigureEventReportingRequest.................................................................... 31
6.1.5.ConfigureEventReportingResponse................................................................. 31
6.1.6.ConfigureWakeRequest ...................................................................................... 32
6.2.BatteryInformation ........................................................................................................ 33
6.2.1.GetSlotStatusandCapacityGaugeResponse .................................................. 37
6.2.2.GetVoltageResponse............................................................................................ 39
6.2.3.GetRemainingTimetoEmptyResponse........................................................... 40
6.2.4.GetCurrentResponse ........................................................................................... 41
6.2.5.GetAverageCurrentResponse............................................................................ 42
6.2.6.GetAveragingTimeIntervalResponse.............................................................. 43
6.2.7.GetRemainingCapacityResponse...................................................................... 44
6.2.8.GetLastFullChargeCapacityResponse............................................................ 45
6.2.9.GetDesignCapacityResponse ............................................................................ 46
6.2.10.GetCriticalCapacityResponse.......................................................................... 47
DA_04649001_11
6October2009
iii
6.2.11.GetTemperatureResponse ................................................................................ 48
6.2.12.GetManufacturerResponse ............................................................................... 49
6.2.13.GetModelResponse............................................................................................ 50
6.2.14.GetTypeResponse .............................................................................................. 51
6.2.15.SetRemainingCapacityAlarmRequest........................................................... 52
6.2.16.SetRemainingCapacityAlarmResponse ........................................................ 52
6.2.17.GetRemainingCapacityAlarmResponse ....................................................... 53
6.2.18.SetConfigurationRequest .................................................................................. 54
6.2.19.SetConfigurationResponse ............................................................................... 54
6.2.20.GetConfigurationResponse .............................................................................. 55
6.2.21.ConfigureEventReportingRequest.................................................................. 56
6.2.22.ConfigureEventReportingResponse............................................................... 56
6.2.23.ConfigureWakeRequest .................................................................................... 57
6.2.24.ConfigureWakeResponse.................................................................................. 57
6.3.GPIOControl................................................................................................................... 58
6.3.1.ConfigurePinRequest .......................................................................................... 61
6.3.2.ConfigurePinResponse(scalar) .......................................................................... 62
6.3.3.SetPinRequest(scalar) ......................................................................................... 63
6.3.4.SetPinResponse(scalar)....................................................................................... 63
6.3.5.SetPinRequest(vector) ........................................................................................ 64
6.3.6.SetPinResponse(vector)...................................................................................... 64
6.3.7.GetPinRequest(scalar) ........................................................................................ 65
6.3.8.GetPinResponse(scalar)...................................................................................... 65
6.3.9.GetPinRequest(vector) ....................................................................................... 66
6.3.10.GetPinResponse(vector)................................................................................... 66
6.3.11.ConfigureEventReportingRequest(scalar).................................................... 67
6.3.12.ConfigureEventReportingResponse(scalar) ................................................. 67
6.3.13.ConfigureEventReportingRequest(vector) ................................................... 68
6.3.14.ConfigureEventReportingResponse(vector) ................................................ 68
6.3.15.AcknowledgeEventReportRequest(scalar)................................................... 69
6.3.16.AcknowledgeEventReportResponse(scalar) ................................................ 69
6.3.17.AcknowledgeEventReportRequest(vector) .................................................. 70
6.3.18.AcknowledgeEventReportResponse(vector) ............................................... 70
6.3.19.GetEventReportRequest(scalar) ..................................................................... 71
6.3.20.GetEventReportResponse(scalar) .................................................................. 71
6.3.21.GetEventReportRequest(vector) .................................................................... 72
6.3.22.GetEventReportResponse(vector).................................................................. 72
6.3.23.ConfigureWakeRequest(scalar) ...................................................................... 73
6.3.24.ConfigureWakeResponse(scalar).................................................................... 73
6.3.25.ConfigureWakeRequest(vector)...................................................................... 74
6.3.26.ConfigureWakeResponse(vector) ................................................................... 74
6.4.SleepStateControl ......................................................................................................... 75
6.4.1.GlobalConfigureEventReportingRequest....................................................... 78
6.4.2.GlobalConfigureEventReportingResponse .................................................... 78
6.5.KeyboardControl ........................................................................................................... 79
6.5.1.ConfigureWakeRequest ...................................................................................... 82
6.5.2.ConfigureWakeResponse.................................................................................... 82
iv
DA_04649001_11
6October2009
6.5.3.ConfigureWakeKeyReportingRequest............................................................ 83
6.5.4.ConfigureWakeKeyReportingResponse ......................................................... 83
6.6.AuxiliaryDeviceControl............................................................................................... 84
6.6.1.SendCommandResponse .................................................................................... 89
6.6.2.ReceiveNBytesResponse .................................................................................... 89
6.6.3.ConfigureWakeRequest ...................................................................................... 90
6.6.4.ConfigureWakeResponse.................................................................................... 90
6.7.SystemControl................................................................................................................ 91
6.7.1.ResetEC................................................................................................................... 92
6.7.2.SelfTest ................................................................................................................... 92
6.7.3.NoOperation(Noop)........................................................................................... 92
6.7.4.GetCapabilities ...................................................................................................... 92
6.7.5.GenericConfiguration........................................................................................... 99
6.7.6.FirmwareUpdate................................................................................................. 105
6.7.7.FirmwareRead ..................................................................................................... 114
7.AsynchronousEventPackets............................................................................................... 118
7.1.SystemEvent ................................................................................................................. 118
7.2.BatteryEvent ................................................................................................................. 118
7.3.KeyboardEvents........................................................................................................... 119
7.4.AuxiliaryDeviceEvents .............................................................................................. 121
7.5.GPIOEvents .................................................................................................................. 123
8.ECBehavioralRules.............................................................................................................. 124
AppendixAListofCommands ........................................................................................... 126
DA_04649001_11
6October2009
List of Tables
vi
DA_04649001_11
6October2009
DA_04649001_11
6October2009
vii
viii
DA_04649001_11
6October2009
List of Figures
DA_04649001_11
6October2009
ix
Revision History
Version
1.0
Date
Description
27Aug2009 Version1.0forinitialrelease.
DA_04649001_11
6October2009
1. Introduction
ThisspecificationdefinesacommunicationinterfacebetweenNVIDIATegra
ApplicationProcessor(AP)andanembeddedcontroller(EC)fornetbookapplications.
Usingtheinterface,theAPcandirecttheECtocarryoutcertainnetbooksystem
operations.TheAPcanalsoquerynetbooksysteminformationfromtheEC.
TheSystemManagementBus(SMBus)isusedastheunderlyingtransportlayerfor
communicationsbetweentheAPandEC.Allofthebusprotocolsutilizedinthis
documentarefullycompliantwithSMBusspecification.Therefore,noTegradedicated
SMBussegmentisrequiredintheNetbookarchitectureTegracanbeconnectedtoany
existingsegmentcontrolledbyEC.
FordetailedinformationonSMBusprotocols(includingthenotationusedforprotocol
depiction)seethefollowingspecification:
SystemManagementBus(SMBus)Specification,V2.0,August3,2000
http://smbus.org/specs/
11
DA_04649001_11
6October2009
2. System Connectivity
Figure1showstheconnectionsbetweenTegraAPandtheEC.Inthenetbooksystem,the
ECisresponsibleforcontrollingthekeyboard,touchpad,GPIOs,andbattery.In
addition,theECisresponsibleforwakinguptheAPfromdeepsleepinresponseto
certainevents(suchaskeypresses).TheAPsendscommandstotheEC,whichthen
carriesoutthedesiredoperations.
ThisspecificationidentifiesthecommunicationprotocolbetweentheAPandtheEC.It
alsospecifiestheformatofmessagessentviatheprotocol.TheECmustimplementthe
communicationprotocol,plustheoperationsdefinedbythevariousmessages.
Finally,someECoperationsmayneedtotakeplacewithouttheinvolvementoftheAP.
Batterycharging,hotkeyprocessing,backlightcontrol,andvolumecontrolarepossible
examples.Suchoperationsareoutsidethescopeofthisdocumentbutwillnevertheless
needtobedefinedandimplementedaccordingtotheplatformrequirements.
Figure1SystemConnectivity
Keyboard
GPI
EC
Touch
TouchPad
Pad
PS/2
SMBus
Master
EC_REQUEST#
SM BUS
Tegra
AP
SMBus
Slave
SM BUS
AP_WAKE#
Charger
Firmware
Storage
Battery
GPIOs
12
DA_04649001_11
6October2009
3. SMBus Overview
SomeimplementationsofnetbookECdonotsupportSMBusslavemodeoperations.To
avoidthislimitation,theECalwaysactsasanSMBusmasterincommunicationswiththe
AP.Correspondingly,theAPalwaysactsasanSMBusslave.
TotransferdatafromtheECtotheAP,theECsimplyperformsanSMBusblockwrite
operationdirectedtotheAP.
TotransferdatafromtheAPtotheEC,anactivelowsidebandsignal(EC_REQUEST#)is
used.ItisassertedbyTegraAPtonotifytheECthatarequestispending.Inresponse,
theECperformsanSMBusblockreadoperationfromtheAP.TheAPdeassertsthe
EC_REQUEST#signalbeforetheblockreadoperationcompletes.TheECisexpectedto
respondtolevelchangesintheEC_REQUEST#signalratherthantoedgessoastoavoid
missingthefirstrequestaftersystemstartup.
TheAPmaychoosetoenteralowpowersleepstateinordertominimizepower
consumption.Inthisstate,theAPwillbeunabletorespondtoanySMBustransactions.
TheAPnotifiestheEC(viaanSMBustransaction)beforeenteringthesleepstate,after
whichtheECmustceaseallfurtherSMBustransactionsinvolvingtheAP.
TheECmaybeconfiguredtowaketheAPinresponsetocertainevents.TowaketheAP,
theECassertsanactivelowsidebandsignal,AP_WAKE#.TheAPrespondstolevel
changesintheAP_WAKE#signal,sotheECmustkeepthesignalasserteduntiltheAP
confirmsthatitisawake.WhentheAPwakesup,itsignalsitsreadinesstoresume
SMBustransactionsbyassertingEC_REQUEST#andtherebyinitiatingadatatransferto
theEC.TheECthendeassertsAP_WAKE#andresumesnormalSMBusoperations,
startingwiththedatatransferinitiatedbytheassertionofEC_REQUEST#.
IfthesystemarchitectureallowsotherdevicesbesidestheECtowakeuptheAP,then
theECmustcontinuetomonitorEC_REQUEST#evenaftertheAPhasgonetosleep.If
theAPisawakenedduetosomenonECrelatedevent,assertionofEC_REQUEST#isthe
onlyindicationtotheECthatSMBusoperationsneedtoresume.
AnydeviceontheSMBushasaunique7bitaddress.TegraAPhasadefaultaddressof
1000_101b. 1Inthecasethatanotherdevicewiththataddressisconnectedtothesame
SMBussegment,thedefaultAPaddresscanbereprogrammed.Themechanismof
addressreprogrammingisbeyondthescopeofthisdocument.
AsanSMBusslavedevice,PacketErrorChecking(PEC)supportisoptionalfortheTegra
AP.ThemechanismforenablinganddisablingPECsupport,ifany,isbeyondthescope
ofthisdocument.
NVIDIAiscommunicatingwithSMBusWorkingGroupinordertoincludeTegrawiththis
addressintoSMBusdeviceassignmentlist.
DA_04649001_11
6October2009
13
4. Packets
TheSMBusblockreadandblockwriteoperationsbetweenAPandECtransportthree
typesofpackets:
Requests(fromAPtoEC)operationsinitiatedbytheAP
Responses(fromECtoAP)ECgeneratedresponsetoarequestpacket
Asynchronousevents(fromECtoAP)ECgeneratedevent
AllpacketscontainaCommandfield.Inaddition,Subcommand,PacketLength,Status,
andPayloadfieldsmayalsobepresent,dependingonthepackettype.
14
DA_04649001_11
6October2009
Table1CommandFieldStructure
Command Field
Bit(s)
7:7
Description
PacketType
0bResponsePacketorRequestPacket
1bEventPacket
forEventPackets(PacketTypeis1b)
6:5
TransferType
0hFixedlengthtransfer,Commandfield+1byte
1hFixedlengthtransfer,Commandfield+2bytes
2hVariablelengthtransfer,asspecifiedbyPacketLengthfield(Section
4.1.3)
3hReserved
4:4
3:0
ErrorFlag
0bSuccessfulcompletion;noerroroccurred
1bAnerroroccurred,asspecifiedbytheStatusfield(Section4.1.4)
EventType
0hKeyboard
1hAuxiliaryDevice0(PS/2port0)
2hAuxiliaryDevice1(PS/2port1)
3hAuxiliaryDevice2(PS/2port2)
4hAuxiliaryDevice3(PS/2port3)
5hSystem
6hGPIO(scalar)
7hGPIO(vector)
8hBattery
dhOEMdefined
ehOEMdefined
OthersReserved
forRequestPacketsandResponsePackets(PacketTypeis0b)
6:4
RequestorTagvalueassignedbyAPandechoedbackbyEC
DA_04649001_11
6October2009
15
3:0
CommandType
1hSystemStatus
2hBatteryInformation
3hGPIOControl
4hSleepStateControl
5hKeyboard
6hAuxiliaryDevice
7hECControl
dhOEMdefined
ehOEMdefined
OthersReserved
16
DA_04649001_11
6October2009
Table2StatusFieldStructure
Status Field
Bit(s)
7:0
Description
Status
00hSuccessfulcompletion
01hPS/2AuxiliaryPorttimeouterror
02hPS/2AuxiliaryPortparityerror
03hHardwareresourcetemporarilyunavailable,i.e.,requesteddata
fromanemptyslot(=notconnectedbattery)
04hInvalidcommand(orsubcommand)
05hInvalidsize.Packetsizeisincorrectforthespecifiedoperation
06hInvalidparameter.Payloaddataisincorrectforthespecified
operation
07hUnsupportedconfiguration.Requestedconfigurationsarenot
supportedbytheEChardwareand/orfirmware.
08hChecksumerror
09hDevicewriteerror
0ahDevicereaderror
0bhDataoverflowerror
0chDataunderflowerror
0dhInvalidstateerror.TheECisnotintheproperstatetocarryoutthe
requestedoperation
d0hefhOEMdefinederrors
ffhErrorReport:anyotherreasonthandescribedabove
OthersReserved
DA_04649001_11
6October2009
17
5. SMBus Messages
ThissectiondescribestheSMBusmessagescorrespondingtothethreepackettypes
(Request,Response,andEvent).
ThelargestSMBusoperationis34bytesinlength.ThiscorrespondstoaBlockWrite
operationwithaByteCountof32(Subcommand,Status,and30bytePayload)andPEC.
Thisallowsfor30bytesofabatterysidentificationstringtobereported.
FullName
StartCondition
Sr
RepeatedStartCondition
Rd
Read(bitvalueof1)
Write(bitvalueof0)
Acknowledge(0forACK,1forNACK)
StopCondition
PEC
PacketErrorCode
Finally,thebottomrowinthediagramgivestheECInterfacefieldnames.IftheEC
Interfacerequiresaspecificconstantvalueinagivenfield,theconstantisshownrather
thanthefieldname.
18
DA_04649001_11
6October2009
Figure2RequestPacketMappedtoSMBusBlockReadOperation
1
SlaveAddress
Wr
Command
Sr
SlaveAddress
Rd
TegraSMBus
Address
0x1
TegraSMBus
Address
ByteCount
DataByte1
DataByte2
DataByte3
PacketLength
(N)
Request
Command
Subcommand
Payload
DataByteN
PEC 2
Payload
0 3
2PacketErrorCode(PEC)byteandfollowingAcknowledgebitareoptional.PECbyteis
calculatedovertheentiremessageasdefinedbySMBusspecification.
3IfthePECispresent,thentheprecedingAcknowledgewillbeanACK,otherwiseitwillbea
NACK.
DA_04649001_11
6October2009
19
SlaveAddress
Wr
Command
ByteCount
DataByte1
TegraSMBus
Address
Response
Command
PacketLength
(N)
Sub
Command
DataByte2
DataByte3
Status
Payload
DataByteN
PEC2
Payload
20
DA_04649001_11
6October2009
Figure4AckPacketMappedtoSMBusBlockWriteOperation
SlaveAddress
Wr
Command
ByteCount
DataByte1
TegraSMBus
Address
Response
Command
PacketLength
(N)
Sub
Command
DataByte2
PEC2
Status
DA_04649001_11
6October2009
21
SlaveAddress
Wr
Command
ByteCount
DataByte1
TegraSMBus
Address
Event
Command
PacketLength
(N)
Payload
DataByte2
DataByte3
Payload
Payload
DataByteN
PEC2
Payload
Figure6FixedLengthEventPacketMappedtoSMBusWriteByteOperation
SlaveAddress
Wr
Command
DataByte1
PEC2
TegraSMBus
Address
Event
Command
Payload
22
DA_04649001_11
6October2009
Figure7FixedLengthEventPacketMappedtoSMBusWriteWordOperation
SlaveAddress
Wr
Command
DataByte1
DataByte2
TegraSMBus
Address
Event
Command
Payload
Payload
PEC2
Figure8VariableLengthEventPacketwithErrorMappedtoSMBusBlockWrite
Operation
SlaveAddress
Wr
Command
ByteCount
DataByte1
TegraSMBus
Address
Event
Command 4
PacketLength
(N)
Status
DataByte2
DataByte3
Payload
Payload
DataByteN
PEC2
Payload
4TheErrorFlagintheCommandFieldwillbesetinthispacket,indicatingthatanerrorhas
occurredandthattheStatusFieldwillreplacethefirstbyteofthePayload.
DA_04649001_11
6October2009
23
Figure9FixedLengthEventPacketwithErrorMappedtoSMBusWriteByte
Operation
SlaveAddress
Wr
Command
DataByte1
PEC2
TegraSMBus
Address
Event
Command4
Status
Figure10FixedLengthEventPacketwithErrorMappedtoSMBusWriteWord
Operation
SlaveAddress
Wr
Command
DataByte1
DataByte2
TegraSMBus
Address
Event
Command4
Status
Payload
PEC2
24
DA_04649001_11
6October2009
DA_04649001_11
6October2009
25
Table4RequestSystemStatus
SMBus Protocol Byte
Description
Note
CommandByte
01h
SystemStatus
ByteCount
01h
DataByte1(SubCommand) 7:0
00hGetSystemStatus
01hConfigureEventReporting
02hAcknowledgeSystemStatus
fdhConfigureWake
26
DA_04649001_11
6October2009
DataByte2DataByteN
Forsubcommand01h,configuration
setting
Forsubcommand02h,systemeventtypes
Forsubcommandfdh,configuration
setting
Otherwise,nodatabytes
DA_04649001_11
6October2009
27
Description
Note
CommandByte
01h
SystemStatus
ByteCount
06h
DataByte1(SubCommand) 00h
GetSystemStatus
DataByte2(Status)
00h
Successful
DataByte3
SystemStateBits70
SeeTable6
DataByte4
SystemStateBits158
DataByte5
OEMSystemStateBits SeeTable7
70
DataByte6
OEMSystemStateBits
158
Table6SystemStateFlags
System State Bit(s)
15:5
4
Description
Reserved(00h)
ECResetNotification
0bNoECResethasoccurred
1bAnECResethasoccurred
Notificationpersistsuntilacknowledged
APPowerDownRequest
0bECdoesNOTrequestthatAPpowerdown
1bECrequeststhatAPpowerdown
Requestpersistsuntilacknowledged
APSuspendRequest
0bECdoesNOTrequestthatAPentersuspendstate
1bECrequeststhatAPentersuspendstate
Requestpersistsuntilacknowledged
28
DA_04649001_11
6October2009
APRestartRequest
0bECdoesNOTrequestthatAPrestart
1bECrequeststhatAPrestart
Requestpersistsuntilacknowledged
ACPresent
0bNoAC(BatteryPower)
1bACPresent
Noacknowledgerequired
Table7OEMSystemStateFlags
System State Bit(s)
15:0
Description
OEMdefined
DA_04649001_11
6October2009
29
Description
Note
CommandByte
01h
SystemStatus
ByteCount
05h
DataByte1(SubCommand) 02h
AcknowledgeSystemStatus
DataByte2
SystemStateFlagBits SeeTable6.Eachbitvaluecontrolsthe
70
correspondingSystemStateFlag.
DataByte3
SystemStateFlagBits
158
DataByte4
OEMSystemState
FlagBits70
DataByte5
OEMSystemState
FlagBits158
0bDonotacknowledge
1bAcknowledge
SeeTable7.Eachbitvaluecontrolsthe
correspondingOEMSystemStateFlag.
0bDonotacknowledge
1bAcknowledge
30
DA_04649001_11
6October2009
Description
Note
CommandByte
01h
SystemStatus
ByteCount
06h
DataByte1(SubCommand) 01h
ConfigureEventReporting
DataByte2
ConfigurationAction
0hDisableeventreporting
1hEnableeventreporting
DataByte3
SystemStateFlag
MaskBits70
SeeTable6.Eachmaskbitcontrolswhether
theConfigurationActionisappliedtothe
correspondingSystemStateFlag.
DataByte4
SystemStateFlag
MaskBits158
DataByte5
OEMSystemState
FlagMaskBits70
DataByte6
OEMSystemState
FlagMaskBits158
0bDonotapplyConfigurationAction
1bApplyConfigurationAction
SeeTable7.Eachmaskbitcontrolswhether
theConfigurationActionisappliedtothe
correspondingOEMSystemStateFlag.
0bDonotapplyConfigurationAction
1bApplyConfigurationAction
DA_04649001_11
6October2009
31
Table10ConfigureWakeRequest
SMBus Protocol Byte
Description
Note
CommandByte
01h
SystemStatus
ByteCount
06h
DataByte1(SubCommand) fdh
ConfigureWake
DataByte2
ConfigurationAction 0hDisablewakeforevent
1hEnablewakeforevent
DataByte3
SystemEventType
MaskBits70
DataByte4
SystemEventType
MaskBits158
DataByte5
OEMSystemEvent
TypeMaskBits70
DataByte6
OEMSystemEvent
TypeMaskBits158
SeeTable6.Eachmaskbitcontrolswhether
theConfigurationActionisappliedtothe
correspondingSystemEventType.
0bDonotapplyConfigurationAction
1bApplyConfigurationAction
SeeTable7.Eachmaskbitcontrolswhether
theConfigurationActionisappliedtothe
correspondingOEMSystemEventType.
0bDonotapplyConfigurationAction
1bApplyConfigurationAction
32
DA_04649001_11
6October2009
DA_04649001_11
6October2009
33
mAhwillbecome5*10mWh.ThisconversionissueaffectstheSetRemaining
CapacityAlarmandGetRemainingCapacityAlarmcommands.
Thebatterycommandsandsubcommandsaretabulatedbelow.Theresponseforeach
subcommandisdetailedintheensuingsubsections.
34
DA_04649001_11
6October2009
Table11RequestBatteryInformation
SMBus Protocol Byte
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
DataByte1(SubCommand) 7:5
BatterySlotTag
0hBatterySlot0
1hBatterySlot1
2hBatterySlot2
3hBatterySlot3
OthersReserved
4:0
BatteryOperations
00hGetSlotStatusandCapacity
Gauge
01hGetVoltage
02hGetRemainingTimetoEmpty
03hGetCurrent
04hGetAverageCurrent
05hGetAveragingTimeInterval
06hGetRemainingCapacity
07hGetLastFullChargeCapacity
08hGetDesignCapacity
09hGetCriticalCapacity
0ahGetTemperature
0bhGetManufacturerName
0chGetModel
0dhGetType
0ehSetRemainingCapacityAlarm
0fhGetRemainingCapacityAlarm
10hSetConfiguration
11hGetConfiguration
12hConfigureEventReporting
1dhConfigureWake
OthersReserved
DA_04649001_11
6October2009
35
DataByte2DataByteN
Forsubcommand0eh,alarmthreshold
value
Forsubcommand10h,configuration
setting
Forsubcommand12h,configuration
setting
Forsubcommand1dh,configuration
setting
Otherwise,nodatabytes
36
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
00h
DataByte2(Status)
00h
Successful
DataByte3
BatterySlotStatus
SeeTable13
DataByte4
BatteryCapacityGauge Batterysrelativeremainingcapacityin%
DA_04649001_11
6October2009
37
Table13BatterySlotStatus
Status Bit(s)
7:4
3
Description
Reserved(0h)
RemainingCapacityAlarm
0bNoalarm
1bAlarmisset
2:1
Chargingstate
00bBatteryisidle(selfdischarging)
01bBatteryisbeingcharged
10bBatteryisbeingdischarged(poweringthesystem)
11bReserved
PresentState
0bBatteryisnotpresentintherespectiveslot
1bBatteryispresentintherespectiveslot
38
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
01h
DataByte2(Status)
00h
Successful
DataByte3
PresentVoltage
Bits70
Batteryspresentvoltage(16bitunsigned
value,inmV)
DataByte4
PresentVoltage
Bits158
DA_04649001_11
6October2009
39
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
02h
DataByte2(Status)
00h
Successful
DataByte3
TimetoEmptyBits70 Estimatedremainingtimetoemptyfor
dischargingbatteryatpresentrate(16bit
TimetoEmptyBits15 unsignedvalue,inminutes)
8
0FFFFhifbatteryisnotdischarging
DataByte4
40
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
03h
DataByte2(Status)
00h
Successful
DataByte3
PresentCurrent
Bits70
Batteryspresentcurrentattheterminals(16
bitsignedvalue,inmA)
DataByte4
PresentCurrent
Bits158
0to32,767ifcharging
0to32,768ifdischarging
DA_04649001_11
6October2009
41
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
04h
DataByte2(Status)
00h
Successful
DataByte3
RateBits70
Batterysaveragecurrentattheterminals
(16bitsignedvalue,inmA)
DataByte4
RateBits158
0to32,767ifcharging
0to32,768ifdischarging
42
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
05h
DataByte2(Status)
00h
Successful
DataByte3
TimeInterval
Bits70
Timeintervaloverwhichaveragedvalues
arecomputed(16bitunsignedvalue,in
msec).
DataByte4
TimeInterval
Bits158
DA_04649001_11
6October2009
43
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
06h
DataByte2(Status)
00h
Successful
DataByte3
CapacityBits70
Batterysremainingcapacity(16bitunsigned
value,inCapacityUnits)
DataByte4
CapacityBits158
44
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
07h
DataByte2(Status)
00h
Successful
DataByte3
CapacityBits70
DataByte4
CapacityBits158
Batteryscapacitywhenfullychargedlast
time(16bitunsignedvalue,inCapacity
Units)
DA_04649001_11
6October2009
45
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
08h
DataByte2(Status)
00h
Successful
DataByte3
CapacityBits70
Batterysdesigncapacity(16bitunsigned
value,inCapacityUnits)
DataByte4
CapacityBits158
46
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
09h
DataByte2(Status)
00h
Successful
DataByte3
CapacityBits70
Batteryscriticalcapacity(16bitunsigned
value,inCapacityUnits)
DataByte4
CapacityBits158
DA_04649001_11
6October2009
47
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
0ah
DataByte2(Status)
00h
Successful
DataByte3
TemperatureBits70
Batterystemperature(16bitunsignedvalue,
in0.1K)
DataByte4
TemperatureBits158
48
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
N=03h20h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
0bh
DataByte2(Status)
00h
Successful
DataByte3DataByteN
ASCIIstring
Manufacturernameisupto30characters
(maynotbenullterminated)
DA_04649001_11
6October2009
49
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
N=03h20h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
0ch
DataByte2(Status)
00h
Successful
DataByte3DataByteN
ASCIIstring
Batterymodelisupto30characters(maynot
benullterminated)
50
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
ByteCount
N=03h20h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
0dh
DataByte2(Status)
00h
Successful
DataByte3DataByteN
ASCIIstring
Batterytype(commonlybatterychemistry)is
upto30characters(maynotbenull
terminated).
DA_04649001_11
6October2009
51
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
0eh
DataByte3
CapacityBits70
Thresholdforremainingcapacityalarm(16
bitunsignedvalue,inCapacityUnits)
DataByte4
CapacityBits158
52
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
04h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
0fh
DataByte2(Status)
00h
Successful
DataByte3
CapacityBits70
Thresholdforremainingcapacityalarm(16
bitunsignedvalue,inCapacityUnits)
DataByte4
CapacityBits158
DA_04649001_11
6October2009
53
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
02h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
DataByte2
10h
ConfigurationSetting SeeTable30
Table30BatteryConfigurationSettings
Battery Configuration
Bit(s)
Description
7:1
Reserved(0b)
CapacityUnits
0bcapacityvaluesarereportedinunitsofmAh
1bcapacityvaluesarereportedinunitsof10mWh
InitialsettinginmAh(0b).
54
DA_04649001_11
6October2009
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
03h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
11h
DataByte2(Status)
00h
Successful
DataByte3
ConfigurationSetting SeeTable30
DA_04649001_11
6October2009
55
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
02h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
12h
DataByte2
ConfigurationAction
0hDisableeventreporting
1hEnableeventreporting
DataByte3
BatteryEventMask
SeeTable33.Eachmaskbitvaluecontrols
whethertheConfigurationActionisapplied
tothespecifiedBatteryEventType.
0bDonotapplyConfigurationAction
1bApplyConfigurationAction
Table33BatteryEventType
System State Bit(s)
7:3
Description
Reserved(00h)
RemainingCapacityAlarm
ChargingState
PresentState
56
DA_04649001_11
6October2009
Table34ConfigureWakeRequest
SMBus Protocol Byte
Description
Note
CommandByte
02h
BatteryInformation
ByteCount
03h
DataByte1(SubCommand) 7:5
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
4:0
1dh
DataByte2
ConfigurationAction
0hDisablewakeforevent
1hEnablewakeforevent
DataByte3
BatteryEventMask
SeeTable33.Eachmaskbitcontrolswhether
theConfigurationActionisappliedtothe
correspondingBatteryEventType.
0bDisablewakeforevent
1bEnablewakeforevent
DA_04649001_11
6October2009
57
58
DA_04649001_11
6October2009
Note:Theinputsignallevelsarejustlogicalvalues;thesystemintegratorand/orEC
firmwaredeveloperdetermineshowtheselogicalvaluesmaptoinputsignal
polarity.
TheECcanbeconfiguredtodetectcertaininputeventsviatheEventTriggerType
settingoftheConfigurePincommand.Edgetriggeredeventsarelatchedwhenthey
occur,allowingthemtobereportedlater.Thelatchisclearedandreenabledwhenthe
edgetriggeredeventiseventuallyreported.Leveltriggeredeventsarenotlatched;only
thecurrent(live)stateofaleveltriggercanbereported.Thus,whileitspossibleto
haveanunreportededgetriggeredevent,thereisnosuchthingasanunreportedlevel
triggeredevent.
Ifautoreportingisenabled(byspecifyingReportEnableas01hwiththeConfigure
EventReportingcommand),theECsendsaGPIOEventpacketwhenatriggerevent
occurs.ForagivenGPIOpin,eachtriggereventmustbeacknowledged(bythe
AcknowledgeEventReportcommand)beforethenextonecanbereported.Unnecessary
acknowledgecommandsareignored.Autoreportingcanbecancelledusingthe
ConfigureEventReportingcommandandsettingReportEnableto00h.TheDisable
EventReportingcommandcancelsautoreporting.Autoreportingisinitiallydisabled
afterreset.
TheAPcanalsoexplicitlyquerytheECfortriggereventsviatheGetEventReport
command.Foredgetriggeredeventsthelatchedstateisreported,whereasforlevel
triggeredeventsthecurrent(live)triggerstateisreported.Ifnotriggerisenabledfora
givenGPIOpin,thenazero(i.e.,notriggereventdetected)isreported.
Ifanunreportededgetriggeredeventisalreadypendingwheneventreportingis
enabled,itisreportedbysendingaGPIOEventpacket.Sincetherecanbenounreported
leveltriggerinterrupts,thecorrespondingsituationcannotariseforleveltriggerevents.
GPIOtriggereventscanalsowakingtheAPfromitssleepstate.Furtherdiscussionof
sleepcontrolcanbefoundinSection6.4.TheroleoftheConfigureWakecommandis
describedthere.
ManyGPIOoperationscomeintwoflavorsscalarandvector.Scalaroperationsapply
toasingleGPIOpin,whereasvectoroperationsapplytomultipleGPIOpins.Forscalar
operations,thelogicalGPIOpinnumberisspecifiedexplicitly.Forvectoroperations,the
setoflogicalGPIOnumbersisspecifiedindirectlyviaabitvector.ForeachlogicalGPIO
numberN,theNthbitofthebitvectorissetto1;allotherbitsaresetto0.
Thebitsinthebitvectorarenumberedinincreasingorderfromtheleastsignificantbit
(LSB)tomostsignificantbit(MSB)withineachbyte,andstartingfromthefirstbyteof
thebitvector.Thus,bit0ofthevectoristheLSBofthefirstbyte,bit7istheMSBofthe
firstbyte,andbit8istheLSBofthe2ndbyte,andsoon.Thenumberofbitsinthebit
vectordoesnothavetomatchthenumberofGPIOpinsontheEC(asreportedbythe
GetSystemConfigurationrequest,Section6.7.4).Ifthebitvectorisshort,themissing
DA_04649001_11
6October2009
59
upperbitsareassumedtobezero.Ifthebitvectorislong,theexcessupperbitsmustbe
ignoredforrequestsandmustbesettozeroforresponses.
FormatoftheRequestandResponsepacketsaregivenbelow.
60
DA_04649001_11
6October2009
Table35GPIOControlRequests
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 7:0
Scalarsubcommands
00hConfigurePin
01hSetPin(scalar)
02hGetPin(scalar)
03hConfigureEventReporting
(scalar)
04hAcknowledgeEventReport
(scalar)
06hGetEventReport(scalar)
1dhConfigureWake(scalar)
Vectorsubcommands
21hSetPin(vector)
22hGetPin(vector)
23hConfigureEventReporting
(vector)
24hAcknowledgeEventReport
(vector)
26hGetEventReport(vector)
3dhConfigureWake(vector)
OthersReserved
DataByte2DataByteN
Forallsubcommands,parameterdata
Forscalarsubcommands,pinnumber
Forvectorsubcommands,bitvector
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DA_04649001_11
6October2009
61
DataByte1(SubCommand) 00h
ConfigurePin(scalar)
DataByte2
Mode
7:5
00hInput
01hOutput
02hTristate
03hUnused
4:2
EventTriggerType
00hnone
01hrisingedge
02hfallingedge
03hanyedge
04hlolevel
05hhilevel
06hlevelchange
1:0
PullEnable
00hnopullenabled
01hpulldownenabled
10hpullupenabled
DataByte3
7:6
OutputDriveType
00hPushpull
01hOpendrain
5:5
SchmittTrigger
00hDisable
01hEnable
DataByte4
LogicalGPIOnumber
62
DA_04649001_11
6October2009
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 01h
DataByte2
SetPin(scalar)
PinDriveLevel
00hLogicallow
01hLogicalhigh
DataByte3
LogicalGPIOnumber
ResponsetoaSetPin(scalar)RequestisanAckpacket.
DA_04649001_11
6October2009
63
Table38RequestGPIOSetPin(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 21h
DataByte2
SetPin(vector)
PinDriveLevel
00hLogicallow
01hLogicalhigh
DataByte3DataByteN
BitVectorofGPIOpinstoset
0bDonotsetpinlevel
1bSetpinlevel
ResponsetoaSetPin(vector)RequestisanAckpacket.
64
DA_04649001_11
6October2009
Table39RequestGPIOGetPin(scalar)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 02h
DataByte2
GetPin(scalar)
LogicalGPIOnumber
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 02h
GetPin(scalar)
DataByte2(Status)
Successful
DataByte3
00h
PinLevel
0bLogicallow
1bLogicalhigh
Forinputandoutputpins,valueindicates
currentlogicallevelatthepin.Forother
pinconfigurations,valueisundefined.
DA_04649001_11
6October2009
65
Table41RequestGPIOGetPin(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 22h
DataByte2DataByteN
GetPin(vector)
BitVectorofGPIOpinstoreport
0bDonotreportpinlevel
1bReportpinlevel
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 22h
GetPin(vector)
DataByte2(Status)
Successful
DataByte3DataByteN
00h
BitVectorofPinLevels
0bLogicallow
1bLogicalhigh
Forinputandoutputpins,bitvalue
indicatescurrentlogicallevelatthepin.
Forotherpinconfigurations,bitvalueis
undefined.
66
DA_04649001_11
6October2009
Table43RequestGPIOConfigureEventReporting(scalar)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 03h
DataByte2
ConfigureEventReporting(scalar)
ReportEnable
00hDisablereporting
01hEnablereporting
DataByte3
LogicalGPIOnumber
ResponsetoaConfigureEventReporting(scalar)RequestisanAckpacket.
DA_04649001_11
6October2009
67
Table44RequestGPIOConfigureEventReporting(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 23h
DataByte2
ConfigureEventReporting(vector)
ReportEnable
00hDisablereporting
01hEnablereporting
DataByte2DataByteN
BitVectorofGPIOpinsforwhichReport
Enableistobeapplied
0bDonotapply
1bApply
ResponsetoanEnableEventReporting(vector)RequestisanAckpacket.
68
DA_04649001_11
6October2009
Table45RequestGPIOAcknowledgeEventReport(scalar)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 04h
DataByte2
AcknowledgeEventReport(scalar)
LogicalGPIOnumber
ResponsetoanAcknowledgeEventReport(scalar)RequestisanAckpacket.
DA_04649001_11
6October2009
69
Table46RequestGPIOAcknowledgeEventReport(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 24h
DataByte2DataByteN
AcknowledgeEventReport(vector)
BitVectorofGPIOpinsforwhichevent
reportsaretobeacknowledged
0bDonotacknowledge
1bAcknowledge
ResponsetoanEnableEventReporting(vector)RequestisanAckpacket.
70
DA_04649001_11
6October2009
Table47RequestGPIOGetEventReport(scalar)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 06h
DataByte2
GetEventReport(scalar)
LogicalGPIOnumber
Table48ResponseGPIOGetEventReport(scalar)
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 06h
GetEventReport(scalar)
DataByte2(Status)
Successful
DataByte3
00h
TriggerEventStatus
0bNotriggereventdetected
1bTriggereventdetected
DA_04649001_11
6October2009
71
Table49RequestGPIOGetEventReport(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 26h
DataByte2DataByteN
GetEventReport(vector)
BitVectorofGPIOpinstoreport
0bDonotreporttriggerevent
1bReporttriggerevent
Table50ResponseGetEventReport(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 26h
GetEventReport(vector)
DataByte2(Status)
Successful
DataByte3DataByteN
00h
BitVectorofTriggerEventsdetected
0bNotriggereventdetected
1bTriggereventdetected
72
DA_04649001_11
6October2009
Table51RequestGPIOConfigureWake(scalar)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 1dh
DataByte2
ConfigureWake(scalar)
WakeEnable
00hDisablewake
01hEnablewake
DataByte3
LogicalGPIOnumber
ResponsetoaConfigureWake(scalar)RequestisanAckpacket.
DA_04649001_11
6October2009
73
Table52RequestGPIOConfigureWake(vector)
SMBus Protocol Byte
Description
Note
CommandByte
03h
GPIOControl
ByteCount
DataByte1(SubCommand) 3dh
DataByte2
ConfigureWake(vector)
WakeEnable
00hDisablewake
01hEnablewake
DataByte2DataByteN
BitVectorofGPIOpinsforwhichWake
Enableistobeapplied
0bDonotapply
1bApply
ResponsetoaConfigureWake(vector)RequestisanAckpacket.
74
DA_04649001_11
6October2009
PowerUp
Suspend/Sleep
Suspended/
Asleep
On
Off
PowerDown
Resume/Wake
TheAPinitiatesapowerstatechangebydisablingeventreporting,asitmaynotbeable
toprocess(asynchronous)Eventpacketswhilepreparingtoenterthenewpowerstate.
Table53liststhecommandsforenablinganddisablingreportingforeacheventtype.In
addition,theGlobalConfigureEventReportingcommandcanbeusedtoenableand
disablereportingforallevents.OncereportinghasbeendisabledforallECfunctional
units,theAPnotifiestheECofthepowerstatechangebyissuinganAPPowerDown,
APSuspend,orAPRestartcommand.TheECsendsaresponseforthecommandand
thenceasesfurtherSMBusoperationsinvolvingtheAP.
DA_04649001_11
6October2009
75
Table53EventReportingCommands
Event Type
System
ConfigureEventReporting
(Section6.1)
ConfigureEventReporting
(Section6.1)
Battery
ConfigureEventReporting
(Section6.1)
ConfigureEventReporting
(Section6.1)
GPIO
ConfigureEventReporting
(Section6.3)
ConfigureEventReporting
(Section6.3)
Keyboard
Enable(Section6.5)
Disable(Section6.5)
PS/2AuxiliaryDevice
AutoreceiveNBytes(Section
6.6)
CancelAutoreceive(Section
6.6)
ForthePowerDownandRestartcommands,theECnowreinitializesitsAPvisiblestate
inpreparationforthenextAPbootcycle.Inaddition,theECresetsitselfandreloadsits
firmwareafterthefirstPowerDownfollowingafirmwareupdateattempt(Section6.7.6).
Dependingonthesystemarchitecture,thePowerDownandRestartcommandsmay
performauxiliaryoperationssuchasshuttingoffthepowertotheAP,resettingtheAP,
orthelike.Anysuchauxiliaryoperationsaredeterminedbythesystemdesignerandare
outsidethescopeofthisdocument.
FortheSuspendcommand,theECbeginsmonitoringfordesignatedeventssuchthatthe
APcanbeawakenedwhenneeded.Whenawakeeventisdetected,theECwakestheAP
byassertingandholdingtheAP_WAKE#signal.TheECalsolatchesthewakeeventfor
subsequentreportingtotheAP.Thewakeevents(ifany)mustbespecifiedbytheAP
beforeissuingtheSuspendcommand.Ingeneral,thesametypesofeventsthatcanbe
reportedwithanEventpacketcanalsotriggerwakeupoftheAP.Eachmajorfunctional
unitintheECfirmwarehasaConfigureWakecommandforitsevents.Wakeisdisabled
foralleventsafterreset.
AssertingtheAP_WAKE#signalcausestheAPtowakeup.Whenreadytoresume
communicationswiththeEC,theAPinitiatesanormaldatatransfer,thefirststepof
whichistoasserttheEC_REQUEST#signal.OncetheECseesthissignal,itdeasserts
AP_WAKE#andresumesnormalSMBusoperationsinvolvingtheAP.Inordertoseethe
EC_REQUEST#signal,theECmustcontinuetomonitorthesignalevenwhentheAPis
asleep(orpowereddownorrestarting),unlessthesystemarchitectureimposessome
limitationsonwhenEC_REQUEST#canbeasserted.Forexample,iftheECcontrols
powertotheAP,thentheAPwontbeabletoassertEC_REQUEST#untilafterbeing
poweredupbytheEC;thus,theECneednotmonitorEC_REQUEST#untilafter
poweringuptheAP.Similarly,iftheECisthesoledevicecapableofwakingtheAP,
thentheECneednotmonitortheEC_REQUEST#signaluntilafteritassertsAP_WAKE#.
TheNonECWakeSupportcapabilitiesbit(Table70)mustbesetaccordingly.
76
DA_04649001_11
6October2009
AfterresumingSMBuscommunications,theAPmayissueanynumberofcommandsto
theEC.
Note:Eventreportingisstilldisabledatthispoint,astheAPmaynotyetbereadyto
process(asynchronous)eventpackets.Whenready,theAPrestartseventreporting
byissuingtheeventreportingcommandsinTable53and/ortheGlobalConfigure
EventReportingcommand.TheECwillthenreportthelatchedwakeeventby
sendingtheappropriateEventpackettotheAP,providedthatreportingisenabled
forthetypeofeventthattriggeredthewake.
ItislefttothesystemdesignerandECfirmwareimplementertodeterminewhethernon
wakeeventsaretobedetectedwhilereportingisdisabledortheAPisasleep,and
reportedlaterafterreportinghasbeenreenabled.Similarly,thesystemdesigner
specifieswhenwakeeventdetectionbeginsandend.Regardlessofwhendetection
begins,theECcannotassertAP_WAKE#untilaftersendingitsresponsefortheAP
Suspendcommand.
TheECfirmwareshouldbedesignedtominimizepowerconsumptionwhiletheAPis
asleeporpowereddown,sofarasispossiblewhilecarryingoutitsdutytodetectwake
events(ifanyareenabled)andmonitortheEC_REQUEST#signal(ifanydevicesother
thantheECcanwaketheAP).
Thepowercontrolcommandsaretabulatedbelow.AllofthesecommandsreturnanAck
packetasresponse.
Table54RequestSleepControlCommand
SMBus Protocol Byte
Description
Note
CommandByte
04h
Sleepcontrolcommand
ByteCount
01h
DataByte1(SubCommand)
00hGlobalConfigureEventReporting
01hAPPowerDown
02hAPSuspend
03hAPRestart
OthersReserved
DataByte2
Forsubcommand00h,configuration
setting
Otherwise,nodatabytes
DA_04649001_11
6October2009
77
Description
Note
CommandByte
04h
Sleepcontrolcommand
ByteCount
02h
DataByte1(SubCommand) 00h
GlobalConfigureEventReporting
DataByte2
ReportEvents
00hDisablereporting
01hEnablereporting
78
DA_04649001_11
6October2009
DA_04649001_11
6October2009
79
reportingisenabledviathesubsequentEnablecommand.Furtherdiscussionofsleep
controlcanbefoundinSection6.4.TheroleoftheConfigureWakecommandis
describedthere.
80
DA_04649001_11
6October2009
Table56RequestKeyboardCommand
SMBus Protocol Byte
Description
Note
CommandByte
05h
KBCcommand
ByteCount
02hforSetLEDsandSetscancodeset
01hotherwise
DataByte1(SubCommand) 7:0
ffhReset
f4hEnable
f5hDisable
f1hGetscancodeset
f0hSetscancodeset
edhSetLEDs
03hConfigureWake
04hConfigureWakeKeyReporting
OthersReserved
DataByte2
Forsubcommandf0h,scancodeset
01histheonlysupportedvalue
Forsubcommandedh,LEDindicators
7:3reserved,mustbezero
2:2scrolllockindicator(0=off,1=on)
1:1numlockindicator(0=off,1=on)
0:0capslockindicator(0=off,1=on)
Forsubcommand03h,configuration
setting
Forsubcommand04h,configuration
setting
Otherwise,nodatabyte
DA_04649001_11
6October2009
81
Description
Note
CommandByte
05h
KBCcommand
ByteCount
03h
DataByte1(SubCommand) 03h
ConfigureWake
DataByte2
ConfigurationAction
0hDisablewakeforevent
1hEnablewakeforevent
DataByte3
KeyboardEventType SeeTable59.Eachbitvaluecontrolswhether
Mask
theConfigurationActionisappliedtothe
correspondingKeyboardEventType.
0bDisablewakeforevent
1bEnablewakeforevent
Table58KeyboardEventType
System State Bit(s)
7:2
Description
Reserved(00h)
SpecialKeyPress
AnyKeyPress
82
DA_04649001_11
6October2009
Description
Note
CommandByte
05h
KBCcommand
ByteCount
02h
DataByte1(SubCommand) 04h
ConfigureWakeKeyReporting
DataByte2
Specifieswhetherscancodeforwakekeyis
placedinkeyboardoutputbufferfor
reportedtoAP
ReportWakeKey
00hDonotreportscancode
01hReportscancode
Defaultis00h
DA_04649001_11
6October2009
83
EnablePS/2interface.
84
DA_04649001_11
6October2009
2.
ReceiveNbytesofdatafromPS/2device(N=userspecifiedvalue).
3.
InhibitPS/2interface.
4.
SendthedatatotheAP.
5.
Waitfordatatransfertocomplete.
6.
Gotostep1.
Ifaparityerroroccursduringstep2ofthecycle,processingshouldcontinueasnormal
exceptthattheerrorwillbereportedinstep4.Inparticular,theErrorFlagmustbesetin
theCommandField,andtheStatusFieldmustbepopulatedwiththeproperstatuscode
(seeTable2).Aftertheerrorhasbeenreported,theacceptingstatecyclecontinuesasif
noerrorhadoccurred.
WhenanewcommandisreceivedonagivenPS/2port,autoreceivewillbecancelledon
thatport,ifitisineffect.Thenewcommandcannotbedelayedindefinitely.Thismeans
that,forexample,step2intheacceptingstatecyclemayhavetobeterminatedearlyif
thePS/2devicefailstotransmittheexpectedamountofdata.Inthiscase,thepartialdata
mustbediscarded(notsenttotheAP)andthePS/2interfaceinhibited.If,ontheother
hand,completedataisreceivedbytheEC,thensteps35canbecarriedoutnormally.
Eitherway,theacceptingstatecycleisnowterminated,anyfinaleventpackethas
alreadybeensenttotheAP,andthePS/2interfaceisinthenonacceptingstate.
Atthispoint,thenewlyreceivedcommandcanbeprocessedanditsresultingresponse
packetsentbacktotheAP.ThePS/2interfacewillentertheacceptingornonaccepting
state,dependingonthecommand.
Note:Whenautoreceiveisinitiated,theresponsepacketwillalwaysbesentpriorto
thefirsteventpacket.Similarly,whenautoreceiveisterminated,thelastevent
packetwillalwaysbesentpriortotheresponsepacket.
SinceAuxiliaryDeviceEventsarelikelytobethemostfrequentpacketsonthesystem,it
isimportanttominimizetransferoverheadandreduceSMBusbandwidthutilization
wherepossible.Oneoptimizationistoavoidsendingthefirstbyteofa3bytelegacyPS/2
mousesample.ThefirstbytecontainsthebuttonstateandX/Ymovementdirection,both
ofwhicharelikelytochangeslowlyrelativetotheX/Ylocationdatainbytes2and3.The
resulting2bytesamplecanbetransferredasafixedsizepacketwhichusestheSMBus
writewordoperation,thussavinganadditionalbyteofoverhead(PacketLength).This
optimizationisenabledanddisabledviatheSetCompressionsubcommand.
Compressiononlyappliestoautoreceiveevents.Thefirsteventpacketwillneverbe
compressed,becausethereisnovalidpreviousvalueforbyte1yet.
IfaPS/2parityerrorortimeouterroroccurs,itmustbereportedinthecorresponding
responseoreventpacket.
DA_04649001_11
6October2009
85
Table60FinalPS/2InterfaceStatePerCommand
Command
Sendcommand
Nonaccepting
ReceiveNbytes
Nonaccepting
AutoreceiveNbytes
Accepting
Cancelautoreceive
Nonaccepting
AutoreceiveandcancelautoreceivecommandsreturnAckpackets;othercommands
returnResponsepacketsasdocumentedinthefollowingsubsections.
86
DA_04649001_11
6October2009
Table61RequestAuxiliaryDeviceCommand
SMBus Protocol Byte
Description
Note
CommandByte
06h
PS/2AuxiliaryDevicecommand
ByteCount
DataByte1(SubCommand) 7:6
PS/2portselect
0hPS/2port0
1hPS/2port1
2hPS/2port2
3hPS/2port3
5:0
01hSendcommand(sendonebyte,then
receiveNbytes)
02hReceiveNbytes
03hAutoreceiveNbytes
04hCancelautoreceive
05hSetcompression
3dhConfigureWake
OthersReserved
DataByte2
Forsubcommand01h,databytetowrite
todevice
Forsubcommand02h,N,numberofbytes
toreceive(1to15)
Forsubcommand03h,N,numberofbytes
toreceive(1to15)
Forsubcommand05h
0hDisableCompression
1hEnableCompression
Forsubcommand3dh,configuration
action
Otherwise,nodatabyte
DA_04649001_11
6October2009
87
DataByte3
Forsubcommand01h,N,numberofbytes
toreceive(0to15)
Forsubcommand3dh,auxiliarydevice
eventtypemask
Otherwise,nodatabyte
88
DA_04649001_11
6October2009
Description
Note
CommandByte
06h
PS/2AuxiliaryDevicecommand
ByteCount
DataByte1(SubCommand) X1h
X=0hforPS/2port0
X=4hforPS/2port1
X=8hforPS/2port2
X=chforPS/2port3
DataByte2(Status)
00h
DataByte3DataByteM
Successful
Ndatabytesreadfromdevice
Description
Note
CommandByte
06h
PS/2AuxiliaryDevicecommand
ByteCount
DataByte1(SubCommand) X2h
X=0hforPS/2port0
X=4hforPS/2port1
X=8hforPS/2port2
X=chforPS/2port3
DataByte2(Status)
DataByte3DataByteM
00h
Successful
Ndatabytesreadfromdevice
DA_04649001_11
6October2009
89
Description
Note
CommandByte
06h
PS/2AuxiliaryDevicecommand
ByteCount
02h
DataByte1(SubCommand) 7:6
PS/2portselect
0hPS/2port0
1hPS/2port1
2hPS/2port2
3hPS/2port3
5:0
3dh
DataByte2
ConfigurationAction
0hDisablewakeforevent
1hEnablewakeforevent
DataByte2
AuxiliaryDevice
EventTypeMask
SeeTable65.Eachbitvaluecontrolswhether
theConfigurationActionisappliedtothe
correspondingAuxiliaryDeviceEventType.
0bDonotapplyConfigurationAction
1bApplyConfigurationAction
Table65AuxiliaryDeviceEventType
System State Bit(s)
7:2
0
Description
Reserved(00h)
AnyAuxiliaryDeviceEvent
90
DA_04649001_11
6October2009
Description
Note
CommandByte
07h
Systemcommand
ByteCount
DataByte1(SubCommand) 7:0
00hResetEC
01hSelfTest
02hNoop
10hGetECInterfaceSpecVersion
11hGetSystemCapabilities
12hGetSystemConfiguration
14hGetECProductName
15hGetECFirmwareVersion
20hInitializeGenericConfiguration
21hSendGenericConfigurationBytes
22hFinalizeGenericConfiguration
30hInitializefirmwareupdate
31hSendfirmwarebytes
32hFinalizefirmwareupdate
33hPollfirmwareupdate
40hGetfirmwaresize
41hReadfirmwarebytes
OthersReserved
DataByte2DataByteN
Nodataforsubcommands00h15h,20h,
22h,30h,32h,33h,40h,41h
DA_04649001_11
6October2009
91
6.7.1. Reset EC
ThiscommandtriggersafullresetoftheEC.TheECmustsendanAckPacketbefore
performingtheactualreset.
TheAPisresponsiblefordisablingeventsanddrainingResponsePacketqueuebefore
requestinganECreset.IftheAPfailstodoso,theECispermittedtocancelanypending
packetswaitingtobesenttotheAPsuchthattheresetcommandwillnotbestalled
indefinitelywaitingfortheAckPackettobesenttotheAP.
92
DA_04649001_11
6October2009
Table67ResponseGetECInterfaceSpecVersion
SMBus Protocol Byte
Description
Note
CommandByte
07h
Systemcommand
ByteCount
03h
DataByte1(SubCommand) 10h
GetECInterfaceSpecVersion
DataByte2(Status)
00h
Successful
DataByte3
VersionNumber
(10h=version1.0)
VersionofthisspecificationECiscompliant
with:themajorversionisspecifiedinthe
highnibble,theminorversioninthelow
nibble.
Forthisrevisionofthespec,theVersion
Numberis10h.
DA_04649001_11
6October2009
93
Table68ResponseGetSystemCapabilities
SMBus Protocol Byte
Description
Note
CommandByte
07h
Systemcommand
ByteCount
07h
DataByte1(SubCommand) 11h
GetSystemCapabilities
DataByte2(Status)
00h
Successful
DataByte3
GPIOallocation
NumberofECGPIOscontrollableby
Tegra
DataByte4
SystemCapabilitiesBits SeeTable69
70
DataByte5
SystemCapabilitiesBits
158
DataByte6
OEMSystem
CapabilitiesBits70
DataByte7
OEMSystem
CapabilitiesBits158
SeeTable70
94
DA_04649001_11
6October2009
Table69SystemCapabilitiesBits
System Capabilities
Bit(s)
15:3
2
Description
Reserved(0b)
FixedSizeEventPacketsupport
0bNotsupported
1bSupported
NonECWakesupport(asperSection6.4)
0bNotsupported
1bSupported
RuntimeGenericConfigurationsupport(asperSection6.7.5)
0bNotsupported
1bSupported
Table70OEMSystemCapabilitiesBits
OEM System
Capabilities Bit(s)
15:0
Description
OEMDefined
DA_04649001_11
6October2009
95
Table71ResponseGetSystemConfiguration
SMBus Protocol Byte
Description
Note
CommandByte
07h
Systemcommand
ByteCount
06h
DataByte1(SubCommand) 12h
GetSystemConfiguration
DataByte2(Status)
00h
Successful
DataByte3
SystemConfiguration
Bits70
SeeTable72
DataByte4
SystemConfiguration
Bits158
DataByte5
OEMSystem
ConfigurationBits70
DataByte6
OEMSystem
ConfigurationBits158
SeeTable73
96
DA_04649001_11
6October2009
Table72SystemConfigurationBits
System Configuration
Bit(s)
Description
15:6
Reserved(0b)
5:4
NumberofPS/2Ports
0hOnePort
1hTwoPorts
2hThreePorts
3hFourPorts
3:0
NumberBatterySlots(=maximumnumberofbatteriesinthesystem)
0hNoBatterySlots
1hOneBatterySlot0
2hTwoBatterySlots1and2
3hThreeBatterySlots0,1and2
4hFourBatterySlots0,1,2and3
OthersReserved
Table73OEMSystemConfigurationBits
OEM System
Configuration Bit(s)
15:0
Description
OEMDefined
DA_04649001_11
6October2009
97
Description
Note
CommandByte
07h
Systemcommand
ByteCount
N=03h20h
DataByte1(SubCommand) 14h
GetECProductName
DataByte2(Status)
00h
Successful
DataByte3DataByteN
ASCIIstring
ECproductnameisupto30characters(may
notbenullterminated)
98
DA_04649001_11
6October2009
Description
Note
CommandByte
07h
Systemcommand
ByteCount
N=03h20h
DataByte1(SubCommand) 02h
GetECFirmwareVersion
DataByte2(Status)
15h
Successful
DataByte3
MinorVersionbits70 MinorVersionNumber
DataByte4
MinorVersionbits15
8
DataByte5
MajorVersionbits70 MajorVersionNumber
DataByte6
MajorVersionbits15
8
DA_04649001_11
6October2009
99
iscomputedusingtheCRC32algorithmfromIEEE802.3(x32+x26+x23+x22+x16+
x12+x11+x10+x8+x7+x5+x4+x2+x+1).
TheECvendorisresponsibleforprovidingtoolsanddocumentationtoassistsystem
integratorsingeneratingtheconfigurationinformation(bothcontentandformat).The
vendormaywishtoleveragepreexistingtoolsthatonlyaddresstheopaquebody
contentportionoftheconfigurationinformation.Inthiscase,theECvendoris
additionallyresponsibletoprovidetoolsanddocumentationtoassistsystemintegrators
intransformingtherawbodycontentintotheformatneededbytheGeneric
Configurationcommands.
TheheadercontentsaredetailedinTable76.TheheadercontainsatrailingCRC32
checksum(justlikethebody),allowingtheAPtovalidatetheintegrityoftheheader
contents.Integrityischeckedbycomputingarunningchecksumthatcoverstheheader
contents,excludingthetrailingchecksumbytes.Iftherunningchecksumvalueisnot
equaltothetrailingCRCvalue,thenintegrityhasbeencompromised.Iftheheaderis
foundtobeintact,thentheintegrityofthebodycanalsobecheckedinasimilarmanner.
TheremaininginformationintheheadercanbeusedbytheAPtoidentifythe
configurationdataandtodecidewhethertoproceedwiththeupdate.Specifically,the
GetECInterfaceSpecVersion,GetECProductName,andGetECFirmwareVersion
commandsprovideusefulinformationthattheAPcanthencomparewiththeheader
contents.Ingeneral,theECInterfaceSpecVersionandECProductNameintheheader
mustmatchthecorrespondingvaluesreportedbythecurrentlyrunningECfirmware;
otherwise,theAPwillrejecttheconfigurationinformation.
ConfigurationinformationisdownloadedtotheECina3stageprocessinitialize,send
bytes,andfinalizeasillustratedinFigure12.First,theInitiateGenericConfiguration
commandissent.ThispreparestheECtoreceivetheconfigurationdataandalsoresets
itsrunningchecksumvalue.Next,thebodycontentsaretransferredtotheECviaaseries
ofSendGenericConfigurationBytescommands.Eachsuchcommandreportsthe
cumulativenumberofbytesreceivedbytheEC.Asbytesarereceived,theECupdatesits
runningchecksumvalue.Onceallthebodydata(includingtrailingchecksum)havebeen
transferredinthismanner,theAPperformsaFinalizeGenericConfigurationcommand.
ThistriggerstheECtoperformanyfinalchecksontheconfigurationdata.Onerequired
checkisfortheECtoverifythattherunningchecksumvalueiszero,reportingaStatus
ofChecksumerrorotherwise.TheECmayoptionallyperformadditionalchecks,sinceit
hasgreaterknowledgeoftheinternalformatofthebodycontentsthandoestheAP.If
theECdetectsnoerror,itreportsaStatusofSuccesstotheAP.
100
DA_04649001_11
6October2009
Table76GenericConfigurationPackageHeader
Byte Number
Description
Note
03
MagicNumber
ASCIIstringcnfg;notnullterminated
ECInterfaceSpec
Version
Major/minorversion;sameformatasin
GetECInterfaceSpecVersionResponse,
Section6.7.4.1
Reserved
Mustbe00h
635
ECProductName
ASCIIstring;sameformatasinGetEC
ProductNameResponse,Section6.7.4.4
3639
ECFirmwareVersion
Major/minorversion;sameformatasin
GetECFirmwareVersionResponse,
Section6.7.4.5
4043
ConfigurationID
OEMdefinedvaluespecifyingthetypeof
configurationdatacontainedinthis
package.
4447
BodyLength
Lengthofopaquedataincludingits
trailingchecksum;firstbyteisleast
significant,lastbyteismostsignificant
4851
CRC
Checksumcomputedovertheabove
headerdata;firstbyteisleastsignificant,
lastbyteismostsignificant
DA_04649001_11
6October2009
101
Figure12GenericConfigurationProcedure
Start
Initialize
Generic
Config
Success?
y
Send
Generic
ConfigBytes
n
Success?
y
Alldata
sent?
Finalize
Generic
Config
Success?
End
102
DA_04649001_11
6October2009
Table77RequestInitializeGenericConfiguration
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 20h
InitializeGenericConfiguration
DataByte2
ConfigurationID
ConfigurationID
Bits70
DataByte3
ConfigurationID
Bits158
DataByte4
ConfigurationID
Bits2316
DataByte5
ConfigurationID
Bits3124
OEMdefinedvaluespecifyingthetypeof
configurationdatatofollow.
DA_04649001_11
6October2009
103
Table78RequestSendGenericConfigurationBytes
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 21h
DataByte2DataByteN
SendGenericConfigurationBytes
Genericconfigurationdatabytes
Table79ResponseSendGenericConfigurationBytes
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 21h
SendGenericConfigurationBytes
DataByte2(Status)
00hSuccessful
08hChecksumerror
DataByte3
DataByte4
BytesReceived
CumulativeNumberofBytesReceived
Bits70
Firstbyteisleastsignificant;lastbyteis
mostsignificant.
BytesReceived
Bits158
DataByte5
BytesReceived
Bits2316
DataByte6
BytesReceived
Bits3124
104
DA_04649001_11
6October2009
Table80RequestFinalizeGenericConfiguration
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 22h
FinalizeGenericConfiguration
Table81ResponseFinalizeGenericConfiguration
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 22h
FinalizeGenericConfiguration
DataByte2(Status)
00hSuccessful
08hChecksumerror
09hDevicewriteerror
0bhDataoverflowerror
0chDataunderflowerror
DA_04649001_11
6October2009
105
1.
TheAPnotifiestheECtoprepareforfirmwareupdatebyissuingtheInitialize
FirmwareUpdatecommand.
2.
TheAPsendsthefirmwareimagetotheECthroughaseriesofSendFirmware
Bytescommands.
3.
TheAPcompletesthefirmwareupdatebyissuingtheFinishFirmwareUpdate
command.
4.
TheAPoptionallyreadsbackthenewfirmwareimagefromtheEC.SeeSection
6.7.7fordetails.
5.
TheAPpowersdownbyissuingtheConfigureGlobalEventReporting
commandtodisableeventreporting(optional),followedbytheAPPowerDown
command(notoptional).TheECthenresetsitselfandbeginsexecutingthenew
firmwareimageintimeforthenextsystemboot.
TheECisfreetorejectanyextraneouscommandsreceivedbetweensteps1and5above,
byrespondingwithanInvalidStateerror.TheECisalsofreetostopreportingevents
duringthefirmwareupdateprocess.Theserestrictionsareintendedtolimitthefootprint
oftheECsidefirmwareupdatecode,suchthatthecodecanfitentirelyintheECs
onboardmemory.Inthisway,firmwareupdatescanbesupportedevenforEC
architecturesthatnormallyexecutedirectlyoutofthefirmwaredatastore.
ThefirmwareupdatemustbedistributedbytheECfirmwaredeveloperasapackage
consistingofaheaderandabody.TheheaderisusedonlybytheAPandcontains
informationthatidentifiestheupdate.TheAPultimatelystripsofftheheaderandsends
onlythebodytotheEC.TheECmustwritetheentirebodycontentstoitsdatastore
(includingthetrailingchecksumvalue,discussedbelow).
Theheaderandbodyeachcontainatrailingchecksum,whichcanbeusedtoverifytheir
integrity.ThechecksumsarecomputedusingtheCRC32algorithmfromIEEE802.3(x32
+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1).Asidefromthe
trailingchecksum,thebodycontentsareentirelyopaquetotheAP.
TheheadercontentsaredetailedinTable82.Aftervalidatingtheheader,theAPcan
compareitscontentswithinformationreportedbythecurrentlyrunningfirmwareimage
beforedecidingwhethertoproceedwiththeupdate.Specifically,theGetECInterface
SpecVersion,GetECProductName,andGetECFirmwareVersioncommandsare
usefulforthispurpose.Ingeneral,theECInterfaceSpecVersionandECProductName
intheheadermustmatchthecorrespondingvaluesreportedbythecurrentlyrunning
ECfirmware;otherwise,theAPwillrejectthenewfirmwareimage.
OncetheAPdecidestoproceedwiththeupdate,itissuesanInitializeFirmwareUpdate
command.ThiscommandpreparestheECtoupdateitsfirmwarestore.TheEC
initializesitsrunningCRCvalueanditscounteroffirmwaredatabytesreceived.
106
DA_04649001_11
6October2009
Note:TheECmustrespondtotheAPwithinthecommunicationtimeoutperiod
specifiedinthisdocument(Section8).IfthestoragedevicefortheECfirmwareis
slow,though,storageoperationsperformedbytheECmaynotfinishbeforea
responseisduetotheAP.Toaccommodatethissituation,theAPentersapolling
loopafterreceivingaresponsefromtheEC(providedthattheECdoesntreportan
error).TheAPissuesthePollFirmwareUpdatecommand,towhichtheECreports
thatitisready,busy,orhasencounteredanerror.PollingcontinuesaslongastheEC
reportsbusy.WhenevertheECreportsreadyorthatithasencounteredanerror,
pollingterminates.UnliketheAP,theEChasdetailedknowledgeoftheparticular
storagedeviceinstalledinthesystem.TheECisencouragedtomakeuseofthis
informationtoreportanerrorifthestoragedevicedoesnotrespondwithina
suitableperiodoftime.
Next,theAPbeginssendingthebodycontentstotheECusingtheSendFirmwareBytes
command.Withthiscommand,theTegraAPtransfersbetween1and30bytesof
firmwaredatatotheEC.TheECmaintainsarunningcountofthenumberofdatabytes
receivedfromtheAP,whichitreportsbacktotheAPintheSendFirmwareBytes
responsepacket.TheAPcanusethisinformationtodeterminewhetheranypacketshave
beendropped.TheECmustalsocomputearunningCRCvalueoverthecumulatively
receiveddata(excludingthefinal4bytesreceived,i.e.,thetrailingCRCvalue),which
willbeusedtoverifytheintegrityofthereceivedfirmwaredata.
TheECmayoptionallybufferthereceiveddatabeforewritingittothedatastore.If
writingtothedatastore,itistheECsresponsibilitytoverifythecorrectnessofthe
writtendatabeforesendingaresponsebacktotheAP.Ifthewriteorsubsequent
verificationfails,theECwillreportaStatusvalueofDeviceWriteError.Afterthefirst
writeerror,theECisfreetofailanysubsequentSendFirmwareBytescommands.
OncetheAPhassentallofthebodycontents(includingthetrailingCRC)itissuesthe
FinalizeFirmwareUpdatecommandtocompletetheupdateprocess.Ifanyerrorswere
reportedbytheprecedingSendFirmwareBytescommands,FinalizeFirmwareUpdate
mustalsoreportanerror;otherwise,theECproceedstowriteanyremainingbuffered
datatoitsdatastoreandcheckthecumulativeCRCvalueagainstthetrailingCRCvalue
(final4bytesofthedownloadeddata).IftheCRCvaluesdonotmatch,thena
transmissionerrorhasoccurredandtheECreportsaStatusofChecksumError.
Finally,iftheamountofdatareceivedbytheEC(asreportedinitsresponsetothefinal
SendFirmwareBytescommand)doesntmatchthesizeofthebody,thentheupdatehas
failedregardlessoftheStatusreportedbyFinalizeFirmwareUpdate.
Finally,theAPagainpollstheECusingthePollFirmwareUpdatecommand,allowing
theECextratimetocompleteanyfinalstorageoperations.
TheAPcannowoptionallyreadbackthefirmwareimage(specifically,thebodycontents
includingtrailingCRC),presumingtheupdatesucceeded.TheAPisfreetoreturnto
InitializeFirmwareUpdateandrepeatthecyclefromthebeginning,regardlessof
whetherthepreviousattemptsucceededorfailed.Finally,wheneverafirmwareupdate
DA_04649001_11
6October2009
107
isattempted(whetheritsucceedsornot),theECisresponsibleforresettingitselfafter
thenextAPPowerDowncommandsothatthenewfirmwarewillbeloadedand
executedwhenthesystemissubsequentlybootedup.
Table82FirmwareUpdatePackageHeader
Byte Number
Description
Note
03
MagicNumber
ASCIIstringupdt;notnullterminated
ECInterfaceSpec
Version
Major/minorversion;sameformatasin
GetECInterfaceSpecVersionResponse,
Section6.7.4.1
Reserved
Mustbe00h
635
ECProductName
ASCIIstring;sameformatasinGetEC
ProductNameResponse,Section6.7.4.4
3639
ECFirmwareVersion
Major/minorversion;sameformatasin
GetECFirmwareVersionResponse,
Section6.7.4.5
4043
BodyLength
Lengthofopaquedataincludingits
trailingchecksum;firstbyteisleast
significant,lastbyteismostsignificant
4447
CRC
Checksumcomputedovertheabove
headerdata;firstbyteisleastsignificant,
lastbyteismostsignificant
108
DA_04649001_11
6October2009
Figure13FirmwareUpdateProcedure
DA_04649001_11
6October2009
109
Table83RequestInitializeFirmwareUpdate
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 30h
InitializeFirmwareUpdate
110
DA_04649001_11
6October2009
Table84RequestSendFirmwareBytes
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 31h
DataByte2DataByteN
SendFirmwareBytes
Firmwaredatabytes
DA_04649001_11
6October2009
111
Table85ResponseSendFirmwareBytes
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 31h
SendFirmwareBytes
DataByte2(Status)
00hSuccessful
08hChecksumerror
09hDevicewriteerror
0chDataunderflowerror
DataByte3
CumulativeNumberofBytesReceived
BytesReceived
Bits70
DataByte4
BytesReceived
Bits158
DataByte5
BytesReceived
Bits2316
DataByte6
BytesReceived
Bits3124
Firstbyteisleastsignificant;lastbyteis
mostsignificant.
112
DA_04649001_11
6October2009
Table86RequestFinalizeFirmwareUpdate
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 32h
FinalizeFirmwareUpdate
Table87ResponseFinalizeFirmwareUpdate
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 32h
FinalizeFirmwareUpdate
DataByte2(Status)
00hSuccessful
08hChecksumerror
09hDevicewriteerror
0bhDataoverflowerror
0chDataunderflowerror
DA_04649001_11
6October2009
113
Table88RequestPollFirmwareUpdate
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 33h
PollFirmwareUpdate
Table89ResponsePollFirmwareUpdate
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 33h
PollFirmwareUpdate
DataByte2(Status)
00hSuccessful
08hChecksumerror
09hDevicewriteerror
0bhDataoverflowerror
0chDataunderflowerror
DataByte3
ECreadyflag
00hECbusy
01hECready
114
DA_04649001_11
6October2009
state.Thereadbackfirmwareimagemustcontainthesametrailingchecksumvalueas
originallyprovidedbytheAPwhentheimagewasinstalled.ThisenablestheAPto
verifytheintegrityofthereadbackimage.
Ifnofirmwareupdatehasbeenattemptedbeforethereadattempt,theECwillprovide
thecurrentlyexecutingfirmwareimage.Ifperformedafterasuccessfulfirmwareupdate,
theECwillprovidethenewlydownloadedfirmwareimage.Readingofthefirmware
imageisnotsupportedfollowinganunsuccessfulupdate;thedatareturnedbytheECis
undefinedinthiscase.
Tobeginreadingthefirmwareimage,theAPissuesaGetFirmwareSizecommand.This
returnsthesizeofthefirmwareimageinbytesandalsoresetstheECsreadpointer.
TheAPthenbeginsreadingthefirmwaredatabyinvokingtheReadFirmwareBytes
command,whichreturnsbetween1and30bytesofdata.Theresponsemustcontainat
leastonebyteoffirmwaredata,unlesstheentirefirmwareimagehasalreadybeen
transferred.Inthislattercase,theECreturnszerodatabytesalongwithaStatusofData
Underflow.Ifareaderroroccurs,theECreportsaStatusofDeviceReadError;thiserror
isstickyandremainsineffectuntilthenextGetFirmwareSizecommandisissued.
DA_04649001_11
6October2009
115
Table90RequestGetFirmwareSize
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 40h
GetFirmwareSize
Table91GetFirmwareSizeResponse
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 40h
GetFirmwareSize
DataByte2(Status)
00h
Successful
DataByte3
FirmwareSizeBits70 Firmwareimagesizeinbytes
DataByte4
Firstbyteisleastsignificant;lastbyteismost
FirmwareSizeBits15
significant.
8
DataByte5
FirmwareSizeBits23
16
DataByte6
FirmwareSizeBits31
24
116
DA_04649001_11
6October2009
Table92RequestReadFirmwareBytes
SMBus Protocol Byte
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 41h
ReadFirmwareBytes
Table93ResponseReadFirmwareBytes
Description
Note
CommandByte
07h
SystemControl
ByteCount
DataByte1(SubCommand) 41h
ReadFirmwareBytes
DataByte2(Status)
00hSuccessful
08hChecksumerror
0ahDevicereaderror
DataByte3DataByteN
Firmwaredatabytes
DA_04649001_11
6October2009
117
Description
Note
CommandByte
c5h
SystemEvent,variablelength
ByteCount
02h
DataByte1
SystemStateBits70
SeeTable6
DataByte2
SystemStateBits158
DataByte3
OEMSystemStateBits
70
DataByte4
SeeTable7
OEMSystemStateBits
158
Description
Note
CommandByte
a8h
BatteryEvent,fixedlength
DataByte1
BatterySlot
0hforBatteryinSlot0
1hforBatteryinSlot1
2hforBatteryinSlot2
3hforBatteryinSlot3
DataByte2
BatterySlotStatus
SeeTable13
118
DA_04649001_11
6October2009
Description
Note
CommandByte
c0h
KeyboardEvent,variablelength
ByteCount
DataByte1N(Payload)
Scancodeforonekey;seeSection6.5fora
discussionofscancodeformats
Table97KeyboardEvent,FixedLength(1ByteScanCode)
SMBus Protocol Byte
Description
Note
CommandByte
80h
KeyboardEvent,fixedlength
DataByte1(Payload)
Singlebytescancodeforonekey;see
Section6.5foradiscussionofscancode
formats
DA_04649001_11
6October2009
119
Table98KeyboardEvent,FixedLength(2ByteScanCode)
SMBus Protocol Byte
Description
Note
CommandByte
a0h
KeyboardEvent,fixedlength
DataByte1(Payload)
Loworderbyteoftwobytescancodefor
onekey;seeSection6.5foradiscussionof
scancodeformats
DataByte2(Payload)
Highorderbyteoftwobytescancodefor
onekey;seeSection6.5foradiscussionof
scancodeformats
120
DA_04649001_11
6October2009
Description
Note
CommandByte
cXh
AuxiliaryDeviceEvent,variablelength
X=1hforPS/2port0
X=2hforPS/2port1
X=3hforPS/2port2
X=4hforPS/2port3
ByteCount
DataByte1N(Payload)
Ndatabytes,whereNisspecifiedasthe
argumenttoautoreceivesubcommand
DA_04649001_11
6October2009
121
Table100AuxiliaryDeviceEvent,FixedLength(2BytePayload)
SMBus Protocol Byte
Description
Note
CommandByte
aXh
AuxiliaryDeviceEvent,variablelength
X=1hforPS/2port0
X=2hforPS/2port1
X=3hforPS/2port2
X=4hforPS/2port3
DataByte1(Payload)
Devicesamplebyte
DataByte2(Payload)
Devicesamplebyte
Table101AuxiliaryDeviceErrorEvent,FixedLength
SMBus Protocol Byte
Description
Note
CommandByte
8Xh
AuxiliaryDeviceEvent,fixedlengthwith
error
X=1hforPS/2port0
X=2hforPS/2port1
X=3hforPS/2port2
X=4hforPS/2port3
DataByte1(Status)
Errorcodeinformation
122
DA_04649001_11
6October2009
Table102GPIOEvent(scalar),FixedLength
SMBus Protocol Byte
Description
Note
CommandByte
86h
GPIOEvent(scalar),fixedlength
DataByte1
LogicalGPIOnumberoftriggeredpin
Table103GPIOEvent(vector),VariableLength
SMBus Protocol Byte
Description
Note
CommandByte
C7h
GPIOEvent(vector),variablelength
ByteCount
DataByte1DataByteN
BitVectorofTriggerEventsdetected
0bNotriggereventdetected
1bTriggereventdetected
DA_04649001_11
6October2009
123
8. EC Behavioral Rules
ThissectiondescribesECbehavioralrequirementsandrecommendationsforproper
communicationwithTegraAPoverSMBusinterface.
AfterECpoweronreset,theECmustbereadytoreceiverequestsfromtheAP;however,
theECmustwaittoreceivethefirstrequestfromtheAPbeforeinitiatinganySMBus
transfersinvolvingtheAP.Inthisway,theAPsidedriverisguaranteedtobereadyto
acceptSMBustransfersfromtheEC.
ThissameprocessisrepeatedwhentheAPentersdeepsleep.OncenotifiedthattheAP
isenteringdeepsleep,theECmustholdanyfurtherSMBustransfersinvolvingtheAP
untilaftertheAPwakesupandinitiatesitsfirstrequest.NotethattheECisrequiredto
sendanacknowledgementfortheAPsdeepsleepnotificationbeforestoppingSMBus
communications.
ECshouldgenerallytransferpacketsinthefollowingpriorityorder(fromhightolow):
1.
Responsepackets
2.
Requestpackets
3.
Eventpackets
ThisshouldavoiddeadlockconditionssincetheResponsepacketqueueisguaranteedto
drainifnonewRequestpacketsarereceived.Itshouldalsoavoidstarvationsinceboth
RequestandResponsepacketsareprocessedbeforeEventpackets.Iftoomany
Request/Responsesareperformed,though,Eventpacketsmaybedelayed.TheEC
firmwaremusthandlethisconditiongracefully.AuxiliaryDeviceEventsalready
degradegracefully,becauseneweventscannotaccumulateuntilpreviouseventshave
alreadybeensenttotheAP.KeyboardEventsshouldalsodegradegracefullyasthereis
alreadyamechanisminplacetoindicateECinternalkeypressbufferoverflow.
TheAPmayNACKanSMBusoperationatanytimeifitisunabletoprocessthe
operationatthattime.TheECisrequiredtoretrytheNACKedoperationafteradelayof
10msec.Iftheoperationstillcannotbecompletedafter10retryattempts,theECmust
inhibitanyfurtherSMBusoperationsuntilsuchtimeastheAPmakesarequest.Oncethe
APmakesitsrequest,SMBusoperationsareonceagainenabledandtheECmustresume
retryingtheNACKedoperation.Thiscycleofretryingtheoperationandinhibitingthe
buscontinuesuntiltheoperationiscompletedsuccessfully.
AfterECPowerOnReset,ECmustbereadytoacceptTegrarequestmessagesover
SMBusandrespondtothemwiththefollowingtimeoutlimits:
AftertheEC_REQUESTsignalisasserted,theECisexpectedtoreadthepending
RequestPacketfromtheAPwithin20msec(typical),500msec(max).After600msec,
theAPwillconcludethatanerrorhasoccurred.
124
DA_04649001_11
6October2009
AftertheECreceivesaRequestPacket,theECmustsendacorrespondingResponse
PackettotheAPwithin20msec(typical),500msec(max).After600msec,theAP
willconcludethatanerrorhasoccurred.
TheECmustbeabletohandlethecasewheretheAPmakesadditionalrequestsbefore
theEChasyetsentresponsesforpreviousrequests.OnepossibleECimplementation
wouldbetoserializerequest/responsepairsbyignoringtheEC_REQUESTsignaluntil
aftersendingaresponseforthecurrentrequest;onlythenwouldthenextrequestberead
fromtheAP.ShouldtheECelecttoprocessmultiplerequestsconcurrently,requests
sharingacommonCommandTypemustbequeuedandprocessedsequentiallyinthe
orderreceived.
DA_04649001_11
6October2009
125
Command
Sub-command
01hSystemStatus
00hGetSystemStatus
01hConfigureEventReporting
02hAcknowledgeSystemStatus
fdhConfigureWake
02hBatteryInformation
BatterySlotTag,bits7:5
0hBatterySlot0
1hBatterySlot1
2hBatterySlot2
3hBatterySlot3
OthersReserved
BatteryOperations,bits4:0
00hGetSlotStatusandCapacityGauge
01hGetVoltage
02hGetRemainingTimetoEmpty
03hGetCurrent
04hGetAverageCurrent
05hGetAveragingTimeInterval
06hGetRemainingCapacity
07hGetLastFullChargeCapacity
08hGetDesignCapacity
09hGetCriticalCapacity
0ahGetTemperature
0bhGetManufacturerName
0chGetModel
0dhGetType
0ehSetRemainingCapacityAlarm
0fhGetRemainingCapacityAlarm
10hSetConfiguration
11hGetConfiguration
12hConfigureEventReporting
1dhConfigureWake
OthersReserved
126
DA_04649001_11
6October2009
Command
Sub-command
03hGPIOControl
Scalarsubcommands
00hConfigurePin
01hSetPin(scalar)
02hGetPin(scalar)
03hConfigureEventReporting(scalar)
04hAcknowledgeEventReport(scalar)
06hGetEventReport(scalar)
1dhConfigureWake(scalar)
Vectorsubcommands
21hSetPin(vector)
22hGetPin(vector)
23hConfigureEventReporting(vector)
24hAcknowledgeEventReport(vector)
26hGetEventReport(vector)
3dhConfigureWake(vector)
OthersReserved
04hSleepControl
00hGlobalConfigureEventReporting
01hAPPowerDown
02hAPSuspend
03hAPRestart
OthersReserved
05hKeyboardControl
ffhReset
f4hEnable
f5hDisable
f1hGetscancodeset
f0hSetscancodeset
edhSetLEDs
03hConfigureWake
04hConfigureWakeKeyReporting
OthersReserved
DA_04649001_11
6October2009
127
Command
Sub-command
06hPS/2AuxiliaryDeviceControl
PS/2PortSelect,bits7:6
0hPS/2port0
1hPS/2port1
2hPS/2port2
3hPS/2port3
PS/2PortOperation,bits5:0
01hSendcommand(sendonebyte,thenreceiveNbytes)
02hReceiveNbytes
03hAutoreceiveNbytes
04hCancelautoreceive
05hSetcompression
3dhConfigureWake
OthersReserved
07hSystemControl
00hResetEC
01hSelfTest
02hNoop
10hGetECInterfaceSpecVersion
11hGetSystemCapabilities
12hGetSystemConfiguration
14hGetECProductName
15hGetECFirmwareVersion
20hInitializeGenericConfiguration
21hSendGenericConfigurationBytes
22hFinalizeGenericConfiguration
30hInitializefirmwareupdate
31hSendfirmwarebytes
32hFinalizefirmwareupdate
33hPollfirmwareupdate
40hGetfirmwaresize
41hReadfirmwarebytes
OthersReserved
128
DA_04649001_11
6October2009