You've already forked PlatformBuildLab_FW
mirror of
https://github.com/Dasharo/PlatformBuildLab_FW.git
synced 2026-03-06 15:00:40 -08:00
Compare commits
23 Commits
V20181002
...
minnowboar
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2db9c66ac1 | ||
|
|
d932fd287c | ||
|
|
e37ff7e97a | ||
|
|
0988477a9e | ||
|
|
6529a9dbf7 | ||
|
|
352c885d27 | ||
|
|
e1c5cc9169 | ||
|
|
62c60f9206 | ||
|
|
62d9069c39 | ||
|
|
7d31ce69bb | ||
|
|
fdb8a55886 | ||
|
|
86f67c315e | ||
|
|
1bd1d19998 | ||
|
|
32f59cbab0 | ||
|
|
c74eb5da1e | ||
|
|
928a6306ac | ||
|
|
72bfb1efd2 | ||
|
|
a84c75caf1 | ||
|
|
c675b3a92a | ||
|
|
d4edf2f3fd | ||
|
|
4167144ba9 | ||
|
|
01e39d4afd | ||
|
|
829651d315 |
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
FW/PlatformBuildLab/Max/edk2/Conf
|
||||
FW/PlatformBuildLab/Max/Build
|
||||
FW/PlatformBuildLab/Max/edk2-platforms/Vlv2TbltDevicePkg/AutoPlatformCFG.txt
|
||||
FW/PlatformBuildLab/Max/ipxe/
|
||||
FW/PlatformBuildLab/Max/silicon/Vlv2MiscBinariesPkg/SEC/Ia32/
|
||||
FW/PlatformBuildLab/Max/silicon/Vlv2MiscBinariesPkg/SEC/X64/
|
||||
.bash_history
|
||||
*.rom
|
||||
*.ROM
|
||||
*.bin
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
3) Checkout MinnowBoard Max Branch from GitHub with the following command.
|
||||
i) Run "git clone https://github.com/tianocore/edk2-platforms.git -b devel-MinnowBoardMax-UDK2017"
|
||||
ii) Enter folder edk2-platforms
|
||||
iii) Run the command "git checkout 423105b15de6dfd769eed56026fa3bc28eb349ef"
|
||||
iii) Run the command "git checkout 2a5f80b862e46de213a3f3635c43394deacdfb05"
|
||||
iv) Enter folder "C:\MyWorkspace"
|
||||
|
||||
4) Checkout BaseTools binaries and copy them to BaseTools binary folder.
|
||||
@@ -20,8 +20,8 @@
|
||||
ii) Enter folder edk2-BaseTools-win32
|
||||
iii) Run the command "git checkout 0e088c19ab31fccd1d2f55d9e4fe0314b57c0097"
|
||||
|
||||
5) Download MinnowBoard MAX 0.99 Binary Object Modules from http://firmware.intel.com/projects/minnowboard-max.
|
||||
The "MinnowBoard_MAX-0.99-Binary.Objects.zip" file contains three additional
|
||||
5) Download MinnowBoard MAX 1.00 Binary Object Modules from http://firmware.intel.com/projects/minnowboard-max.
|
||||
The "MinnowBoard_MAX-1.00-Binary.Objects.zip" file contains three additional
|
||||
folders required for the full source tree.
|
||||
|
||||
IA32FamilyCpuPkg
|
||||
@@ -2,9 +2,9 @@ MINNOWBOARD MAX/TURBOT PLATFORM Maintainers
|
||||
==================
|
||||
|
||||
Vlv2DeviceRefCodePkg
|
||||
David Wei <david.wei@intel.com>
|
||||
Mang Guo <mang.guo@intel.com>
|
||||
M: Zailiang Sun <zailiang.sun@intel.com>
|
||||
M: Yi Qian <yi.qian@intel.com>
|
||||
|
||||
Vlv2TbltDevicePkg
|
||||
David Wei <david.wei@intel.com>
|
||||
Mang Guo <mang.guo@intel.com>
|
||||
M: Zailiang Sun <zailiang.sun@intel.com>
|
||||
M: Yi Qian <yi.qian@intel.com>
|
||||
|
||||
@@ -427,7 +427,7 @@ Scope(\_SB)
|
||||
|
||||
// Check for a specific OS which supports _OSI.
|
||||
|
||||
If(CondRefOf(\_OSI,Local0))
|
||||
If(CondRefOf(\_OSI))
|
||||
{
|
||||
// Linux returns _OSI = TRUE for numerous Windows
|
||||
// strings so that it is fully compatible with
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
DEFINE X64_CONFIG = TRUE
|
||||
DEFINE ENBDT_PF_BUILD = TRUE
|
||||
DEFINE X64_CONFIG = TRUE
|
||||
DEFINE ENBDT_PF_BUILD = TRUE
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
#
|
||||
|
||||
|
||||
@@ -35,5 +35,5 @@ OEM_ID = I32
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -35,5 +35,5 @@ OEM_ID = I32
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -25,6 +25,6 @@ BOARD_REV = 1
|
||||
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
@@ -25,6 +25,6 @@ BOARD_REV = 1
|
||||
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
43
FW/PlatformBuildLab/Max/edk2-platforms/Vlv2TbltDevicePkg/Build_IFWI.sh
Normal file → Executable file
43
FW/PlatformBuildLab/Max/edk2-platforms/Vlv2TbltDevicePkg/Build_IFWI.sh
Normal file → Executable file
@@ -33,6 +33,7 @@ Build_Flags=
|
||||
Stitch_Flags=
|
||||
Arch=X64
|
||||
PLATFORM_PACKAGE=Vlv2TbltDevicePkg
|
||||
CleanBuild=0
|
||||
|
||||
## Parse Optional arguments
|
||||
if [ "$1" == "/?" ]; then
|
||||
@@ -50,6 +51,7 @@ for (( i=1; i<=$#; ))
|
||||
shift
|
||||
elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/C" ]; then
|
||||
Build_Flags="$Build_Flags /c"
|
||||
CleanBuild=1
|
||||
shift
|
||||
elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/ECP" ]; then
|
||||
Build_Flags="$Build_Flags /ecp"
|
||||
@@ -64,6 +66,10 @@ for (( i=1; i<=$#; ))
|
||||
Arch=X64
|
||||
Build_Flags="$Build_Flags /x64"
|
||||
shift
|
||||
elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/IA32" ]; then
|
||||
Arch=IA32
|
||||
Build_Flags="$Build_Flags /IA32"
|
||||
shift
|
||||
elif [ "$1" == "/nG" ]; then
|
||||
Stitch_Flags="$Stitch_Flags /nG"
|
||||
shift
|
||||
@@ -79,11 +85,15 @@ for (( i=1; i<=$#; ))
|
||||
elif [ "$1" == "/yL" ]; then
|
||||
Build_Flags="$Build_Flags /yL"
|
||||
shift
|
||||
elif [ "$1" == "/16M" ]; then
|
||||
Build_Flags="$Build_Flags /16M"
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
## Require 2 input parameters
|
||||
if [ "$2" == "" ]; then
|
||||
echo "Not Enough Arguments Provided"
|
||||
@@ -104,6 +114,39 @@ else
|
||||
IFWI_Suffix="/S $3"
|
||||
fi
|
||||
|
||||
if [ $Arch == "X64" ]; then
|
||||
|
||||
## Build iPXE
|
||||
if [ ! -d ../../ipxe ]; then
|
||||
git clone http://git.ipxe.org/ipxe.git ../../ipxe
|
||||
if [ $? != 0 ];then
|
||||
echo "Failed to clone ipxe"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f ../../ipxe/src/bin-x86_64-efi-sb/ipxe.efi ]; then
|
||||
cd ../../ipxe || exit 1
|
||||
git reset --hard HEAD || exit 1
|
||||
git clean -df || exit 1
|
||||
git checkout 77b07ea4fdc259d7253c6f9df2beda6e6c7a9d85 || exit 1
|
||||
if [ $CleanBuild == "1" ]; then
|
||||
make clean || exit 1
|
||||
fi
|
||||
sed -i 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "src/config/general.h"
|
||||
if [ ! -f dasharo.ipxe ]; then
|
||||
wget http://raw.githubusercontent.com/Dasharo/dasharo-blobs/main/dasharo/dasharo.ipxe || exit 1
|
||||
fi
|
||||
sed -i 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "src/config/general.h"
|
||||
make -C src bin-x86_64-efi-sb/ipxe.efi EMBED=$PWD/dasharo.ipxe BUILD_ID_CMD="echo 0x1234567890"
|
||||
if [ ! -f src/bin-x86_64-efi-sb/ipxe.efi ]; then
|
||||
echo "Failed to build ipxe"
|
||||
exit 1
|
||||
fi
|
||||
cd ../edk2-platforms/$PLATFORM_PACKAGE
|
||||
fi
|
||||
fi
|
||||
|
||||
## Go to root directory
|
||||
cd ..
|
||||
|
||||
|
||||
@@ -3,15 +3,24 @@
|
||||
These data is intent to decouple FVB driver with FV header.
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
@@ -35,6 +44,9 @@ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
#define NV_STORAGE_BASE_ADDRESS FixedPcdGet32(PcdFlashNvStorageVariableBase)
|
||||
#define SYSTEM_NV_BLOCK_NUM ((FixedPcdGet32(PcdFlashNvStorageVariableSize)+ FixedPcdGet32(PcdFlashNvStorageFtwWorkingSize) + FixedPcdGet32(PcdFlashNvStorageFtwSpareSize))/ FVB_MEDIA_BLOCK_SIZE)
|
||||
|
||||
#define FV_TXE_TOOLS_BASE_ADDRESS FixedPcdGet32(PcdFlashTxeToolsBase)
|
||||
#define TXE_TOOLS_BLOCK_NUM (FixedPcdGet32(PcdFlashTxeToolsSize) / FVB_MEDIA_BLOCK_SIZE)
|
||||
|
||||
typedef struct {
|
||||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||
EFI_FIRMWARE_VOLUME_HEADER FvbInfo;
|
||||
@@ -137,6 +149,36 @@ EFI_FVB2_MEDIA_INFO mPlatformFvbMediaInfo[] = {
|
||||
0
|
||||
}
|
||||
}
|
||||
},
|
||||
//
|
||||
// TXE Tools FVB
|
||||
//
|
||||
{
|
||||
FV_TXE_TOOLS_BASE_ADDRESS,
|
||||
{
|
||||
{0,}, //ZeroVector[16]
|
||||
EFI_FIRMWARE_FILE_SYSTEM2_GUID,
|
||||
FVB_MEDIA_BLOCK_SIZE * TXE_TOOLS_BLOCK_NUM,
|
||||
EFI_FVH_SIGNATURE,
|
||||
0x0004feff, // check MdePkg/Include/Pi/PiFirmwareVolume.h for details on EFI_FVB_ATTRIBUTES_2
|
||||
sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),
|
||||
0, //CheckSum which will be calucated dynamically.
|
||||
0, //ExtHeaderOffset
|
||||
{0,}, //Reserved[1]
|
||||
2, //Revision
|
||||
{
|
||||
{
|
||||
TXE_TOOLS_BLOCK_NUM,
|
||||
FVB_MEDIA_BLOCK_SIZE,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
0,
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,15 +2,24 @@
|
||||
# This driver implement the EFI_FIRMWARE_VOLUMEN_PROTOCOL.
|
||||
#
|
||||
# Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
# The full text of the license may be found at
|
||||
|
||||
# http://opensource.org/licenses/bsd-license.php.
|
||||
#
|
||||
|
||||
# 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.
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -72,7 +81,9 @@
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecoveryBase
|
||||
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashTxeToolsBase
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashTxeToolsSize
|
||||
|
||||
[FeaturePcd]
|
||||
gPlatformModuleTokenSpaceGuid.PcdFeatureRecoveryDisabled
|
||||
|
||||
|
||||
@@ -5,15 +5,24 @@
|
||||
It depends on which Flash Device Library to be linked with this driver.
|
||||
|
||||
Copyright (c) 2006 - 2017, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
@@ -1008,7 +1017,7 @@ FvbInitialize (
|
||||
UINTN Idx;
|
||||
UINT32 MaxLbaSize;
|
||||
EFI_BOOT_MODE BootMode;
|
||||
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
|
||||
UINT32 PlatformFvBaseAddress[4];
|
||||
UINT32 PlatformFvBaseAddressCount;
|
||||
|
||||
//
|
||||
@@ -1023,10 +1032,11 @@ FvbInitialize (
|
||||
PlatformFvBaseAddressCount = 1;
|
||||
PlatformFvBaseAddress[0] = PcdGet32 (PcdFlashNvStorageVariableBase);
|
||||
} else {
|
||||
//
|
||||
PlatformFvBaseAddressCount = 4;
|
||||
PlatformFvBaseAddress[0] = PcdGet32 (PcdFlashFvMainBase);
|
||||
PlatformFvBaseAddress[1] = PcdGet32 (PcdFlashNvStorageVariableBase);
|
||||
PlatformFvBaseAddress[2] = PcdGet32 (PcdFlashFvRecoveryBase);
|
||||
PlatformFvBaseAddress[3] = PcdGet32 (PcdFlashTxeToolsBase);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -2,15 +2,24 @@
|
||||
# This driver implement the EFI_SMM_FIRMWARE_VOLUMEN_PROTOCOL.
|
||||
#
|
||||
# Copyright (c) 2010 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
# The full text of the license may be found at
|
||||
|
||||
# http://opensource.org/licenses/bsd-license.php.
|
||||
#
|
||||
|
||||
# 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.
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -75,7 +84,10 @@
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecoveryBase
|
||||
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashTxeToolsBase
|
||||
gPlatformModuleTokenSpaceGuid.PcdFlashTxeToolsSize
|
||||
|
||||
|
||||
[FeaturePcd]
|
||||
gPlatformModuleTokenSpaceGuid.PcdFeatureRecoveryDisabled
|
||||
|
||||
|
||||
0
FW/PlatformBuildLab/Max/edk2-platforms/Vlv2TbltDevicePkg/GenBiosId
Normal file → Executable file
0
FW/PlatformBuildLab/Max/edk2-platforms/Vlv2TbltDevicePkg/GenBiosId
Normal file → Executable file
@@ -0,0 +1,66 @@
|
||||
## @file
|
||||
# This driver implement the EFI_FIRMWARE_VOLUMEN_PROTOCOL.
|
||||
#
|
||||
# Copyright (c) 2006 - 2014, 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 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.
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = HeciOverrideDxe
|
||||
FILE_GUID = 62FC58DD-9D9F-42B8-8378-3F8FB2F006CE
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = ReinstallHeciProtocol
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64
|
||||
#
|
||||
|
||||
[Sources]
|
||||
HeciProtocol.h
|
||||
HeciProtocol.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
Vlv2TbltDevicePkg/PlatformPkg.dec
|
||||
Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
MemoryAllocationLib
|
||||
IoLib
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
BaseLib
|
||||
UefiLib
|
||||
UefiBootServicesTableLib
|
||||
UefiDriverEntryPoint
|
||||
|
||||
[Protocols]
|
||||
gEfiHeciProtocolGuid # PROTOCOL CONSUMES AND PRODUCES
|
||||
|
||||
[Depex]
|
||||
gEfiHeciProtocolGuid
|
||||
@@ -0,0 +1,204 @@
|
||||
|
||||
#include <Uefi/UefiBaseType.h>
|
||||
#include <Uefi/UefiSpec.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
|
||||
#include "HeciProtocol.h"
|
||||
|
||||
#if defined(SEC_DEBUG_INFO) && SEC_DEBUG_INFO
|
||||
#define PRINT(x...) DEBUG ((EFI_D_INFO, x))
|
||||
#else
|
||||
#define PRINT(x...) Print (L ## x)
|
||||
#endif
|
||||
|
||||
EFI_HECI_PROTOCOL mHeciProtocolOld;
|
||||
EFI_HECI_PROTOCOL mHeciProtocolNew;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI HeciSendWithAck (
|
||||
IN OUT UINT32 *Message,
|
||||
IN OUT UINT32 Length,
|
||||
IN OUT UINT32 *RecLength,
|
||||
IN UINT8 HostAddress,
|
||||
IN UINT8 SECAddress
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 *Buf = (UINT8 *)Message;
|
||||
|
||||
PRINT ("HeciSendWithAck: Length %x, RecLength %s, HostAddr %x, SeCAddr %x\n", Length, *RecLength, HostAddress, SECAddress);
|
||||
PRINT ("HeciSendWithAck: Message:\n");
|
||||
|
||||
for (UINT32 i = 0; i < Length; i++)
|
||||
PRINT ("%02x ", Buf[i]);
|
||||
|
||||
PRINT ("\n");
|
||||
|
||||
Status = mHeciProtocolOld.SendwACK(Message, Length, RecLength, HostAddress, SECAddress);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
||||
PRINT ("HeciSendWithAck: Response:\n");
|
||||
|
||||
Buf = (UINT8 *)Message;
|
||||
|
||||
for (UINT32 i = 0; i < *RecLength; i++)
|
||||
PRINT ("%02x ", Buf[i]);
|
||||
|
||||
PRINT ("\n");
|
||||
} else {
|
||||
PRINT ("HECI SendwACK failed %r\n", Status);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI HeciSend (
|
||||
IN UINT32 *Message,
|
||||
IN UINT32 Length,
|
||||
IN UINT8 HostAddress,
|
||||
IN UINT8 SECAddress
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 *Buf = (UINT8 *)Message;
|
||||
|
||||
PRINT ("HeciSend: Length %x, HostAddr %x, SeCAddr %x\n", Length, HostAddress, SECAddress);
|
||||
PRINT ("HeciSend: Message:\n");
|
||||
|
||||
for (UINT32 i = 0; i < Length; i++)
|
||||
PRINT ("%02x ", Buf[i]);
|
||||
|
||||
PRINT ("\n");
|
||||
|
||||
Status = mHeciProtocolOld.SendMsg(Message, Length, HostAddress, SECAddress);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
PRINT ("HECI SendMsg failed %r\n", Status);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI HeciReceive (
|
||||
IN UINT32 Blocking,
|
||||
IN UINT32 *MessageBody,
|
||||
IN OUT UINT32 *Length
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 *Buf;
|
||||
|
||||
PRINT ("HeciReceive: Length %x, Blocking %x\n", *Length, Blocking);
|
||||
|
||||
Status = mHeciProtocolOld.ReadMsg(Blocking, MessageBody, Length);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
||||
PRINT ("HeciReceive: Response:\n");
|
||||
|
||||
Buf = (UINT8 *)MessageBody;
|
||||
|
||||
for (UINT32 i = 0; i < *Length; i++)
|
||||
PRINT ("%02x ", Buf[i]);
|
||||
|
||||
PRINT ("\n");
|
||||
} else {
|
||||
PRINT ("HECI Receive failed %r\n", Status);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ReinstallHeciProtocol(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HECI_PROTOCOL *ProtocolOld;
|
||||
EFI_HANDLE HeciHandle;
|
||||
EFI_HANDLE *HandleBuffer;
|
||||
UINTN BufferSize = 0;
|
||||
|
||||
|
||||
DEBUG ((EFI_D_INFO, ">>>>ReinstallHeciProtocol\n"));
|
||||
|
||||
//
|
||||
// Run memory test code at this point.
|
||||
//
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiHeciProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &ProtocolOld
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_INFO, "gEfiHeciProtocolGuid not found: %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
gBS->CopyMem((VOID *)&mHeciProtocolOld, (VOID *)ProtocolOld, sizeof(EFI_HECI_PROTOCOL));
|
||||
|
||||
BufferSize = sizeof (EFI_HANDLE);
|
||||
HandleBuffer = AllocateZeroPool (BufferSize);
|
||||
|
||||
Status = gBS->LocateHandle(
|
||||
ByProtocol,
|
||||
&gEfiHeciProtocolGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
HandleBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_INFO, "gEfiHeciProtocolGuid handles not found %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (BufferSize > sizeof (EFI_HANDLE)) {
|
||||
DEBUG ((EFI_D_INFO, "gEfiHeciProtocolGuid handles found %d\n", BufferSize));
|
||||
return EFI_BAD_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
HeciHandle = *HandleBuffer;
|
||||
FreePool (HandleBuffer);
|
||||
|
||||
mHeciProtocolNew.SendwACK = HeciSendWithAck;
|
||||
mHeciProtocolNew.ReadMsg = HeciReceive;
|
||||
mHeciProtocolNew.SendMsg = HeciSend;
|
||||
mHeciProtocolNew.ResetHeci = mHeciProtocolOld.ResetHeci;
|
||||
mHeciProtocolNew.InitHeci = mHeciProtocolOld.InitHeci;
|
||||
mHeciProtocolNew.SeCResetWait = mHeciProtocolOld.SeCResetWait;
|
||||
mHeciProtocolNew.ReInitHeci = mHeciProtocolOld.ReInitHeci;
|
||||
mHeciProtocolNew.GetSeCStatus = mHeciProtocolOld.GetSeCStatus;
|
||||
mHeciProtocolNew.GetSeCMode = mHeciProtocolOld.GetSeCMode;
|
||||
|
||||
|
||||
Status = gBS->ReinstallProtocolInterface (
|
||||
HeciHandle,
|
||||
&gEfiHeciProtocolGuid,
|
||||
ProtocolOld,
|
||||
&mHeciProtocolNew
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_INFO, "Could not reinstall gEfiHeciProtocolGuid: %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "gEfiHeciProtocolGuid reinstalled successfully\n"));
|
||||
|
||||
return Status;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/**@file
|
||||
EFI HECI Protocol
|
||||
|
||||
@copyright
|
||||
Copyright (c) 1999 - 2014 Intel Corporation. All rights reserved
|
||||
This software and associated documentation (if any) is furnished
|
||||
under a license and may only be used or copied in accordance
|
||||
with the terms of the license. Except as permitted by the
|
||||
license, no part of this software or documentation may be
|
||||
reproduced, stored in a retrieval system, or transmitted in any
|
||||
form or by any means without the express written consent of
|
||||
Intel Corporation.
|
||||
This file contains an 'Intel Peripheral Driver' and is uniquely
|
||||
identified as "Intel Reference Module" and is licensed for Intel
|
||||
CPUs and chipsets under the terms of your license agreement with
|
||||
Intel or your vendor. This file may be modified by the user, subject
|
||||
to additional terms of the license agreement.
|
||||
|
||||
@par Specification
|
||||
**/
|
||||
#ifndef _EFI_HECI_H
|
||||
#define _EFI_HECI_H
|
||||
|
||||
typedef struct _EFI_HECI_PROTOCOL EFI_HECI_PROTOCOL;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_SENDWACK) (
|
||||
IN OUT UINT32 *Message,
|
||||
IN OUT UINT32 Length,
|
||||
IN OUT UINT32 *RecLength,
|
||||
IN UINT8 HostAddress,
|
||||
IN UINT8 SECAddress
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_READ_MESSAGE) (
|
||||
IN UINT32 Blocking,
|
||||
IN UINT32 *MessageBody,
|
||||
IN OUT UINT32 *Length
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_SEND_MESSAGE) (
|
||||
IN UINT32 *Message,
|
||||
IN UINT32 Length,
|
||||
IN UINT8 HostAddress,
|
||||
IN UINT8 SECAddress
|
||||
);
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_RESET) (
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_INIT) (
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_REINIT) (
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_RESET_WAIT) (
|
||||
IN UINT32 Delay
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_GET_SEC_STATUS) (
|
||||
IN UINT32 *Status
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HECI_GET_SEC_MODE) (
|
||||
IN UINT32 *Mode
|
||||
);
|
||||
|
||||
typedef struct _EFI_HECI_PROTOCOL {
|
||||
EFI_HECI_SENDWACK SendwACK;
|
||||
EFI_HECI_READ_MESSAGE ReadMsg;
|
||||
EFI_HECI_SEND_MESSAGE SendMsg;
|
||||
EFI_HECI_RESET ResetHeci;
|
||||
EFI_HECI_INIT InitHeci;
|
||||
EFI_HECI_RESET_WAIT SeCResetWait;
|
||||
EFI_HECI_REINIT ReInitHeci;
|
||||
EFI_HECI_GET_SEC_STATUS GetSeCStatus;
|
||||
EFI_HECI_GET_SEC_MODE GetSeCMode;
|
||||
} EFI_HECI_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiHeciProtocolGuid;
|
||||
|
||||
#endif // _EFI_HECI_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user