diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2016-04-18 14:34:18 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2016-04-20 15:31:18 +0200 |
commit | 318e2ac974e4f02e75fcfe9772b90de3dbe01327 (patch) | |
tree | d9331813d71a457f99e4bae87e83cbf476b1184d /src/vendorcode/amd | |
parent | 0793afe913a78990b1f4b3fff037eae5365f1078 (diff) |
AMD CIMX: Drop unused code
We never define B1_IMAGE or B2_IMAGE. These are about building
CIMx as separate binary modules, while coreboot builds these into
same romstage or ramstage module.
Change-Id: I9cfa3f0bff8332aff4b661d56d0e7b340a992992
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14393
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Kerry Sheh <shekairui@gmail.com>
Diffstat (limited to 'src/vendorcode/amd')
-rw-r--r-- | src/vendorcode/amd/cimx/rd890/nbDispatcher.c | 102 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb700/DISPATCHER.c | 56 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb700/SBDEF.h | 2 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb700/SBMAIN.c | 4 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb800/DISPATCHER.c | 87 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb800/SBMAIN.c | 4 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb900/Dispatcher.c | 90 | ||||
-rw-r--r-- | src/vendorcode/amd/cimx/sb900/SbMain.c | 4 |
8 files changed, 2 insertions, 347 deletions
diff --git a/src/vendorcode/amd/cimx/rd890/nbDispatcher.c b/src/vendorcode/amd/cimx/rd890/nbDispatcher.c index 16e86a1aaa..f1c315b7d7 100644 --- a/src/vendorcode/amd/cimx/rd890/nbDispatcher.c +++ b/src/vendorcode/amd/cimx/rd890/nbDispatcher.c @@ -85,109 +85,9 @@ AmdNbDispatcher ( CIMX_TRACE ((TRACE_DATA (ConfigPtr, CIMX_TRACE_ALL), "CIMx - RD890 Entry \n")); CIMX_TRACE ((TRACE_DATA (ConfigPtr, CIMX_TRACE_ALL), " Funcid = %x Callout = %x\n", ((AMD_CONFIG_PARAMS*)ConfigPtr)->Func, ((AMD_CONFIG_PARAMS*)ConfigPtr)->CalloutPtr)); -#ifdef B1_IMAGE - // 1. Try to execute any B1 specific functions - switch (((AMD_CONFIG_PARAMS*)ConfigPtr)->Func) { - #ifdef B1_IMAGE - // B1 ONLY Functions - // - // - #endif - default: - break; - } -#endif - - // 2. If not B1 specific function but we are B1, see if we can find B2 instead -#ifdef B1_IMAGE - if (Status == AGESA_UNSUPPORTED) { - UINTN ImageStart; - UINTN ImageEnd; - AMD_IMAGE_HEADER* AltImagePtr; - ImageStart = 0xFFF00000; - ImageEnd = 0xFFFFFFFF; - AltImagePtr = (AMD_IMAGE_HEADER*) (UINTN) ((AMD_CONFIG_PARAMS*)ConfigPtr)->AltImageBasePtr; - if ((UINTN)AltImagePtr != 0xFFFFFFFF) { - if (AltImagePtr != NULL) { - ImageStart = (UINT32) (UINTN)AltImagePtr; - ImageEnd = ImageStart + 4; - } - // Locate/test image base that matches this component - AltImagePtr = LibAmdLocateImage ((VOID*)ImageStart, (VOID*)ImageEnd, 4096, CIMX_NB_ID); - if (AltImagePtr != NULL) { - //Invoke alternative Image - ImageEntry = (IMAGE_ENTRY) (UINTN) ((UINT8*) AltImagePtr + AltImagePtr->EntryPointAddress); - Status = (*ImageEntry) (ConfigPtr); - } - } - } -#endif - if (Status == AGESA_UNSUPPORTED) { - // 3. Try to execute any other functions - switch (((AMD_CONFIG_PARAMS*)ConfigPtr)->Func) { + // 2. AltImage not supported -#if defined (B1_IMAGE) || defined (B2_IMAGE) -// B1 & B2 Functions - case PH_AmdPowerOnResetInit: - Status = LibSystemApiCall (AmdPowerOnResetInit, ConfigPtr); - break; - case PH_AmdPcieEarlyInit: - Status = LibSystemApiCall (AmdPcieEarlyInit, ConfigPtr); - break; - case PH_AmdInitializer: - Status = LibSystemApiCall (AmdInitializer, ConfigPtr); - break; -#endif -#ifdef B2_IMAGE -// B2 Functions - case PH_AmdNbHtInit : - Status = LibSystemApiCall (AmdHtInit, ConfigPtr); - break; - case PH_AmdEarlyPostInit : - LibSystemApiCall (AmdMaskedMemoryInit, ConfigPtr); - Status = LibSystemApiCall (AmdEarlyPostInit, ConfigPtr); - break; - case PH_AmdMidPostInit : - Status = LibSystemApiCall (AmdMidPostInit, ConfigPtr); - break; - case PH_AmdLatePostInit : - Status = LibSystemApiCall (AmdPcieLateInit, ConfigPtr); - Status = LibSystemApiCall (AmdLatePostInit, ConfigPtr); - Status = LibSystemApiCall (AmdPcieLateInitWa, ConfigPtr); - break; - case PH_AmdPcieValidatePortState : - Status = LibSystemApiCall (AmdPcieValidatePortState, ConfigPtr); - break; - case PH_AmdPcieLateInit : - Status = LibSystemApiCall (AmdPcieLateInit, ConfigPtr); - break; - case PH_AmdNbLateInit : - Status = LibSystemApiCall (AmdLatePostInit, ConfigPtr); - break; - case PH_AmdS3Init : - LibSystemApiCall (AmdMaskedMemoryInit, ConfigPtr); - Status = LibSystemApiCall (AmdS3InitIommu, ConfigPtr); - Status = LibSystemApiCall (AmdPcieS3Init, ConfigPtr); - Status = LibSystemApiCall (AmdS3Init, ConfigPtr); - Status = LibSystemApiCall (AmdPcieLateInitWa, ConfigPtr); - break; - case PH_AmdNbS3Init : - LibSystemApiCall (AmdMaskedMemoryInit, ConfigPtr); - Status = LibSystemApiCall (AmdS3Init, ConfigPtr); - break; - case PH_AmdPcieS3Init : - Status = LibSystemApiCall (AmdS3InitIommu, ConfigPtr); - Status = LibSystemApiCall (AmdPcieS3Init, ConfigPtr); - break; -#endif -#ifdef B3_IMAGE -// B3 Functions -#endif - default: - break; - } - } // 4. Try next dispatcher if possible, and we have not already got status back if ((mNbModuleID.NextBlock != NULL) && (Status == AGESA_UNSUPPORTED)) { diff --git a/src/vendorcode/amd/cimx/sb700/DISPATCHER.c b/src/vendorcode/amd/cimx/sb700/DISPATCHER.c index af0d45d7c0..920539d571 100644 --- a/src/vendorcode/amd/cimx/sb700/DISPATCHER.c +++ b/src/vendorcode/amd/cimx/sb700/DISPATCHER.c @@ -33,38 +33,17 @@ void DispatcherEntry(void *pConfig){ -#ifdef B1_IMAGE - void *pB2ImagePtr = NULL; - CIM_IMAGE_ENTRY pB2ImageEntry; -#endif - //#if CIM_DEBUG // InitSerialOut(); //#endif TRACE((DMSG_SB_TRACE, "CIM - SB700 Entry\n")); -#ifdef B1_IMAGE - if ((UINT32)(((STDCFG*)pConfig)->pB2ImageBase) != 0xffffffff){ - if (((STDCFG*)pConfig)->pB2ImageBase) - pB2ImagePtr = CheckImage('007S',(void*)((STDCFG*)pConfig)->pB2ImageBase); - if (pB2ImagePtr == NULL) - pB2ImagePtr = LocateImage('007S'); - if (pB2ImagePtr!=NULL){ - TRACE((DMSG_SB_TRACE, "CIM - SB700 Redirect to B2 Image\n")); - ((STDCFG*)pConfig)->pImageBase = (UINT32)pB2ImagePtr; - pB2ImageEntry = (CIM_IMAGE_ENTRY)(*((UINT32*)pB2ImagePtr+1) + (UINT32)pB2ImagePtr); - (*pB2ImageEntry)(pConfig); - return; - } - } -#endif saveConfigPointer(pConfig); if (((STDCFG*)pConfig)->Func == SB_POWERON_INIT) sbPowerOnInit((AMDSBCFG*)pConfig); -#ifndef B1_IMAGE if (((STDCFG*)pConfig)->Func == SB_BEFORE_PCI_INIT) sbBeforePciInit((AMDSBCFG*)pConfig); if (((STDCFG*)pConfig)->Func == SB_AFTER_PCI_INIT) @@ -81,43 +60,10 @@ void DispatcherEntry(void *pConfig){ } if (((STDCFG*)pConfig)->Func == SB_SMM_ACPION) sbSmmAcpiOn((AMDSBCFG*)pConfig); -#endif - TRACE((DMSG_SB_TRACE, "CIMx - SB Exit\n")); -} - - -void* LocateImage(UINT32 Signature){ - void *Result; - UINT8 *ImagePtr = (UINT8*)(0xffffffff - (IMAGE_ALIGN-1)); - while ((UINTN)ImagePtr>=(0xfffffff - (NUM_IMAGE_LOCATION*IMAGE_ALIGN -1))){ - Result = CheckImage(Signature,(void*)ImagePtr); - if (Result != NULL) - return Result; - ImagePtr -= IMAGE_ALIGN; - } - return NULL; -} - -void* CheckImage(UINT32 Signature, void* ImagePtr){ - UINT8 *TempImagePtr; - UINT8 Sum = 0; - UINT32 i; -// if ((*((UINT32*)ImagePtr) == 'ITA$' && ((CIMFILEHEADER*)ImagePtr)->ModuleLogo == Signature)){ - if ((*((UINT32*)ImagePtr) == Int32FromChar ('$', 'A', 'T', 'I')) && (((CIMFILEHEADER*)ImagePtr)->ModuleLogo == Signature)){ - //GetImage Image size - TempImagePtr = (UINT8*)ImagePtr; - for (i=0;i<(((CIMFILEHEADER*)ImagePtr)->ImageSize);i++){ - Sum += *TempImagePtr; - TempImagePtr++; - } - if (Sum == 0) - return ImagePtr; - } - return NULL; + TRACE((DMSG_SB_TRACE, "CIMx - SB Exit\n")); } - UINT32 GetPciebase(){ AMDSBCFG* Result; Result = getConfigPointer(); diff --git a/src/vendorcode/amd/cimx/sb700/SBDEF.h b/src/vendorcode/amd/cimx/sb700/SBDEF.h index 184584b808..5ffd34e7da 100644 --- a/src/vendorcode/amd/cimx/sb700/SBDEF.h +++ b/src/vendorcode/amd/cimx/sb700/SBDEF.h @@ -59,8 +59,6 @@ UINT32 IsFamily10(void); UINT64 ReadMSR(UINT32 Address); void WriteMSR(UINT32 Address,UINT64 Value); void RWMSR(UINT32 Address, UINT64 Mask, UINT64 Value); -void* LocateImage(UINT32 Signature); -void* CheckImage( UINT32 Signature, void* ImagePtr); void Stall(UINT32 uSec); void Reset(void); CIM_STATUS RWSMBUSBlock(UINT8 Controller, UINT8 Address, UINT8 Offset, UINT8 BufferSize, UINT8* BufferPrt); diff --git a/src/vendorcode/amd/cimx/sb700/SBMAIN.c b/src/vendorcode/amd/cimx/sb700/SBMAIN.c index 7468eb2d4c..45f08df7de 100644 --- a/src/vendorcode/amd/cimx/sb700/SBMAIN.c +++ b/src/vendorcode/amd/cimx/sb700/SBMAIN.c @@ -31,8 +31,6 @@ #include "Platform.h" -#ifndef B1_IMAGE - BUILDPARAM DfltStaticOptions={ BIOS_SIZE, // BIOS Size LEGACY_FREE, // Legacy Free Option @@ -285,5 +283,3 @@ UINT32 CallBackToOEM(UINT32 Func, UINTN Data,AMDSBCFG* pConfig){ TRACE((DMSG_SB_TRACE,"SB Hook Status [%x]\n",Result)); return Result; } - -#endif diff --git a/src/vendorcode/amd/cimx/sb800/DISPATCHER.c b/src/vendorcode/amd/cimx/sb800/DISPATCHER.c index 8b35047aaf..1c86c5810a 100644 --- a/src/vendorcode/amd/cimx/sb800/DISPATCHER.c +++ b/src/vendorcode/amd/cimx/sb800/DISPATCHER.c @@ -62,8 +62,6 @@ // VOID saveConfigPointer (IN AMDSBCFG* pConfig); -VOID* VerifyImage (IN UINT64 Signature, IN VOID* ImagePtr); -VOID* LocateImage (IN UINT64 Signature); /*---------------------------------------------------------------------------------------- * T Y P E D E F S A N D S T R U C T U R E S @@ -90,42 +88,17 @@ AmdSbDispatcher ( { AGESA_STATUS Status; -#ifdef B1_IMAGE - VOID *pAltImagePtr; - CIM_IMAGE_ENTRY AltImageEntry; -#endif - UINT64 tdValue; tdValue = 0x32314130384253ULL; -#ifdef B1_IMAGE - pAltImagePtr = NULL; -#endif Status = AGESA_UNSUPPORTED; -#ifdef B1_IMAGE - if ((UINT32) (UINTN) (((AMD_CONFIG_PARAMS*)pConfig)->AltImageBasePtr) != 0xffffffff ) { - if ( ((AMD_CONFIG_PARAMS*)pConfig)->AltImageBasePtr ) { - pAltImagePtr = VerifyImage ( tdValue, (VOID*) (UINTN) ((AMD_CONFIG_PARAMS*)pConfig)->AltImageBasePtr); - } - if ( pAltImagePtr == NULL ) { - pAltImagePtr = LocateImage ( tdValue ); - } - if ( pAltImagePtr != NULL ) { - ((AMD_CONFIG_PARAMS*)pConfig)->ImageBasePtr = (UINT32) (UINTN) pAltImagePtr; - AltImageEntry = (CIM_IMAGE_ENTRY) (UINTN) ((UINT32) (UINTN) pAltImagePtr + (UINT32) (((AMD_IMAGE_HEADER*) (UINTN) pAltImagePtr)->EntryPointAddress)); - (*AltImageEntry) (pConfig); - return Status; - } - } -#endif saveConfigPointer (pConfig); if ( ((AMD_CONFIG_PARAMS*)pConfig)->Func == SB_POWERON_INIT ) { sbPowerOnInit ((AMDSBCFG*) pConfig); } -#ifndef B1_IMAGE if ( ((AMD_CONFIG_PARAMS*)pConfig)->Func == SB_BEFORE_PCI_INIT ) { sbBeforePciInit ((AMDSBCFG*)pConfig); } @@ -161,70 +134,10 @@ AmdSbDispatcher ( if ( ((AMD_CONFIG_PARAMS*)pConfig)->Func == SB_EC_FANCONTROL ) { sbECfancontrolservice((AMDSBCFG*)pConfig); } -#endif return Status; } /** - * LocateImage - Locate Southbridge CIMx module - * - * - * - * @param[in] Signature Southbridge CIMx image signature. - * - */ -VOID* -LocateImage ( - IN UINT64 Signature - ) -{ - VOID *Result; - UINT32 ImagePtr; - ImagePtr = 0xffffffff - (IMAGE_ALIGN - 1); - - while ( ImagePtr >= (0xfffffff - (NUM_IMAGE_LOCATION * IMAGE_ALIGN - 1)) ) { - Result = VerifyImage (Signature, (VOID*)(UINTN)ImagePtr); - if ( Result != NULL ) { - return Result; - } - ImagePtr -= IMAGE_ALIGN; - } - return NULL; -} - -/** - * VerifyImage - Verify Southbridge CIMx module - * - * - * @param[in] Signature Southbridge CIMx image signature. - * @param[in] ImagePtr Southbridge CIMx image address. - * - */ -VOID* -VerifyImage ( - IN UINT64 Signature, - IN VOID* ImagePtr - ) -{ - UINT16 *TempImagePtr; - UINT16 Sum; - UINT32 i; - Sum = 0; - if ( (*((UINT32*)ImagePtr) == Int32FromChar('$', 'A', 'M', 'D') && ((CIMFILEHEADER*)ImagePtr)->CreatorID == Signature) ) { - //GetImage Image size - TempImagePtr = (UINT16*)ImagePtr; - for ( i = 0; i < (((CIMFILEHEADER*)ImagePtr)->ImageSize); i += 2 ) { - Sum = Sum + *TempImagePtr; - TempImagePtr++; - } - if ( Sum == 0 ) { - return ImagePtr; - } - } - return NULL; -} - -/** * saveConfigPointer - Verify Southbridge CIMx module * * diff --git a/src/vendorcode/amd/cimx/sb800/SBMAIN.c b/src/vendorcode/amd/cimx/sb800/SBMAIN.c index a494d3033b..0e10a2a57c 100644 --- a/src/vendorcode/amd/cimx/sb800/SBMAIN.c +++ b/src/vendorcode/amd/cimx/sb800/SBMAIN.c @@ -46,8 +46,6 @@ #include "SBPLATFORM.h" #include "cbtypes.h" -#ifndef B1_IMAGE - /*----------------------------------------------------------------------------------------*/ /** * sbBeforePciInit - Config Southbridge before PCI emulation @@ -228,8 +226,6 @@ sbSmmAcpiOn ( RWMEM (ACPI_MMIO_BASE + SMI_BASE + SB_SMI_REGAC, AccWidthUint8, ~(BIT6 + BIT7), 0); } -#endif - /*----------------------------------------------------------------------------------------*/ /** * Call Back routine. diff --git a/src/vendorcode/amd/cimx/sb900/Dispatcher.c b/src/vendorcode/amd/cimx/sb900/Dispatcher.c index 49523134c1..ac1b517e64 100644 --- a/src/vendorcode/amd/cimx/sb900/Dispatcher.c +++ b/src/vendorcode/amd/cimx/sb900/Dispatcher.c @@ -60,8 +60,6 @@ // VOID saveConfigPointer (IN AMDSBCFG* pConfig); -VOID* VerifyImage (IN UINT64 Signature, IN VOID* ImagePtr); -VOID* LocateImage (IN UINT64 Signature); /*---------------------------------------------------------------------------------------- * T Y P E D E F S A N D S T R U C T U R E S @@ -89,12 +87,6 @@ AmdSbDispatcher ( AGESA_STATUS Status; UINT64 tdValue; -#ifdef B1_IMAGE - VOID *pAltImagePtr; - CIM_IMAGE_ENTRY AltImageEntry; - - pAltImagePtr = NULL; -#endif Status = AGESA_UNSUPPORTED; tdValue = 0x313141324E4448ull; @@ -106,29 +98,12 @@ AmdSbDispatcher ( Status = AGESA_UNSUPPORTED; TRACE ((DMSG_SB_TRACE, "CIM - Hudson-2 Entry\n")); -#ifdef B1_IMAGE - if ((UINT32) (UINTN) (((AMD_CONFIG_PARAMS*)pConfig)->AltImageBasePtr) != 0xffffffff ) { - if ( ((AMD_CONFIG_PARAMS*)pConfig)->AltImageBasePtr ) { - pAltImagePtr = VerifyImage ( tdValue, (VOID*) (UINTN) ((AMD_CONFIG_PARAMS*)pConfig)->AltImageBasePtr); - } - if ( pAltImagePtr == NULL ) { - pAltImagePtr = LocateImage ( tdValue ); - } - if ( pAltImagePtr != NULL ) { - ((AMD_CONFIG_PARAMS*)pConfig)->ImageBasePtr = (UINT32) (UINTN) pAltImagePtr; - AltImageEntry = (CIM_IMAGE_ENTRY) (UINTN) ((UINT32) (UINTN) pAltImagePtr + (UINT32) (((AMD_IMAGE_HEADER*) (UINTN) pAltImagePtr)->EntryPointAddress)); - (*AltImageEntry) (pConfig); - return Status; - } - } -#endif saveConfigPointer (pConfig); if ( ((AMD_CONFIG_PARAMS*)pConfig)->Func == SB_POWERON_INIT ) { sbPowerOnInit ((AMDSBCFG*) pConfig); } -#ifndef B1_IMAGE if ( ((AMD_CONFIG_PARAMS*)pConfig)->Func == SB_BEFORE_PCI_INIT ) { sbBeforePciInit ((AMDSBCFG*)pConfig); } @@ -164,76 +139,11 @@ AmdSbDispatcher ( if ( ((AMD_CONFIG_PARAMS*)pConfig)->Func == SB_EC_FANCONTROL ) { sbECfancontrolservice ((AMDSBCFG*)pConfig); } -#endif TRACE ((DMSG_SB_TRACE, "CIMx - SB Exit\n")); return Status; } /** - * LocateImage - Locate Southbridge CIMx module - * - * - * - * @param[in] Signature Southbridge CIMx image signature. - * - */ -VOID* -LocateImage ( - IN UINT64 Signature - ) -{ - VOID *Result; - UINT32 ImagePtr; - ImagePtr = 0xffffffff - (IMAGE_ALIGN - 1); - - while ( ImagePtr >= (0xfffffff - (NUM_IMAGE_LOCATION * IMAGE_ALIGN - 1)) ) { -#ifdef x64 - 12346789 -#else - Result = VerifyImage (Signature, (VOID*) (intptr_t) ImagePtr); -#endif - if ( Result != NULL ) { - return Result; - } - ImagePtr -= IMAGE_ALIGN; - } - return NULL; -} - -/** - * VerifyImage - Verify Southbridge CIMx module - * - * - * @param[in] Signature Southbridge CIMx image signature. - * @param[in] ImagePtr Southbridge CIMx image address. - * - */ -VOID* -VerifyImage ( - IN UINT64 Signature, - IN VOID* ImagePtr - ) -{ - UINT16 *TempImagePtr; - UINT16 Sum; - UINT32 i; - Sum = 0; -// if ( (*((UINT32*)ImagePtr) == 'DMA$' && ((CIMFILEHEADER*)ImagePtr)->CreatorID == Signature) ) { - if ( (*((UINT32*)ImagePtr) == Int32FromChar('D', 'M', 'A', '$') && ((CIMFILEHEADER*)ImagePtr)->CreatorID == Signature) ) { - //GetImage Image size - TempImagePtr = (UINT16*)ImagePtr; - for ( i = 0; i < (((CIMFILEHEADER*)ImagePtr)->ImageSize); i += 2 ) { - Sum = Sum + *TempImagePtr; - TempImagePtr++; - } - if ( Sum == 0 ) { - return ImagePtr; - } - } - return NULL; -} - -/** * saveConfigPointer - Verify Southbridge CIMx module * * diff --git a/src/vendorcode/amd/cimx/sb900/SbMain.c b/src/vendorcode/amd/cimx/sb900/SbMain.c index 7c9dbbdff6..dc39a944db 100644 --- a/src/vendorcode/amd/cimx/sb900/SbMain.c +++ b/src/vendorcode/amd/cimx/sb900/SbMain.c @@ -44,8 +44,6 @@ #include "cbtypes.h" #include "AmdSbLib.h" -#ifndef B1_IMAGE - /*----------------------------------------------------------------------------------------*/ /** * sbBeforePciInit - Config Southbridge before PCI emulation @@ -263,8 +261,6 @@ sbSmmAcpiOn ( //RWMEM (0x20, AccWidthUint32, 0, 0); } -#endif - /*----------------------------------------------------------------------------------------*/ /** * Call Back routine. |