diff options
author | Guo Mang <mang.guo@intel.com> | 2016-12-23 14:33:37 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-05-09 13:03:04 +0800 |
commit | a31d2863b02752aff8e632084806cc0ea69ec508 (patch) | |
tree | 816a663f07e2d2ef7c7d1d14cb7b6d8c4111c7d6 /Platform | |
parent | 33eb86541d9305fd33140931c4c70bd064af3ec3 (diff) | |
download | edk2-platforms-a31d2863b02752aff8e632084806cc0ea69ec508.tar.xz |
BroxtonPlatformPkg: Add PnpDxe
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang <mang.guo@intel.com>
Diffstat (limited to 'Platform')
6 files changed, 676 insertions, 0 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/PnpDxe/AunitBiosSettings.h b/Platform/BroxtonPlatformPkg/Common/PnpDxe/AunitBiosSettings.h new file mode 100644 index 0000000000..1aa2934424 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/PnpDxe/AunitBiosSettings.h @@ -0,0 +1,144 @@ +/** @file
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef AUNIT_BIOS_SETTINGS_HH
+#define AUNIT_BIOS_SETTINGS_HH
+
+#define AUNIT_VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT \
+\
+ 0x4d, 0x6430, 7, 0, 0x1, \
+ 0x4d, 0x6430, 15, 8, 0x1, \
+ 0x4d, 0x6430, 23, 16, 0x0, \
+ 0x4d, 0x6430, 31, 24, 0x1, \
+ 0x4d, 0x6434, 7, 0, 0x0, \
+ 0x4d, 0x6434, 15, 8, 0x1, \
+ 0x4d, 0x6434, 23, 16, 0x1, \
+ 0x4d, 0x6434, 31, 24, 0x1, \
+ 0x4d, 0x6438, 7, 0, 0x1, \
+ 0x4d, 0x6438, 15, 8, 0x1, \
+ 0x4d, 0x6438, 23, 16, 0x1, \
+ 0x4d, 0x6438, 31, 24, 0x1, \
+ 0x4d, 0x643c, 7, 0, 0x1, \
+ 0x4d, 0x643c, 15, 8, 0x1, \
+ 0x4d, 0x643c, 23, 16, 0x1, \
+ 0x4d, 0x643c, 31, 24, 0x1, \
+ 0x4d, 0x6440, 7, 0, 0x1, \
+ 0x4d, 0x6440, 15, 8, 0x1, \
+ 0x4d, 0x6440, 23, 16, 0x0, \
+ 0x4d, 0x6440, 31, 24, 0x0, \
+ 0x4d, 0x6444, 7, 0, 0x1, \
+ 0x4d, 0x6444, 15, 8, 0x1, \
+ 0x4d, 0x6444, 23, 16, 0x1, \
+ 0x4d, 0x6448, 7, 0, 0x8, \
+ 0x4d, 0x6448, 15, 8, 0xff, \
+ 0x4d, 0x6448, 23, 16, 0xff, \
+ 0x4d, 0x6448, 31, 24, 0xff, \
+ 0x4d, 0x644c, 7, 0, 0xff, \
+ 0x4d, 0x644c, 15, 8, 0xff, \
+ 0x4d, 0x644c, 23, 16, 0xff, \
+ 0x4d, 0x644c, 31, 24, 0xff, \
+ 0x4d, 0x6450, 0, 0, 0x0, \
+ 0x4d, 0x6450, 1, 1, 0x0, \
+ 0x4d, 0x6450, 3, 2, 0x2, \
+ 0x4d, 0x6450, 19, 6, 0x9, \
+ 0x4d, 0x6450, 51, 38, 0x36, \
+ 0x4d, 0x6484, 7, 0, 0xff, \
+ 0x4d, 0x6484, 23, 16, 0xff \
+
+
+#define AUNIT_VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT \
+ \
+ 0x4d, 0x6430, 7, 0, 0x1, \
+ 0x4d, 0x6430, 15, 8, 0x1, \
+ 0x4d, 0x6430, 23, 16, 0x0, \
+ 0x4d, 0x6430, 31, 24, 0x1, \
+ 0x4d, 0x6434, 7, 0, 0x0, \
+ 0x4d, 0x6434, 15, 8, 0x1, \
+ 0x4d, 0x6434, 23, 16, 0x1, \
+ 0x4d, 0x6434, 31, 24, 0x1, \
+ 0x4d, 0x6438, 7, 0, 0x1, \
+ 0x4d, 0x6438, 15, 8, 0x1, \
+ 0x4d, 0x6438, 23, 16, 0x1, \
+ 0x4d, 0x6438, 31, 24, 0x1, \
+ 0x4d, 0x643c, 7, 0, 0x1, \
+ 0x4d, 0x643c, 15, 8, 0x1, \
+ 0x4d, 0x643c, 23, 16, 0x1, \
+ 0x4d, 0x643c, 31, 24, 0x1, \
+ 0x4d, 0x6440, 7, 0, 0x1, \
+ 0x4d, 0x6440, 15, 8, 0x1, \
+ 0x4d, 0x6440, 23, 16, 0x0, \
+ 0x4d, 0x6440, 31, 24, 0x0, \
+ 0x4d, 0x6444, 7, 0, 0x1, \
+ 0x4d, 0x6444, 15, 8, 0x1, \
+ 0x4d, 0x6444, 23, 16, 0x1, \
+ 0x4d, 0x6448, 7, 0, 0x8, \
+ 0x4d, 0x6448, 15, 8, 0xff, \
+ 0x4d, 0x6448, 23, 16, 0xff, \
+ 0x4d, 0x6448, 31, 24, 0xff, \
+ 0x4d, 0x644c, 7, 0, 0xff, \
+ 0x4d, 0x644c, 15, 8, 0xff, \
+ 0x4d, 0x644c, 23, 16, 0xff, \
+ 0x4d, 0x644c, 31, 24, 0xff, \
+ 0x4d, 0x6450, 0, 0, 0x0, \
+ 0x4d, 0x6450, 1, 1, 0x0, \
+ 0x4d, 0x6450, 3, 2, 0x2, \
+ 0x4d, 0x6450, 19, 6, 0x9, \
+ 0x4d, 0x6450, 51, 38, 0x36, \
+ 0x4d, 0x6484, 7, 0, 0xff, \
+ 0x4d, 0x6484, 23, 16, 0xff \
+
+
+#define AUNIT_VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT \
+ \
+ 0x4d, 0x6430, 7, 0, 0x1, \
+ 0x4d, 0x6430, 15, 8, 0x1, \
+ 0x4d, 0x6430, 23, 16, 0x0, \
+ 0x4d, 0x6430, 31, 24, 0x1, \
+ 0x4d, 0x6434, 7, 0, 0x0, \
+ 0x4d, 0x6434, 15, 8, 0x1, \
+ 0x4d, 0x6434, 23, 16, 0x1, \
+ 0x4d, 0x6434, 31, 24, 0x1, \
+ 0x4d, 0x6438, 7, 0, 0x1, \
+ 0x4d, 0x6438, 15, 8, 0x1, \
+ 0x4d, 0x6438, 23, 16, 0x1, \
+ 0x4d, 0x6438, 31, 24, 0x1, \
+ 0x4d, 0x643c, 7, 0, 0x1, \
+ 0x4d, 0x643c, 15, 8, 0x1, \
+ 0x4d, 0x643c, 23, 16, 0x1, \
+ 0x4d, 0x643c, 31, 24, 0x1, \
+ 0x4d, 0x6440, 7, 0, 0x1, \
+ 0x4d, 0x6440, 15, 8, 0x1, \
+ 0x4d, 0x6440, 23, 16, 0x0, \
+ 0x4d, 0x6440, 31, 24, 0x0, \
+ 0x4d, 0x6444, 7, 0, 0x1, \
+ 0x4d, 0x6444, 15, 8, 0x1, \
+ 0x4d, 0x6444, 23, 16, 0x1, \
+ 0x4d, 0x6448, 7, 0, 0x8, \
+ 0x4d, 0x6448, 15, 8, 0xff, \
+ 0x4d, 0x6448, 23, 16, 0xff, \
+ 0x4d, 0x6448, 31, 24, 0xff, \
+ 0x4d, 0x644c, 7, 0, 0xff, \
+ 0x4d, 0x644c, 15, 8, 0xff, \
+ 0x4d, 0x644c, 23, 16, 0xff, \
+ 0x4d, 0x644c, 31, 24, 0xff, \
+ 0x4d, 0x6450, 0, 0, 0x0, \
+ 0x4d, 0x6450, 1, 1, 0x0, \
+ 0x4d, 0x6450, 3, 2, 0x2, \
+ 0x4d, 0x6450, 19, 6, 0x9, \
+ 0x4d, 0x6450, 51, 38, 0x36, \
+ 0x4d, 0x6484, 7, 0, 0xff, \
+ 0x4d, 0x6484, 23, 16, 0xff \
+
+
+#endif // AUNIT_BIOS_SETTINGS_HH
+
diff --git a/Platform/BroxtonPlatformPkg/Common/PnpDxe/BunitBiosSettings.h b/Platform/BroxtonPlatformPkg/Common/PnpDxe/BunitBiosSettings.h new file mode 100644 index 0000000000..fa41473a68 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/PnpDxe/BunitBiosSettings.h @@ -0,0 +1,132 @@ +/** @file
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef BUNIT_BIOS_SETTINGS_HH
+#define BUNIT_BIOS_SETTINGS_HH
+
+#define BUNIT_VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT \
+ \
+ 0x4c, 0x6d4c, 5, 0, 0x8, \
+ 0x4c, 0x6d4c, 13, 8, 0x8, \
+ 0x4c, 0x6d4c, 21, 16, 0x8, \
+ 0x4c, 0x6d4c, 29, 24, 0x8, \
+ 0x4c, 0x6d50, 5, 0, 0x8, \
+ 0x4c, 0x6d50, 13, 8, 0x8, \
+ 0x4c, 0x6d50, 21, 16, 0x8, \
+ 0x4c, 0x6d50, 29, 24, 0x8, \
+ 0x4c, 0x6d54, 5, 0, 0x8, \
+ 0x4c, 0x6d54, 13, 8, 0x8, \
+ 0x4c, 0x6d54, 21, 16, 0x8, \
+ 0x4c, 0x6d54, 29, 24, 0x8, \
+ 0x4c, 0x6d58, 5, 0, 0x8, \
+ 0x4c, 0x6d58, 13, 8, 0x8, \
+ 0x4c, 0x6d58, 21, 16, 0x8, \
+ 0x4c, 0x6d58, 29, 24, 0x8, \
+ 0x4c, 0x6d5c, 5, 0, 0x8, \
+ 0x4c, 0x6d5c, 13, 8, 0x8, \
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c, 21, 16, 0x4, \
+ 0x4c, 0x6d5c, 29, 24, 0x4, \
+ 0x4c, 0x6d60, 5, 0, 0x4, \
+ 0x4c, 0x6d60, 13, 8, 0x4, \
+ 0x4c, 0x6d60, 21, 16, 0x4, \
+ 0x4c, 0x6d60, 29, 24, 0x4, \
+ 0x4c, 0x6d64, 7, 0, 0x0, \
+ 0x4c, 0x6d64, 15, 8, 0x0, \
+ 0x4c, 0x6d64, 31, 24, 0x0, \
+ 0x4c, 0x6d68, 5, 0, 0x0, \
+ 0x4c, 0x6d68, 13, 8, 0x0, \
+ 0x4c, 0x6d68, 31, 31, 0x0, \
+ 0x4c, 0x6d6c, 5, 0, 0x0, \
+ 0x4c, 0x6d6c, 13, 8, 0x0, \
+ 0x4c, 0x6d6c, 31, 31, 0x0, \
+ 0x4c, 0x6d70, 0, 0, 0x0 \
+
+
+#endif // BUNIT_BIOS_SETTINGS_HH
+
diff --git a/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnPDxe.h b/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnPDxe.h new file mode 100644 index 0000000000..234ba2877e --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnPDxe.h @@ -0,0 +1,62 @@ +/** @file
+ Power and Performance header file.
+
+ Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _PNP_DXE_H_
+#define _PNP_DXE_H_
+
+#include <IndustryStandard/Pci22.h>
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/BaseMemoryLib.h>
+#include "SaAccess.h"
+#include <Guid/SetupVariable.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/SideBandLib.h>
+#include <Protocol/SetupMode.h>
+
+#include "AunitBiosSettings.h"
+#include "BunitBiosSettings.h"
+#include "TunitBiosSettings.h"
+
+#define PNP_POWER 1
+#define PNP_PERF 2
+#define PNP_POWER_PERF 3
+
+#define VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT \
+ AUNIT_VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT, \
+ BUNIT_VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT, \
+ TUNIT_VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT
+
+#define VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT \
+ AUNIT_VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT, \
+ BUNIT_VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT, \
+ TUNIT_VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT
+
+#define VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT \
+ AUNIT_VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT, \
+ BUNIT_VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT, \
+ TUNIT_VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT
+
+typedef struct {
+ UINT8 MsgPort;
+ UINT16 MsgRegAddr;
+ UINT8 MSB;
+ UINT8 LSB;
+ UINT32 Value;
+} PNP_SETTING;
+
+#endif
+
diff --git a/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnpDxe.c b/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnpDxe.c new file mode 100644 index 0000000000..cb52c48fc9 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnpDxe.c @@ -0,0 +1,122 @@ +/** @file
+ This driver initialize the power and performance Setting.
+
+ Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include "PnPDxe.h"
+
+PNP_SETTING mPnPValueForPerf[] = {
+ VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT,
+};
+
+PNP_SETTING mPnPValueForPower[] = {
+ VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT,
+};
+
+PNP_SETTING mPnPValueForPwrPerf[] = {
+ VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT,
+};
+
+VOID
+PnpSetting (
+VOID
+ )
+{
+ EFI_STATUS Status;
+ SYSTEM_CONFIGURATION SystemConfiguration;
+ UINTN VarSize;
+ volatile UINT32 Index;
+ UINT8 Index1;
+ UINT32 Value;
+ UINT32 Mask;
+ PNP_SETTING* PnpSettingDataArray;
+ UINT32 PnpSettingArraySize;
+
+ Status = EFI_SUCCESS;
+
+ VarSize = sizeof (SYSTEM_CONFIGURATION);
+ Status = gRT->GetVariable (
+ L"Setup",
+ &gEfiSetupVariableGuid,
+ NULL,
+ &VarSize,
+ &SystemConfiguration
+ );
+
+ ASSERT_EFI_ERROR (Status);
+
+ if (SystemConfiguration.PnpSettings == PNP_POWER) {
+ //
+ // Power
+ //
+ PnpSettingDataArray = mPnPValueForPower;
+ PnpSettingArraySize = sizeof (mPnPValueForPower);
+ } else if (SystemConfiguration.PnpSettings == PNP_PERF) {
+ //
+ // Performance
+ //
+ PnpSettingDataArray = mPnPValueForPerf;
+ PnpSettingArraySize = sizeof (mPnPValueForPerf);
+ } else if (SystemConfiguration.PnpSettings == PNP_POWER_PERF) {
+ //
+ // Power & Performance
+ //
+ PnpSettingDataArray = mPnPValueForPwrPerf;
+ PnpSettingArraySize = sizeof (mPnPValueForPwrPerf);
+ } else {
+ DEBUG ((EFI_D_INFO, "No PnP Setting been Configured !!!\n"));
+ return;
+ }
+
+ for (Index = 0; Index < PnpSettingArraySize / sizeof (PNP_SETTING); Index++) {
+ if ((PnpSettingDataArray[Index].MsgPort ==0) && (PnpSettingDataArray[Index].MsgRegAddr == 0) &&(PnpSettingDataArray[Index].Value ==0)) {
+ continue;
+ }
+
+ Mask = 0;
+ for (Index1 = PnpSettingDataArray[Index].LSB; Index1 <= PnpSettingDataArray[Index].MSB; Index1++) {
+ Mask |= (1 << Index1);
+ }
+
+ DEBUG ((EFI_D_INFO, "Output PwrPerf Register: PortID: 0x%x, Offset:0x%x, Field[%2d:%2d], Value:%8x\n", PnpSettingDataArray[Index].MsgPort, PnpSettingDataArray[Index].MsgRegAddr,PnpSettingDataArray[Index].MSB, PnpSettingDataArray[Index].LSB, PnpSettingDataArray[Index].Value));
+
+ Value = SideBandRead32(PnpSettingDataArray[Index].MsgPort, PnpSettingDataArray[Index].MsgRegAddr);
+ Value &= ~Mask;
+ Value |= (PnpSettingDataArray[Index].Value << PnpSettingDataArray[Index].LSB);
+ SideBandWrite32 (PnpSettingDataArray[Index].MsgPort, PnpSettingDataArray[Index].MsgRegAddr, Value);
+ }
+}
+
+
+/**
+ Initialize the power and performance Setting.
+
+ @param[in] ImageHandle Pointer to the loaded image protocol for this driver
+ @param[in] SystemTable Pointer to the EFI System Table
+
+ @retval EFI_SUCCESS The driver installed/initialized correctly.
+
+**/
+EFI_STATUS
+EFIAPI
+InitializePnpSetting (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ DEBUG ((EFI_D_INFO, "PnpSetting Entering !!!\n"));
+ PnpSetting ();
+
+ return EFI_SUCCESS;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnpDxe.inf b/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnpDxe.inf new file mode 100644 index 0000000000..1f964716ff --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/PnpDxe/PnpDxe.inf @@ -0,0 +1,48 @@ +## @file
+# Component description file a single segment PCI Host Bridge driver.
+#
+# Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PnpDxe
+ FILE_GUID = CE7CD764-a1d9-44e5-9857-14fefaae96dd
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = InitializePnpSetting
+
+[Packages]
+ MdePkg/MdePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ UefiCpuPkg/UefiCpuPkg.dec
+ BroxtonPlatformPkg/PlatformPkg.dec
+ BroxtonSiPkg/BroxtonSiPkg.dec
+
+[LibraryClasses]
+ UefiDriverEntryPoint
+ BaseLib
+ DebugLib
+ UefiBootServicesTableLib
+ UefiRuntimeServicesTableLib
+ SideBandLib
+
+[Sources]
+ PnpDxe.c
+
+[Guids]
+ gEfiSetupVariableGuid
+
+[Protocols]
+
+[Depex]
+ gEfiVariableArchProtocolGuid
diff --git a/Platform/BroxtonPlatformPkg/Common/PnpDxe/TunitBiosSettings.h b/Platform/BroxtonPlatformPkg/Common/PnpDxe/TunitBiosSettings.h new file mode 100644 index 0000000000..1b69f623b0 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/PnpDxe/TunitBiosSettings.h @@ -0,0 +1,168 @@ +/** @file
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef TUNIT_BIOS_SETTINGS_HH
+#define TUNIT_BIOS_SETTINGS_HH
+
+#define TUNIT_VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT \
+ \
+ 0x52, 0x7810, 0, 0, 0x0, \
+ 0x52, 0x7810, 1, 1, 0x0, \
+ 0x52, 0x7810, 2, 2, 0x0, \
+ 0x52, 0x7810, 3, 3, 0x0, \
+ 0x52, 0x7810, 7, 7, 0x0, \
+ 0x52, 0x7810, 18, 18, 0x0, \
+ 0x52, 0x7810, 19, 19, 0x0, \
+ 0x52, 0x7810, 20, 20, 0x0, \
+ 0x52, 0x781c, 0, 0, 0x1, \
+ 0x52, 0x781c, 1, 1, 0x1, \
+ 0x52, 0x781c, 2, 2, 0x0, \
+ 0x52, 0x781c, 3, 3, 0x0, \
+ 0x52, 0x781c, 4, 4, 0x1, \
+ 0x52, 0x781c, 5, 5, 0x1, \
+ 0x52, 0x781c, 6, 6, 0x1, \
+ 0x52, 0x781c, 7, 7, 0x1, \
+ 0x52, 0x7820, 0, 0, 0x1, \
+ 0x52, 0x7820, 1, 1, 0x1, \
+ 0x52, 0x7820, 2, 2, 0x0, \
+ 0x52, 0x7820, 3, 3, 0x0, \
+ 0x52, 0x7820, 4, 4, 0x1, \
+ 0x52, 0x7820, 5, 5, 0x1, \
+ 0x52, 0x7820, 6, 6, 0x1, \
+ 0x52, 0x7820, 7, 7, 0x1, \
+ 0x52, 0x523c, 0, 0, 0x0, \
+ 0x52, 0x523c, 2, 2, 0x0, \
+ 0x52, 0x523c, 3, 3, 0x0, \
+ 0x52, 0x523c, 18, 18, 0x0, \
+ 0x52, 0x523c, 19, 19, 0x0, \
+ 0x52, 0x523c, 20, 20, 0x0, \
+ 0x52, 0x5288, 0, 0, 0x1, \
+ 0x52, 0x5288, 1, 1, 0x1, \
+ 0x52, 0x5288, 2, 2, 0x0, \
+ 0x52, 0x5288, 3, 3, 0x0, \
+ 0x52, 0x5288, 4, 4, 0x1, \
+ 0x52, 0x5288, 5, 5, 0x1, \
+ 0x52, 0x5288, 6, 6, 0x1, \
+ 0x52, 0x5288, 7, 7, 0x1, \
+ 0x52, 0x528c, 0, 0, 0x1, \
+ 0x52, 0x528c, 1, 1, 0x1, \
+ 0x52, 0x528c, 2, 2, 0x0, \
+ 0x52, 0x528c, 3, 3, 0x0, \
+ 0x52, 0x528c, 4, 4, 0x1, \
+ 0x52, 0x528c, 5, 5, 0x1, \
+ 0x52, 0x528c, 6, 6, 0x1, \
+ 0x52, 0x528c, 7, 7, 0x1 \
+
+
+#define TUNIT_VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT \
+ \
+ 0x52, 0x7810, 0, 0, 0x0, \
+ 0x52, 0x7810, 1, 1, 0x0, \
+ 0x52, 0x7810, 2, 2, 0x0, \
+ 0x52, 0x7810, 3, 3, 0x0, \
+ 0x52, 0x7810, 7, 7, 0x0, \
+ 0x52, 0x7810, 18, 18, 0x0, \
+ 0x52, 0x7810, 19, 19, 0x0, \
+ 0x52, 0x7810, 20, 20, 0x0, \
+ 0x52, 0x781c, 0, 0, 0x1, \
+ 0x52, 0x781c, 1, 1, 0x1, \
+ 0x52, 0x781c, 2, 2, 0x0, \
+ 0x52, 0x781c, 3, 3, 0x0, \
+ 0x52, 0x781c, 4, 4, 0x1, \
+ 0x52, 0x781c, 5, 5, 0x1, \
+ 0x52, 0x781c, 6, 6, 0x1, \
+ 0x52, 0x781c, 7, 7, 0x1, \
+ 0x52, 0x7820, 0, 0, 0x1, \
+ 0x52, 0x7820, 1, 1, 0x1, \
+ 0x52, 0x7820, 2, 2, 0x0, \
+ 0x52, 0x7820, 3, 3, 0x0, \
+ 0x52, 0x7820, 4, 4, 0x1, \
+ 0x52, 0x7820, 5, 5, 0x1, \
+ 0x52, 0x7820, 6, 6, 0x1, \
+ 0x52, 0x7820, 7, 7, 0x1, \
+ 0x52, 0x523c, 0, 0, 0x0, \
+ 0x52, 0x523c, 2, 2, 0x0, \
+ 0x52, 0x523c, 3, 3, 0x0, \
+ 0x52, 0x523c, 18, 18, 0x0, \
+ 0x52, 0x523c, 19, 19, 0x0, \
+ 0x52, 0x523c, 20, 20, 0x0, \
+ 0x52, 0x5288, 0, 0, 0x1, \
+ 0x52, 0x5288, 1, 1, 0x1, \
+ 0x52, 0x5288, 2, 2, 0x0, \
+ 0x52, 0x5288, 3, 3, 0x0, \
+ 0x52, 0x5288, 4, 4, 0x1, \
+ 0x52, 0x5288, 5, 5, 0x1, \
+ 0x52, 0x5288, 6, 6, 0x1, \
+ 0x52, 0x5288, 7, 7, 0x1, \
+ 0x52, 0x528c, 0, 0, 0x1, \
+ 0x52, 0x528c, 1, 1, 0x1, \
+ 0x52, 0x528c, 2, 2, 0x0, \
+ 0x52, 0x528c, 3, 3, 0x0, \
+ 0x52, 0x528c, 4, 4, 0x1, \
+ 0x52, 0x528c, 5, 5, 0x1, \
+ 0x52, 0x528c, 6, 6, 0x1, \
+ 0x52, 0x528c, 7, 7, 0x1 \
+
+
+#define TUNIT_VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT \
+ \
+ 0x52, 0x7810, 0, 0, 0x0, \
+ 0x52, 0x7810, 1, 1, 0x0, \
+ 0x52, 0x7810, 2, 2, 0x0, \
+ 0x52, 0x7810, 3, 3, 0x0, \
+ 0x52, 0x7810, 7, 7, 0x0, \
+ 0x52, 0x7810, 18, 18, 0x0, \
+ 0x52, 0x7810, 19, 19, 0x0, \
+ 0x52, 0x7810, 20, 20, 0x0, \
+ 0x52, 0x781c, 0, 0, 0x1, \
+ 0x52, 0x781c, 1, 1, 0x1, \
+ 0x52, 0x781c, 2, 2, 0x0, \
+ 0x52, 0x781c, 3, 3, 0x0, \
+ 0x52, 0x781c, 4, 4, 0x1, \
+ 0x52, 0x781c, 5, 5, 0x1, \
+ 0x52, 0x781c, 6, 6, 0x1, \
+ 0x52, 0x781c, 7, 7, 0x1, \
+ 0x52, 0x7820, 0, 0, 0x1, \
+ 0x52, 0x7820, 1, 1, 0x1, \
+ 0x52, 0x7820, 2, 2, 0x0, \
+ 0x52, 0x7820, 3, 3, 0x0, \
+ 0x52, 0x7820, 4, 4, 0x1, \
+ 0x52, 0x7820, 5, 5, 0x1, \
+ 0x52, 0x7820, 6, 6, 0x1, \
+ 0x52, 0x7820, 7, 7, 0x1, \
+ 0x52, 0x523c, 0, 0, 0x0, \
+ 0x52, 0x523c, 2, 2, 0x0, \
+ 0x52, 0x523c, 3, 3, 0x0, \
+ 0x52, 0x523c, 18, 18, 0x0, \
+ 0x52, 0x523c, 19, 19, 0x0, \
+ 0x52, 0x523c, 20, 20, 0x0, \
+ 0x52, 0x5288, 0, 0, 0x1, \
+ 0x52, 0x5288, 1, 1, 0x1, \
+ 0x52, 0x5288, 2, 2, 0x0, \
+ 0x52, 0x5288, 3, 3, 0x0, \
+ 0x52, 0x5288, 4, 4, 0x1, \
+ 0x52, 0x5288, 5, 5, 0x1, \
+ 0x52, 0x5288, 6, 6, 0x1, \
+ 0x52, 0x5288, 7, 7, 0x1, \
+ 0x52, 0x528c, 0, 0, 0x1, \
+ 0x52, 0x528c, 1, 1, 0x1, \
+ 0x52, 0x528c, 2, 2, 0x0, \
+ 0x52, 0x528c, 3, 3, 0x0, \
+ 0x52, 0x528c, 4, 4, 0x1, \
+ 0x52, 0x528c, 5, 5, 0x1, \
+ 0x52, 0x528c, 6, 6, 0x1, \
+ 0x52, 0x528c, 7, 7, 0x1 \
+
+
+#endif // TUNIT_BIOS_SETTINGS_HH
+
|