aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdmct/wrappers/mcti.h
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2016-11-28 00:29:10 +1100
committerMartin Roth <martinroth@google.com>2017-01-04 18:56:01 +0100
commit75a3d1fb7c31bc5bd287bf6579ff70c5da9275a7 (patch)
tree618c2bc04f44cf73d3dae288bff0a5e2ef44d616 /src/northbridge/amd/amdmct/wrappers/mcti.h
parent6c20b65849aeda664cc40ebc0f0bab2e99768423 (diff)
amdfam10: Perform major include ".c" cleanup
Previously, all romstages for this northbridge family would compile via 1 single C file with everything included into the romstage.c file (!) This patch separates the build into separate .o modules and links them accordingly. Currently compiles and links all fam10 roms without breaking other roms. Both DDR2 and DDR3 have been completed TESTED on REACTS: passes all boot tests for 2 boards ASUS KGPE-D16 ASUS KFSN4-DRE Some extra changes were required to make it compile otherwise there were unused functions in included "c" files. This is because I needed to exchange CIMX for the native southbridge routines. See in particular: advansus/a785e-i asus/m5a88-v avalue/eax-785e A followup patch may be required to fix the above boards. See FIXME, XXX tags Change-Id: Id0f9849578fd0f8b1eab83aed910902c27354426 Signed-off-by: Damien Zammit <damien@zamaudio.com> Reviewed-on: https://review.coreboot.org/17625 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Reviewed-by: Timothy Pearson <tpearson@raptorengineering.com>
Diffstat (limited to 'src/northbridge/amd/amdmct/wrappers/mcti.h')
-rw-r--r--src/northbridge/amd/amdmct/wrappers/mcti.h78
1 files changed, 76 insertions, 2 deletions
diff --git a/src/northbridge/amd/amdmct/wrappers/mcti.h b/src/northbridge/amd/amdmct/wrappers/mcti.h
index 5eaff2c75a..db92fa789e 100644
--- a/src/northbridge/amd/amdmct/wrappers/mcti.h
+++ b/src/northbridge/amd/amdmct/wrappers/mcti.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 2007 Advanced Micro Devices, Inc.
* Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
+ * Copyright (C) 2016 Damien Zammit <damien@zamaudio.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,6 +15,15 @@
* GNU General Public License for more details.
*/
+#ifndef MCTI_H
+#define MCTI_H
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <pc80/mc146818rtc.h>
+
+struct DCTStatStruc;
+struct MCTStatStruc;
#define SERVER 0
#define DESKTOP 1
@@ -22,7 +32,6 @@
#define REV_DR 1
#define REV_FDR 2
-
/*----------------------------------------------------------------------------
COMMENT OUT ALL BUT 1
----------------------------------------------------------------------------*/
@@ -63,7 +72,7 @@ UPDATE AS NEEDED
#endif
#ifndef MEM_MAX_LOAD_FREQ
-#if (CONFIG_DIMM_SUPPORT & 0x000F) == 0x0005 /* AMD_FAM10_DDR3 */
+#if IS_ENABLED(CONFIG_DIMM_DDR3)
#define MEM_MAX_LOAD_FREQ 933
#define MEM_MIN_PLATFORM_FREQ_FAM10 400
#define MEM_MIN_PLATFORM_FREQ_FAM15 333
@@ -77,3 +86,68 @@ UPDATE AS NEEDED
#define MCT_TRNG_KEEPOUT_START 0x00000C00
#define MCT_TRNG_KEEPOUT_END 0x00000CFF
+
+#define NVRAM_DDR2_800 0
+#define NVRAM_DDR2_667 1
+#define NVRAM_DDR2_533 2
+#define NVRAM_DDR2_400 3
+
+#define NVRAM_DDR3_1600 0
+#define NVRAM_DDR3_1333 1
+#define NVRAM_DDR3_1066 2
+#define NVRAM_DDR3_800 3
+
+/* The recommended maximum GFX Upper Memory Area
+ * size is 256M, however, to be on the safe side
+ * move TOM down by 512M.
+ */
+#define MAXIMUM_GFXUMA_SIZE 0x20000000
+
+/* Do not allow less than 16M of DRAM in 32-bit space.
+ * This number is not hardware constrained and can be
+ * changed as needed.
+ */
+#define MINIMUM_DRAM_BELOW_4G 0x1000000
+
+static const uint16_t ddr2_limits[4] = {400, 333, 266, 200};
+static const uint16_t ddr3_limits[16] = {933, 800, 666, 533, 400, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+#if IS_ENABLED(CONFIG_DIMM_DDR3)
+ #include <northbridge/amd/amdmct/mct_ddr3/mct_d.h>
+#else
+ #include <northbridge/amd/amdmct/mct/mct_d.h>
+#endif
+
+#if IS_ENABLED(CONFIG_DIMM_DDR2)
+void mctSaveDQSSigTmg_D(void);
+void mctGetDQSSigTmg_D(void);
+u8 mctSetNodeBoundary_D(void);
+#endif
+u16 mctGet_NVbits(u8 index);
+void mctHookAfterDIMMpre(void);
+void mctGet_MaxLoadFreq(struct DCTStatStruc *pDCTstat);
+void mctAdjustAutoCycTmg_D(void);
+void mctHookAfterAutoCycTmg(void);
+void mctGetCS_ExcludeMap(void);
+void mctHookBeforeECC(void);
+void mctHookAfterECC(void);
+void mctHookAfterAutoCfg(void);
+void mctHookAfterPSCfg(void);
+void mctHookAfterHTMap(void);
+void mctHookAfterCPU(void);
+void mctInitMemGPIOs_A_D(void);
+void mctNodeIDDebugPort_D(void);
+void mctWarmReset_D(void);
+void mctHookBeforeDramInit(void);
+void mctHookAfterDramInit(void);
+void mctHookBeforeAnyTraining(struct MCTStatStruc *pMCTstat, struct DCTStatStruc *pDCTstatA);
+void mctHookAfterAnyTraining(void);
+uint64_t mctGetLogicalCPUID_D(u8 node);
+
+#if IS_ENABLED(CONFIG_DIMM_DDR3)
+void vErratum372(struct DCTStatStruc *pDCTstat);
+void vErratum414(struct DCTStatStruc *pDCTstat);
+u32 mct_AdjustSPDTimings(struct MCTStatStruc *pMCTstat, struct DCTStatStruc *pDCTstatA, u32 val);
+#endif
+
+#endif