Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 1 | /* |
| 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. |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | /* These devices are created at runtime */ |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 18 | External (\_PR.CP00, DeviceObj) |
| 19 | External (\_PR.CP01, DeviceObj) |
| 20 | External (\_PR.CP02, DeviceObj) |
| 21 | External (\_PR.CP03, DeviceObj) |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 22 | |
| 23 | /* Notify OS to re-read CPU tables, assuming ^2 CPU count */ |
| 24 | Method (PNOT) |
| 25 | { |
| 26 | If (LGreaterEqual (\PCNT, 2)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 27 | Notify (\_PR.CP00, 0x81) // _CST |
| 28 | Notify (\_PR.CP01, 0x81) // _CST |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 29 | } |
| 30 | If (LGreaterEqual (\PCNT, 4)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 31 | Notify (\_PR.CP02, 0x81) // _CST |
| 32 | Notify (\_PR.CP03, 0x81) // _CST |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 33 | } |
| 34 | } |
| 35 | |
| 36 | /* Notify OS to re-read CPU _PPC limit, assuming ^2 CPU count */ |
| 37 | Method (PPCN) |
| 38 | { |
| 39 | If (LGreaterEqual (\PCNT, 2)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 40 | Notify (\_PR.CP00, 0x80) // _PPC |
| 41 | Notify (\_PR.CP01, 0x80) // _PPC |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 42 | } |
| 43 | If (LGreaterEqual (\PCNT, 4)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 44 | Notify (\_PR.CP02, 0x80) // _PPC |
| 45 | Notify (\_PR.CP03, 0x80) // _PPC |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 46 | } |
| 47 | } |
| 48 | |
| 49 | /* Notify OS to re-read Throttle Limit tables, assuming ^2 CPU count */ |
| 50 | Method (TNOT) |
| 51 | { |
| 52 | If (LGreaterEqual (\PCNT, 2)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 53 | Notify (\_PR.CP00, 0x82) // _TPC |
| 54 | Notify (\_PR.CP01, 0x82) // _TPC |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 55 | } |
| 56 | If (LGreaterEqual (\PCNT, 4)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 57 | Notify (\_PR.CP02, 0x82) // _TPC |
| 58 | Notify (\_PR.CP03, 0x82) // _TPC |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 59 | } |
| 60 | } |
| 61 | |
| 62 | /* Return a package containing enabled processor entries */ |
| 63 | Method (PPKG) |
| 64 | { |
| 65 | If (LGreaterEqual (\PCNT, 4)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 66 | Return (Package() {\_PR.CP00, \_PR.CP01, \_PR.CP02, \_PR.CP03}) |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 67 | } ElseIf (LGreaterEqual (\PCNT, 2)) { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 68 | Return (Package() {\_PR.CP00, \_PR.CP01}) |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 69 | } Else { |
Timothy Pearson | 033bb4b | 2015-02-10 22:21:39 -0600 | [diff] [blame] | 70 | Return (Package() {\_PR.CP00}) |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 71 | } |
| 72 | } |