资源描述
Speaker:WYITE 8512 1精选课件Whats the EC?nEmbedded Controller comes form ACPI structurenHost is communicated EC by LPC interface.The I/O port are 60/64 and 62/66 nEC integrated ps2 device,keyboard matrix,battery charger,fan control,power sequence,hot key function,backlight,CPU thermal sensor,system power consumption,etc.2精选课件System StructurePS/2 KB/MSMATRIXFAN ControlChargerFlash ROM Power Sequence.NB SB ECLPC3精选课件Keyboard Controller Overview18 Scan Out(Column)Scan MatrixKeyboard 3 PS/2 DevicesHost SystemLPC/Firmware HubSMBusITE KBCPS/2ScanI2CHIF3 SMBus Devices8 Scan In(Row)4精选课件EC Feature ITE ECPS/2 KB/MSMATRIXACPIPower managementSMBusKBS MonitorUART/CIRPWM ADC/DACShare BIOS5精选课件EC Position6精选课件Share BIOS Architecture 64K16M ByteBIOS ROM ZoneKBC ROM Zone064KMax:16M64K ByteMax:16M-64K ByteFull space 16M ByteKBC ROM Zone7精选课件BIOS&EC Code Position8精选课件FeaturesnIBM AT&PS/2 8042-Compitable Host InterfacesnSupport all standard Host CommandsnACPI Embedded Controller InterfacenACPI System Management Bus InterfacenPS/2 DevicesnScan Matrix KeyboardnOEM Customization9精选课件Features Host InterfacenHost InterfacesPrimary Host Interface(0 x60,0 x64)HIF1 8042 Command InterfaceSecondary Host Interface(0 x62,0 x66)HIF2 Logical HIF ACPI Command InterfaceHIF3 Logical HIF SMI AccessThird Host Interface(0 x68,0 x6C)nIBM AT&PS/2 8042-CompatibleStandard KBC Commands 0 x64 port Standard KBD Commands-0 x60 port Standard AUX Commands 0 x64 port D4 command10精选课件Command Handler11精选课件BitDescription7 Parity Error6 Timeout Error5 Auxiliary Output Buffer Full4 Inhibit Switch3 Command/Data2 System Flag1 Input Buffer Full(IBF)0 Output Buffer Full(OBF)n Keyboard Controller Status Register 64h12精选课件Features Standard KBC CommandsStandard 64 command listnWrite/Read Keyboard Controller Command Byte(60h/20h)nThe KCCB resides in 8042 RAM location 20h,Address 20h defined in the IBM 8042 programming specification.nIBM standard command set,use command 20h to read the KCCB and command 60h to write KCCB.Default:0 x65 PS/2 Mouse Not Present0 x47 PS/2 Mouse PresentvController Command Byte:Bit7-ReservedBit6-Keyboard TranslateBit5-Disable Auxiliary DeviceBit4-Disable KeyboardBit3-ReservedBit2-System FlagBit1-Enable Auxiliary InterruptBit0-Enable Keyboard Interrupt13精选课件Features Standard KBC CommandsnOutput Buffer Write Commands:Write Keyboard Output Buffer(D2h)Write Auxiliary Device Output Buffer(D3h)nWrite to Auxiliary Device Command(D4h)Write to PS2 DevicenPulse Output Port Commands:Pulse Both Reset and Gate A20(FCh)Pulse Gate A20(FDh)Pulse System Reset(FEh)14精选课件Features Standard KBD CommandsStandard KBD 60 command listnSet/Reset Status Indicators Command(EDh)nEcho Command(EEh)nSelect Alternate Scan Codes Command(F0h)nRead Id Command(F2h)nSet Typematic Rate/Delay Command(F3h)nEnable Command(F4h)nDefault Disable Command(F5h)nSet Default Command(F6h)nSet Keys Commands(F7h-FDh)nResend Command(FEh)nReset Command(FFh)15精选课件Features Standard AUX CommandsStandard PS2 64_D4 command listnReset Scaling(E6h)nSet Scaling to 2:1(E7h)nSet Resolution(E8h)nStatus Request(E9h)nSet Stream Mode(EAh)nRead Data(EBh)nRead/Set Wrap Mode(ECh/EEh)nSet Remote Mode(F0h)nRead Device Type(F2h)nSet Sampling Rate(F3h)nEnable/Disable Auxiliary Device(F4h/F5h)nSet Default(F6h)nReset Auxiliary Device(FFh)16精选课件Features CommandsnExtended Controller CommandsSpecific FunctionalitiesAccess Legacy EC SpaceSample A/D ChannelTurn On/Off LEDsAccess Configuration TableEtc.17精选课件Features ACPI InterfacenEmbedded Controller Interface(0 x62/0 x66)nACPI fully supportCommand Setn0 x80-Read EC spacen0 x81-Write EC spacen0 x82-Burst Enablen0 x83-Burst Disablen0 x84-Query SCI event18精选课件Features PS/2 DevicesnThree PS/2 Ports One internal ps2 mouse&two external ps2 device(one keyboard+one mouse)Port 1&Port 2 Keyboard&Pointing DevicesPort 3 Touchpad Devices(Internal)nActive PS/2 MultiplexingnHot-plugif Ext.aux device is also attached,send command to it but do not pass Ext.response to the system.19精选课件Features Scan MatrixnAll Standard Notebook PC KeysnEasy CustomizationDownload OEM Scan Table in RAMUpdate Scan Table in ROM20精选课件Features OEM CustomizationnOEM-Definable Hotkeys-Hotkey,Quick button nOEM-Definable SMI/SCI Events-Battery event,System Beep,Thermel throttle event,etc 21精选课件Firmware Architecture22精选课件Firmware ROM ImagenKBC.ROM-64KCrisisRecoveryConfigurationTablesScanTablesMainCore0 x0000OEM function0 xFFFF0 x100023精选课件Power UpInitializationIdleInterruptRuntime ServiceEC FlowchartnTop-Level Flow Diagram24精选课件Power UpInitializationIdleFirmware-InitializationCrisis?CrisisInitializationCrisisRecoveryPower UpIdleNormalInitializationYesNo25精选课件InitializationIdleFirmware-IdleStandbyStandbySetupDisable InterruptsEnableInterruptsYesNoIdle(SLEEP)26精选课件IdleRuntime ServiceInterruptFirmware Runtime ServiceInterruptCheck ServiceDo ServiceNoYesMore ServiceIdle27精选课件How To Enter Power Down Moden 1.Check condition for enter power-down moden 2.Disable module(reduce leak current)n 3.Change all gpio pin function(if need)(reduce leak current)n 4.Set wake-up pin functionn 5.Set wake-up sourcen 6.Set interrupt sourcen 7.Enter power-down modeDeep sleepIRQ eventn 8.Set gpio pin to original funtionn 9.Enable modulen10.Restore all gpio pin function(if need)n11.Return to main_loop28精选课件Upper LoopnKBC-centric:1 byte output buffer,wait forever for the System to read kbd/mouse.nPoll all other interrupts expect ps/2(KBC/EC Host commands,External pin,Smbus,etc)nPS2 device inactive29精选课件Lower LoopnWait for interrupt(sleep,Idle,wait)nPs2 devices active.n1ms Timer-periodic switch to Upper LoopnEach Interrupt switch to Upper Loop30精选课件Interrupts SourcesnInternal:1.Timer interrupt(for 1ms timer.)nExternal:1.IRQ pin(WUxx)2.SMBus interrupt(for receive data)3.Peripheral interrupt(for PS2 device data in)4.Data buffer interrupt(for IBF,IBF1 and IBF2)5.Keyboard interrupt(for internal keypressed)31精选课件ITE8512 Memory IntroductionnITE8512 Memory MappingThere are different commands for these memory area.RamInternalROMRAMFFFF0000FFF000External External 00FF32精选课件Code StructurenBuild EnvironmentnSource Code DirectoriesnSource Code Overview33精选课件Code Structure Build EnvironmentnWindows XP DOS Command promptnToolsKeil C51 ToolsAssembler-ax51.exe(v2.13)Compiler c51.exe(v7.20)Linker-lx51.exe(v3.64)Misc.Toolsh2b.exereplace.exe34精选课件Code Structure DirectoriesnCORECORE_ACPI.CCORE_HOSTIF.CCORE_INIT.CCORE_DATA.CCORE_FLASH.CCORE_IRQ.CCORE_MAIN.CCORE_PS2.CCORE_SCAN.CCORE_PORT6064.CCORE_TIMERS.CCORE_CIR.CCORE_CHIPREGS.CnOEM Default OEM ProjectOEM_BATTERY.C OEM_LED.COEM_FAN.COEM_SCANTABS.COEM_GPIO.COEM_MAIN.CnTOOLSNmaker15.exe hex2bin.exe35精选课件Code Structure BuildnSet EnvironmentKeilC51 nCustomize Build EC codeIteec.mak iteec.binIteec_bb.mak iteec_bb.binbb_iteec.bin=iteec_bb.bin+iteec.binnSet Build EC FirmwareMAKEAll.bat36精选课件Source Code COREnReset Entry PointStartup.a51nCrisis RecoveryCORECore_Hardware DependantChip RegistersInterrupt HandlersHardware Control RoutinesnVariable Data TypesCORE TYPES.H37精选课件Source Code Core_IRQ.CnOn-CHIP peripherals System interrupt tablenInterrupt HandlerTimers(1mS&150S)Host InterfacesPS/2 PortsI2CEtc.38精选课件Source Code Core_BBlock.CnCOREnCrisis Command HandlerStandard KBC/KBD/AUX Commands Crisis ModeFlash Commands GPIO setting39精选课件nCOREnInitializationRegistersTimers(1mS Timer&150S Timer)Host InterfaceDevicesnHook to OEM Source Code Core_ini.C40精选课件Source Code Core_MAIN.CnCOREnNormal Code EntrynMain RoutineIdle LoopService RoutinesnService Flags41精选课件(Source Code Core_MAIN.C)n16 Service Routines:service_unlock-Unlock device transmissionservice_pci Primary Host Interface(0 x60,0 x64)service_aux_port-Send byte from auxiliary port to Hostservice_1mS 1 millisecond serviceservice_scan Scan Matrixservice_send-Send byte from scanner keyboardservice_pci2-Secondary Host Interface(0 x62,0 x66)service_pci3-Third Host Interfaceservice_core_7 Reservedservice_ext_irq-External IRQservice_core_10,service_core_11 Reservedservice_chk_aux-Check External mouse existenceservice_OEM_0,service_OEM_1,service_OEM_2-Reserved42精选课件Source Code Core_port6064.CnCOREnStandard 8042 CommandsIBM AT&PS/2 8042-CompitableStandard KBC CommandsStandard KBD CommandsStandard AUX Commands43精选课件Source Code Core_ps2.CnCOREnPS/2 DevicesLock/unlock PS/2 deviceSuspend/Resume PS/2 deviceSend/Get data to/From PS/2 device44精选课件Source Code Core_scan.CnCOREnScan Matrix Keyboard8x16 Matrix(Row:8,Column:16)Ghost KeyKey Press/Release Debounce45精选课件Keyboard Drawing46精选课件Standard Matrix47精选课件(Source Code PURSCN.C)Scan Matrix KeyboardR-ROW(Scan In)02413567C Column(Scan Out)151413101112987456231048精选课件(Source Code PURSCN.SRC)Ghost Key 2(or more)keys pressed on the same ROWR-ROW(Scan In)02413567C Column(Scan Out)151413101112987456231049精选课件(Source Code PURSCN.C)Key Press/Release DebounceMake?1015 msBreak?Re-checkRe-check1015 ms50精选课件Source Code Core_XLT.CnCOREnScan Code TranslationR/C InputTranslate to Scan CodeStore into internal key bufferHotkey51精选课件Source Code Core_ACPI.CnCOREnACPI Command HandlernSCI GenerationnSMBus Protocol HandlernACPI EC Space Access52精选课件Source Code Core_SMBusnCore_SMB.CCORESMBus ProtocolRead/Write Smbus byteRead/Write Smbus WordRead/Write Smbus Block53精选课件Source Code Core_DAT.CnCOREnInternal VariablesBITDATAnExternal VariablesIDATAXDATAnCHIP TYPE.H54精选课件BUILD A PROJECT WITH EC CODE Define GPIOs Setting/variablesBuild Matrix tableSet power sequenceBuild OEM FunctionFiles ModifyFiles ModifyFiles ModifyFiles Modify1.CORE_INIT.C2.OEM_GPIO.C1.OEM_SCANTABS.C1.OEMMAIN.C2.OEMGPIO.C3.OEMGPIO.H1.OEM_FAN.C2.OEM_BATTERY.C3.OEm_FAN.C4.OEM_LED.C5.:55精选课件ITE chip solution56精选课件PS/257精选课件SMBusnSMBus-0 Battery#1,Thermal IC#1nSMBus-1 Battery#2,Thermal IC#2nSMBus-2 System Clock Generator58精选课件FAN Control59精选课件LCD Brightness Control60精选课件Adapter&BatterynAdapter StatusnBattery Detection 61精选课件Charger ControlnCharge On/OffnCharging Current Setting62精选课件Software Battery GasGaugenReference Software GasGauge Document (O2/Texas Instruments)63精选课件EC Beep PWM(Battery Status Warning)64精选课件On Board Programming65精选课件66精选课件ITE KBS Download Board67精选课件ITE KBS download tool68精选课件ITE KBS D2EC access RAM69精选课件System utility 70精选课件EC Register/Ram access Dos/XP/Vista71精选课件Utility-Rom FlashnFlash utility for dos modeIteflash.exe nFlash utility for Windows XP/VistaWinflash v1.072精选课件SummarynPS2 and keyboard traffic communicationnEC要使系统節能,更加省电,增加电池的续航能力,控制良好的散热性能,减少風扇系统的噪音,根据温度,控制CPU风扇的停转。n系統電源管理-s3/s4/s5 電力調節n充电指示灯、WIFI指示灯、Fn快速鍵功能n背光亮度,聲音控制等。73精选课件Q&AnQ&AnThank you!74精选课件
展开阅读全文