Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | //BTDC Due to IMC Fan, ACPI control codes |
| 17 | OperationRegion(IMIO, SystemIO, 0x3E, 0x02) |
| 18 | Field(IMIO , ByteAcc, NoLock, Preserve) { |
| 19 | IMCX,8, |
| 20 | IMCA,8 |
| 21 | } |
| 22 | |
| 23 | IndexField(IMCX, IMCA, ByteAcc, NoLock, Preserve) { |
| 24 | Offset(0x80), |
| 25 | MSTI, 8, |
| 26 | MITS, 8, |
| 27 | MRG0, 8, |
| 28 | MRG1, 8, |
| 29 | MRG2, 8, |
| 30 | MRG3, 8, |
| 31 | } |
| 32 | |
| 33 | Method(WACK, 0) |
| 34 | { |
| 35 | Store(0, Local0) |
| 36 | While (LNotEqual(Local0, 0xFA)) { |
| 37 | Store(MRG0, Local0) |
| 38 | Sleep(10) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | //Init |
| 43 | Method (ITZE, 0) |
| 44 | { |
| 45 | Store(0, MRG0) |
| 46 | Store(0xB5, MRG1) |
| 47 | Store(0, MRG2) |
| 48 | Store(0x96, MSTI) |
| 49 | WACK() |
| 50 | |
| 51 | Store(0, MRG0) |
| 52 | Store(0, MRG1) |
| 53 | Store(0, MRG2) |
| 54 | Store(0x80, MSTI) |
| 55 | WACK() |
| 56 | |
| 57 | Or(MRG2, 0x01, Local0) |
| 58 | |
| 59 | Store(0, MRG0) |
| 60 | Store(0, MRG1) |
| 61 | Store(Local0, MRG2) |
| 62 | Store(0x81, MSTI) |
| 63 | WACK() |
| 64 | } |
| 65 | |
| 66 | //Sleep |
| 67 | Method (IMSP, 0) |
| 68 | { |
| 69 | Store(0, MRG0) |
| 70 | Store(0xB5, MRG1) |
| 71 | Store(0, MRG2) |
| 72 | Store(0x96, MSTI) |
| 73 | WACK() |
| 74 | |
| 75 | Store(0, MRG0) |
| 76 | Store(1, MRG1) |
| 77 | Store(0, MRG2) |
| 78 | Store(0x98, MSTI) |
| 79 | WACK() |
| 80 | |
| 81 | Store(0, MRG0) |
| 82 | Store(0xB4, MRG1) |
| 83 | Store(0, MRG2) |
| 84 | Store(0x96, MSTI) |
| 85 | WACK() |
| 86 | } |
| 87 | |
| 88 | //Wake |
| 89 | Method (IMWK, 0) |
| 90 | { |
| 91 | Store(0, MRG0) |
| 92 | Store(0xB5, MRG1) |
| 93 | Store(0, MRG2) |
| 94 | Store(0x96, MSTI) |
| 95 | WACK() |
| 96 | |
| 97 | Store(0, MRG0) |
| 98 | Store(0, MRG1) |
| 99 | Store(0, MRG2) |
| 100 | Store(0x80, MSTI) |
| 101 | WACK() |
| 102 | |
| 103 | Or(MRG2, 0x01, Local0) |
| 104 | |
| 105 | Store(0, MRG0) |
| 106 | Store(0, MRG1) |
| 107 | Store(Local0, MRG2) |
| 108 | Store(0x81, MSTI) |
| 109 | WACK() |
| 110 | } |