superio/winbond/{w83627hf,w83977tf}: Use macro

Change-Id: I3ac8dd2ba089970a18b460769dfc3fabf9395709
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39907
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes HAOUAS 2020-03-29 17:29:48 +02:00 committed by Patrick Georgi
parent 8602fb7f65
commit cfaf4c7ac8
2 changed files with 138 additions and 136 deletions

View File

@ -43,6 +43,8 @@
* http://www.itox.com/pages/support/wdt/W83627HF.pdf * http://www.itox.com/pages/support/wdt/W83627HF.pdf
*/ */
#include <superio/acpi/pnp.asl>
Device(SIO) { Device(SIO) {
Name (_HID, EisaId("PNP0A05")) Name (_HID, EisaId("PNP0A05"))
Name (_STR, Unicode("Winbond W83627HF SuperIO")) Name (_STR, Unicode("Winbond W83627HF SuperIO"))
@ -52,7 +54,7 @@ Device(SIO) {
Mutex(CRMX, 1) Mutex(CRMX, 1)
/* SuperIO configuration ports */ /* SuperIO configuration ports */
OperationRegion (CREG, SystemIO, 0x2E, 0x02) OperationRegion (CREG, SystemIO, SUPERIO_PNP_BASE, 0x02)
Field (CREG, ByteAcc, NoLock, Preserve) Field (CREG, ByteAcc, NoLock, Preserve)
{ {
PNP_ADDR_REG, 8, PNP_ADDR_REG, 8,
@ -137,8 +139,8 @@ Device(SIO) {
Method (_CRS) Method (_CRS)
{ {
Return (ResourceTemplate () { Return (ResourceTemplate () {
IO (Decode16, 0x002E, 0x002E, 0x02, 0x01) /* Announce the used I/O ports to the OS */ /* Announce the used I/O ports to the OS */
IO (Decode16, 0x004E, 0x004E, 0x01, 0x01) /* this port is used in some configurations, so announce it to be sure */ IO (Decode16, SUPERIO_PNP_BASE, SUPERIO_PNP_BASE, 0x02, 0x01)
}) })
} }
@ -147,7 +149,7 @@ Device(SIO) {
Parameter is the LDN which should be accessed. Values >= 0xFF mean Parameter is the LDN which should be accessed. Values >= 0xFF mean
no LDN switch should be done. no LDN switch should be done.
*/ */
Method (ENCM, 1) Method (ENTER_CONFIG_MODE, 1)
{ {
Acquire (CRMX, 0xFFFF) Acquire (CRMX, 0xFFFF)
Store (0x87, ADDR) Store (0x87, ADDR)
@ -160,7 +162,7 @@ Device(SIO) {
/* Exit configuration mode (and release mutex) /* Exit configuration mode (and release mutex)
Method must be run after accessing the configuration region. Method must be run after accessing the configuration region.
*/ */
Method (EXCM) Method (EXIT_CONFIG_MODE)
{ {
Store (0xAA, ADDR) Store (0xAA, ADDR)
Release (CRMX) Release (CRMX)
@ -168,25 +170,25 @@ Device(SIO) {
/* PM: indicate IPD (Immediate Power Down) bit state as D0/D3 */ /* PM: indicate IPD (Immediate Power Down) bit state as D0/D3 */
Method (_PSC) { Method (_PSC) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (IPD, Local0) Store (IPD, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
/* PM: Switch to D0 by setting IPD low */ /* PM: Switch to D0 by setting IPD low */
Method (_PS0) { Method (_PS0) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, IPD) Store (Zero, IPD)
EXCM () EXIT_CONFIG_MODE ()
} }
/* PM: Switch to D3 by setting IPD high */ /* PM: Switch to D3 by setting IPD high */
Method (_PS3) { Method (_PS3) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, IPD) Store (One, IPD)
EXCM () EXIT_CONFIG_MODE ()
} }
#ifndef NO_W83627HF_FDC #ifndef NO_W83627HF_FDC
@ -199,7 +201,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (0) ENTER_CONFIG_MODE (0)
If (ACTR) { If (ACTR) {
Store (0x0F, Local0) Store (0x0F, Local0)
} }
@ -207,7 +209,7 @@ Device(SIO) {
{ {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
@ -217,30 +219,30 @@ Device(SIO) {
Method (_PSC) { Method (_PSC) {
Store(^^_PSC (), Local0) Store(^^_PSC (), Local0)
If (Local0) { Return (Local0) } If (Local0) { Return (Local0) }
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (FDPW, Local0) Store (FDPW, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
/* Disable power saving mode */ /* Disable power saving mode */
Method (_PS0) { Method (_PS0) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, FDPW) Store (One, FDPW)
EXCM () EXIT_CONFIG_MODE ()
} }
/* Enable power saving mode */ /* Enable power saving mode */
Method (_PS3) { Method (_PS3) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, FDPW) Store (Zero, FDPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (0) ENTER_CONFIG_MODE (0)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS) Method (_CRS)
@ -252,10 +254,10 @@ Device(SIO) {
}) })
/* Get IO port info */ /* Get IO port info */
ENCM (0) ENTER_CONFIG_MODE (0)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
EXCM () EXIT_CONFIG_MODE ()
/* Calculate full IO port address */ /* Calculate full IO port address */
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
@ -298,11 +300,11 @@ Device(SIO) {
CreateByteField (FDE, 12, FD4) CreateByteField (FDE, 12, FD4)
// Get resources from logical device // Get resources from logical device
ENCM (0) ENTER_CONFIG_MODE (0)
Store (ACTR, Local0) Store (ACTR, Local0)
Store (IO1H, Local1) Store (IO1H, Local1)
Store (IO1L, Local2) Store (IO1L, Local2)
EXCM () EXIT_CONFIG_MODE ()
ShiftLeft(Local1, 8, Local1) ShiftLeft(Local1, 8, Local1)
Or(Local1, Local2, Local1) Or(Local1, Local2, Local1)
If (LNot(Local0)) { If (LNot(Local0)) {
@ -380,11 +382,11 @@ Device(SIO) {
Divide(IOA0, 256, Local0, Local1) Divide(IOA0, 256, Local0, Local1)
ENCM (0) ENTER_CONFIG_MODE (0)
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -399,10 +401,10 @@ Device(SIO) {
Method (MODE, 1) { Method (MODE, 1) {
And(Arg0, 0x07, Local0) And(Arg0, 0x07, Local0)
ENCM (1) ENTER_CONFIG_MODE (1)
And(OPT1, 0x3, Local1) And(OPT1, 0x3, Local1)
Or(Local1, Local0, OPT1) Or(Local1, Local0, OPT1)
EXCM() EXIT_CONFIG_MODE()
} }
Method (_INI) Method (_INI)
@ -410,15 +412,15 @@ Device(SIO) {
/* Deactivate DMA, even if set by BIOS. We don't announce it /* Deactivate DMA, even if set by BIOS. We don't announce it
through _CRS and it's only useful in ECP mode which we through _CRS and it's only useful in ECP mode which we
don't support at the moment. */ don't support at the moment. */
ENCM (1) ENTER_CONFIG_MODE (1)
Store (0x04, DMA0) Store (0x04, DMA0)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (1) ENTER_CONFIG_MODE (1)
And(OPT1, 0x3, Local1) And(OPT1, 0x3, Local1)
If (ACTR) { If (ACTR) {
If (LNotEqual(Local1, 2)) { If (LNotEqual(Local1, 2)) {
@ -431,34 +433,34 @@ Device(SIO) {
{ {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_PSC) { Method (_PSC) {
Store(^^_PSC (), Local0) Store(^^_PSC (), Local0)
If (Local0) { Return (Local0) } If (Local0) { Return (Local0) }
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (PRPW, Local0) Store (PRPW, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
Method (_PS0) { Method (_PS0) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, PRPW) Store (One, PRPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_PS3) { Method (_PS3) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, PRPW) Store (Zero, PRPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_DIS) { Method (_DIS) {
ENCM (1) ENTER_CONFIG_MODE (1)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS) Method (_CRS)
@ -475,12 +477,12 @@ Device(SIO) {
CreateWordField (CRS, IRQX._INT, IRQW) CreateWordField (CRS, IRQX._INT, IRQW)
/* Get device settings */ /* Get device settings */
ENCM (1) ENTER_CONFIG_MODE (1)
Store (IO1L, Local0) Store (IO1L, Local0)
Store (IO1H, Local1) Store (IO1H, Local1)
Store (OPT1, Local2) Store (OPT1, Local2)
Store (IRQ0, Local5) Store (IRQ0, Local5)
EXCM () EXIT_CONFIG_MODE ()
/* Calculate IO port and modify template */ /* Calculate IO port and modify template */
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
Store(Local1, IOP0) Store(Local1, IOP0)
@ -571,7 +573,7 @@ Device(SIO) {
Divide(IOA0, 256, Local0, Local1) Divide(IOA0, 256, Local0, Local1)
ENCM (1) ENTER_CONFIG_MODE (1)
/* IO port */ /* IO port */
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
@ -585,7 +587,7 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, IRQ0) Subtract(FindSetLeftBit (IRQL), 1, IRQ0)
/* Activate */ /* Activate */
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -600,7 +602,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (2) ENTER_CONFIG_MODE (2)
If (ACTR) { If (ACTR) {
Store (0x0F, Local0) Store (0x0F, Local0)
} }
@ -608,35 +610,35 @@ Device(SIO) {
{ {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_PSC) { Method (_PSC) {
Store(^^_PSC (), Local0) Store(^^_PSC (), Local0)
If (Local0) { Return (Local0) } If (Local0) { Return (Local0) }
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (UAPW, Local0) Store (UAPW, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
Method (_PS0) { Method (_PS0) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, UAPW) Store (One, UAPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_PS3) { Method (_PS3) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, UAPW) Store (Zero, UAPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (2) ENTER_CONFIG_MODE (2)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS, 0, Serialized) Method (_CRS, 0, Serialized)
@ -645,11 +647,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0) IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
IRQNoFlags (IRQX) {6} IRQNoFlags (IRQX) {6}
}) })
ENCM (2) ENTER_CONFIG_MODE (2)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IRQ0, Local2) Store(IRQ0, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
CreateWordField (CRS, IO0._MIN, IMIN) CreateWordField (CRS, IO0._MIN, IMIN)
@ -702,12 +704,12 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, Local3) Subtract(FindSetLeftBit (IRQL), 1, Local3)
ENCM (2) ENTER_CONFIG_MODE (2)
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
Store (Local3, IRQ0) Store (Local3, IRQ0)
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -722,7 +724,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (3) ENTER_CONFIG_MODE (3)
If (LNot(And(OPT2, 0x30))) If (LNot(And(OPT2, 0x30)))
{ {
If (ACTR) { If (ACTR) {
@ -733,35 +735,35 @@ Device(SIO) {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_PSC) { Method (_PSC) {
Store(^^_PSC (), Local0) Store(^^_PSC (), Local0)
If (Local0) { Return (Local0) } If (Local0) { Return (Local0) }
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (UBPW, Local0) Store (UBPW, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
Method (_PS0) { Method (_PS0) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, UBPW) Store (One, UBPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_PS3) { Method (_PS3) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, UBPW) Store (Zero, UBPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (3) ENTER_CONFIG_MODE (3)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS) Method (_CRS)
@ -770,11 +772,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0) IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
IRQNoFlags (IRQX) {6} IRQNoFlags (IRQX) {6}
}) })
ENCM (3) ENTER_CONFIG_MODE (3)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IRQ0, Local2) Store(IRQ0, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
CreateWordField (CRS, IO0._MIN, IMIN) CreateWordField (CRS, IO0._MIN, IMIN)
@ -827,12 +829,12 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, Local3) Subtract(FindSetLeftBit (IRQL), 1, Local3)
ENCM (3) ENTER_CONFIG_MODE (3)
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
Store (Local3, IRQ0) Store (Local3, IRQ0)
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -847,7 +849,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (3) ENTER_CONFIG_MODE (3)
If (And(OPT2, 0x30)) If (And(OPT2, 0x30))
{ {
If (ACTR) { If (ACTR) {
@ -858,35 +860,35 @@ Device(SIO) {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_PSC) { Method (_PSC) {
Store(^^_PSC (), Local0) Store(^^_PSC (), Local0)
If (Local0) { Return (Local0) } If (Local0) { Return (Local0) }
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (UBPW, Local0) Store (UBPW, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
Method (_PS0) { Method (_PS0) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, UBPW) Store (One, UBPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_PS3) { Method (_PS3) {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, UBPW) Store (Zero, UBPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (3) ENTER_CONFIG_MODE (3)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS) Method (_CRS)
@ -895,11 +897,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0) IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
IRQNoFlags (IRQX) {6} IRQNoFlags (IRQX) {6}
}) })
ENCM (3) ENTER_CONFIG_MODE (3)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IRQ0, Local2) Store(IRQ0, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
CreateWordField (CRS, IO0._MIN, IMIN) CreateWordField (CRS, IO0._MIN, IMIN)
@ -952,12 +954,12 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, Local3) Subtract(FindSetLeftBit (IRQL), 1, Local3)
ENCM (3) ENTER_CONFIG_MODE (3)
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
Store (Local3, IRQ0) Store (Local3, IRQ0)
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -973,7 +975,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (6) ENTER_CONFIG_MODE (6)
If (ACTR) { If (ACTR) {
Store (0x0F, Local0) Store (0x0F, Local0)
} }
@ -981,15 +983,15 @@ Device(SIO) {
{ {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (6) ENTER_CONFIG_MODE (6)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS) Method (_CRS)
@ -998,11 +1000,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0) IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
IRQNoFlags (IRQX) {6} IRQNoFlags (IRQX) {6}
}) })
ENCM (6) ENTER_CONFIG_MODE (6)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IRQ0, Local2) Store(IRQ0, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
CreateWordField (CRS, IO0._MIN, IMIN) CreateWordField (CRS, IO0._MIN, IMIN)
@ -1039,12 +1041,12 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, Local3) Subtract(FindSetLeftBit (IRQL), 1, Local3)
ENCM (6) ENTER_CONFIG_MODE (6)
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
Store (Local3, IRQ0) Store (Local3, IRQ0)
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -1059,7 +1061,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (5) ENTER_CONFIG_MODE (5)
If (ACTR) { If (ACTR) {
Store (0x0F, Local0) Store (0x0F, Local0)
} }
@ -1071,15 +1073,15 @@ Device(SIO) {
Store (0x0D, Local0) Store (0x0D, Local0)
#endif #endif
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (5) ENTER_CONFIG_MODE (5)
Store (Zero, ACTR) Store (Zero, ACTR)
EXCM () EXIT_CONFIG_MODE ()
Notify(PS2M, 1) Notify(PS2M, 1)
} }
@ -1090,13 +1092,13 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO0) IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO0)
IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO1) IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO1)
}) })
ENCM (5) ENTER_CONFIG_MODE (5)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IO2L, Local2) Store(IO2L, Local2)
Store(IO2H, Local3) Store(IO2H, Local3)
Store(IRQ0, Local4) Store(IRQ0, Local4)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
Or(ShiftLeft(Local3, 8), Local2, Local2) Or(ShiftLeft(Local3, 8), Local2, Local2)
@ -1144,14 +1146,14 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, Local4) Subtract(FindSetLeftBit (IRQL), 1, Local4)
ENCM (5) ENTER_CONFIG_MODE (5)
Store (Local0, IO1L) Store (Local0, IO1L)
Store (Local1, IO1H) Store (Local1, IO1H)
Store (Local2, IO2L) Store (Local2, IO2L)
Store (Local3, IO2H) Store (Local3, IO2H)
Store (Local4, IRQ0) Store (Local4, IRQ0)
Store (One, ACTR) Store (One, ACTR)
EXCM () EXIT_CONFIG_MODE ()
Notify(PS2M, 1) Notify(PS2M, 1)
} }
} }
@ -1164,7 +1166,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (5) ENTER_CONFIG_MODE (5)
If (LAnd(ACTR, IRQ1) ) { If (LAnd(ACTR, IRQ1) ) {
Store (0x0F, Local0) Store (0x0F, Local0)
} }
@ -1176,15 +1178,15 @@ Device(SIO) {
Store (0x0D, Local0) Store (0x0D, Local0)
#endif #endif
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
Method (_DIS) Method (_DIS)
{ {
ENCM (5) ENTER_CONFIG_MODE (5)
Store (Zero, IRQ1) Store (Zero, IRQ1)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS, 0, Serialized) Method (_CRS, 0, Serialized)
@ -1192,9 +1194,9 @@ Device(SIO) {
Name (CRS, ResourceTemplate () { Name (CRS, ResourceTemplate () {
IRQNoFlags (IRQX) {} IRQNoFlags (IRQX) {}
}) })
ENCM (5) ENTER_CONFIG_MODE (5)
Store(IRQ1, Local4) Store(IRQ1, Local4)
EXCM () EXIT_CONFIG_MODE ()
CreateWordField (CRS, IRQX._INT, IRQW) CreateWordField (CRS, IRQX._INT, IRQW)
Store (One, Local5) Store (One, Local5)
@ -1223,10 +1225,10 @@ Device(SIO) {
Subtract(FindSetLeftBit (IRQL), 1, Local0) Subtract(FindSetLeftBit (IRQL), 1, Local0)
ENCM (5) ENTER_CONFIG_MODE (5)
Store (Local0, IRQ1) Store (Local0, IRQ1)
/* Only activates if KBD is active */ /* Only activates if KBD is active */
EXCM () EXIT_CONFIG_MODE ()
} }
} }
#endif #endif
@ -1242,7 +1244,7 @@ Device(SIO) {
Method (_STA) { Method (_STA) {
Store(0, Local0) Store(0, Local0)
ENCM (7) ENTER_CONFIG_MODE (7)
If (LOr(IO1L, IO1H)) { If (LOr(IO1L, IO1H)) {
If (LOr(ACTR, ACT1)) { If (LOr(ACTR, ACT1)) {
Store (0x0F, Local0) Store (0x0F, Local0)
@ -1251,7 +1253,7 @@ Device(SIO) {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
@ -1261,11 +1263,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO0) IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO0)
IRQNoFlags (IRQX) {} IRQNoFlags (IRQX) {}
}) })
ENCM (7) ENTER_CONFIG_MODE (7)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IRQ0, Local2) Store(IRQ0, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
@ -1297,7 +1299,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store(0, Local0) Store(0, Local0)
ENCM (7) ENTER_CONFIG_MODE (7)
If (LOr(IO2L, IO2H)) { If (LOr(IO2L, IO2H)) {
If (LOr(ACTR, ACT2)) { If (LOr(ACTR, ACT2)) {
Store (0x0F, Local0) Store (0x0F, Local0)
@ -1306,7 +1308,7 @@ Device(SIO) {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
@ -1316,11 +1318,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x02, 0x02, IO0) IO (Decode16, 0x0000, 0x0000, 0x02, 0x02, IO0)
IRQNoFlags (IRQX) {} IRQNoFlags (IRQX) {}
}) })
ENCM (7) ENTER_CONFIG_MODE (7)
Store(IO2L, Local0) Store(IO2L, Local0)
Store(IO2H, Local1) Store(IO2H, Local1)
Store(IRQ1, Local2) Store(IRQ1, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
@ -1344,21 +1346,21 @@ Device(SIO) {
/* ==== Suspend LED control if it is connected to the SuperIO ==== */ /* ==== Suspend LED control if it is connected to the SuperIO ==== */
Method (SLED, 1) Method (SLED, 1)
{ {
ENCM (9) ENTER_CONFIG_MODE (9)
Store(OPT4, Local0) Store(OPT4, Local0)
And(Local0, 63, Local0) And(Local0, 63, Local0)
Or(Local0, ShiftLeft(And(Arg0, 0x03), 6), OPT4) Or(Local0, ShiftLeft(And(Arg0, 0x03), 6), OPT4)
EXCM () EXIT_CONFIG_MODE ()
} }
/* ===== Power LED control if it is connected to the SuperIO ===== */ /* ===== Power LED control if it is connected to the SuperIO ===== */
Method (PLED, 1) Method (PLED, 1)
{ {
ENCM (8) ENTER_CONFIG_MODE (8)
Store(OPT4, Local0) Store(OPT4, Local0)
And(Local0, 63, Local0) And(Local0, 63, Local0)
Or(Local0, ShiftLeft(And(Arg0, 0x03), 6), OPT4) Or(Local0, ShiftLeft(And(Arg0, 0x03), 6), OPT4)
EXCM () EXIT_CONFIG_MODE ()
} }
#ifndef NO_W83627HF_HWMON #ifndef NO_W83627HF_HWMON
@ -1372,7 +1374,7 @@ Device(SIO) {
Method (_STA) Method (_STA)
{ {
Store (0x00, Local0) Store (0x00, Local0)
ENCM (11) ENTER_CONFIG_MODE (11)
If (ACTR) { If (ACTR) {
Store (0x0F, Local0) Store (0x0F, Local0)
} }
@ -1380,7 +1382,7 @@ Device(SIO) {
{ {
Store (0x0D, Local0) Store (0x0D, Local0)
} }
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
@ -1388,25 +1390,25 @@ Device(SIO) {
{ {
Store(^^_PSC (), Local0) Store(^^_PSC (), Local0)
If (Local0) { Return (Local0) } If (Local0) { Return (Local0) }
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (HWPW, Local0) Store (HWPW, Local0)
EXCM () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }
Else { Return (0) } Else { Return (0) }
} }
Method (_PS0) Method (_PS0)
{ {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (One, HWPW) Store (One, HWPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_PS3) Method (_PS3)
{ {
ENCM (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (Zero, HWPW) Store (Zero, HWPW)
EXCM () EXIT_CONFIG_MODE ()
} }
Method (_CRS, 0, Serialized) Method (_CRS, 0, Serialized)
@ -1415,11 +1417,11 @@ Device(SIO) {
IO (Decode16, 0x0000, 0x0000, 0x08, 0x02, IO0) IO (Decode16, 0x0000, 0x0000, 0x08, 0x02, IO0)
IRQNoFlags (IRQX) {} IRQNoFlags (IRQX) {}
}) })
ENCM (11) ENTER_CONFIG_MODE (11)
Store(IO1L, Local0) Store(IO1L, Local0)
Store(IO1H, Local1) Store(IO1H, Local1)
Store(IRQ1, Local2) Store(IRQ1, Local2)
EXCM () EXIT_CONFIG_MODE ()
Or(ShiftLeft(Local1, 8), Local0, Local0) Or(ShiftLeft(Local1, 8), Local0, Local0)
@ -1449,9 +1451,9 @@ Device(SIO) {
*/ */
Method (WAKS) Method (WAKS)
{ {
ENCM (10) ENTER_CONFIG_MODE (10)
Store (CRE3, Local0) Store (CRE3, Local0)
EXCM () EXIT_CONFIG_MODE ()
Return (Local0) Return (Local0)
} }
} }

View File

@ -74,7 +74,7 @@ IndexField (PNP_ADDR_REG, PNP_DATA_REG, ByteAcc, NoLock, Preserve)
/* PM: indicate IPD (Immediate Power Down) bit state as D0/D3 */ /* PM: indicate IPD (Immediate Power Down) bit state as D0/D3 */
Method (_PSC) { Method (_PSC) {
ENTER_CONFIG_MODE (0xFF) ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
Store (IPD, Local0) Store (IPD, Local0)
EXIT_CONFIG_MODE () EXIT_CONFIG_MODE ()
If (Local0) { Return (3) } If (Local0) { Return (3) }