diff options
Diffstat (limited to 'src/vendorcode/amd/agesa/f14/Lib')
-rw-r--r-- | src/vendorcode/amd/agesa/f14/Lib/amdlib.c | 86 | ||||
-rw-r--r-- | src/vendorcode/amd/agesa/f14/Lib/amdlib.h | 13 |
2 files changed, 0 insertions, 99 deletions
diff --git a/src/vendorcode/amd/agesa/f14/Lib/amdlib.c b/src/vendorcode/amd/agesa/f14/Lib/amdlib.c index 24c162a731..b28878b8e9 100644 --- a/src/vendorcode/amd/agesa/f14/Lib/amdlib.c +++ b/src/vendorcode/amd/agesa/f14/Lib/amdlib.c @@ -1137,92 +1137,6 @@ LibAmdMemCopy ( /*---------------------------------------------------------------------------------------*/ /** - * Verify checksum of binary image (B1/B2/B3) - * - * - * @param[in] ImagePtr Pointer to image start - * @retval TRUE Checksum valid - * @retval FALSE Checksum invalid - */ -BOOLEAN -LibAmdVerifyImageChecksum ( - IN CONST VOID *ImagePtr - ) -{ - // Assume ImagePtr points to the binary start ($AMD) - // Checksum is on an even boundary in AMD_IMAGE_HEADER - - UINT16 Sum; - UINT32 i; - - Sum = 0; - - i = ((AMD_IMAGE_HEADER*) ImagePtr)->ImageSize; - - while (i > 1) { - Sum = Sum + *((UINT16 *)ImagePtr); - ImagePtr = (VOID *) ((UINT8 *)ImagePtr + 2); - i = i - 2; - } - if (i > 0) { - Sum = Sum + *((UINT8 *) ImagePtr); - } - - return (Sum == 0)?TRUE:FALSE; -} - -/*---------------------------------------------------------------------------------------*/ -/** - * Locate AMD binary image that contain specific module - * - * - * @param[in] StartAddress Pointer to start range - * @param[in] EndAddress Pointer to end range - * @param[in] Alignment Image address alignment - * @param[in] ModuleSignature Module signature. - * @retval NULL if image not found - * @retval pointer to image header - */ -CONST VOID * -LibAmdLocateImage ( - IN CONST VOID *StartAddress, - IN CONST VOID *EndAddress, - IN UINT32 Alignment, - IN CONST CHAR8 ModuleSignature[8] - ) - -{ - CONST UINT8 *CurrentPtr; - AMD_MODULE_HEADER *ModuleHeaderPtr; - CONST UINT64 *SearchStr; - CONST UINT64 *InputStr; - - CurrentPtr = StartAddress; - InputStr = (UINT64 *)ModuleSignature; - - // Search from start to end incrementing by alignment - while ((CurrentPtr >= (UINT8 *) StartAddress) && (CurrentPtr < (UINT8 *) EndAddress)) { - // First find a binary image - if (*((UINT32 *) CurrentPtr) == IMAGE_SIGNATURE) { - if (LibAmdVerifyImageChecksum (CurrentPtr)) { - // If we have a valid image, search module linked list for a match - ModuleHeaderPtr = (AMD_MODULE_HEADER*) ((UINT8 *)CurrentPtr + ((AMD_IMAGE_HEADER *) CurrentPtr)->ModuleInfoOffset); - while (ModuleHeaderPtr != NULL) { - SearchStr = (UINT64 *)&ModuleHeaderPtr->ModuleIdentifier; - if (*InputStr == *SearchStr) { - return CurrentPtr; - } - ModuleHeaderPtr = (AMD_MODULE_HEADER *)ModuleHeaderPtr->NextBlock; - } - } - } - CurrentPtr += Alignment; - } - return NULL; -} - -/*---------------------------------------------------------------------------------------*/ -/** * Returns the package type mask for the processor * * diff --git a/src/vendorcode/amd/agesa/f14/Lib/amdlib.h b/src/vendorcode/amd/agesa/f14/Lib/amdlib.h index 17b2be933f..25f19a3b01 100644 --- a/src/vendorcode/amd/agesa/f14/Lib/amdlib.h +++ b/src/vendorcode/amd/agesa/f14/Lib/amdlib.h @@ -331,24 +331,11 @@ LibAmdMemCopy ( IN OUT AMD_CONFIG_PARAMS *StdHeader ); -CONST VOID * -LibAmdLocateImage ( - IN CONST VOID *StartAddress, - IN CONST VOID *EndAddress, - IN UINT32 Alignment, - IN CONST CHAR8 ModuleSignature[8] - ); - UINT32 LibAmdGetPackageType ( IN AMD_CONFIG_PARAMS *StdHeader ); -BOOLEAN -LibAmdVerifyImageChecksum ( - IN CONST VOID *ImagePtr - ); - UINT8 LibAmdBitScanReverse ( IN UINT32 value |