BayTrail/AaeonIoPkg/IT8728F/IT8728FEVT.asl
2022-09-02 09:03:16 +08:00

146 lines
6.6 KiB
Plaintext

// THIS FILE IS INCLUDED to South Bridge device scope
//*************************************************************************
//*************************************************************************
//** **
//** (C)Copyright 1985-2013, American Megatrends, Inc. **
//** **
//** All Rights Reserved. **
//** **
//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
//** **
//** Phone: (770)-246-8600 **
//** **
//*************************************************************************
//*************************************************************************
//<AMI_FHDR_START>
//
// Name: <IT8728FEVT.asl>
//
// Description: Define event handler for Super IO.
//
//<AMI_FHDR_END>
//*************************************************************************
//Scope(\_SB.PCI0.SBRG) {
//-----------------------------------------------------------------------
// SET OF COMMON DATA/CONTROL METHODS USED FOR ALL LDN BASED SIO DEVICES
//-----------------------------------------------------------------------
// SIO specific: SIOS - SIO Chipset specific code called from _PTS
// SIO specific: SIOW - SIO Chipset specific code called from _WAK
// SIO specific: SIOH - SIO event handler, to be called from correspondent _Lxx method
// SIO specific: PowerResources & _PR0 object to control Power management for FDC, LPT, UART1,2.
//-------------------------------------------------------------------------
// SIO_PME WAKE UP EVENTS //
//-------------------------------------------------------------------------
// Following code is the workaround for wake up on RI/Key/Mouse events
// are generated by some SuperIO. The wake up signal (SIO_PME) is
// connected to one of GPIOs of south bridge chip.
// Make sure the correspondent GPIO in south bridge is enabled to generate an SCI
//-------------------------------------------------------------------------
// Add Flag for Fix WakeUp Switch bug.
Name(PMFG, 0x00) //PME wake ststus
//-------------------------------------------------------------------------
// SIOS - SIO Chipset specific code called from _PTS
//-------------------------------------------------------------------------
// input - Arg0 : Sleep state #
// output - nothing
//-------------------------------------------------------------------------
Method(SIOS, 1){
// Aware wake up events in SIO chip
Store("SIOS", Debug)
//AMI_TODO:
// 1. select sleep state
If(LNotEqual(0x05, Arg0)){
^ENFG(0x04) //Set Logical Device 0A (ACPI)
// 2. clear PME Status
Store(0xFF, ^OPT1) //Clear I/O PME# Status,Write 1 clear.
// 3. enable wake-up
if(\KBFG){
Or(^OPT0, 0x08, ^OPT0) //Enable Keyboard Wake-up bit
}
Else{
And(^OPT0, 0xF7, ^OPT0) //Disable Keyboard Wake-up bit
}
if(\MSFG){
Or(^OPT0, 0x10, ^OPT0) //Enable Mouse Wake-up bit
}
Else{
And(^OPT0, 0xEF, ^OPT0) //Disable Mouse Wake-up bit
}
// 4. Enable PME bit
And(0xBF, ^OPT2, Local0) //Enable PME#
Store(Local0, ^OPT2)
//>>-ITE workround---------------------------------------------------------
Store(0x06, ^LDN) //Select mouse
Store(0x00, ^ACTR) //Deactive mouse
Store(0x05, ^LDN) //Select keyboard
Store(0x00, ^ACTR) //Deactive keyboard
//<<-----------------------------------------------------------------------
^EXFG()
}
}
//-----------------------------------------------------------------------
// SIOW - SIO Chipset specific code called from _WAK
//-----------------------------------------------------------------------
// input - Sleep State #
// output - nothing
//-----------------------------------------------------------------------
Method(SIOW, 1){
Store("SIOW", Debug)
//AMI_TODO:
^ENFG(0x04) //Set Logical Device 0A (ACPI)
// 1. Clear Status
Store(^OPT1, PMFG) // PMFG=PME Wake Status
Store(0xFF, ^OPT1) //Clear KBC Wake Event
And(^OPT0, 0xE7, ^OPT0) //Disable Keyboard and Mouse Wake-up bit
// 2. Disable PME
Or(0x40, ^OPT2, Local0) //Diable PME#, set bit 6
Store(Local0, ^OPT2)
//>>-ITE workround---------------------------------------------------------
Store(0x06, ^LDN) //Select mouse
Store(0x01, ^ACTR) //active mouse
Store(0x05, ^LDN) //Select keyboard
Store(0x01, ^ACTR) //active keyboard
//<<-----------------------------------------------------------------------
^EXFG()
}
//-----------------------------------------------------------------------
// SIOH - SIO event handler, to be called from correspondent _Lxx method
// in order to serve the SIO chipset side of wake up event
//-----------------------------------------------------------------------
// input - nothing
// output - nothing
//-----------------------------------------------------------------------
Method(SIOH, 0){
If(And(PMFG, 0x08)){
#if IT8728F_KEYBOARD_PRESENT
Notify(PS2K, 0x2) //KBD Wake up
#endif
}
If(And(PMFG, 0x10)){
#if IT8728F_MOUSE_PRESENT
Notify(PS2M, 0x2) //MOUSE Wake up
#endif
}
} //End Of SIOH
//*************************************************************************
//*************************************************************************
//** **
//** (C)Copyright 1985-2013, American Megatrends, Inc. **
//** **
//** All Rights Reserved. **
//** **
//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
//** **
//** Phone: (770)-246-8600 **
//** **
//*************************************************************************
//*************************************************************************