📄 686_uar1.asl
字号:
Device(UAR1) { //UAR1 Device
Name(_HID,EISAID("PNP0501")) //Hardware Device ID
Name(_UID,0x1)
Method(_STA,0) { //Status
Store(0x80003884, PIND)
Store(PDAT, Local0)
And(Local0, 0x00000100, Local0) // VT686 Function 0 Rx85 bit 0
If(LNot(Local0)) {
Return(0x00)
} //end if
Else {
ENFG() // Enter Config Mode
Store(CRC2, Local0) //Read FSR register
And(Local0, 0x04, Local0) //Read bit2 UART1 enable
If(LNotEqual(Local0, 0x00)){
EXFG()
Return(0x0F) //present, enable, UI, functioning
} // end if
Else {
Store(CRC7, Local1) // Read SAR1 register //R02 - starts
If (LNotEqual(Local1, 0x00)) {
EXFG()
Return(0x0D) //present, disable
} // end if
else { //R02 - ends
EXFG()
Return(0x00) //present, disable
}
} // end else
} // end else
} // end of _STA method
Method(_DIS,0) { //Disable
ENFG()
And(CRC2,0xFB,CRC2) // Disable UART1
EXFG()
} //end _DIS method
Method(_CRS,0) { // Current Serial 1 Resource
Name(BFU1, ResourceTemplate(){
IO(
Decode16,
0x03F8, // Min base I/O addr, UIO1._MIN
0x03F8, // Max base I/O addr, UIO1._MAX
0x08, // Base alignment
0x08, // Number of contig I/O ports
UIO1
)
IRQNoFlags(
UIRQ
)
{0x04} // IRQ 4, UIRQ._INT
} // end Resource Template
) // end buffer BFU1
CreateWordField (BFU1, UIO1._MIN, IMIN) //IO MIN address
CreateWordField (BFU1, UIO1._MAX, IMAX) //IO MAX address
CreateWordField (BFU1, UIRQ._INT, IRQ0) //IRQ Mask
ENFG() // Enter Config Mode
Store(CRC7, Local0) // Read UART1 FSR register
Store(Local0, Local1) // Local1: IOUH, Local0: IOUL
And(Local1, 0x00C0, Local1) // CRC7:
ShiftLeft(Local1, 0x02, Local1) // Bit7-6: ADR9-8
And(Local0, 0x003F, Local0) // Bit5-1: ADR7-3
ShiftLeft(Local0, 0x02, Local0) // Bit0: 0
Or(Local0, Local1, Local0)
Store(Local0, IMIN)
Store(Local0, IMAX)
EXFG() // Exit Config Mode
Store(\_SB.PCI0.PIB.U1IR, Local0) //Get UAR1 IRQ Value
Store(0x01, Local1)
ShiftLeft(Local1, Local0, IRQ0)
Return(BFU1) //Return BFU1
} //end _CRS method
Name(_PRS, ResourceTemplate(){
StartDependentFnNoPri(){
IO(
Decode16,
0x03F8, // Min base I/O addr
0x03F8, // Max base I/O addr
0x08, // Base alignment
0x08 // Number of contig I/O ports
)
IRQNoFlags()
{0x04} // IRQ 4
} // end first dependent function
StartDependentFnNoPri(){
IO(
Decode16,
0x02F8, // Min base I/O addr
0x02F8, // Max base I/O addr
0x08, // Base alignment
0x08 // Number of contig I/O ports
)
IRQNoFlags()
{0x03} // IRQ 3
} // end second dependent function
StartDependentFnNoPri(){
IO(
Decode16,
0x03E8, // Min base I/O addr
0x03E8, // Max base I/O addr
0x08, // Base alignment
0x08 // Number of contig I/O ports
)
IRQNoFlags()
{0x04} // IRQ 4
} // end third dependent function
StartDependentFnNoPri(){
IO(
Decode16,
0x02E8, // Min base I/O addr
0x02E8, // Max base I/O addr
0x08, // Base alignment
0x08 // Number of contig I/O ports
)
IRQNoFlags()
{0x03} // IRQ 3
} // end fourth dependent function
EndDependentFn() // end dependent functions
} // end Resource Template
) // end _PRS
Method(_SRS,1) { //Set Resource
CreateByteField (Arg0, 0x02, IOLO) //IO Port Low
CreateByteField (Arg0, 0x03, IOHI) //IO Port High
CreateWordField (Arg0, 0x09, IRQ0) // IRQ MASK
ENFG() // Enter Config Mode
Store(CRC2,Local0) // Disable UART1
And(Local0,0xFB,Local1)
Store(Local1,CRC2)
Store(IOLO, Local0) //Set IO
ShiftRight(Local0, 0x02, Local0) //UART1 IO: CRC7
And(Local0, 0xFE, Local0) //Bit7-1 = ADR9-3
Store(IOHI, Local1) //Bit0 = 0
ShiftLeft(Local1, 0x06, Local1)
Or(Local0, Local1, Local0)
Store(Local0, CRC7)
FindSetRightBit(IRQ0, Local0) //Set IRQ
If(LGreater(Local0, 0x00)) {
Decrement(Local0)
}
Store(Local0, \_SB.PCI0.PIB.U1IR)
Store(CRC2,Local0) // Enable UART1
Or(Local0,0x04,Local1)
Store(Local1,CRC2)
EXFG() // Exit Config Mode
} //End of _SRS Method
} // end of UART1 device
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -