aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/amd/agesa/f12/Proc/Mem/Ps')
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/Makefile.inc3
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mprln3.c146
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpsln3.c165
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpuln3.c164
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/Makefile.inc11
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mp.c523
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplribt.c193
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnlr.c115
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnpr.c115
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmaxfreq.c260
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmr0.c183
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpodtpat.c195
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc10opspd.c167
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc2ibt.c214
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprtt.c235
-rw-r--r--src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpsao.c206
16 files changed, 0 insertions, 2895 deletions
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/Makefile.inc b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/Makefile.inc
deleted file mode 100644
index 9283b173be..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-libagesa-y += mprln3.c
-libagesa-y += mpsln3.c
-libagesa-y += mpuln3.c
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mprln3.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mprln3.c
deleted file mode 100644
index 130b4682c0..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mprln3.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mprln3.c
- *
- * Platform specific settings for LN DDR3 R-DIMM system
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
- * ***************************************************************************
- *
- */
-
-/* This file contains routine that add platform specific support L1 */
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "ma.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "mm.h"
-#include "mn.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-
-#define FILECODE PROC_MEM_PS_LN_MPRLN3_FILECODE
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-STATIC
-MemPDoPsRLN3 (
- IN OUT MEM_NB_BLOCK *NBPtr
- );
-/*
- *-----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *-----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function is the constructor platform specific settings for R DIMM-DDR3 LN DDR3
- *
- * @param[in,out] *MemPtr Pointer to MEM_DATA_STRUCTURE
- * @param[in,out] *ChannelPtr Pointer to CH_DEF_STRUCT
- * @param[in,out] *PsPtr Pointer to MEM_PS_BLOCK
- *
- * @return AGESA_SUCCESS
- *
- */
-
-AGESA_STATUS
-MemPConstructPsRLN3 (
- IN OUT MEM_DATA_STRUCT *MemPtr,
- IN OUT CH_DEF_STRUCT *ChannelPtr,
- IN OUT MEM_PS_BLOCK *PsPtr
- )
-{
- ASSERT (MemPtr != 0);
- ASSERT (ChannelPtr != 0);
-
-
- if ((ChannelPtr->MCTPtr->LogicalCpuid.Family & AMD_FAMILY_12_LN) == 0) {
- return AGESA_UNSUPPORTED;
- }
- if (ChannelPtr->TechType != DDR3_TECHNOLOGY) {
- return AGESA_UNSUPPORTED;
- }
- if (ChannelPtr->RegDimmPresent != ChannelPtr->ChDimmValid) {
- return AGESA_UNSUPPORTED;
- }
- PsPtr->MemPDoPs = MemPDoPsRLN3;
- PsPtr->MemPGetPORFreqLimit = MemPGetPORFreqLimitDef;
- return AGESA_SUCCESS;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This is function sets the platform specific settings for R-DDR3 LN DDR3
- *
- * @param[in,out] *NBPtr Pointer to MEM_NB_BLOCK
- *
- * @return TRUE - Find settings for corresponding platform and dimm population.
- * @return FALSE - Fail to find settings for corresponding platform and dimm population.
- *
- */
-
-BOOLEAN
-STATIC
-MemPDoPsRLN3 (
- IN OUT MEM_NB_BLOCK *NBPtr
- )
-{
- return TRUE;
-}
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpsln3.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpsln3.c
deleted file mode 100644
index 2803a3910c..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpsln3.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mpsln3.c
- *
- * Platform specific settings for LN DDR3 SO-DIMM system
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
- * ***************************************************************************
- *
- */
-
-/* This file contains routine that add platform specific support L1 */
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "mport.h"
-#include "ma.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "mm.h"
-#include "mn.h"
-#include "mp.h"
-#include "mu.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-
-#define FILECODE PROC_MEM_PS_LN_MPSLN3_FILECODE
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-STATIC
-MemPDoPsSLN3 (
- IN OUT MEM_NB_BLOCK *NBPtr
- );
-
-/*
- *-----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *-----------------------------------------------------------------------------
- */
-STATIC CONST DRAM_TERM_ENTRY LnSDdr3DramTerm[] = {
- {DDR800, ONE_DIMM, NO_DIMM, 2, 0, 0},
- {DDR1066, ONE_DIMM, NO_DIMM, 2, 0, 0},
- {DDR1333, ONE_DIMM, NO_DIMM, 1, 0, 0},
- {DDR1600 + DDR1866, ONE_DIMM, NO_DIMM, 3, 0, 0},
-
- {DDR800, TWO_DIMM, NO_DIMM, 3, 0, 2},
- {DDR1066 + DDR1333, TWO_DIMM, NO_DIMM, 5, 0, 2},
- {DDR1600 + DDR1866, TWO_DIMM, NO_DIMM, 4, 0, 1}
-};
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function is the constructor the platform specific settings for SO SIMM-DDR3 LN DDR3
- *
- * @param[in,out] *MemPtr Pointer to MEM_DATA_STRUCTURE
- * @param[in,out] *ChannelPtr Pointer to CH_DEF_STRUCT
- * @param[in,out] *PsPtr Pointer to MEM_PS_BLOCK
- *
- * @return AGESA_SUCCESS
- *
- */
-
-AGESA_STATUS
-MemPConstructPsSLN3 (
- IN OUT MEM_DATA_STRUCT *MemPtr,
- IN OUT CH_DEF_STRUCT *ChannelPtr,
- IN OUT MEM_PS_BLOCK *PsPtr
- )
-{
- ASSERT (MemPtr != 0);
- ASSERT (ChannelPtr != 0);
-
- if ((ChannelPtr->MCTPtr->LogicalCpuid.Family & AMD_FAMILY_12_LN) == 0) {
- return AGESA_UNSUPPORTED;
- }
- if (ChannelPtr->TechType != DDR3_TECHNOLOGY) {
- return AGESA_UNSUPPORTED;
- }
- if (ChannelPtr->SODimmPresent != ChannelPtr->ChDimmValid) {
- return AGESA_UNSUPPORTED;
- }
- PsPtr->MemPDoPs = MemPDoPsSLN3;
- PsPtr->MemPGetPORFreqLimit = MemPGetPORFreqLimitDef;
- return AGESA_SUCCESS;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This is function sets the platform specific settings for S-DDR3 LN DDR3
- *
- * @param[in,out] *NBPtr Pointer to MEM_NB_BLOCK
- *
- * @return TRUE - Find settings for corresponding platform and dimm population.
- * @return FALSE - Fail to find settings for corresponding platform and dimm population.
- *
- */
-
-BOOLEAN
-STATIC
-MemPDoPsSLN3 (
- IN OUT MEM_NB_BLOCK *NBPtr
- )
-{
- if (!MemPGetDramTerm (NBPtr, GET_SIZE_OF (LnSDdr3DramTerm), LnSDdr3DramTerm)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpuln3.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpuln3.c
deleted file mode 100644
index 0afab69c7b..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/LN/mpuln3.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mpuln3.c
- *
- * Platform specific settings for LN DDR3 U-DIMM system
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
- * ***************************************************************************
- *
- */
-
-/* This file contains routine that add platform specific support L1 */
-
-
-#include "AGESA.h"
-#include "Ids.h"
-#include "AdvancedApi.h"
-#include "mport.h"
-#include "ma.h"
-#include "cpuFamRegisters.h"
-#include "mm.h"
-#include "mn.h"
-#include "mp.h"
-#include "mu.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-
-#define FILECODE PROC_MEM_PS_LN_MPULN3_FILECODE
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-STATIC
-MemPDoPsULN3 (
- IN OUT MEM_NB_BLOCK *NBPtr
- );
-/*
- *-----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *-----------------------------------------------------------------------------
- */
-STATIC CONST DRAM_TERM_ENTRY LnUDdr3DramTerm[] = {
- {DDR800, ONE_DIMM, NO_DIMM, 2, 0, 0},
- {DDR1066, ONE_DIMM, NO_DIMM, 2, 0, 0},
- {DDR1333, ONE_DIMM, NO_DIMM, 1, 0, 0},
- {DDR1600 + DDR1866, ONE_DIMM, NO_DIMM, 3, 0, 0},
-
- {DDR800 + DDR1066, TWO_DIMM, NO_DIMM, 3, 0, 2},
- {DDR1333, TWO_DIMM, NO_DIMM, 5, 0, 2},
- {DDR1600 + DDR1866, TWO_DIMM, NO_DIMM, 4, 0, 1}
-};
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function is the constructor for the platform specific settings for U-DDR3 LN DDR3
- *
- * @param[in,out] *MemPtr Pointer to MEM_DATA_STRUCTURE
- * @param[in,out] *ChannelPtr Pointer to CH_DEF_STRUCT
- * @param[in,out] *PsPtr Pointer to MEM_PS_BLOCK
- *
- * @return AGESA_SUCCESS
- *
- */
-
-AGESA_STATUS
-MemPConstructPsULN3 (
- IN OUT MEM_DATA_STRUCT *MemPtr,
- IN OUT CH_DEF_STRUCT *ChannelPtr,
- IN OUT MEM_PS_BLOCK *PsPtr
- )
-{
- ASSERT (MemPtr != 0);
- ASSERT (ChannelPtr != 0);
-
- if ((ChannelPtr->MCTPtr->LogicalCpuid.Family & AMD_FAMILY_12_LN) == 0) {
- return AGESA_UNSUPPORTED;
- }
- if (ChannelPtr->TechType != DDR3_TECHNOLOGY) {
- return AGESA_UNSUPPORTED;
- }
- if ((ChannelPtr->RegDimmPresent != 0) || (ChannelPtr->SODimmPresent != 0)) {
- return AGESA_UNSUPPORTED;
- }
- PsPtr->MemPDoPs = MemPDoPsULN3;
- PsPtr->MemPGetPORFreqLimit = MemPGetPORFreqLimitDef;
- return AGESA_SUCCESS;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This is function sets the platform specific settings for U-DDR3 LN DDR3
- *
- * @param[in,out] *NBPtr Pointer to MEM_NB_BLOCK
- *
- * @return TRUE - Find settings for corresponding platform and dimm population.
- * @return FALSE - Fail to find settings for corresponding platform and dimm population.
- *
- */
-
-BOOLEAN
-STATIC
-MemPDoPsULN3 (
- IN OUT MEM_NB_BLOCK *NBPtr
- )
-{
- if (!MemPGetDramTerm (NBPtr, GET_SIZE_OF (LnUDdr3DramTerm), LnUDdr3DramTerm)) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/Makefile.inc b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/Makefile.inc
deleted file mode 100644
index 5f2e596093..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/Makefile.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-libagesa-y += mp.c
-libagesa-y += mplribt.c
-libagesa-y += mplrnlr.c
-libagesa-y += mplrnpr.c
-libagesa-y += mpmaxfreq.c
-libagesa-y += mpmr0.c
-libagesa-y += mpodtpat.c
-libagesa-y += mprc10opspd.c
-libagesa-y += mprc2ibt.c
-libagesa-y += mprtt.c
-libagesa-y += mpsao.c
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mp.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mp.c
deleted file mode 100644
index 2d261f8c2d..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mp.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mp.c
- *
- * Common platform specific configuration.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 49545 $ @e \$Date: 2011-03-25 05:58:58 +0800 (Fri, 25 Mar 2011) $
- *
- **/
-/*****************************************************************************
-*
-* 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-
-#define FILECODE PROC_MEM_PS_MP_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-STATIC
-MemPPSCGen (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-extern MEM_PSC_FLOW_BLOCK* memPlatSpecFlowArray[];
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This is the default return function of the Platform Specific block. The function always
- * returns AGESA_UNSUPPORTED
- *
- * @param[in,out] *MemPtr Pointer to MEM_DATA_STRUCTURE
- * @param[in] *ChannelPtr Pointer to CH_DEF_STRUCT
- * @param[in] *PsPtr Pointer to MEM_PS_BLOCK
- *
- * @return AGESA_UNSUPPORTED AGESA status indicating that default is unsupported
- *
- */
-
-AGESA_STATUS
-MemPConstructPsUDef (
- IN OUT MEM_DATA_STRUCT *MemPtr,
- IN OUT CH_DEF_STRUCT *ChannelPtr,
- IN OUT MEM_PS_BLOCK *PsPtr
- )
-{
- return AGESA_UNSUPPORTED;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function will set the DramTerm and DramTermDyn in the structure of a channel.
- *
- * @param[in,out] *NBPtr Pointer to MEM_NB_BLOCK
- * @param[in] ArraySize Size of the array of DramTerm
- * @param[in] *DramTermPtr Address the array of DramTerm
- *
- * @return TRUE - Find DramTerm and DramTermDyn for corresponding platform and dimm population.
- * @return FALSE - Fail to find DramTerm and DramTermDyn for corresponding platform and dimm population.
- *
- */
-BOOLEAN
-MemPGetDramTerm (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN UINT8 ArraySize,
- IN CONST DRAM_TERM_ENTRY *DramTermPtr
- )
-{
- UINT8 Dimms;
- UINT8 QR_Dimms;
- UINT8 i;
- Dimms = NBPtr->ChannelPtr->Dimms;
- QR_Dimms = 0;
- for (i = 0; i < MAX_DIMMS_PER_CHANNEL; i ++) {
- if (((NBPtr->ChannelPtr->DimmQrPresent & (UINT16) (1 << i)) != 0) && (i < 2)) {
- QR_Dimms ++;
- }
- }
-
- for (i = 0; i < ArraySize; i ++) {
- if ((DramTermPtr[i].Speed & ((UINT32) 1 << (NBPtr->DCTPtr->Timings.Speed / 66))) != 0) {
- if ((((UINT8) (1 << (Dimms - 1)) & DramTermPtr[i].Dimms) != 0) || (DramTermPtr[i].Dimms == ANY_NUM)) {
- if (((QR_Dimms == 0) && (DramTermPtr[i].QR_Dimms == NO_DIMM)) ||
- ((QR_Dimms > 0) && (((UINT8) (1 << (QR_Dimms - 1)) & DramTermPtr[i].QR_Dimms) != 0)) ||
- (DramTermPtr[i].QR_Dimms == ANY_NUM)) {
- NBPtr->PsPtr->DramTerm = DramTermPtr[i].DramTerm;
- NBPtr->PsPtr->QR_DramTerm = DramTermPtr[i].QR_DramTerm;
- NBPtr->PsPtr->DynamicDramTerm = DramTermPtr[i].DynamicDramTerm;
- break;
- }
- }
- }
- }
- return TRUE;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function gets the highest POR supported speed.
- *
- * @param[in,out] *NBPtr Pointer to MEM_NB_BLOCK
- * @param[in] FreqLimitSize Size of the array of Frequency Limit
- * @param[in] *FreqLimitPtr Address the array of Frequency Limit
- *
- * @return UINT8 - frequency limit
- *
- */
-UINT16
-MemPGetPorFreqLimit (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN UINT8 FreqLimitSize,
- IN CONST POR_SPEED_LIMIT *FreqLimitPtr
- )
-{
- UINT8 i;
- UINT8 j;
- UINT8 DimmTpMatch;
- UINT16 SpeedLimit;
- UINT16 DIMMRankType;
- UINT16 _DIMMRankType;
-
- SpeedLimit = 0;
- DIMMRankType = MemAGetPsRankType (NBPtr->ChannelPtr);
- for (i = 0; i < FreqLimitSize; i++, FreqLimitPtr++) {
- if (NBPtr->ChannelPtr->Dimms != FreqLimitPtr->Dimms) {
- continue;
- }
- DimmTpMatch = 0;
- _DIMMRankType = DIMMRankType & FreqLimitPtr->DIMMRankType;
- for (j = 0; j < MAX_DIMMS_PER_CHANNEL; j ++) {
- if ((_DIMMRankType & (UINT16) 0x0F << (j << 2)) != 0) {
- DimmTpMatch++;
- }
- }
- if (DimmTpMatch == FreqLimitPtr->Dimms) {
- if (NBPtr->RefPtr->DDR3Voltage == VOLT1_5) {
- SpeedLimit = FreqLimitPtr->SpeedLimit_1_5V;
- break;
- } else if (NBPtr->RefPtr->DDR3Voltage == VOLT1_25) {
- SpeedLimit = FreqLimitPtr->SpeedLimit_1_25V;
- break;
- } else {
- SpeedLimit = FreqLimitPtr->SpeedLimit_1_35V;
- break;
- }
- }
- }
-
- return SpeedLimit;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function is the default function for getting POR speed limit. When a
- * package does not need to cap the speed, it should use this function to initialize
- * the corresponding function pointer.
- *
- * @param[in,out] *NBPtr Pointer to MEM_NB_BLOCK
- *
- */
-VOID
-MemPGetPORFreqLimitDef (
- IN OUT MEM_NB_BLOCK *NBPtr
- )
-{
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function gets platform specific configuration such as Max Freq., Slow Mode, Dram Term,
- * and so on.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- *
- * @return TRUE - Successfully execute platform specific configuration flow.
- * @return FALSE - Fail to execute platform specific configuration flow.
- *
- */
-BOOLEAN
-MemPPSCFlow (
- IN OUT MEM_NB_BLOCK *NBPtr
- )
-{
- UINT8 i;
- BOOLEAN Result;
-
- Result = TRUE;
- i = 0;
- while (memPlatSpecFlowArray[i] != NULL) {
- if ((memPlatSpecFlowArray[i])->DramTerm (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->ODTPattern (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->SAO (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->MR0WrCL (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->RC2IBT (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->RC10OpSpeed (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->LRIBT (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->LRNPR (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if ((memPlatSpecFlowArray[i])->LRNLR (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- if (MemPPSCGen (NBPtr, (memPlatSpecFlowArray[i])->EntryOfTables)) {
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- i++;
- }
-
- IDS_SKIP_HOOK (IDS_ENFORCE_PLAT_TABLES, NBPtr, &(NBPtr->MemPtr->StdHeader)) {
- if (memPlatSpecFlowArray[i] == NULL) {
- Result = FALSE;
- }
- }
- return Result;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function constructs the rank type map of Dimm0, Dimm1, Dimm2. Also it counts the number
- * of dimm in the table.
- *
- * @param[in] Dimm0 Rank type of Dimm0
- * @param[in] Dimm1 Rank type of Dimm1
- * @param[in] Dimm2 Rank type of Dimm2
- * @param[in, out] *RankTypeInTable Pointer to RankTypeInTable variable
- *
- *
- */
-VOID
-MemPConstructRankTypeMap (
- IN UINT16 Dimm0,
- IN UINT16 Dimm1,
- IN UINT16 Dimm2,
- IN OUT UINT16 *RankTypeInTable
- )
-{
- UINT8 i;
- UINT16 RT;
- UINT8 BitShift;
-
- *RankTypeInTable = 0;
- RT = 0;
- BitShift = 0;
-
- for (i = 0; i < MAX_DIMMS_PER_CHANNEL; i++) {
- switch (i) {
- case 0:
- RT = (Dimm0 == 0) ? NP : Dimm0;
- BitShift = 0;
- break;
- case 1:
- RT = (Dimm1 == 0) ? NP : Dimm1;
- BitShift = 4;
- break;
- case 2:
- RT = (Dimm2 == 0) ? NP : Dimm2;
- BitShift = 8;
- break;
- default:
- // dimm3 is not used, fills nibble3 with "NP"
- RT = NP;
- BitShift = 12;
- }
- *RankTypeInTable |= RT << BitShift;
- }
-}
-
-/*-----------------------------------------------------------------------------*/
-/**
- * MemPIsIdSupported
- * This function matches the CPU_LOGICAL_ID and PackageType with certain criteria to
- * determine if it is supported by this NB type.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] LogicalId - CPU_LOGICAL_ID
- * @param[in] PackageType - Package Type
- *
- * @return TRUE - NB type is matched !
- * @return FALSE - NB type is not matched !
- *
- */
-BOOLEAN
-MemPIsIdSupported (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN CPU_LOGICAL_ID LogicalId,
- IN UINT8 PackageType
- )
-{
- CPUID_DATA CpuId;
- UINT8 PkgType;
-
- LibAmdCpuidRead (AMD_CPUID_FMF, &CpuId, &(NBPtr->MemPtr->StdHeader));
- PkgType = (UINT8) (CpuId.EBX_Reg >> 28) & 0xF; // bit 31:28
-
- if (((NBPtr->MCTPtr->LogicalCpuid.Family & LogicalId.Family) != 0)
- && ((NBPtr->MCTPtr->LogicalCpuid.Revision & LogicalId.Revision) != 0)) {
- if ((PackageType == PT_DONT_CARE) || (PackageType == PkgType)) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function returns the rank type map of a channel.
- *
- * @param[in] *CurrentChannel Pointer to CH_DEF_STRUCT
- *
- * @return UINT16 - The map of rank type.
- *
- */
-UINT16
-MemPGetPsRankType (
- IN CH_DEF_STRUCT *CurrentChannel
- )
-{
- UINT8 i;
- UINT16 DIMMRankType;
-
- DIMMRankType = 0;
- for (i = 0; i < MAX_DIMMS_PER_CHANNEL; i++) {
- if (CurrentChannel->MCTPtr->Status[SbLrdimms]) {
- // For LrDimm, we construct the map according to Dimm present bits rather than rank type bits
- if ((CurrentChannel->LrDimmPresent & (UINT8) 1 << i) != 0) {
- DIMMRankType |= (UINT16) DIMM_LR << (i << 2);
- } else {
- DIMMRankType |= (UINT16) NP << (i << 2);
- }
- } else {
- if ((CurrentChannel->DimmQrPresent & (UINT8) 1 << i) != 0) {
- if (i < 2) {
- DIMMRankType |= (UINT16) DIMM_QR << (i << 2);
- }
- } else if ((CurrentChannel->DimmDrPresent & (UINT8) 1 << i) != 0) {
- DIMMRankType |= (UINT16) DIMM_DR << (i << 2);
- } else if ((CurrentChannel->DimmSRPresent & (UINT8) 1 << i) != 0) {
- DIMMRankType |= (UINT16) DIMM_SR << (i << 2);
- } else {
- DIMMRankType |= (UINT16) NP << (i << 2);
- }
- }
- }
-
- return DIMMRankType;
-}
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * This function performs the action for the rest of platform specific configuration such as
- * tri-state stuff
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - No error occurred.
- * @return FALSE - Error occurred.
- *
- */
-BOOLEAN
-STATIC
-MemPPSCGen (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- PSCFG_TYPE PSCType;
- DIMM_TYPE DimmType;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- if (CurrentChannel->RegDimmPresent != 0) {
- DimmType = RDIMM_TYPE;
- } else if (CurrentChannel->SODimmPresent != 0) {
- DimmType = SODIMM_TYPE;
- } else if (CurrentChannel->LrDimmPresent != 0) {
- DimmType = LRDIMM_TYPE;
- } else {
- DimmType = UDIMM_TYPE;
- }
-
- for (PSCType = PSCFG_GEN_START + 1; PSCType < PSCFG_GEN_END; PSCType++) {
- i = 0;
- while (EntryOfTables->TblEntryOfGen[i] != NULL) {
- if ((EntryOfTables->TblEntryOfGen[i])->Header.PSCType == PSCType) {
- if (((EntryOfTables->TblEntryOfGen[i])->Header.DimmType & DimmType) != 0) {
- if (((EntryOfTables->TblEntryOfGen[i])->Header.NumOfDimm & NOD) != 0) {
- //
- // Determine if this is the expected NB Type
- //
- LogicalCpuid = (EntryOfTables->TblEntryOfGen[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfGen[i])->Header.PackageType;
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- break;
- }
- }
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfGen[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo %s Table\n", (PSCType == PSCFG_CLKDIS) ? "ClkDis" : ((PSCType == PSCFG_CKETRI) ? "CkeTri" : ((PSCType == PSCFG_ODTTRI) ? "OdtTri" : "CsTri")));
- return FALSE;
- }
-
- // Perform the action for specific PSCType.
- if (PSCType == PSCFG_CLKDIS) {
- CurrentChannel->MemClkDisMap = (UINT8 *) (EntryOfTables->TblEntryOfGen[i])->TBLPtr;
- } else if (PSCType == PSCFG_CKETRI) {
- CurrentChannel->CKETriMap = (UINT8 *) (EntryOfTables->TblEntryOfGen[i])->TBLPtr;
- } else if (PSCType == PSCFG_ODTTRI) {
- CurrentChannel->ODTTriMap = (UINT8 *) (EntryOfTables->TblEntryOfGen[i])->TBLPtr;
- } else if (PSCType == PSCFG_CSTRI) {
- CurrentChannel->ChipSelTriMap = (UINT8 *) (EntryOfTables->TblEntryOfGen[i])->TBLPtr;
- }
- }
-
- CurrentChannel->DctEccDqsLike = 0x0403;
- CurrentChannel->DctEccDqsScale = 0x70;
-
- return TRUE;
-}
-
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplribt.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplribt.c
deleted file mode 100644
index 91cfeee575..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplribt.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mplribt.c
- *
- * A sub-engine which extracts F0RC8, F1RC0, F1RC1 and F1RC2 value for LRDIMM configuration.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPLRIBT_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetLRIBT (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts LRDIMM F0RC8, F1RC0, F1RC1 and F1RC2 value from a input
- * table and stores extracted value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Succeed in extracting the table value
- * @return FALSE - Fail to extract the table value
- *
- */
-BOOLEAN
-MemPGetLRIBT (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- UINT8 TableSize;
- UINT32 CurDDRrate;
- UINT8 DDR3Voltage;
- UINT16 RankTypeOfPopulatedDimm;
- UINT16 RankTypeInTable;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- PSCFG_L_IBT_ENTRY *TblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- if (CurrentChannel->LrDimmPresent == 0) {
- return TRUE;
- }
-
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to NB type and package type.
- while (EntryOfTables->TblEntryOfLRIBT[i] != NULL) {
- if (((EntryOfTables->TblEntryOfLRIBT[i])->Header.NumOfDimm & NOD) != 0) {
- LogicalCpuid = (EntryOfTables->TblEntryOfLRIBT[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfLRIBT[i])->Header.PackageType;
- //
- // Determine if this is the expected NB Type
- //
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_L_IBT_ENTRY *) ((EntryOfTables->TblEntryOfLRIBT[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfLRIBT[i])->TableSize;
- break;
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfLRIBT[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo LRDIMM IBT table\n");
- return FALSE;
- }
-
- CurDDRrate = (UINT32) (1 << (CurrentChannel->DCTPtr->Timings.Speed / 66));
- DDR3Voltage = (UINT8) (1 << CONVERT_VDDIO_TO_ENCODED (NBPtr->RefPtr->DDR3Voltage));
- RankTypeOfPopulatedDimm = MemPGetPsRankType (CurrentChannel);
-
- for (i = 0; i < TableSize; i++) {
- MemPConstructRankTypeMap ((UINT16) TblPtr->Dimm0, (UINT16) TblPtr->Dimm1, (UINT16) TblPtr->Dimm2, &RankTypeInTable);
- if (TblPtr->DimmPerCh == MaxDimmPerCh) {
- if ((TblPtr->DDRrate & CurDDRrate) != 0) {
- if ((TblPtr->VDDIO & DDR3Voltage) != 0) {
- if ((RankTypeInTable & RankTypeOfPopulatedDimm) == RankTypeOfPopulatedDimm) {
- NBPtr->PsPtr->F0RC8 = (UINT8) TblPtr->F0RC8;
- NBPtr->PsPtr->F1RC0 = (UINT8) TblPtr->F1RC0;
- NBPtr->PsPtr->F1RC1 = (UINT8) TblPtr->F1RC1;
- NBPtr->PsPtr->F1RC2 = (UINT8) TblPtr->F1RC2;
- break;
- }
- }
- }
- }
- TblPtr++;
- }
- if (i == TableSize) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo LRDIMM IBT entries\n");
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnlr.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnlr.c
deleted file mode 100644
index 2c69768398..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnlr.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mplrnlr.c
- *
- * A sub-engine which extracts F0RC13[NumLogicalRanks] value for LRDIMM configuration.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPLRNLR_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetLRNLR (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts LRDIMM F0RC13[NumLogicalRanks] value from a input
- * table and stores extracted value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Succeed in extracting the table value
- * @return FALSE - Fail to extract the table value
- *
- */
-BOOLEAN
-MemPGetLRNLR (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- return TRUE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnpr.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnpr.c
deleted file mode 100644
index 25186e3a3f..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mplrnpr.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mplrnpr.c
- *
- * A sub-engine which extracts F0RC13[NumPhysicalRanks] value for LRDIMM configuration.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPLRNPR_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetLRNPR (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts LRDIMM F0RC13[NumPhysicalRanks] value from a input
- * table and stores extracted value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Succeed in extracting the table value
- * @return FALSE - Fail to extract the table value
- *
- */
-BOOLEAN
-MemPGetLRNPR (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- return TRUE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmaxfreq.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmaxfreq.c
deleted file mode 100644
index f6f90f9ffd..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmaxfreq.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mpmaxfreq.c
- *
- * A sub-engine which extracts max. frequency limit value.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 45233 $ @e \$Date: 2011-01-14 11:58:29 +0800 (Fri, 14 Jan 2011) $
- *
- **/
-/*****************************************************************************
-*
-* 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPMAXFREQ_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-typedef struct {
- UINT16 DimmPerCh:3;
- UINT16 Dimms:3;
- UINT16 SR:3;
- UINT16 DR:3;
- UINT16 QR:4;
-} CDNMaxFreq;
-
-typedef struct {
- UINT16 DimmPerCh:3;
- UINT16 Dimms:3;
- UINT16 LR:10;
-} CDNLMaxFreq;
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetMaxFreqSupported (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts the value of max frequency supported from a input table and
- * compares it with DCTPtr->Timings.TargetSpeed
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Succeed in extracting the table value
- * @return FALSE - Fail to extract the table value
- *
- */
-BOOLEAN
-MemPGetMaxFreqSupported (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- UINT8 TableSize;
- PSCFG_TYPE Type;
- UINT16 CDN;
- UINT16 MaxFreqSupported;
- UINT16 *SpeedArray;
- UINT8 DDR3Voltage;
- UINT8 CurrentVoltage;
- DIMM_TYPE DimmType;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- PSCFG_MAXFREQ_ENTRY *TblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- Type = PSCFG_MAXFREQ;
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
-
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- if (CurrentChannel->RegDimmPresent != 0) {
- DimmType = RDIMM_TYPE;
- } else if (CurrentChannel->SODimmPresent != 0) {
- DimmType = SODIMM_TYPE;
- if (FindPSOverrideEntry (NBPtr->RefPtr->PlatformMemoryConfiguration, PSO_SOLDERED_DOWN_SODIMM_TYPE, NBPtr->MCTPtr->SocketId, NBPtr->ChannelPtr->ChannelID) != NULL) {
- DimmType = SODWN_SODIMM_TYPE;
- }
- } else if (CurrentChannel->LrDimmPresent != 0) {
- DimmType = LRDIMM_TYPE;
- } else {
- DimmType = UDIMM_TYPE;
- }
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to Dimm, NB and package type.
- while (EntryOfTables->TblEntryOfMaxFreq[i] != NULL) {
- if (((EntryOfTables->TblEntryOfMaxFreq[i])->Header.DimmType & DimmType) != 0) {
- if (((EntryOfTables->TblEntryOfMaxFreq[i])->Header.NumOfDimm & NOD) != 0) {
- //
- // Determine if this is the expected NB Type
- //
- LogicalCpuid = (EntryOfTables->TblEntryOfMaxFreq[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfMaxFreq[i])->Header.PackageType;
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_MAXFREQ_ENTRY *) ((EntryOfTables->TblEntryOfMaxFreq[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfMaxFreq[i])->TableSize;
- Type = (EntryOfTables->TblEntryOfMaxFreq[i])->Header.PSCType;
- break;
- }
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfMaxFreq[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo MaxFreq table\n");
- return FALSE;
- }
-
- MaxFreqSupported = DDR1866_FREQUENCY;
- CDN = 0;
- DDR3Voltage = (UINT8) CONVERT_VDDIO_TO_ENCODED (NBPtr->RefPtr->DDR3Voltage);
-
- // Construct the condition value
- ((CDNMaxFreq *)&CDN)->DimmPerCh = MaxDimmPerCh;
- ((CDNMaxFreq *)&CDN)->Dimms = CurrentChannel->Dimms;
- if (Type == PSCFG_MAXFREQ) {
- for (i = 0; i < MAX_DIMMS_PER_CHANNEL; i++) {
- if ((CurrentChannel->DimmSRPresent & (UINT8) (1 << i)) != 0) {
- ((CDNMaxFreq *)&CDN)->SR += 1;
- }
- if ((CurrentChannel->DimmDrPresent & (UINT16) (1 << i)) != 0) {
- ((CDNMaxFreq *)&CDN)->DR += 1;
- }
- if ((CurrentChannel->DimmQrPresent & (UINT16) (1 << i)) != 0) {
- if (i < 2) {
- ((CDNMaxFreq *)&CDN)->QR += 1;
- }
- }
- }
- } else {
- ((CDNLMaxFreq *)&CDN)->LR = CurrentChannel->Dimms;
- }
-
- for (i = 0; i < TableSize; i++) {
- if (CDN == ((Type == PSCFG_MAXFREQ) ? TblPtr->MAXFREQ_ENTRY.CDN :
- ((PSCFG_LR_MAXFREQ_ENTRY *)TblPtr)->LR_MAXFREQ_ENTRY.CDN)) {
- if (Type == PSCFG_MAXFREQ) {
- SpeedArray = TblPtr->MAXFREQ_ENTRY.Speed;
- } else {
- SpeedArray = ((PSCFG_LR_MAXFREQ_ENTRY *)TblPtr)->LR_MAXFREQ_ENTRY.Speed;
- }
- if (NBPtr->SharedPtr->VoltageMap != VDDIO_DETERMINED) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nCheck speed supported for each VDDIO for Node%d DCT%d: ", NBPtr->Node, NBPtr->Dct);
- for (CurrentVoltage = VOLT1_5_ENCODED_VAL; CurrentVoltage <= VOLT1_25_ENCODED_VAL; CurrentVoltage ++) {
- if (NBPtr->SharedPtr->VoltageMap & (1 << CurrentVoltage)) {
- IDS_HDT_CONSOLE (MEM_FLOW, "%s -> %dMHz ", (CurrentVoltage == VOLT1_5_ENCODED_VAL) ? "1.5V" : ((CurrentVoltage == VOLT1_35_ENCODED_VAL) ? "1.35V" : "1.25V"), SpeedArray[CurrentVoltage]);
- if (NBPtr->DCTPtr->Timings.TargetSpeed > SpeedArray[CurrentVoltage]) {
- MaxFreqSupported = SpeedArray[CurrentVoltage];
- } else {
- MaxFreqSupported = NBPtr->DCTPtr->Timings.TargetSpeed;
- }
- if (NBPtr->MaxFreqVDDIO[CurrentVoltage] > MaxFreqSupported) {
- NBPtr->MaxFreqVDDIO[CurrentVoltage] = MaxFreqSupported;
- }
- } else {
- NBPtr->MaxFreqVDDIO[CurrentVoltage] = 0;
- }
- }
- IDS_HDT_CONSOLE (MEM_FLOW, "\n");
- }
- ASSERT (DDR3Voltage <= VOLT1_25_ENCODED_VAL);
- MaxFreqSupported = SpeedArray[DDR3Voltage];
- break;
- }
- TblPtr++;
- }
-
- if (NBPtr->DCTPtr->Timings.TargetSpeed > MaxFreqSupported) {
- NBPtr->DCTPtr->Timings.TargetSpeed = MaxFreqSupported;
- }
- return TRUE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmr0.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmr0.c
deleted file mode 100644
index a6c8b40f9c..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpmr0.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mpmr0.c
- *
- * A sub-engine which extracts MR0[WR] and MR0[CL] value.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPMR0_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetMR0WrCL (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts MR0[WR] or MR0[CL] value from a input table and store the
- * value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Succeed in extracting the table value
- * @return FALSE - Fail to extract the table value
- *
- */
-BOOLEAN
-MemPGetMR0WrCL (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
-
- UINT8 i;
- UINT8 j;
- UINT8 p;
- UINT32 Value32;
- UINT8 TableSize;
- PSCFG_TYPE Type;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- PSCFG_MR0CL_ENTRY *TblPtr;
- PSC_TBL_ENTRY **ptr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
- TblPtr = NULL;
- TableSize = 0;
-
- // Extract MR0[WR] value, then MR0[CL] value
- for (i = 0; i < 2; i++) {
- if (i == 0) {
- ptr = EntryOfTables->TblEntryOfMR0WR;
- Type = PSCFG_MR0WR;
- } else {
- ptr = EntryOfTables->TblEntryOfMR0CL;
- Type = PSCFG_MR0CL;
- }
-
- p = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to Dimm, NB and package type.
- while (ptr[p] != NULL) {
- //
- // Determine if this is the expected NB Type
- //
- LogicalCpuid = (ptr[p])->Header.LogicalCpuid;
- PackageType = (ptr[p])->Header.PackageType;
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_MR0CL_ENTRY *) ((ptr[p])->TBLPtr);
- TableSize = (ptr[p])->TableSize;
- break;
- }
- p++;
- }
-
- // Check whether no table entry is found.
- if (ptr[p] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo MR0 table\n");
- return FALSE;
- }
-
- Value32 = (Type == PSCFG_MR0WR) ? NBPtr->GetBitField (NBPtr, BFTwrDDR3) : NBPtr->GetBitField (NBPtr, BFTcl);
- for (j = 0; j < TableSize; j++, TblPtr++) {
- if (Value32 == (UINT32) TblPtr->Timing) {
- if (Type == PSCFG_MR0WR) {
- NBPtr->PsPtr->MR0WR = (UINT8) TblPtr->Value;
- break;
- } else {
- NBPtr->PsPtr->MR0CL31 = (UINT8) TblPtr->Value;
- NBPtr->PsPtr->MR0CL0 = (UINT8) TblPtr->Value1;
- break;
- }
- }
- }
- if (j == TableSize) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo MR0 entries\n");
- return FALSE;
- }
- }
-
- return TRUE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpodtpat.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpodtpat.c
deleted file mode 100644
index 0f1a4a99fb..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpodtpat.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mpodtpat.c
- *
- * A sub-engine which extracts ODT pattern value.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPODTPAT_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetODTPattern (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts ODT Pattern value from a input table and stores extracted
- * value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Table values can be extracted per dimm population and ranks type.
- * @return FALSE - Table values cannot be extracted per dimm population and ranks type.
- *
- */
-BOOLEAN
-MemPGetODTPattern (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- UINT16 RankTypeInTable;
- UINT16 RankTypeOfPopulatedDimm;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- UINT8 TableSize;
- DIMM_TYPE DimmType;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- PSCFG_3D_ODTPAT_ENTRY *TblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- if (CurrentChannel->RegDimmPresent != 0) {
- DimmType = RDIMM_TYPE;
- } else if (CurrentChannel->SODimmPresent != 0) {
- DimmType = SODIMM_TYPE;
- } else if (CurrentChannel->LrDimmPresent != 0) {
- DimmType = LRDIMM_TYPE;
- } else {
- DimmType = UDIMM_TYPE;
- }
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to Dimm, NB and package type.
- while (EntryOfTables->TblEntryOfODTPattern[i] != NULL) {
- if (((EntryOfTables->TblEntryOfODTPattern[i])->Header.DimmType & DimmType) != 0) {
- if (((EntryOfTables->TblEntryOfODTPattern[i])->Header.NumOfDimm & NOD) != 0) {
- //
- // Determine if this is the expected NB Type
- //
- LogicalCpuid = (EntryOfTables->TblEntryOfODTPattern[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfODTPattern[i])->Header.PackageType;
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_3D_ODTPAT_ENTRY *) ((EntryOfTables->TblEntryOfODTPattern[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfODTPattern[i])->TableSize;
- break;
- }
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfODTPattern[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo ODT table\n");
- return FALSE;
- }
-
- RankTypeOfPopulatedDimm = MemPGetPsRankType (CurrentChannel);
-
- for (i = 0; i < TableSize; i++) {
- MemPConstructRankTypeMap ((UINT16) TblPtr->Dimm0, (UINT16) TblPtr->Dimm1, (UINT16) TblPtr->Dimm2, &RankTypeInTable);
- if ((RankTypeInTable & RankTypeOfPopulatedDimm) == RankTypeOfPopulatedDimm) {
- CurrentChannel->PhyRODTCSHigh = TblPtr->RdODTCSHigh;
- CurrentChannel->PhyRODTCSLow = TblPtr->RdODTCSLow;
- CurrentChannel->PhyWODTCSHigh = TblPtr->WrODTCSHigh;
- CurrentChannel->PhyWODTCSLow = TblPtr->WrODTCSLow;
-
- //WL ODT
- CurrentChannel->PhyWLODT[0] = (UINT8) (CurrentChannel->PhyWODTCSLow & 0x0F);
- CurrentChannel->PhyWLODT[1] = (UINT8) ((CurrentChannel->PhyWODTCSLow >> 16) & 0x0F);
- CurrentChannel->PhyWLODT[2] = (UINT8) (CurrentChannel->PhyWODTCSHigh & 0x0F);
- CurrentChannel->PhyWLODT[3] = (UINT8) ((CurrentChannel->PhyWODTCSHigh >> 16) & 0x0F);
-
- return TRUE;
- }
- TblPtr++;
- }
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo ODT entries\n");
- return FALSE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc10opspd.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc10opspd.c
deleted file mode 100644
index df92a4b535..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc10opspd.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mprc10opspd.c
- *
- * A sub-engine which extracts RC10 operating speed value for RDIMM configuration.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPRC10OPSPD_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetRC10OpSpd (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts RC10 operating speed value from a input table and stores extracted
- * value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Succeed in extracting the table value
- * @return FALSE - Fail to extract the table value
- *
- */
-BOOLEAN
-MemPGetRC10OpSpd (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- UINT8 TableSize;
- UINT32 CurDDRrate;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- PSCFG_OPSPD_ENTRY *TblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- if (CurrentChannel->RegDimmPresent == 0) {
- return TRUE;
- }
-
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to NB type and package type.
- while (EntryOfTables->TblEntryOfRC10OpSpeed[i] != NULL) {
- LogicalCpuid = (EntryOfTables->TblEntryOfRC10OpSpeed[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfRC10OpSpeed[i])->Header.PackageType;
- //
- // Determine if this is the expected NB Type
- //
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_OPSPD_ENTRY *) ((EntryOfTables->TblEntryOfRC10OpSpeed[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfRC10OpSpeed[i])->TableSize;
- break;
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfRC10OpSpeed[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo RC10 Op Speed table\n");
- return FALSE;
- }
-
- CurDDRrate = (UINT32) (1 << (CurrentChannel->DCTPtr->Timings.Speed / 66));
-
- for (i = 0; i < TableSize; i++) {
- if ((TblPtr->DDRrate & CurDDRrate) != 0) {
- NBPtr->PsPtr->RC10OpSpd = TblPtr->OPSPD;
- return TRUE;
- }
- TblPtr++;
- }
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo RC10 Op Speed entries\n");
- return FALSE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc2ibt.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc2ibt.c
deleted file mode 100644
index ac4e345e8e..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprc2ibt.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mprc2ibt.c
- *
- * A sub-engine which extracts RC2[IBT] value for RDIMM configuration.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-#define FILECODE PROC_MEM_PS_MPRC2IBT_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetRC2IBT (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts RC2[IBT] value from a input table and stores extracted
- * value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Table values can be extracted for all present dimms/ranks
- * @return FALSE - Table values cannot be extracted for all present dimms/ranks
- *
- */
-BOOLEAN
-MemPGetRC2IBT (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- UINT8 DimmIndex;
- UINT8 TableSize;
- UINT32 CurDDRrate;
- UINT8 DDR3Voltage;
- UINT16 RankTypeOfPopulatedDimm;
- UINT16 RankTypeInTable;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- UINT8 TgtDimmType;
- UINT8 NumOfReg;
- PSCFG_MR2IBT_ENTRY *TblPtr;
- PSCFG_MR2IBT_ENTRY *OrgTblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- if (CurrentChannel->RegDimmPresent == 0) {
- return TRUE;
- }
-
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to NB type and package type.
- while (EntryOfTables->TblEntryOfRC2IBT[i] != NULL) {
- if (((EntryOfTables->TblEntryOfRC2IBT[i])->Header.NumOfDimm & NOD) != 0) {
- LogicalCpuid = (EntryOfTables->TblEntryOfRC2IBT[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfRC2IBT[i])->Header.PackageType;
- //
- // Determine if this is the expected NB Type
- //
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_MR2IBT_ENTRY *) ((EntryOfTables->TblEntryOfRC2IBT[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfRC2IBT[i])->TableSize;
- break;
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfRC2IBT[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo RC2 IBT table\n");
- return FALSE;
- }
-
- CurDDRrate = (UINT32) (1 << (CurrentChannel->DCTPtr->Timings.Speed / 66));
- DDR3Voltage = (UINT8) (1 << CONVERT_VDDIO_TO_ENCODED (NBPtr->RefPtr->DDR3Voltage));
- RankTypeOfPopulatedDimm = MemPGetPsRankType (CurrentChannel);
-
- OrgTblPtr = TblPtr;
- for (DimmIndex = 0; DimmIndex < MAX_DIMMS_PER_CHANNEL; DimmIndex++) {
- TblPtr = OrgTblPtr;
- NumOfReg = NBPtr->PsPtr->NumOfReg[DimmIndex];
- if ((CurrentChannel->ChDimmValid& (UINT8) (1 << DimmIndex)) != 0) {
- if ((CurrentChannel->DimmQrPresent & (UINT8) (1 << DimmIndex)) != 0) {
- TgtDimmType = DIMM_QR;
- } else if ((CurrentChannel->DimmDrPresent & (UINT8) (1 << DimmIndex)) != 0) {
- TgtDimmType = DIMM_DR;
- } else {
- TgtDimmType = DIMM_SR;
- }
-
- for (i = 0; i < TableSize; i++) {
- MemPConstructRankTypeMap ((UINT16) TblPtr->Dimm0, (UINT16) TblPtr->Dimm1, (UINT16) TblPtr->Dimm2, &RankTypeInTable);
- if (TblPtr->DimmPerCh == MaxDimmPerCh) {
- if ((TblPtr->DDRrate & CurDDRrate) != 0) {
- if ((TblPtr->VDDIO & DDR3Voltage) != 0) {
- if ((RankTypeInTable & RankTypeOfPopulatedDimm) == RankTypeOfPopulatedDimm) {
- if ((TblPtr->Dimm & TgtDimmType) != 0) {
- // If TblPtr->NumOfReg == 0x0F, that means the condition will be TRUE regardless of NumRegisters in DIMM
- if ((TblPtr->NumOfReg == 0xF) || (TblPtr->NumOfReg == NumOfReg)) {
- CurrentChannel->CtrlWrd02[DimmIndex] = (UINT8) ((TblPtr->IBT & 0x1) << 2);
- CurrentChannel->CtrlWrd08[DimmIndex] = (UINT8) ((TblPtr->IBT & 0xE) >> 1);
- break;
- }
- }
- }
- }
- }
- }
- TblPtr++;
- }
- if (i == TableSize) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo RC2 IBT entries\n");
- return FALSE;
- }
- }
- }
-
- return TRUE;
-} \ No newline at end of file
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprtt.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprtt.c
deleted file mode 100644
index 338f2a0301..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mprtt.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mprtt.c
- *
- * A sub-engine which extracts RttNom and RttWr (Dram Term and Dynamic Dram Term) value.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 45233 $ @e \$Date: 2011-01-14 11:58:29 +0800 (Fri, 14 Jan 2011) $
- *
- **/
-/*****************************************************************************
-*
-* 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-
-#define FILECODE PROC_MEM_PS_MPRTT_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-#define _DONT_CARE 0xFF
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetRttNomWr (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts RttNom and RttWr value from a input table and stores extracted
- * value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Table values can be extracted for all present dimms/ranks
- * @return FALSE - Table values cannot be extracted for all present dimms/ranks
- *
- */
-BOOLEAN
-MemPGetRttNomWr (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
- UINT8 i;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- UINT8 TableSize;
- UINT32 CurDDRrate;
- UINT8 DDR3Voltage;
- UINT16 RankTypeOfPopulatedDimm;
- UINT16 RankTypeInTable;
- DIMM_TYPE DimmType;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- UINT8 TgtDimmType;
- UINT8 TgtRank;
- UINT8 Chipsel;
- PSCFG_RTT_ENTRY *TblPtr;
- PSCFG_RTT_ENTRY *OrgTblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- if (CurrentChannel->RegDimmPresent != 0) {
- DimmType = RDIMM_TYPE;
- } else if (CurrentChannel->SODimmPresent != 0) {
- DimmType = SODIMM_TYPE;
- if (FindPSOverrideEntry (NBPtr->RefPtr->PlatformMemoryConfiguration, PSO_SOLDERED_DOWN_SODIMM_TYPE, NBPtr->MCTPtr->SocketId, NBPtr->ChannelPtr->ChannelID) != NULL) {
- DimmType = SODWN_SODIMM_TYPE;
- }
- } else if (CurrentChannel->LrDimmPresent != 0) {
- DimmType = LRDIMM_TYPE;
- } else {
- DimmType = UDIMM_TYPE;
- }
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to Dimm, NB and package type.
- while (EntryOfTables->TblEntryOfDramTerm[i] != NULL) {
- if (((EntryOfTables->TblEntryOfDramTerm[i])->Header.DimmType & DimmType) != 0) {
- if (((EntryOfTables->TblEntryOfDramTerm[i])->Header.NumOfDimm & NOD) != 0) {
- //
- // Determine if this is the expected NB Type
- //
- LogicalCpuid = (EntryOfTables->TblEntryOfDramTerm[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfDramTerm[i])->Header.PackageType;
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_RTT_ENTRY *) ((EntryOfTables->TblEntryOfDramTerm[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfDramTerm[i])->TableSize;
- break;
- }
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfDramTerm[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo RTT table\n");
- return FALSE;
- }
-
- CurDDRrate = (UINT32) (1 << (CurrentChannel->DCTPtr->Timings.Speed / 66));
- DDR3Voltage = (UINT8) (1 << CONVERT_VDDIO_TO_ENCODED (NBPtr->RefPtr->DDR3Voltage));
- RankTypeOfPopulatedDimm = MemPGetPsRankType (CurrentChannel);
-
- OrgTblPtr = TblPtr;
- for (Chipsel = 0; Chipsel < MAX_CS_PER_CHANNEL; Chipsel++) {
- TblPtr = OrgTblPtr;
- if ((NBPtr->DCTPtr->Timings.CsEnabled & (UINT16) (1 << Chipsel)) != 0) {
- if ((CurrentChannel->DimmQrPresent & (UINT8) (1 << (Chipsel >> 1))) != 0) {
- TgtDimmType = DIMM_QR;
- TgtRank = (UINT8) ((Chipsel < 4) ? 1 << (Chipsel & 1) : 4 << (Chipsel & 1));
- } else if ((CurrentChannel->DimmDrPresent & (UINT8) (1 << (Chipsel >> 1))) != 0) {
- TgtDimmType = DIMM_DR;
- TgtRank = (UINT8) 1 << (Chipsel & 1);
- } else {
- TgtDimmType = DIMM_SR;
- TgtRank = (UINT8) 1 << (Chipsel & 1);
- }
-
- if (DimmType == LRDIMM_TYPE) {
- TgtDimmType = _DONT_CARE;
- TgtRank = _DONT_CARE;
- }
-
- for (i = 0; i < TableSize; i++) {
- MemPConstructRankTypeMap ((UINT16) TblPtr->Dimm0, (UINT16) TblPtr->Dimm1, (UINT16) TblPtr->Dimm2, &RankTypeInTable);
- if (TblPtr->DimmPerCh == MaxDimmPerCh) {
- if ((TblPtr->DDRrate & CurDDRrate) != 0) {
- if ((TblPtr->VDDIO & DDR3Voltage) != 0) {
- if ((RankTypeInTable & RankTypeOfPopulatedDimm) == RankTypeOfPopulatedDimm) {
- if (((TblPtr->Dimm & TgtDimmType) != 0) || (TgtDimmType == _DONT_CARE)) {
- if (((TblPtr->Rank & TgtRank) != 0) || (TgtRank == _DONT_CARE)) {
- NBPtr->PsPtr->RttNom[Chipsel] = (UINT8) TblPtr->RttNom;
- NBPtr->PsPtr->RttWr[Chipsel] = (UINT8) TblPtr->RttWr;
- break;
- }
- }
- }
- }
- }
- }
- TblPtr++;
- }
- if ((i == TableSize) && (NBPtr->SharedPtr->VoltageMap == VDDIO_DETERMINED)) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo Rtt entries\n");
- return FALSE;
- }
- }
- }
- return TRUE;
-}
diff --git a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpsao.c b/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpsao.c
deleted file mode 100644
index 95030610f7..0000000000
--- a/src/vendorcode/amd/agesa/f12/Proc/Mem/Ps/mpsao.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* $NoKeywords:$ */
-/**
- * @file
- *
- * mpsao.c
- *
- * A sub-engine which extracts Slow access mode, Address timing and Output driver compensation value.
- *
- * @xrefitem bom "File Content Label" "Release Content"
- * @e project: AGESA
- * @e sub-project: (Mem/Ps)
- * @e \$Revision: 45233 $ @e \$Date: 2011-01-14 11:58:29 +0800 (Fri, 14 Jan 2011) $
- *
- **/
-/*****************************************************************************
-*
-* 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.
-* ***************************************************************************
-*
-*/
-/*
- *----------------------------------------------------------------------------
- * MODULES USED
- *
- *----------------------------------------------------------------------------
- */
-
-
-
-#include "AGESA.h"
-#include "AdvancedApi.h"
-#include "amdlib.h"
-#include "Ids.h"
-#include "cpuFamRegisters.h"
-#include "cpuRegisters.h"
-#include "OptionMemory.h"
-#include "PlatformMemoryConfiguration.h"
-#include "mu.h"
-#include "ma.h"
-#include "mp.h"
-#include "Filecode.h"
-CODE_GROUP (G2_PEI)
-RDATA_GROUP (G2_PEI)
-
-#define FILECODE PROC_MEM_PS_MPSAO_FILECODE
-
-
-/*----------------------------------------------------------------------------
- * DEFINITIONS AND MACROS
- *
- *----------------------------------------------------------------------------
- */
-
-/*----------------------------------------------------------------------------
- * TYPEDEFS AND STRUCTURES
- *
- *----------------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
- * PROTOTYPES OF LOCAL FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-BOOLEAN
-MemPGetSAO (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- );
-
-/*----------------------------------------------------------------------------
- * EXPORTED FUNCTIONS
- *
- *----------------------------------------------------------------------------
- */
-/* -----------------------------------------------------------------------------*/
-/**
- *
- * A sub-function which extracts Slow mode, Address timing and Output driver compensation value
- * from a input table and store those value to a specific address.
- *
- * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
- * @param[in] *EntryOfTables - Pointer to MEM_PSC_TABLE_BLOCK
- *
- * @return TRUE - Table values can be extracted per dimm population and ranks type.
- * @return FALSE - Table values cannot be extracted per dimm population and ranks type.
- *
- */
-BOOLEAN
-MemPGetSAO (
- IN OUT MEM_NB_BLOCK *NBPtr,
- IN MEM_PSC_TABLE_BLOCK *EntryOfTables
- )
-{
-
- UINT8 i;
- UINT8 MaxDimmPerCh;
- UINT8 NOD;
- UINT8 TableSize;
- UINT32 CurDDRrate;
- UINT8 DDR3Voltage;
- UINT16 RankTypeOfPopulatedDimm;
- UINT16 RankTypeInTable;
- DIMM_TYPE DimmType;
- CPU_LOGICAL_ID LogicalCpuid;
- UINT8 PackageType;
- PSCFG_SAO_ENTRY *TblPtr;
- CH_DEF_STRUCT *CurrentChannel;
-
- CurrentChannel = NBPtr->ChannelPtr;
-
- TblPtr = NULL;
- TableSize = 0;
- PackageType = 0;
- LogicalCpuid.Family = (UINT64) AMD_FAMILY_UNKNOWN;
- MaxDimmPerCh = GetMaxDimmsPerChannel (NBPtr->RefPtr->PlatformMemoryConfiguration, NBPtr->MCTPtr->SocketId, CurrentChannel->ChannelID);
- NOD = (UINT8) 1 << (MaxDimmPerCh - 1);
-
- if (CurrentChannel->RegDimmPresent != 0) {
- DimmType = RDIMM_TYPE;
- } else if (CurrentChannel->SODimmPresent != 0) {
- DimmType = SODIMM_TYPE;
- if (FindPSOverrideEntry (NBPtr->RefPtr->PlatformMemoryConfiguration, PSO_SOLDERED_DOWN_SODIMM_TYPE, NBPtr->MCTPtr->SocketId, NBPtr->ChannelPtr->ChannelID) != NULL) {
- DimmType = SODWN_SODIMM_TYPE;
- }
- } else if (CurrentChannel->LrDimmPresent != 0) {
- DimmType = LRDIMM_TYPE;
- } else {
- DimmType = UDIMM_TYPE;
- }
-
- i = 0;
- // Obtain table pointer, table size, Logical Cpuid and PSC type according to Dimm, NB and package type.
- while (EntryOfTables->TblEntryOfSAO[i] != NULL) {
- if (((EntryOfTables->TblEntryOfSAO[i])->Header.DimmType & DimmType) != 0) {
- if (((EntryOfTables->TblEntryOfSAO[i])->Header.NumOfDimm & NOD) != 0) {
- //
- // Determine if this is the expected NB Type
- //
- LogicalCpuid = (EntryOfTables->TblEntryOfSAO[i])->Header.LogicalCpuid;
- PackageType = (EntryOfTables->TblEntryOfSAO[i])->Header.PackageType;
- if (MemPIsIdSupported (NBPtr, LogicalCpuid, PackageType)) {
- TblPtr = (PSCFG_SAO_ENTRY *) ((EntryOfTables->TblEntryOfSAO[i])->TBLPtr);
- TableSize = (EntryOfTables->TblEntryOfSAO[i])->TableSize;
- break;
- }
- }
- }
- i++;
- }
-
- // Check whether no table entry is found.
- if (EntryOfTables->TblEntryOfSAO[i] == NULL) {
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo SlowMode table\n");
- return FALSE;
- }
-
- CurDDRrate = (UINT32) (1 << (CurrentChannel->DCTPtr->Timings.Speed / 66));
- DDR3Voltage = (UINT8) (1 << CONVERT_VDDIO_TO_ENCODED (NBPtr->RefPtr->DDR3Voltage));
- RankTypeOfPopulatedDimm = MemPGetPsRankType (CurrentChannel);
-
- for (i = 0; i < TableSize; i++) {
- MemPConstructRankTypeMap ((UINT16) TblPtr->Dimm0, (UINT16) TblPtr->Dimm1, (UINT16) TblPtr->Dimm2, &RankTypeInTable);
- if (TblPtr->DimmPerCh == MaxDimmPerCh) {
- if ((TblPtr->DDRrate & CurDDRrate) != 0) {
- if ((TblPtr->VDDIO & DDR3Voltage) != 0) {
- if ((RankTypeInTable & RankTypeOfPopulatedDimm) == RankTypeOfPopulatedDimm) {
- CurrentChannel->DctAddrTmg = TblPtr->AddTmgCtl;
- CurrentChannel->DctOdcCtl = TblPtr->ODC;
- CurrentChannel->SlowMode = (TblPtr->SlowMode == 1) ? TRUE : FALSE;
- return TRUE;
- }
- }
- }
- }
- TblPtr++;
- }
- IDS_HDT_CONSOLE (MEM_FLOW, "\nNo SlowMode entries\n");
- if (NBPtr->SharedPtr->VoltageMap != VDDIO_DETERMINED) {
- return TRUE;
- }
-
- return FALSE;
-} \ No newline at end of file