Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 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. |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | /* Data to be patched by the BIOS during POST */ |
| 17 | /* FIXME the patching is not done yet! */ |
| 18 | /* Memory related values */ |
| 19 | Name(LOMH, 0x0) /* Start of unused memory in C0000-E0000 range */ |
| 20 | Name(PBAD, 0x0) /* Address of BIOS area (If TOM2 != 0, Addr >> 16) */ |
| 21 | Name(PBLN, 0x0) /* Length of BIOS area */ |
| 22 | |
| 23 | Name(PCBA, CONFIG_MMCONF_BASE_ADDRESS) /* Base address of PCIe config space */ |
| 24 | Name(HPBA, 0xFED00000) /* Base address of HPET table */ |
| 25 | |
| 26 | Name(SSFG, 0x0D) /* S1 support: bit 0, S2 Support: bit 1, etc. S0 & S5 assumed */ |
| 27 | |
| 28 | /* Some global data */ |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 29 | Name(OSVR, 3) /* Assume nothing. WinXp = 1, Vista = 2, Linux = 3, WinCE = 4 */ |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 30 | Name(OSV, Ones) /* Assume nothing */ |
| 31 | Name(PMOD, One) /* Assume APIC */ |
| 32 | |
| 33 | Scope(\_SB) { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 34 | Method(OSFL, 0){ |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 35 | |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 36 | if(LNotEqual(OSVR, Ones)) {Return(OSVR)} /* OS version was already detected */ |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 37 | |
Martin Roth | 91d9cbc | 2015-12-08 15:04:23 -0700 | [diff] [blame] | 38 | if(CondRefOf(\_OSI)) |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 39 | { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 40 | Store(1, OSVR) /* Assume some form of XP */ |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 41 | if (\_OSI("Windows 2006")) /* Vista */ |
| 42 | { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 43 | Store(2, OSVR) |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 44 | } |
| 45 | } else { |
| 46 | If(WCMP(\_OS,"Linux")) { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 47 | Store(3, OSVR) /* Linux */ |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 48 | } Else { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 49 | Store(4, OSVR) /* Gotta be WinCE */ |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 50 | } |
| 51 | } |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 52 | Return(OSVR) |
Mike Loptien | ba7ed4b | 2013-03-29 13:33:39 -0600 | [diff] [blame] | 53 | } |
| 54 | } |
| 55 | |
| 56 | Scope(\_SI) { |
| 57 | Method(_SST, 1) { |
| 58 | /* DBGO("\\_SI\\_SST\n") */ |
| 59 | /* DBGO(" New Indicator state: ") */ |
| 60 | /* DBGO(Arg0) */ |
| 61 | /* DBGO("\n") */ |
| 62 | } |
| 63 | } /* End Scope SI */ |