blob: 8bfd63274b078cfa030f064aa1fd2b7bf05d84f2 [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Google Inc.
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.
Lee Leahy77ff0b12015-05-05 15:07:29 -070015 */
16
17/* These devices are created at runtime */
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070018External (\_PR.CP00, DeviceObj)
19External (\_PR.CP01, DeviceObj)
20External (\_PR.CP02, DeviceObj)
21External (\_PR.CP03, DeviceObj)
Lee Leahy32471722015-04-20 15:20:28 -070022
Lee Leahy77ff0b12015-05-05 15:07:29 -070023
24/* Notify OS to re-read CPU tables, assuming ^2 CPU count */
25Method (PNOT)
26{
27 If (LGreaterEqual (\PCNT, 2)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070028 Notify (\_PR.CP00, 0x81) /* _CST */
29 Notify (\_PR.CP01, 0x81) /* _CST */
Lee Leahy77ff0b12015-05-05 15:07:29 -070030 }
31 If (LGreaterEqual (\PCNT, 4)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070032 Notify (\_PR.CP02, 0x81) /* _CST */
33 Notify (\_PR.CP03, 0x81) /* _CST */
Lee Leahy77ff0b12015-05-05 15:07:29 -070034 }
35}
36
37/* Notify OS to re-read CPU _PPC limit, assuming ^2 CPU count */
38Method (PPCN)
39{
40 If (LGreaterEqual (\PCNT, 2)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070041 Notify (\_PR.CP00, 0x80) /* _PPC */
42 Notify (\_PR.CP01, 0x80) /* _PPC */
Lee Leahy77ff0b12015-05-05 15:07:29 -070043 }
44 If (LGreaterEqual (\PCNT, 4)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070045 Notify (\_PR.CP02, 0x80) /* _PPC */
46 Notify (\_PR.CP03, 0x80) /* _PPC */
Lee Leahy77ff0b12015-05-05 15:07:29 -070047 }
48}
49
50/* Notify OS to re-read Throttle Limit tables, assuming ^2 CPU count */
51Method (TNOT)
52{
53 If (LGreaterEqual (\PCNT, 2)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070054 Notify (\_PR.CP00, 0x82) /* _TPC */
55 Notify (\_PR.CP01, 0x82) /* _TPC */
Lee Leahy77ff0b12015-05-05 15:07:29 -070056 }
57 If (LGreaterEqual (\PCNT, 4)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070058 Notify (\_PR.CP02, 0x82) /* _TPC */
59 Notify (\_PR.CP03, 0x82) /* _TPC */
Lee Leahy77ff0b12015-05-05 15:07:29 -070060 }
61}
62
63/* Return a package containing enabled processor entries */
64Method (PPKG)
65{
66 If (LGreaterEqual (\PCNT, 4)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070067 Return (Package() {\_PR.CP00, \_PR.CP01, \_PR.CP02, \_PR.CP03})
Lee Leahy77ff0b12015-05-05 15:07:29 -070068 } ElseIf (LGreaterEqual (\PCNT, 2)) {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070069 Return (Package() {\_PR.CP00, \_PR.CP01})
Lee Leahy77ff0b12015-05-05 15:07:29 -070070 } Else {
Jagadish Krishnamoorthy98d62f22015-07-09 00:32:32 -070071 Return (Package() {\_PR.CP00})
Lee Leahy77ff0b12015-05-05 15:07:29 -070072 }
73}