blob: 81dfb46b747196111025377f2338c97364944f3c [file] [log] [blame]
Bruce Griffith72645bb2014-06-10 05:10:19 -06001/*
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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20OperationRegion(IMIO, SystemIO, 0x3E, 0x02)
21Field(IMIO , ByteAcc, NoLock, Preserve) {
22 IMCX,8,
23 IMCA,8
24}
25
26IndexField(IMCX, IMCA, ByteAcc, NoLock, Preserve) {
27 Offset(0x80),
28 MSTI, 8,
29 MITS, 8,
30 MRG0, 8,
31 MRG1, 8,
32 MRG2, 8,
33 MRG3, 8,
34}
35
36Method(WACK, 0)
37{
38 Store(0, Local0)
39 Store(50, Local1)
40 While (LAnd (LNotEqual(Local0, 0xFA), LGreater(Local1,0))) {
41 Store(MRG0, Local0)
42 Sleep(10)
43 Decrement(Local1)
44 }
45}
46
47//Init
48Method (ITZE, 0)
49{
50 Store(0, MRG0)
51 Store(0xB5, MRG1)
52 Store(0, MRG2)
53 Store(0x96, MSTI)
54 WACK()
55
56 Store(0, MRG0)
57 Store(0, MRG1)
58 Store(0, MRG2)
59 Store(0x80, MSTI)
60 WACK()
61
62 Or(MRG2, 0x01, Local0)
63
64 Store(0, MRG0)
65 Store(0, MRG1)
66 Store(Local0, MRG2)
67 Store(0x81, MSTI)
68 WACK()
69}
70
71//Sleep
72Method (IMSP, 0)
73{
74 Store(0, MRG0)
75 Store(0xB5, MRG1)
76 Store(0, MRG2)
77 Store(0x96, MSTI)
78 WACK()
79
80 Store(0, MRG0)
81 Store(1, MRG1)
82 Store(0, MRG2)
83 Store(0x98, MSTI)
84 WACK()
85
86 Store(0, MRG0)
87 Store(0xB4, MRG1)
88 Store(0, MRG2)
89 Store(0x96, MSTI)
90 WACK()
91}
92
93//Wake
94Method (IMWK, 0)
95{
96 Store(0, MRG0)
97 Store(0xB5, MRG1)
98 Store(0, MRG2)
99 Store(0x96, MSTI)
100 WACK()
101
102 Store(0, MRG0)
103 Store(0, MRG1)
104 Store(0, MRG2)
105 Store(0x80, MSTI)
106 WACK()
107
108 Or(MRG2, 0x01, Local0)
109
110 Store(0, MRG0)
111 Store(0, MRG1)
112 Store(Local0, MRG2)
113 Store(0x81, MSTI)
114 WACK()
115}