Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
https://svn.code.sf.net/p/edk2/code/trunk/edk2/, which are for MinnowBoard MAX open source project. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Wei <david.wei@intel.com> Reviewed-by: Mike Wu <mike.wu@intel.com> Reviewed-by: Hot Tian <hot.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16599 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
55
Vlv2TbltDevicePkg/Library/PchPlatformLib/PchPlatformLib.inf
Normal file
55
Vlv2TbltDevicePkg/Library/PchPlatformLib/PchPlatformLib.inf
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
#
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved
|
||||
#
|
||||
|
||||
# This program and the accompanying materials are licensed and made available under
|
||||
|
||||
# the terms and conditions of the BSD License that 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.
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# PeiDxePchPlatformLib.inf
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# Component description file for PEI/DXE PCH Platform Lib
|
||||
#
|
||||
#--*/
|
||||
|
||||
[defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = PchPlatformLib
|
||||
FILE_GUID = 32F89CBC-305D-4bdd-8B2C-9C65592E66AC
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = PchPlatformLib
|
||||
|
||||
[sources.common]
|
||||
PchPlatformLibrary.h
|
||||
PchPlatformLibrary.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
PciLib
|
||||
IoLib
|
131
Vlv2TbltDevicePkg/Library/PchPlatformLib/PchPlatformLibrary.c
Normal file
131
Vlv2TbltDevicePkg/Library/PchPlatformLib/PchPlatformLibrary.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
|
||||
Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved
|
||||
|
||||
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
||||
the terms and conditions of the BSD License that 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.
|
||||
|
||||
|
||||
|
||||
|
||||
@file
|
||||
PchPlatformLib.c
|
||||
|
||||
@brief
|
||||
PCH Platform Lib implementation.
|
||||
|
||||
**/
|
||||
|
||||
#include "PchPlatformLibrary.h"
|
||||
|
||||
//
|
||||
// Silicon Steppings
|
||||
//
|
||||
/**
|
||||
Return Pch stepping type
|
||||
|
||||
@param[in] None
|
||||
|
||||
@retval PCH_STEPPING Pch stepping type
|
||||
|
||||
**/
|
||||
PCH_STEPPING
|
||||
EFIAPI
|
||||
PchStepping (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT8 RevId;
|
||||
|
||||
RevId = MmioRead8 (
|
||||
MmPciAddress (0,
|
||||
DEFAULT_PCI_BUS_NUMBER_PCH,
|
||||
PCI_DEVICE_NUMBER_PCH_LPC,
|
||||
PCI_FUNCTION_NUMBER_PCH_LPC,
|
||||
R_PCH_LPC_RID_CC)
|
||||
);
|
||||
|
||||
switch (RevId) {
|
||||
case V_PCH_LPC_RID_0:
|
||||
case V_PCH_LPC_RID_1:
|
||||
return PchA0;
|
||||
break;
|
||||
|
||||
case V_PCH_LPC_RID_2:
|
||||
case V_PCH_LPC_RID_3:
|
||||
return PchA1;
|
||||
break;
|
||||
|
||||
case V_PCH_LPC_RID_4:
|
||||
case V_PCH_LPC_RID_5:
|
||||
return PchB0;
|
||||
break;
|
||||
|
||||
case V_PCH_LPC_RID_6:
|
||||
case V_PCH_LPC_RID_7:
|
||||
return PchB1;
|
||||
break;
|
||||
|
||||
case V_PCH_LPC_RID_8:
|
||||
case V_PCH_LPC_RID_9:
|
||||
return PchB2;
|
||||
break;
|
||||
|
||||
case V_PCH_LPC_RID_A:
|
||||
case V_PCH_LPC_RID_B:
|
||||
return PchB3;
|
||||
break;
|
||||
|
||||
case V_PCH_LPC_RID_C:
|
||||
case V_PCH_LPC_RID_D:
|
||||
return PchC0;
|
||||
break;
|
||||
|
||||
default:
|
||||
return PchSteppingMax;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Determine if PCH is supported
|
||||
|
||||
@param[in] None
|
||||
|
||||
@retval TRUE PCH is supported
|
||||
@retval FALSE PCH is not supported
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsPchSupported (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT32 Identifiers;
|
||||
UINT16 PcuVendorId;
|
||||
UINT16 PcuDeviceId;
|
||||
|
||||
Identifiers = MmioRead32 (
|
||||
MmPciAddress (0,
|
||||
DEFAULT_PCI_BUS_NUMBER_PCH,
|
||||
PCI_DEVICE_NUMBER_PCH_LPC,
|
||||
PCI_FUNCTION_NUMBER_PCH_LPC,
|
||||
R_PCH_LPC_REG_ID)
|
||||
);
|
||||
|
||||
PcuDeviceId = (UINT16) ((Identifiers & B_PCH_LPC_DEVICE_ID) >> 16);
|
||||
PcuVendorId = (UINT16) (Identifiers & B_PCH_LPC_VENDOR_ID);
|
||||
|
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
**/
|
||||
/**
|
||||
|
||||
Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved
|
||||
|
||||
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
||||
the terms and conditions of the BSD License that 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.
|
||||
|
||||
|
||||
|
||||
|
||||
@file
|
||||
PchPlatformLibrary.h
|
||||
|
||||
@brief
|
||||
Header file for PCH Platform Lib implementation.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _PCH_PLATFORM_LIBRARY_IMPLEMENTATION_H_
|
||||
#define _PCH_PLATFORM_LIBRARY_IMPLEMENTATION_H_
|
||||
|
||||
#include "PchAccess.h"
|
||||
#ifdef ECP_FLAG
|
||||
#include "EdkIIGlueBase.h"
|
||||
#include "Library/EdkIIGlueMemoryAllocationLib.h"
|
||||
#else
|
Reference in New Issue
Block a user