aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@amd.corp-partner.google.com>2018-08-17 08:57:10 -0700
committerMartin Roth <martinroth@google.com>2018-08-20 17:29:48 +0000
commit3388fdecf2ad6a0edc843284e7068ab8fd39fcd6 (patch)
tree37705700ba19f6a0d0bee9aaeeebc018363e33ea /src/vendorcode/amd/pi/00670F00/Lib/amdlib.c
parent0e596ae76033eee91fdd791b183378d9fd7cf79f (diff)
vendorcode/amd/pi/00670F00/Lib: Remove unused functions
The only code still used are LibAmdPciRead() and LibAmdPciWrite(). These functions are used by PspBaseLib. Remove all functions that are not used, directly or indirectly, by LibAmdPciRead() and LibAmdPciWrite(). BUG=b:112688270 TEST=Build grunt Change-Id: Iba5cfbeee8e83ca78279a1bc2a333370c04f55ed Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/28194 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/amd/pi/00670F00/Lib/amdlib.c')
-rw-r--r--src/vendorcode/amd/pi/00670F00/Lib/amdlib.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c b/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c
index 7181d1db9c..b03beee287 100644
--- a/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c
+++ b/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c
@@ -62,13 +62,6 @@ GetPciMmioAddress (
);
VOID
-IdsOutPort (
- IN UINT32 Addr,
- IN UINT32 Value,
- IN UINT32 Flag
- );
-
-VOID
CpuidRead (
IN UINT32 CpuidFcnAddress,
OUT CPUID_DATA *Value
@@ -582,89 +575,6 @@ GetPciMmioAddress (
return MmioIsEnabled;
}
-/*---------------------------------------------------------------------------------------*/
-/**
- * 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 = StartAddress;
- AMD_MODULE_HEADER *ModuleHeaderPtr;
- CONST UINT64 SearchStr = *((UINT64*)ModuleSignature);
-
- // Search from start to end incrementing by alignment
- while ((CurrentPtr >= (UINT8 *) StartAddress) && (CurrentPtr < (UINT8 *) EndAddress)) {
- // First find a binary image
- if (IMAGE_SIGNATURE == *((UINT32 *) CurrentPtr)) {
- // TODO Figure out a way to fix the AGESA binary checksum
-// if (LibAmdVerifyImageChecksum (CurrentPtr)) {
- // If we have a valid image, search module linked list for a match
- ModuleHeaderPtr = (AMD_MODULE_HEADER*)(((AMD_IMAGE_HEADER *) CurrentPtr)->ModuleInfoOffset);
- while ((ModuleHeaderPtr != NULL) &&
- (MODULE_SIGNATURE == *((UINT32*)&(ModuleHeaderPtr->ModuleHeaderSignature)))) {
- if (SearchStr == *((UINT64*)&(ModuleHeaderPtr->ModuleIdentifier))) {
- return CurrentPtr;
- }
- ModuleHeaderPtr = (AMD_MODULE_HEADER *)ModuleHeaderPtr->NextBlock;
- }
-// }
- }
- CurrentPtr += Alignment;
- }
- return NULL;
-}
-
BOOLEAN
IdsErrorStop (
IN UINT32 FileCode