From fd77d714f968458670ef7a477996ed61af46650b Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Tue, 29 Aug 2017 13:08:43 +0300 Subject: AGESA f12 vendorcode: Remove unused sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia22c96ee19babb3fc64d57966ea923eb5ec4b48f Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21259 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Marshall Dawson --- .../Modules/GnbFamTranslation/GnbPcieTranslation.c | 486 --------------------- .../Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.c | 242 ---------- .../Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.h | 54 --- .../f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.c | 181 -------- .../f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.h | 80 ---- .../Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.c | 117 ----- .../Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.h | 55 --- 7 files changed, 1215 deletions(-) delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbFamTranslation/GnbPcieTranslation.c delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.c delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.h delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.c delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.h delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.c delete mode 100644 src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.h (limited to 'src/vendorcode/amd/agesa/f12/Proc/GNB') diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbFamTranslation/GnbPcieTranslation.c b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbFamTranslation/GnbPcieTranslation.c deleted file mode 100644 index 5f267c6f6f..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbFamTranslation/GnbPcieTranslation.c +++ /dev/null @@ -1,486 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * Family specific function translation - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39255 $ @e \$Date: 2010-10-08 11:27:41 -0700 (Fri, 08 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ - -/*---------------------------------------------------------------------------------------- - * M O D U L E S U S E D - *---------------------------------------------------------------------------------------- - */ -#include "AGESA.h" -#include "Ids.h" -#include "amdlib.h" -#include "Gnb.h" -#include "GnbPcie.h" -#include "GnbPcieFamServices.h" -#include "GnbCommonLib.h" -#include "GnbPcieConfig.h" -#include "Filecode.h" -#define FILECODE PROC_GNB_MODULES_GNBFAMTRANSLATION_GNBPCIETRANSLATION_FILECODE -/*---------------------------------------------------------------------------------------- - * D E F I N I T I O N S A N D M A C R O S - *---------------------------------------------------------------------------------------- - */ - -/*---------------------------------------------------------------------------------------- - * T Y P E D E F S A N D S T R U C T U R E S - *---------------------------------------------------------------------------------------- - */ - - -/*---------------------------------------------------------------------------------------- - * P R O T O T Y P E S O F L O C A L F U N C T I O N S - *---------------------------------------------------------------------------------------- - */ -/*----------------------------------------------------------------------------------------*/ -/** - * Configure engine list to support lane allocation according to configuration ID. - * - * - * - * @param[in] Wrapper Pointer to wrapper config descriptor - * @param[in] EngineType Engine Type - * @param[in] ConfigurationId Configuration ID - * @retval AGESA_SUCCESS Configuration successfully applied - * @retval AGESA_UNSUPPORTED No more configuration available for given engine type - * @retval AGESA_ERROR Requested configuration not supported - */ -AGESA_STATUS -PcieFmConfigureEnginesLaneAllocation ( - IN PCIe_WRAPPER_CONFIG *Wrapper, - IN PCIE_ENGINE_TYPE EngineType, - IN UINT8 ConfigurationId - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Wrapper->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Wrapper->Header); - Status = GnbLibLocateService (GnbPcieFamConfigService, Complex->SocketId, &PcieConfigService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmConfigureEnginesLaneAllocation (Wrapper, EngineType, ConfigurationId); - } - return AGESA_ERROR; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get core configuration value - * - * - * - * @param[in] Wrapper Pointer to internal configuration data area - * @param[in] CoreId Core ID - * @param[in] ConfigurationSignature Configuration signature - * @param[out] ConfigurationValue Configuration value (for core configuration) - * @retval AGESA_SUCCESS Configuration successfully applied - * @retval AGESA_ERROR Core configuration value can not be determined - */ -AGESA_STATUS -PcieFmGetCoreConfigurationValue ( - IN PCIe_WRAPPER_CONFIG *Wrapper, - IN UINT8 CoreId, - IN UINT64 ConfigurationSignature, - IN UINT8 *ConfigurationValue - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_INIT_SERVICES *PcieInitService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Wrapper->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Wrapper->Header); - Status = GnbLibLocateService (GnbPcieFamInitService, Complex->SocketId, &PcieInitService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieInitService->PcieFmGetCoreConfigurationValue (Wrapper, CoreId, ConfigurationSignature, ConfigurationValue); - } - return AGESA_ERROR; -} - - -/*----------------------------------------------------------------------------------------*/ -/** - * Check if engine can be remapped to Device/function number requested by user - * defined engine descriptor - * - * Function only called if requested device/function does not much native device/function - * - * @param[in] PortDescriptor Pointer to user defined engine descriptor - * @param[in] Engine Pointer engine configuration - * @retval TRUE Descriptor can be mapped to engine - * @retval FALSE Descriptor can NOT be mapped to engine - */ - -BOOLEAN -PcieFmCheckPortPciDeviceMapping ( - IN PCIe_PORT_DESCRIPTOR *PortDescriptor, - IN PCIe_ENGINE_CONFIG *Engine - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Engine->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamConfigService, Complex->SocketId, &PcieConfigService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmCheckPortPciDeviceMapping (PortDescriptor, Engine); - } - return FALSE; -} - - -/*----------------------------------------------------------------------------------------*/ -/** - * Get core configuration string - * - * Debug function for logging configuration - * - * @param[in] Wrapper Pointer to internal configuration data area - * @param[in] ConfigurationValue Configuration value - * @retval Configuration string - */ - -CONST CHAR8* -PcieFmDebugGetCoreConfigurationString ( - IN PCIe_WRAPPER_CONFIG *Wrapper, - IN UINT8 ConfigurationValue - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_DEBUG_SERVICES *PcieDebugService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Wrapper->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamDebugService, Complex->SocketId, &PcieDebugService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieDebugService->PcieFmDebugGetCoreConfigurationString (Wrapper, ConfigurationValue); - } - return " !!! Something Wrong !!!"; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get wrapper name - * - * Debug function for logging wrapper name - * - * @param[in] Wrapper Pointer to internal configuration data area - * @retval Wrapper Name string - */ - -CONST CHAR8* -PcieFmDebugGetWrapperNameString ( - IN PCIe_WRAPPER_CONFIG *Wrapper - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_DEBUG_SERVICES *PcieDebugService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Wrapper->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamDebugService, Complex->SocketId, &PcieDebugService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieDebugService->PcieFmDebugGetWrapperNameString (Wrapper); - } - return " !!! Something Wrong !!!"; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get register address name - * - * Debug function for logging register trace - * - * @param[in] Silicon Silicon config descriptor - * @param[in] AddressFrame Address Frame - * @retval Register address name - */ -CONST CHAR8* -PcieFmDebugGetHostRegAddressSpaceString ( - IN PCIe_SILICON_CONFIG *Silicon, - IN UINT16 AddressFrame - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_DEBUG_SERVICES *PcieDebugService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Silicon->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamDebugService, Complex->SocketId, &PcieDebugService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieDebugService->PcieFmDebugGetHostRegAddressSpaceString (Silicon, AddressFrame); - } - return " !!! Something Wrong !!!"; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Check if the lane can be muxed by link width requested by user - * defined engine descriptor - * - * Check Engine StartCoreLane could be aligned by user requested link width(x1, x2, x4, x8, x16). - * Check Engine StartCoreLane could be aligned by user requested link width x2. - * - * @param[in] PortDescriptor Pointer to user defined engine descriptor - * @param[in] Engine Pointer engine configuration - * @retval TRUE Lane can be muxed - * @retval FALSE Lane can NOT be muxed - */ - -BOOLEAN -PcieFmCheckPortPcieLaneCanBeMuxed ( - IN PCIe_PORT_DESCRIPTOR *PortDescriptor, - IN PCIe_ENGINE_CONFIG *Engine - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Engine->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamConfigService, Complex->SocketId, &PcieConfigService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmCheckPortPcieLaneCanBeMuxed (PortDescriptor, Engine); - } - return FALSE; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Map engine to specific PCI device address - * - * - * - * @param[in] Engine Pointer to engine configuration - * @retval AGESA_ERROR Fail to map PCI device address - * @retval AGESA_SUCCESS Successfully allocate PCI address - */ - -AGESA_STATUS -PcieFmMapPortPciAddress ( - IN PCIe_ENGINE_CONFIG *Engine - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Engine->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamConfigService, Complex->SocketId, &PcieConfigService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmMapPortPciAddress (Engine); - } - return AGESA_ERROR; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get total number of silicons/wrappers/engines for this complex - * - * - * - * @param[in] SocketId Socket ID. - * @param[out] Length Length of configuration info block - * @param[out] StdHeader Standard Configuration Header - * @retval AGESA_SUCCESS Configuration data length is correct - */ -AGESA_STATUS -PcieFmGetComplexDataLength ( - IN UINT8 SocketId, - OUT UINTN *Length, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - AGESA_STATUS Status; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - Status = GnbLibLocateService (GnbPcieFamConfigService, SocketId, &PcieConfigService, StdHeader); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmGetComplexDataLength (SocketId, Length, StdHeader); - } - return Status; -} - - - - -/*----------------------------------------------------------------------------------------*/ -/** - * Build configuration - * - * - * @param[in] SocketId Socket ID. - * @param[out] Buffer Pointer to buffer to build internal complex data structure - * @param[out] StdHeader Standard configuration header. - * @retval AGESA_SUCCESS Configuration data build successfully - */ -AGESA_STATUS -PcieFmBuildComplexConfiguration ( - IN UINT8 SocketId, - OUT VOID *Buffer, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - AGESA_STATUS Status; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - Status = GnbLibLocateService (GnbPcieFamConfigService, SocketId, &PcieConfigService, StdHeader); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmBuildComplexConfiguration (SocketId, Buffer, StdHeader); - } - return Status; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get max link speed capability supported by this port - * - * - * - * @param[in] Flags See Flags PCIE_PORT_GEN_CAP_BOOT / PCIE_PORT_GEN_CAP_MAX - * @param[in] Engine Pointer to engine config descriptor - * @retval PcieGen1/PcieGen2 Max supported link gen capability - */ -PCIE_LINK_SPEED_CAP -PcieFmGetLinkSpeedCap ( - IN UINT32 Flags, - IN PCIe_ENGINE_CONFIG *Engine - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_INIT_SERVICES *PcieInitService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Engine->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamInitService, Complex->SocketId, &PcieInitService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieInitService->PcieFmGetLinkSpeedCap (Flags, Engine); - } - return PcieGen1; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get native PHY lane bitmap - * - * - * @param[in] PhyLaneBitmap Package PHY lane bitmap - * @param[in] Engine Standard configuration header. - * @retval Native PHY lane bitmap - */ -UINT32 -PcieFmGetNativePhyLaneBitmap ( - IN UINT32 PhyLaneBitmap, - IN PCIe_ENGINE_CONFIG *Engine - ) -{ - AGESA_STATUS Status; - PCIe_COMPLEX_CONFIG *Complex; - PCIe_PLATFORM_CONFIG *Pcie; - PCIe_FAM_INIT_SERVICES *PcieInitService; - - Complex = (PCIe_COMPLEX_CONFIG *) PcieConfigGetParent (DESCRIPTOR_COMPLEX, &Engine->Header); - Pcie = (PCIe_PLATFORM_CONFIG *) PcieConfigGetParent (DESCRIPTOR_PLATFORM, &Complex->Header); - Status = GnbLibLocateService (GnbPcieFamInitService, Complex->SocketId, &PcieInitService, GnbLibGetHeader (Pcie)); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieInitService->PcieFmGetNativePhyLaneBitmap (PhyLaneBitmap, Engine); - } - return 0x0; -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Get SB port info - * - * - * @param[out] SocketId Socket ID - * @param[out] SbPort Pointer to SB configuration descriptor - * @param[in] StdHeader Standard configuration header. - * @retval AGESA_SUCCESS SB configuration determined successfully - */ -AGESA_STATUS -PcieFmGetSbConfigInfo ( - IN UINT8 SocketId, - OUT PCIe_PORT_DESCRIPTOR *SbPort, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - AGESA_STATUS Status; - PCIe_FAM_CONFIG_SERVICES *PcieConfigService; - Status = GnbLibLocateService (GnbPcieFamConfigService, SocketId, &PcieConfigService, StdHeader); - ASSERT (Status == AGESA_SUCCESS); - if (Status == AGESA_SUCCESS) { - return PcieConfigService->PcieFmGetSbConfigInfo (SocketId, SbPort, StdHeader); - } - return Status; -} - diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.c b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.c deleted file mode 100644 index 90e9ca52a1..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.c +++ /dev/null @@ -1,242 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * PCIe ALIB - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39433 $ @e \$Date: 2010-10-11 14:15:36 -0700 (Mon, 11 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ - -/*---------------------------------------------------------------------------------------- - * M O D U L E S U S E D - *---------------------------------------------------------------------------------------- - */ -#include "AGESA.h" -#include "Ids.h" -#include "amdlib.h" -#include "heapManager.h" -#include "cpuLateInit.h" -#include "Gnb.h" -#include "GnbFamServices.h" -#include "GnbCommonLib.h" -#include "OptionGnb.h" -#include "Filecode.h" -#define FILECODE PROC_GNB_MODULES_GNBIOMMUIVRS_GNBIOMMUIVRS_FILECODE -/*---------------------------------------------------------------------------------------- - * D E F I N I T I O N S A N D M A C R O S - *---------------------------------------------------------------------------------------- - */ -extern GNB_BUILD_OPTIONS ROMDATA GnbBuildOptions; -/*---------------------------------------------------------------------------------------- - * T Y P E D E F S A N D S T R U C T U R E S - *---------------------------------------------------------------------------------------- - */ - -#define IVRS_TABLE_LENGTH 8 * 1024 - -/*---------------------------------------------------------------------------------------- - * P R O T O T Y P E S O F L O C A L F U N C T I O N S - *---------------------------------------------------------------------------------------- - */ - -VOID -GnbIommuIvrsTableDump ( - IN VOID *Ivrs, - IN AMD_CONFIG_PARAMS *StdHeader - ); - - -IOMMU_IVRS_HEADER IvrsHeader = { - {'I', 'V', 'R', 'S'}, - sizeof (IOMMU_IVRS_HEADER), - 2, - 0, - {'A', 'M', 'D', ' ', ' ', 0}, - {'A', 'M', 'D', 'I', 'O', 'M', 'M', 'U'}, - 1, - {'A','M','D',' '}, - 0, - 0, - 0 -}; - - -/*----------------------------------------------------------------------------------------*/ -/** - * Build IVRS table - * - * - * - * @param[in] StdHeader Standard Configuration Header - * @retval AGESA_SUCCESS - * @retval AGESA_ERROR - */ - -AGESA_STATUS -GnbIommuIvrsTable ( - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - AGESA_STATUS Status; - AMD_LATE_PARAMS *LateParamsPtr; - VOID *Ivrs; - BOOLEAN IvrsSupport; - UINT32 SocketId; - UINT32 SiliconId; - UINT32 NumberOfSockets; - UINT32 NumberOfSilicons; - - Status = AGESA_SUCCESS; - LateParamsPtr = (AMD_LATE_PARAMS*) StdHeader; - IvrsSupport = FALSE; - Ivrs = LateParamsPtr->AcpiIvrs; - if (Ivrs == NULL) { - Ivrs = GnbAllocateHeapBuffer ( - AMD_ACPI_IVRS_BUFFER_HANDLE, - IVRS_TABLE_LENGTH, - StdHeader - ); - ASSERT (Ivrs != NULL); - if (Ivrs == NULL) { - return AGESA_ERROR; - } - LateParamsPtr->AcpiIvrs = Ivrs; - } - LibAmdMemFill (Ivrs, 0x0, IVRS_TABLE_LENGTH, StdHeader); - LibAmdMemCopy (Ivrs, &IvrsHeader, sizeof (IvrsHeader), StdHeader); - NumberOfSockets = GnbGetNumberOfSockets (StdHeader); - for (SocketId = 0; SocketId < NumberOfSockets; SocketId++) { - if (GnbIsDevicePresentInSocket (SocketId, StdHeader)) { - NumberOfSilicons = GnbGetNumberOfSiliconsOnSocket (SocketId, StdHeader); - for (SiliconId = 0; SiliconId < NumberOfSilicons; SiliconId++) { - if (GnbFmCheckIommuPresent (SocketId, SiliconId, StdHeader)) { - IDS_HDT_CONSOLE (GNB_TRACE, "Build IVRS for Socket %d Silicon %d\n", SocketId, SiliconId); - IvrsSupport = TRUE; - GnbFmCreateIvrsEntry (SocketId, SiliconId, IvrsIvhdBlock, Ivrs, StdHeader); - if (GnbBuildOptions.IvrsRelativeAddrNamesSupport) { - GnbFmCreateIvrsEntry (SocketId, SiliconId, IvrsIvhdrBlock, Ivrs, StdHeader); - } - } - } - } - } - if (IvrsSupport == TRUE) { - ChecksumAcpiTable ((ACPI_TABLE_HEADER*) Ivrs, StdHeader); - GNB_DEBUG_CODE (GnbIommuIvrsTableDump (Ivrs, StdHeader)); - } else { - IDS_HDT_CONSOLE (GNB_TRACE, " IVRS table not generated\n"); - LateParamsPtr->AcpiIvrs = NULL; - } - return Status; -} - - -/*----------------------------------------------------------------------------------------*/ -/** - * Dump IVRS table - * - * - * @param[in] Ivrs Pointer to IVRS table - * @param[in] StdHeader Standard Configuration Header - */ - -VOID -GnbIommuIvrsTableDump ( - IN VOID *Ivrs, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - UINT8 *Block; - UINT8 *Entry; - Block = (UINT8 *) Ivrs + sizeof (IOMMU_IVRS_HEADER); - IDS_HDT_CONSOLE (GNB_TRACE, "<---------- IVRS Table Start -----------> \n"); - IDS_HDT_CONSOLE (GNB_TRACE, " IVInfo = 0x%08x\n", ((IOMMU_IVRS_HEADER *) Ivrs)-> IvInfo); - while (Block < ((UINT8 *) Ivrs + ((IOMMU_IVRS_HEADER *) Ivrs)->TableLength)) { - if (*Block == IvrsIvhdBlock) { - IDS_HDT_CONSOLE (GNB_TRACE, " <-------------IVHD Block Start -------->\n"); - IDS_HDT_CONSOLE (GNB_TRACE, " Flags = 0x%02x\n", ((IVRS_IVHD_ENTRY *) Block)->Flags); - IDS_HDT_CONSOLE (GNB_TRACE, " DeviceId = 0x%04x\n", ((IVRS_IVHD_ENTRY *) Block)->DeviceId); - IDS_HDT_CONSOLE (GNB_TRACE, " CapabilityOffset = 0x%02x\n", ((IVRS_IVHD_ENTRY *) Block)->CapabilityOffset); - IDS_HDT_CONSOLE (GNB_TRACE, " BaseAddress = 0x%08x%08x\n", (UINT32) (((IVRS_IVHD_ENTRY *) Block)->BaseAddress >> 32), (UINT32) ((IVRS_IVHD_ENTRY *) Block)->BaseAddress); - IDS_HDT_CONSOLE (GNB_TRACE, " PCI Segment = 0x%04x\n", ((IVRS_IVHD_ENTRY *) Block)->PciSegment); - IDS_HDT_CONSOLE (GNB_TRACE, " IommuInfo = 0x%04x\n", ((IVRS_IVHD_ENTRY *) Block)->IommuInfo); - IDS_HDT_CONSOLE (GNB_TRACE, " IommuEfr = 0x%08x\n", ((IVRS_IVHD_ENTRY *) Block)->IommuEfr); - Entry = Block + sizeof (IVRS_IVHD_ENTRY); - IDS_HDT_CONSOLE (GNB_TRACE, " <-------------IVHD Block Device Entries Start -------->\n"); - while (Entry < (Block + ((IVRS_IVHD_ENTRY *) Block)->Length)) { - IDS_HDT_CONSOLE (GNB_TRACE, " "); - switch (*Entry) { - case IvhdEntrySelect: - case IvhdEntryEndRange: - GnbLibDebugDumpBuffer (Entry, 4, 1, 4); - Entry = Entry + 4; - break; - case IvhdEntryStartRange: - GnbLibDebugDumpBuffer (Entry, 8, 1, 8); - Entry = Entry + 8; - break; - case IvhdEntryAliasStartRange: - GnbLibDebugDumpBuffer (Entry, 12, 1, 12); - Entry = Entry + 12; - break; - case IvhdEntryAliasSelect: - case IvhdEntryExtendedSelect: - case IvhdEntrySpecialDevice: - GnbLibDebugDumpBuffer (Entry, 8, 1, 8); - Entry = Entry + 8; - break; - case IvhdEntryPadding: - Entry = Entry + 4; - break; - default: - IDS_HDT_CONSOLE (GNB_TRACE, " Unsupported entry type [%d]\n"); - ASSERT (FALSE); - } - } - IDS_HDT_CONSOLE (GNB_TRACE, " <-------------IVHD Block Device Entries End -------->\n"); - IDS_HDT_CONSOLE (GNB_TRACE, " <-------------IVHD Block End ---------->\n"); - Block = Block + ((IVRS_IVHD_ENTRY *) Block)->Length; - } - } - IDS_HDT_CONSOLE (GNB_TRACE, "<---------- IVRS Table Raw Data --------> \n"); - GnbLibDebugDumpBuffer (Ivrs, ((IOMMU_IVRS_HEADER *) Ivrs)->TableLength, 1, 16); - IDS_HDT_CONSOLE (GNB_TRACE, "\n"); - IDS_HDT_CONSOLE (GNB_TRACE, "<---------- IVRS Table End -------------> \n"); -} - diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.h b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.h deleted file mode 100644 index c9ccb07c34..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIommuIvrs/GnbIommuIvrs.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * PCIe ALIB - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39433 $ @e \$Date: 2010-10-11 14:15:36 -0700 (Mon, 11 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ - -#ifndef _GNBIOMMUIVRS_H_ -#define _GNBIOMMUIVRS_H_ - -AGESA_STATUS -GnbIommuIvrsTable ( - IN AMD_CONFIG_PARAMS *StdHeader - ); - -#endif diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.c b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.c deleted file mode 100644 index ff4d979702..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.c +++ /dev/null @@ -1,181 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * PCIe ALIB - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39433 $ @e \$Date: 2010-10-11 14:15:36 -0700 (Mon, 11 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ - -/*---------------------------------------------------------------------------------------- - * M O D U L E S U S E D - *---------------------------------------------------------------------------------------- - */ - - -#include "AGESA.h" -#include "Ids.h" -#include "amdlib.h" -#include "heapManager.h" -#include "cpuLateInit.h" -#include "Gnb.h" -#include "GnbFamServices.h" -#include "GnbCommonLib.h" -#include "GnbIommuIvrs.h" -#include "Filecode.h" -#define FILECODE PROC_GNB_MODULES_GNBIVRSLIB_GNBIVRSLIB_FILECODE -/*---------------------------------------------------------------------------------------- - * D E F I N I T I O N S A N D M A C R O S - *---------------------------------------------------------------------------------------- - */ - -/*---------------------------------------------------------------------------------------- - * T Y P E D E F S A N D S T R U C T U R E S - *---------------------------------------------------------------------------------------- - */ - -/*---------------------------------------------------------------------------------------- - * P R O T O T Y P E S O F L O C A L F U N C T I O N S - *---------------------------------------------------------------------------------------- - */ - -/*----------------------------------------------------------------------------------------*/ -/** - * Create IVHDR entry for device range - * - * - * @param[in] StartRange Address of start range - * @param[in] EndRange Address of end range - * @param[in] DataSetting Data setting - * @param[in] Ivhd Pointer to IVHD entry - * @param[in] StdHeader Standard configuration header - * - */ -VOID -GnbIvhdAddDeviceRangeEntry ( - IN PCI_ADDR StartRange, - IN PCI_ADDR EndRange, - IN UINT8 DataSetting, - IN IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - IVHD_GENERIC_ENTRY *Entry; - Entry = (IVHD_GENERIC_ENTRY *) ((UINT8 *) Ivhd + Ivhd->Length); - Entry->Type = IvhdEntryStartRange; - Entry->DeviceId = DEVICE_ID (StartRange); - Entry->DataSetting = DataSetting; - Ivhd->Length += sizeof (IVHD_GENERIC_ENTRY); - Entry = (IVHD_GENERIC_ENTRY *) ((UINT8 *) Ivhd + Ivhd->Length); - Entry->Type = IvhdEntryEndRange; - Entry->DeviceId = DEVICE_ID (EndRange); - Ivhd->Length += sizeof (IVHD_GENERIC_ENTRY); -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Create IVHDR entry for aliased range - * - * - * @param[in] StartRange Address of start range - * @param[in] EndRange Address of end range - * @param[in] Alias Address of alias requestor ID for range - * @param[in] DataSetting Data setting - * @param[in] Ivhd Pointer to IVHD entry - * @param[in] StdHeader Standard configuration header - * - */ -VOID -GnbIvhdAddDeviceAliasRangeEntry ( - IN PCI_ADDR StartRange, - IN PCI_ADDR EndRange, - IN PCI_ADDR Alias, - IN UINT8 DataSetting, - IN IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - IVHD_ALIAS_ENTRY *RangeEntry; - IVHD_GENERIC_ENTRY *Entry; - UINT8 Padding; - Padding = (UINT8) ((Ivhd->Length + 0x7) & (~ 0x7)); - RangeEntry = (IVHD_ALIAS_ENTRY *) ((UINT8 *) Ivhd + Padding); - RangeEntry->Type = IvhdEntryAliasStartRange; - RangeEntry->DeviceId = DEVICE_ID (StartRange); - RangeEntry->AliasDeviceId = DEVICE_ID (Alias); - RangeEntry->DataSetting = DataSetting; - Ivhd->Length += sizeof (IVHD_ALIAS_ENTRY); - Entry = (IVHD_GENERIC_ENTRY *) ((UINT8 *) Ivhd + Ivhd->Length); - Entry->Type = IvhdEntryEndRange; - Entry->DeviceId = DEVICE_ID (EndRange); - Ivhd->Length += (sizeof (IVHD_GENERIC_ENTRY) + Padding); -} - -/*----------------------------------------------------------------------------------------*/ -/** - * Create IVHDR entry for special device - * - * - * @param[in] SpecialDevice Special device Type - * @param[in] Device Address of requestor ID for special device - * @param[in] Id Apic ID/ Hpet ID - * @param[in] DataSetting Data setting - * @param[in] Ivhd Pointer to IVHD entry - * @param[in] StdHeader Standard configuration header - * - */ -VOID -GnbIvhdAddSpecialDeviceEntry ( - IN IVHD_SPECIAL_DEVICE SpecialDevice, - IN PCI_ADDR Device, - IN UINT8 Id, - IN UINT8 DataSetting, - IN IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - IVHD_SPECIAL_ENTRY *SpecialEntry; - UINT8 Padding; - Padding = (UINT8) ((Ivhd->Length + 0x7) & (~ 0x7)); - SpecialEntry = (IVHD_SPECIAL_ENTRY *) ((UINT8 *) Ivhd + Padding); - SpecialEntry->Type = IvhdEntrySpecialDevice; - SpecialEntry->AliasDeviceId = DEVICE_ID (Device); - SpecialEntry->Variety = (UINT8) SpecialDevice; - Ivhd->Length += (sizeof (IVHD_SPECIAL_ENTRY) + Padding); -} diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.h b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.h deleted file mode 100644 index 55459c9fa2..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbIvrsLib/GnbIvrsLib.h +++ /dev/null @@ -1,80 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * PCIe ALIB - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39433 $ @e \$Date: 2010-10-11 14:15:36 -0700 (Mon, 11 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ - -#ifndef _GNBIVRSLIB_H_ -#define _GNBIVRSLIB_H_ - - -VOID -GnbIvhdAddDeviceRangeEntry ( - IN PCI_ADDR StartRange, - IN PCI_ADDR EndRange, - IN UINT8 DataSetting, - IN IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ); - -VOID -GnbIvhdAddDeviceAliasRangeEntry ( - IN PCI_ADDR StartRange, - IN PCI_ADDR EndRange, - IN PCI_ADDR Alias, - IN UINT8 DataSetting, - IN IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ); - -VOID -GnbIvhdAddSpecialDeviceEntry ( - IN IVHD_SPECIAL_DEVICE SpecialDevice, - IN PCI_ADDR Device, - IN UINT8 Id, - IN UINT8 DataSetting, - IN IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ); - - -#endif diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.c b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.c deleted file mode 100644 index c6dfcb32fa..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.c +++ /dev/null @@ -1,117 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * SB services - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39931 $ @e \$Date: 2010-10-16 18:19:16 -0700 (Sat, 16 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ - -/*---------------------------------------------------------------------------------------- - * M O D U L E S U S E D - *---------------------------------------------------------------------------------------- - */ -#include "AGESA.h" -#include "Ids.h" -#include "amdlib.h" -#include "Gnb.h" -#include "GnbCommonLib.h" -#include "GnbIvrsLib.h" -#include "GnbSbLib.h" -#include "Filecode.h" -#define FILECODE PROC_GNB_MODULES_GNBSBIOMMULIB_GNBSBIOMMULIB_FILECODE -/*---------------------------------------------------------------------------------------- - * D E F I N I T I O N S A N D M A C R O S - *---------------------------------------------------------------------------------------- - */ - - -/*---------------------------------------------------------------------------------------- - * T Y P E D E F S A N D S T R U C T U R E S - *---------------------------------------------------------------------------------------- - */ - - -/*---------------------------------------------------------------------------------------- - * P R O T O T Y P E S O F L O C A L F U N C T I O N S - *---------------------------------------------------------------------------------------- - */ - - - -/*----------------------------------------------------------------------------------------*/ -/** - * Create IVHD entry - * - * - * @param[in] Ivhd IVHD header pointer - * @param[in] StdHeader Standard configuration header - * - */ -VOID -SbCreateIvhdEntries ( - OUT IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ) -{ - PCI_ADDR Start; - PCI_ADDR End; - PCI_ADDR PciAddress; - UINT32 Value; - IDS_HDT_CONSOLE (GNB_TRACE, "SbCreateIvhdEntries Entry\n"); - PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x14, 4, 0); -// P2P alias entry - GnbLibPciRead (PciAddress.AddressValue | 0x18, AccessWidth32, &Value, StdHeader); - Start.AddressValue = MAKE_SBDFO (0, (Value >> 8) & 0xff, 0, 0, 0); - End.AddressValue = MAKE_SBDFO (0, (Value >> 16) & 0xff, 0x1f, 0x7, 0); - GnbIvhdAddDeviceAliasRangeEntry (Start, End, PciAddress, 0, Ivhd, StdHeader); - PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x14, 0, 0); -// HPET - GnbIvhdAddSpecialDeviceEntry (IvhdSpecialDeviceHpet, PciAddress, 0, 0, Ivhd, StdHeader); -// APIC - GnbIvhdAddSpecialDeviceEntry ( - IvhdSpecialDeviceIoapic, - PciAddress, - GnbLiGetIoapicId (SbGetSbIoApicBaseAddress (StdHeader), StdHeader), - 0xD7, - Ivhd, - StdHeader - ); - IDS_HDT_CONSOLE (GNB_TRACE, "SbCreateIvhdEntries Exit\n"); -} diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.h b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.h deleted file mode 100644 index 4b9c26e676..0000000000 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbSbIommuLib/GnbSbIommuLib.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $NoKeywords:$ */ -/** - * @file - * - * SB services - * - * - * - * @xrefitem bom "File Content Label" "Release Content" - * @e project: AGESA - * @e sub-project: GNB - * @e \$Revision: 39931 $ @e \$Date: 2010-10-16 18:19:16 -0700 (Sat, 16 Oct 2010) $ - * - */ -/* -***************************************************************************** -* -* Copyright (c) 2011, Advanced Micro Devices, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Advanced Micro Devices, Inc. nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* *************************************************************************** -* -*/ -#ifndef _GNBSBIOMMULIB_H_ -#define _GNBSBIOMMULIB_H_ - - -VOID -SbCreateIvhdEntries ( - OUT IVRS_IVHD_ENTRY *Ivhd, - IN AMD_CONFIG_PARAMS *StdHeader - ); - -#endif -- cgit v1.2.3