From bb6bf5a1d8ffe157b17a5b7f5b85eb04aeaafe68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 13 Feb 2021 23:29:14 +0200 Subject: mb/lippert/frontrunner-af: Split sections from dsdt.asl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added file acpi/sleep.asl is really a copy from persimmon with debug statement and some comments removed. Added file acpi/gpe.asl is slightly modified copy from persimmon with changes that seem valid, considering the other changes present in ASL for the board. Rename existing usb.asl to usb_oc.asl for consistency. Change-Id: I493ad1c110380378bad80e49cd888f47fbe41a92 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/50649 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/lippert/frontrunner-af/acpi/gpe.asl | 53 ++++++++ .../lippert/frontrunner-af/acpi/sleep.asl | 64 +++++++++ src/mainboard/lippert/frontrunner-af/acpi/usb.asl | 136 ------------------- .../lippert/frontrunner-af/acpi/usb_oc.asl | 148 +++++++++++++++++++++ src/mainboard/lippert/frontrunner-af/dsdt.asl | 130 +----------------- 5 files changed, 269 insertions(+), 262 deletions(-) create mode 100644 src/mainboard/lippert/frontrunner-af/acpi/gpe.asl create mode 100644 src/mainboard/lippert/frontrunner-af/acpi/sleep.asl delete mode 100644 src/mainboard/lippert/frontrunner-af/acpi/usb.asl create mode 100644 src/mainboard/lippert/frontrunner-af/acpi/usb_oc.asl diff --git a/src/mainboard/lippert/frontrunner-af/acpi/gpe.asl b/src/mainboard/lippert/frontrunner-af/acpi/gpe.asl new file mode 100644 index 0000000000..7472ffed71 --- /dev/null +++ b/src/mainboard/lippert/frontrunner-af/acpi/gpe.asl @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + + Scope(\_GPE) { /* Start Scope GPE */ + + /* General event 3 */ + Method(_L03) { + Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ + } + + /* Legacy PM event */ + Method(_L08) { + } + + /* Temp warning (TWarn) event */ + Method(_L09) { + } + + /* USB controller PME# */ + Method(_L0B) { + Notify(\_SB.PCI0.UOH1, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.UOH2, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.UOH3, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.UOH4, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.UOH5, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.UOH6, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.UEH1, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ + } + + /* ExtEvent0 SCI event */ + Method(_L10) { + } + + /* ExtEvent1 SCI event */ + Method(_L11) { + } + + /* GPIO0 or GEvent8 event */ + Method(_L18) { + Notify(\_SB.PCI0.PBR2, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.PBR4, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.PBR5, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.PBR6, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PCI0.PBR7, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ + } + + /* Azalia SCI event */ + Method(_L1B) { + Notify(\_SB.PCI0.AZHD, 0x02) /* NOTIFY_DEVICE_WAKE */ + Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ + } + } /* End Scope GPE */ diff --git a/src/mainboard/lippert/frontrunner-af/acpi/sleep.asl b/src/mainboard/lippert/frontrunner-af/acpi/sleep.asl new file mode 100644 index 0000000000..dc6e8a4e32 --- /dev/null +++ b/src/mainboard/lippert/frontrunner-af/acpi/sleep.asl @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + + /* Wake status package */ + Name(WKST,Package(){Zero, Zero}) + + /* + * \_PTS - Prepare to Sleep method + * + * Entry: + * Arg0=The value of the sleeping state S1=1, S2=2, etc + * + * Exit: + * -none- + * + * The _PTS control method is executed at the beginning of the sleep process + * for S1-S5. The sleeping value is passed to the _PTS control method. This + * control method may be executed a relatively long time before entering the + * sleep state and the OS may abort the operation without notification to + * the ACPI driver. This method cannot modify the configuration or power + * state of any device in the system. + */ + Method(\_PTS, 1) { + + /* Don't allow PCIRST# to reset USB */ + if (Arg0 == 3){ + URRE = 0 + } + + /* Clear wake status structure. */ + WKST [0] = 0 + WKST [1] = 0 + } /* End Method(\_PTS) */ + + /* + * \_WAK System Wake method + * + * Entry: + * Arg0=The value of the sleeping state S1=1, S2=2 + * + * Exit: + * Return package of 2 DWords + * Dword 1 - Status + * 0x00000000 wake succeeded + * 0x00000001 Wake was signaled but failed due to lack of power + * 0x00000002 Wake was signaled but failed due to thermal condition + * Dword 2 - Power Supply state + * if non-zero the effective S-state the power supply entered + */ + Method(\_WAK, 1) { + + /* Re-enable HPET */ + HPDE = 1 + + /* Restore PCIRST# so it resets USB */ + if (Arg0 == 3){ + URRE = 1 + } + + /* Arbitrarily clear PciExpWakeStatus */ + Local1 = PWST + PWST = Local1 + + Return(WKST) + } /* End Method(\_WAK) */ diff --git a/src/mainboard/lippert/frontrunner-af/acpi/usb.asl b/src/mainboard/lippert/frontrunner-af/acpi/usb.asl deleted file mode 100644 index 59f7d921dd..0000000000 --- a/src/mainboard/lippert/frontrunner-af/acpi/usb.asl +++ /dev/null @@ -1,136 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -Method(UCOC, 0) { - Sleep(20) - CMTI = 0x13 - GPSL = 0 -} - -/* USB Port 0 overcurrent uses Gpm 0 */ -If (UOM0 <= 9) { - Scope (\_GPE) { - Method (_L13) { - UCOC() - if (GPB0 == PLC0) { - PLC0 = ~PLC0 - \_SB.PT0D = PLC0 - } - } - } -} - -/* USB Port 1 overcurrent uses Gpm 1 */ -If (UOM1 <= 9) { - Scope (\_GPE) { - Method (_L14) { - UCOC() - if (GPB1 == PLC1) { - PLC1 = ~PLC1 - \_SB.PT1D = PLC1 - } - } - } -} - -/* USB Port 2 overcurrent uses Gpm 2 */ -If (UOM2 <= 9) { - Scope (\_GPE) { - Method (_L15) { - UCOC() - if (GPB2 == PLC2) { - PLC2 = ~PLC2 - \_SB.PT2D = PLC2 - } - } - } -} - -/* USB Port 3 overcurrent uses Gpm 3 */ -If (UOM3 <= 9) { - Scope (\_GPE) { - Method (_L16) { - UCOC() - if (GPB3 == PLC3) { - PLC3 = ~PLC3 - \_SB.PT3D = PLC3 - } - } - } -} - -/* USB Port 4 overcurrent uses Gpm 4 */ -If (UOM4 <= 9) { - Scope (\_GPE) { - Method (_L19) { - UCOC() - if (GPB4 == PLC4) { - PLC4 = ~PLC4 - \_SB.PT4D = PLC4 - } - } - } -} - -/* USB Port 5 overcurrent uses Gpm 5 */ -If (UOM5 <= 9) { - Scope (\_GPE) { - Method (_L1A) { - UCOC() - if (GPB5 == PLC5) { - PLC5 = ~PLC5 - \_SB.PT5D = PLC5 - } - } - } -} - -/* USB Port 6 overcurrent uses Gpm 6 */ -If (UOM6 <= 9) { - Scope (\_GPE) { - /* Method (_L1C) { */ - Method (_L06) { - UCOC() - if (GPB6 == PLC6) { - PLC6 = ~PLC6 - \_SB.PT6D = PLC6 - } - } - } -} - -/* USB Port 7 overcurrent uses Gpm 7 */ -If (UOM7 <= 9) { - Scope (\_GPE) { - /* Method (_L1D) { */ - Method (_L07) { - UCOC() - if (GPB7 == PLC7) { - PLC7 = ~PLC7 - \_SB.PT7D = PLC7 - } - } - } -} - -/* USB Port 8 overcurrent uses Gpm 8 */ -If (UOM8 <= 9) { - Scope (\_GPE) { - Method (_L17) { - if (G8IS == PLC8) { - PLC8 = ~PLC8 - \_SB.PT8D = PLC8 - } - } - } -} - -/* USB Port 9 overcurrent uses Gpm 9 */ -If (UOM9 <= 9) { - Scope (\_GPE) { - Method (_L0E) { - if (G9IS == 0) { - \_SB.PT9D = 1 - } - } - } -} diff --git a/src/mainboard/lippert/frontrunner-af/acpi/usb_oc.asl b/src/mainboard/lippert/frontrunner-af/acpi/usb_oc.asl new file mode 100644 index 0000000000..e4ed275617 --- /dev/null +++ b/src/mainboard/lippert/frontrunner-af/acpi/usb_oc.asl @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* USB overcurrent mapping pins. */ +Name(UOM0, 0) +Name(UOM1, 2) +Name(UOM2, 0) +Name(UOM3, 7) +Name(UOM4, 2) +Name(UOM5, 2) +Name(UOM6, 6) +Name(UOM7, 2) +Name(UOM8, 6) +Name(UOM9, 6) + +Method(UCOC, 0) { + Sleep(20) + CMTI = 0x13 + GPSL = 0 +} + +/* USB Port 0 overcurrent uses Gpm 0 */ +If (UOM0 <= 9) { + Scope (\_GPE) { + Method (_L13) { + UCOC() + if (GPB0 == PLC0) { + PLC0 = ~PLC0 + \_SB.PT0D = PLC0 + } + } + } +} + +/* USB Port 1 overcurrent uses Gpm 1 */ +If (UOM1 <= 9) { + Scope (\_GPE) { + Method (_L14) { + UCOC() + if (GPB1 == PLC1) { + PLC1 = ~PLC1 + \_SB.PT1D = PLC1 + } + } + } +} + +/* USB Port 2 overcurrent uses Gpm 2 */ +If (UOM2 <= 9) { + Scope (\_GPE) { + Method (_L15) { + UCOC() + if (GPB2 == PLC2) { + PLC2 = ~PLC2 + \_SB.PT2D = PLC2 + } + } + } +} + +/* USB Port 3 overcurrent uses Gpm 3 */ +If (UOM3 <= 9) { + Scope (\_GPE) { + Method (_L16) { + UCOC() + if (GPB3 == PLC3) { + PLC3 = ~PLC3 + \_SB.PT3D = PLC3 + } + } + } +} + +/* USB Port 4 overcurrent uses Gpm 4 */ +If (UOM4 <= 9) { + Scope (\_GPE) { + Method (_L19) { + UCOC() + if (GPB4 == PLC4) { + PLC4 = ~PLC4 + \_SB.PT4D = PLC4 + } + } + } +} + +/* USB Port 5 overcurrent uses Gpm 5 */ +If (UOM5 <= 9) { + Scope (\_GPE) { + Method (_L1A) { + UCOC() + if (GPB5 == PLC5) { + PLC5 = ~PLC5 + \_SB.PT5D = PLC5 + } + } + } +} + +/* USB Port 6 overcurrent uses Gpm 6 */ +If (UOM6 <= 9) { + Scope (\_GPE) { + /* Method (_L1C) { */ + Method (_L06) { + UCOC() + if (GPB6 == PLC6) { + PLC6 = ~PLC6 + \_SB.PT6D = PLC6 + } + } + } +} + +/* USB Port 7 overcurrent uses Gpm 7 */ +If (UOM7 <= 9) { + Scope (\_GPE) { + /* Method (_L1D) { */ + Method (_L07) { + UCOC() + if (GPB7 == PLC7) { + PLC7 = ~PLC7 + \_SB.PT7D = PLC7 + } + } + } +} + +/* USB Port 8 overcurrent uses Gpm 8 */ +If (UOM8 <= 9) { + Scope (\_GPE) { + Method (_L17) { + if (G8IS == PLC8) { + PLC8 = ~PLC8 + \_SB.PT8D = PLC8 + } + } + } +} + +/* USB Port 9 overcurrent uses Gpm 9 */ +If (UOM9 <= 9) { + Scope (\_GPE) { + Method (_L0E) { + if (G9IS == 0) { + \_SB.PT9D = 1 + } + } + } +} diff --git a/src/mainboard/lippert/frontrunner-af/dsdt.asl b/src/mainboard/lippert/frontrunner-af/dsdt.asl index 014ea08c65..0e610d7d07 100644 --- a/src/mainboard/lippert/frontrunner-af/dsdt.asl +++ b/src/mainboard/lippert/frontrunner-af/dsdt.asl @@ -14,18 +14,6 @@ DefinitionBlock ( #include - /* USB overcurrent mapping pins. */ - Name(UOM0, 0) - Name(UOM1, 2) - Name(UOM2, 0) - Name(UOM3, 7) - Name(UOM4, 2) - Name(UOM5, 2) - Name(UOM6, 6) - Name(UOM7, 2) - Name(UOM8, 6) - Name(UOM9, 6) - /* * Processor Object * @@ -225,122 +213,12 @@ DefinitionBlock ( /* Contains the supported sleep states for this chipset */ #include - /* Wake status package */ - Name(WKST,Package(){Zero, Zero}) - - /* - * \_PTS - Prepare to Sleep method - * - * Entry: - * Arg0=The value of the sleeping state S1=1, S2=2, etc - * - * Exit: - * -none- - * - * The _PTS control method is executed at the beginning of the sleep process - * for S1-S5. The sleeping value is passed to the _PTS control method. This - * control method may be executed a relatively long time before entering the - * sleep state and the OS may abort the operation without notification to - * the ACPI driver. This method cannot modify the configuration or power - * state of any device in the system. - */ - Method(\_PTS, 1) { - - /* Don't allow PCIRST# to reset USB */ - if (Arg0 == 3){ - URRE = 0 - } - - /* Clear wake status structure. */ - WKST [0] = 0 - WKST [1] = 0 - } /* End Method(\_PTS) */ - - /* - * \_WAK System Wake method - * - * Entry: - * Arg0=The value of the sleeping state S1=1, S2=2 - * - * Exit: - * Return package of 2 DWords - * Dword 1 - Status - * 0x00000000 wake succeeded - * 0x00000001 Wake was signaled but failed due to lack of power - * 0x00000002 Wake was signaled but failed due to thermal condition - * Dword 2 - Power Supply state - * if non-zero the effective S-state the power supply entered - */ - Method(\_WAK, 1) { - - /* Re-enable HPET */ - HPDE = 1 - - /* Restore PCIRST# so it resets USB */ - if (Arg0 == 3){ - URRE = 1 - } - - /* Arbitrarily clear PciExpWakeStatus */ - Local1 = PWST - PWST = Local1 - - Return(WKST) - } /* End Method(\_WAK) */ - - Scope(\_GPE) { /* Start Scope GPE */ + /* Contains the Sleep methods (WAK, PTS, GTS, etc.) */ + #include "acpi/sleep.asl" - /* General event 3 */ - Method(_L03) { - Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ - } - - /* Legacy PM event */ - Method(_L08) { - } - - /* Temp warning (TWarn) event */ - Method(_L09) { - } - - /* USB controller PME# */ - Method(_L0B) { - Notify(\_SB.PCI0.UOH1, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.UOH2, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.UOH3, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.UOH4, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.UOH5, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.UOH6, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.UEH1, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ - } - - /* ExtEvent0 SCI event */ - Method(_L10) { - } - - /* ExtEvent1 SCI event */ - Method(_L11) { - } - - /* GPIO0 or GEvent8 event */ - Method(_L18) { - Notify(\_SB.PCI0.PBR2, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.PBR4, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.PBR5, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.PBR6, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PCI0.PBR7, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ - } - - /* Azalia SCI event */ - Method(_L1B) { - Notify(\_SB.PCI0.AZHD, 0x02) /* NOTIFY_DEVICE_WAKE */ - Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ - } - } /* End Scope GPE */ + #include "acpi/gpe.asl" - #include "acpi/usb.asl" + #include "acpi/usb_oc.asl" /* System Bus */ Scope(\_SB) { /* Start \_SB scope */ -- cgit v1.2.3