Timothy Pearson | 4b373c9 | 2015-04-05 17:54:08 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Timothy Pearson | 4b373c9 | 2015-04-05 17:54:08 -0500 | [diff] [blame] | 15 | */ |
| 16 | |
Timothy Pearson | 4b373c9 | 2015-04-05 17:54:08 -0500 | [diff] [blame] | 17 | /* The _PTS method (Prepare To Sleep) is called before the OS is |
| 18 | * entering a sleep state. The sleep state number is passed in Arg0 |
| 19 | */ |
| 20 | |
| 21 | Method(_PTS,1) |
| 22 | { |
| 23 | // Call a trap so SMI can prepare for Sleep as well. |
| 24 | // TRAP(0x55) |
Nicola Corna | 435d307 | 2017-02-22 16:52:29 +0100 | [diff] [blame] | 25 | \_SB.PCI0.LPCB.EC.MUTE(1) |
| 26 | \_SB.PCI0.LPCB.EC.USBP(0) |
Timothy Pearson | 4b373c9 | 2015-04-05 17:54:08 -0500 | [diff] [blame] | 27 | \_SB.PCI0.LPCB.EC.RADI(0) |
| 28 | } |
| 29 | |
| 30 | /* The _WAK method is called on system wakeup */ |
| 31 | |
| 32 | Method(_WAK,1) |
| 33 | { |
| 34 | // CPU specific part |
| 35 | |
| 36 | // Notify PCI Express slots in case a card |
| 37 | // was inserted while a sleep state was active. |
| 38 | |
| 39 | // Are we going to S3? |
| 40 | If (LEqual(Arg0, 3)) { |
| 41 | // .. |
| 42 | } |
| 43 | |
| 44 | // Are we going to S4? |
| 45 | If (LEqual(Arg0, 4)) { |
| 46 | // .. |
| 47 | } |
| 48 | |
| 49 | // TODO: Windows XP SP2 P-State restore |
| 50 | |
| 51 | // TODO: Return Arg0 as second value if S-Arg0 was entered |
| 52 | // before. |
| 53 | |
| 54 | Return(Package(){0,0}) |
| 55 | } |
| 56 | |
Timothy Pearson | 4b373c9 | 2015-04-05 17:54:08 -0500 | [diff] [blame] | 57 | /* System Bus */ |
| 58 | |
| 59 | Scope(\_SB) |
| 60 | { |
| 61 | /* This method is placed on the top level, so we can make sure it's the |
| 62 | * first executed _INI method. |
| 63 | */ |
| 64 | Method(_INI, 0) |
| 65 | { |
| 66 | /* The DTS data in NVS is probably not up to date. |
| 67 | * Update temperature values and make sure AP thermal |
| 68 | * interrupts can happen |
| 69 | */ |
| 70 | |
| 71 | // TRAP(71) // TODO |
| 72 | |
Paul Menzel | bb1b259 | 2015-10-12 19:20:48 +0200 | [diff] [blame] | 73 | \GOS() |
Timothy Pearson | 4b373c9 | 2015-04-05 17:54:08 -0500 | [diff] [blame] | 74 | |
| 75 | /* And the OS workarounds start right after we know what we're |
| 76 | * running: Windows XP SP1 needs to have C-State coordination |
| 77 | * enabled in SMM. |
| 78 | */ |
| 79 | If (LAnd(LEqual(OSYS, 2001), MPEN)) { |
| 80 | // TRAP(61) // TODO |
| 81 | } |
| 82 | |
| 83 | /* SMM power state and C4-on-C3 settings need to be updated */ |
| 84 | // TRAP(43) // TODO |
| 85 | } |
| 86 | } |