75 lines
2.4 KiB
C
75 lines
2.4 KiB
C
/** @file
|
|
Provide hook function for OEM to retrieve EC version.
|
|
|
|
;******************************************************************************
|
|
;* Copyright (c) 2014 - 2017, Insyde Software Corporation. All Rights Reserved.
|
|
;*
|
|
;* You may not reproduce, distribute, publish, display, perform, modify, adapt,
|
|
;* transmit, broadcast, present, recite, release, license or otherwise exploit
|
|
;* any part of this publication in any form, by any means, without the prior
|
|
;* written permission of Insyde Software Corporation.
|
|
;*
|
|
;******************************************************************************
|
|
*/
|
|
|
|
#include <Library/BaseOemSvcChipsetLib.h>
|
|
//[-start-210519-KEBIN00001-modify]//
|
|
#ifdef LCFC_SUPPORT
|
|
#include <Library/LfcEcLib.h>
|
|
#else
|
|
#include <Library/EcCommands.h>
|
|
#include <Library/EcLib.h>
|
|
#endif
|
|
//[-end-210519-KEBIN00001-modify]//
|
|
/**
|
|
Get major/minor version from EC.
|
|
|
|
@param[out] ReadEcVersionStatus The status of read EC version.
|
|
@param[out] MajorNum EC major number.
|
|
@param[out] MinorNum EC minor number.
|
|
|
|
@retval EFI_UNSUPPORTED Returns unsupported by default.
|
|
@retval EFI_MEDIA_CHANGED Alter the Configuration Parameter.
|
|
@retval EFI_SUCCESS The function performs the same operation as caller.
|
|
The caller will skip the specified behavior and assuming
|
|
that it has been handled completely by this function.
|
|
*/
|
|
EFI_STATUS
|
|
OemSvcEcVersion (
|
|
OUT EFI_STATUS *ReadEcVersionStatus,
|
|
OUT UINT8 *MajorNum,
|
|
OUT UINT8 *MinorNum
|
|
)
|
|
{
|
|
//[-start-210519-KEBIN00001-modify]//
|
|
#ifdef LCFC_SUPPORT
|
|
UINT8 EcTestVersion;
|
|
EFI_STATUS Status;
|
|
|
|
Status = LfcEcLibReadEcVersion(MajorNum, MinorNum,&EcTestVersion);
|
|
*ReadEcVersionStatus = Status;
|
|
|
|
return Status;
|
|
#else
|
|
EFI_STATUS Status;
|
|
UINT8 EcMajorRevision;
|
|
UINT8 EcMinorRevision;
|
|
|
|
Status = SendEcCommand (EC_C_EC_REVISION);
|
|
if (Status == EFI_SUCCESS) {
|
|
Status = ReceiveEcData (&EcMajorRevision);
|
|
if (Status == EFI_SUCCESS) {
|
|
Status = ReceiveEcData (&EcMinorRevision);
|
|
if (Status == EFI_SUCCESS) {
|
|
*ReadEcVersionStatus = Status;
|
|
*MajorNum = EcMajorRevision;
|
|
*MinorNum = EcMinorRevision;
|
|
}
|
|
}
|
|
}
|
|
|
|
return EFI_MEDIA_CHANGED;
|
|
#endif
|
|
//[-end-210519-KEBIN00001-modify]//
|
|
}
|