[coreboot-gerrit] New patch to review for coreboot: fd6bfb4 AGESA: Add OemCustomize hooks structure

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Tue Dec 16 19:30:20 CET 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7824

-gerrit

commit fd6bfb491e4ff2491262ead8103503428fa5b4ce
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Tue Dec 16 07:34:58 2014 +0200

    AGESA: Add OemCustomize hooks structure
    
    We should potentially provide an OEM platform hook to manipulate parameters
    around any entry point to AGESA. Use structure for such ops to avoid weak
    functions and lots of empty function stubs.
    
    Change-Id: I99bf7de8a1e2f183399d2216520a45d0c24fd64c
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/mainboard/amd/dinar/buildOpts.c                | 12 ++++++++++++
 src/mainboard/amd/inagua/PlatformGnbPcie.c         | 11 +++++++----
 src/mainboard/amd/olivehill/PlatformGnbPcie.c      | 11 +++++++----
 src/mainboard/amd/parmer/PlatformGnbPcie.c         | 11 +++++++----
 src/mainboard/amd/persimmon/PlatformGnbPcie.c      | 11 +++++++----
 src/mainboard/amd/south_station/PlatformGnbPcie.c  | 11 +++++++----
 src/mainboard/amd/thatcher/PlatformGnbPcie.c       | 11 +++++++----
 src/mainboard/amd/torpedo/PlatformGnbPcie.c        | 11 +++++++----
 src/mainboard/amd/union_station/PlatformGnbPcie.c  | 11 +++++++----
 src/mainboard/asrock/e350m1/PlatformGnbPcie.c      | 11 +++++++----
 src/mainboard/asrock/imb-a180/PlatformGnbPcie.c    | 11 +++++++----
 src/mainboard/asus/f2a85-m/PlatformGnbPcie.c       | 11 +++++++----
 src/mainboard/gizmosphere/gizmo/PlatformGnbPcie.c  | 11 +++++++----
 src/mainboard/gizmosphere/gizmo2/PlatformGnbPcie.c | 11 +++++++----
 .../hp/pavilion_m6_1035dx/PlatformGnbPcie.c        | 11 +++++++----
 src/mainboard/lenovo/g505s/PlatformGnbPcie.c       | 11 +++++++----
 .../lippert/frontrunner-af/PlatformGnbPcie.c       | 11 +++++++----
 src/mainboard/lippert/toucan-af/PlatformGnbPcie.c  | 11 +++++++----
 src/mainboard/supermicro/h8qgi/buildOpts.c         |  3 +++
 src/mainboard/supermicro/h8scm/buildOpts.c         |  3 +++
 src/mainboard/tyan/s8226/buildOpts.c               |  3 +++
 src/northbridge/amd/agesa/agesawrapper.h           | 22 ++++++++++++++++++++--
 src/northbridge/amd/agesa/family15/agesawrapper.c  | 14 --------------
 23 files changed, 160 insertions(+), 84 deletions(-)

diff --git a/src/mainboard/amd/dinar/buildOpts.c b/src/mainboard/amd/dinar/buildOpts.c
index 88e3c6f..16d69d3 100644
--- a/src/mainboard/amd/dinar/buildOpts.c
+++ b/src/mainboard/amd/dinar/buildOpts.c
@@ -552,3 +552,15 @@ UINT8 SizeOfTableHy = ARRAY_SIZE(AGESA_MEM_TABLE_HY);
 //  /* platform code to read an SPD...  */
 //  return Status;
 //}
+
+static AGESA_STATUS OemInitPost(AMD_POST_PARAMS *InitPost)
+{
+	InitPost->MemConfig.UmaMode = UMA_AUTO;
+	InitPost->MemConfig.BottomIo = 0xE0;
+	InitPost->MemConfig.UmaSize = 0xE0-0xC0;
+	return AGESA_SUCCESS;
+}
+
+const struct OEM_HOOK OemCustomize = {
+	.InitPost = OemInitPost,
+};
diff --git a/src/mainboard/amd/inagua/PlatformGnbPcie.c b/src/mainboard/amd/inagua/PlatformGnbPcie.c
index b7d9d5b..c3f9d9a 100644
--- a/src/mainboard/amd/inagua/PlatformGnbPcie.c
+++ b/src/mainboard/amd/inagua/PlatformGnbPcie.c
@@ -41,10 +41,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-		IN	OUT AMD_EARLY_PARAMS	*InitEarly
-		)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS		 Status;
 	VOID				 *BrazosPcieComplexListPtr;
@@ -132,4 +130,9 @@ OemCustomizeInitEarly (
 
 	InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
 	InitEarly->GnbConfig.PsppPolicy      = 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/olivehill/PlatformGnbPcie.c b/src/mainboard/amd/olivehill/PlatformGnbPcie.c
index e9eef35..e959925 100644
--- a/src/mainboard/amd/olivehill/PlatformGnbPcie.c
+++ b/src/mainboard/amd/olivehill/PlatformGnbPcie.c
@@ -123,10 +123,8 @@ static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS            Status;
 	PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
@@ -148,4 +146,9 @@ OemCustomizeInitEarly (
 	PcieComplexListPtr  =  (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
 	LibAmdMemCopy  (PcieComplexListPtr, &PcieComplex, sizeof(PcieComplex), &InitEarly->StdHeader);
 	InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/parmer/PlatformGnbPcie.c b/src/mainboard/amd/parmer/PlatformGnbPcie.c
index e8d1b07..91326ef 100644
--- a/src/mainboard/amd/parmer/PlatformGnbPcie.c
+++ b/src/mainboard/amd/parmer/PlatformGnbPcie.c
@@ -160,10 +160,8 @@ static const PCIe_DDI_DESCRIPTOR DdiList [] = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS            Status;
 	PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
@@ -195,4 +193,9 @@ OemCustomizeInitEarly (
 	PcieComplexListPtr->DdiLinkList  = DdiList;
 
 	InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/persimmon/PlatformGnbPcie.c b/src/mainboard/amd/persimmon/PlatformGnbPcie.c
index 6357021..c13a383 100644
--- a/src/mainboard/amd/persimmon/PlatformGnbPcie.c
+++ b/src/mainboard/amd/persimmon/PlatformGnbPcie.c
@@ -39,10 +39,8 @@
  *	@retval		 VOID
  *
  **/
-VOID
-OemCustomizeInitEarly (
-	IN	OUT AMD_EARLY_PARAMS	*InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS		 Status;
 	VOID				 *BrazosPcieComplexListPtr;
@@ -138,4 +136,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
 	InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
 	InitEarly->GnbConfig.PsppPolicy		= 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/south_station/PlatformGnbPcie.c b/src/mainboard/amd/south_station/PlatformGnbPcie.c
index ee7f90c..ca33c6b 100644
--- a/src/mainboard/amd/south_station/PlatformGnbPcie.c
+++ b/src/mainboard/amd/south_station/PlatformGnbPcie.c
@@ -41,10 +41,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-  IN  OUT AMD_EARLY_PARAMS    *InitEarly
-  )
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
   AGESA_STATUS         Status;
   VOID                 *BrazosPcieComplexListPtr;
@@ -140,4 +138,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
   InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
   InitEarly->GnbConfig.PsppPolicy      = 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/thatcher/PlatformGnbPcie.c b/src/mainboard/amd/thatcher/PlatformGnbPcie.c
index 28f1687..4a985d1 100644
--- a/src/mainboard/amd/thatcher/PlatformGnbPcie.c
+++ b/src/mainboard/amd/thatcher/PlatformGnbPcie.c
@@ -166,10 +166,8 @@ static const PCIe_COMPLEX_DESCRIPTOR Trinity = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS         Status;
 	VOID                 *TrinityPcieComplexListPtr;
@@ -221,4 +219,9 @@ OemCustomizeInitEarly (
 	((PCIe_COMPLEX_DESCRIPTOR*)TrinityPcieComplexListPtr)->DdiLinkList  =  (PCIe_DDI_DESCRIPTOR*)TrinityPcieDdiPtr;
 
 	InitEarly->GnbConfig.PcieComplexList = TrinityPcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/torpedo/PlatformGnbPcie.c b/src/mainboard/amd/torpedo/PlatformGnbPcie.c
index 7a69fd6..893b48b 100644
--- a/src/mainboard/amd/torpedo/PlatformGnbPcie.c
+++ b/src/mainboard/amd/torpedo/PlatformGnbPcie.c
@@ -108,10 +108,8 @@ static const PCIe_COMPLEX_DESCRIPTOR Llano = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-  IN  OUT AMD_EARLY_PARAMS    *InitEarly
-  )
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
   AGESA_STATUS         Status;
   VOID                 *LlanoPcieComplexListPtr;
@@ -165,4 +163,9 @@ OemCustomizeInitEarly (
 
   InitEarly->GnbConfig.PcieComplexList = LlanoPcieComplexListPtr;
   InitEarly->GnbConfig.PsppPolicy      = 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/amd/union_station/PlatformGnbPcie.c b/src/mainboard/amd/union_station/PlatformGnbPcie.c
index 1bd602d..68ac8b6 100644
--- a/src/mainboard/amd/union_station/PlatformGnbPcie.c
+++ b/src/mainboard/amd/union_station/PlatformGnbPcie.c
@@ -45,10 +45,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-  IN  OUT AMD_EARLY_PARAMS    *InitEarly
-  )
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
   AGESA_STATUS         Status;
   VOID                 *BrazosPcieComplexListPtr;
@@ -146,4 +144,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
   InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
   InitEarly->GnbConfig.PsppPolicy      = 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/asrock/e350m1/PlatformGnbPcie.c b/src/mainboard/asrock/e350m1/PlatformGnbPcie.c
index 21d0f8d..b591642 100644
--- a/src/mainboard/asrock/e350m1/PlatformGnbPcie.c
+++ b/src/mainboard/asrock/e350m1/PlatformGnbPcie.c
@@ -45,10 +45,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-  IN  OUT AMD_EARLY_PARAMS    *InitEarly
-  )
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
   AGESA_STATUS         Status;
   VOID                 *BrazosPcieComplexListPtr;
@@ -146,4 +144,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
   InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
   InitEarly->GnbConfig.PsppPolicy      = 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/asrock/imb-a180/PlatformGnbPcie.c b/src/mainboard/asrock/imb-a180/PlatformGnbPcie.c
index 4f8bc82..cd3fdd6 100644
--- a/src/mainboard/asrock/imb-a180/PlatformGnbPcie.c
+++ b/src/mainboard/asrock/imb-a180/PlatformGnbPcie.c
@@ -123,10 +123,8 @@ static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS            Status;
 	PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
@@ -148,4 +146,9 @@ OemCustomizeInitEarly (
 	PcieComplexListPtr  =  (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
 	LibAmdMemCopy  (PcieComplexListPtr, &PcieComplex, sizeof(PcieComplex), &InitEarly->StdHeader);
 	InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/asus/f2a85-m/PlatformGnbPcie.c b/src/mainboard/asus/f2a85-m/PlatformGnbPcie.c
index 84936ea..ecfe926 100644
--- a/src/mainboard/asus/f2a85-m/PlatformGnbPcie.c
+++ b/src/mainboard/asus/f2a85-m/PlatformGnbPcie.c
@@ -142,10 +142,8 @@ static const PCIe_COMPLEX_DESCRIPTOR Trinity = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS         Status;
 	VOID                 *TrinityPcieComplexListPtr;
@@ -196,4 +194,9 @@ OemCustomizeInitEarly (
 	((PCIe_COMPLEX_DESCRIPTOR*)TrinityPcieComplexListPtr)->DdiLinkList  =  (PCIe_DDI_DESCRIPTOR*)TrinityPcieDdiPtr;
 
 	InitEarly->GnbConfig.PcieComplexList = TrinityPcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/gizmosphere/gizmo/PlatformGnbPcie.c b/src/mainboard/gizmosphere/gizmo/PlatformGnbPcie.c
index aae1c10..3e86817 100644
--- a/src/mainboard/gizmosphere/gizmo/PlatformGnbPcie.c
+++ b/src/mainboard/gizmosphere/gizmo/PlatformGnbPcie.c
@@ -44,10 +44,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN	OUT AMD_EARLY_PARAMS	*InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS		 Status;
 	VOID				 *BrazosPcieComplexListPtr;
@@ -143,4 +141,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
 	InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
 	InitEarly->GnbConfig.PsppPolicy		= 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/gizmosphere/gizmo2/PlatformGnbPcie.c b/src/mainboard/gizmosphere/gizmo2/PlatformGnbPcie.c
index d48aa9f..f27a1c3 100644
--- a/src/mainboard/gizmosphere/gizmo2/PlatformGnbPcie.c
+++ b/src/mainboard/gizmosphere/gizmo2/PlatformGnbPcie.c
@@ -117,10 +117,8 @@ static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS            Status;
 	PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
@@ -142,4 +140,9 @@ OemCustomizeInitEarly (
 	PcieComplexListPtr  =  (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
 	LibAmdMemCopy  (PcieComplexListPtr, &PcieComplex, sizeof(PcieComplex), &InitEarly->StdHeader);
 	InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c b/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c
index 920afc4..4522379 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c
@@ -159,10 +159,8 @@ static const PCIe_DDI_DESCRIPTOR DdiList [] = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS            Status;
 	PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
@@ -194,4 +192,9 @@ OemCustomizeInitEarly (
 	PcieComplexListPtr->DdiLinkList  = DdiList;
 
 	InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/lenovo/g505s/PlatformGnbPcie.c b/src/mainboard/lenovo/g505s/PlatformGnbPcie.c
index 920afc4..4522379 100644
--- a/src/mainboard/lenovo/g505s/PlatformGnbPcie.c
+++ b/src/mainboard/lenovo/g505s/PlatformGnbPcie.c
@@ -159,10 +159,8 @@ static const PCIe_DDI_DESCRIPTOR DdiList [] = {
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN  OUT AMD_EARLY_PARAMS    *InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS            Status;
 	PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
@@ -194,4 +192,9 @@ OemCustomizeInitEarly (
 	PcieComplexListPtr->DdiLinkList  = DdiList;
 
 	InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/lippert/frontrunner-af/PlatformGnbPcie.c b/src/mainboard/lippert/frontrunner-af/PlatformGnbPcie.c
index 6bd2b1c..ae79dc8 100644
--- a/src/mainboard/lippert/frontrunner-af/PlatformGnbPcie.c
+++ b/src/mainboard/lippert/frontrunner-af/PlatformGnbPcie.c
@@ -45,10 +45,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN	OUT AMD_EARLY_PARAMS	*InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS		 Status;
 	VOID				 *BrazosPcieComplexListPtr;
@@ -144,4 +142,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
 	InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
 	InitEarly->GnbConfig.PsppPolicy		= 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/lippert/toucan-af/PlatformGnbPcie.c b/src/mainboard/lippert/toucan-af/PlatformGnbPcie.c
index 3584280..16d1b4a 100644
--- a/src/mainboard/lippert/toucan-af/PlatformGnbPcie.c
+++ b/src/mainboard/lippert/toucan-af/PlatformGnbPcie.c
@@ -45,10 +45,8 @@
  *
  **/
 /*---------------------------------------------------------------------------------------*/
-VOID
-OemCustomizeInitEarly (
-	IN	OUT AMD_EARLY_PARAMS	*InitEarly
-	)
+
+static AGESA_STATUS OemInitEarly(AMD_EARLY_PARAMS * InitEarly)
 {
 	AGESA_STATUS		 Status;
 	VOID				 *BrazosPcieComplexListPtr;
@@ -144,4 +142,9 @@ PCIe_COMPLEX_DESCRIPTOR Brazos = {
 
 	InitEarly->GnbConfig.PcieComplexList = BrazosPcieComplexListPtr;
 	InitEarly->GnbConfig.PsppPolicy		= 0;
+	return AGESA_SUCCESS;
 }
+
+const struct OEM_HOOK OemCustomize = {
+	.InitEarly = OemInitEarly,
+};
diff --git a/src/mainboard/supermicro/h8qgi/buildOpts.c b/src/mainboard/supermicro/h8qgi/buildOpts.c
index 40dbc57..7b97ebe 100644
--- a/src/mainboard/supermicro/h8qgi/buildOpts.c
+++ b/src/mainboard/supermicro/h8qgi/buildOpts.c
@@ -615,3 +615,6 @@ UINT8 AGESA_MEM_TABLE_HY[][sizeof (MEM_TABLE_ALIAS)] =
 	NBACCESS (MTEnd, 0,  0, 0, 0, 0),      // End of Table
 };
 UINT8 SizeOfTableHy = ARRAY_SIZE(AGESA_MEM_TABLE_HY);
+
+const struct OEM_HOOK OemCustomize = {
+};
diff --git a/src/mainboard/supermicro/h8scm/buildOpts.c b/src/mainboard/supermicro/h8scm/buildOpts.c
index 95dffaa..2ccb92d 100644
--- a/src/mainboard/supermicro/h8scm/buildOpts.c
+++ b/src/mainboard/supermicro/h8scm/buildOpts.c
@@ -519,3 +519,6 @@ UINT8 AGESA_MEM_TABLE_HY[][sizeof (MEM_TABLE_ALIAS)] =
 	NBACCESS (MTEnd, 0,  0, 0, 0, 0),      // End of Table
 };
 UINT8 SizeOfTableHy = ARRAY_SIZE(AGESA_MEM_TABLE_HY);
+
+const struct OEM_HOOK OemCustomize = {
+};
diff --git a/src/mainboard/tyan/s8226/buildOpts.c b/src/mainboard/tyan/s8226/buildOpts.c
index da368c8..66bb8b6 100644
--- a/src/mainboard/tyan/s8226/buildOpts.c
+++ b/src/mainboard/tyan/s8226/buildOpts.c
@@ -615,3 +615,6 @@ UINT8 AGESA_MEM_TABLE_HY[][sizeof (MEM_TABLE_ALIAS)] =
 	NBACCESS (MTEnd, 0,  0, 0, 0, 0),      // End of Table
 };
 UINT8 SizeOfTableHy = ARRAY_SIZE(AGESA_MEM_TABLE_HY);
+
+const struct OEM_HOOK OemCustomize = {
+};
diff --git a/src/northbridge/amd/agesa/agesawrapper.h b/src/northbridge/amd/agesa/agesawrapper.h
index dfb8c74..8147f85 100644
--- a/src/northbridge/amd/agesa/agesawrapper.h
+++ b/src/northbridge/amd/agesa/agesawrapper.h
@@ -59,7 +59,25 @@ void *agesawrapper_getlateinitptr (int pick);
 AGESA_STATUS agesawrapper_fchs3earlyrestore(void);
 AGESA_STATUS agesawrapper_fchs3laterestore(void);
 
-void OemCustomizeInitEarly(AMD_EARLY_PARAMS *InitEarly);
-void OemCustomizeInitPost(AMD_POST_PARAMS *InitPost);
+struct OEM_HOOK
+{
+	/* romstage */
+	AGESA_STATUS (*InitEarly)(AMD_EARLY_PARAMS *);
+	AGESA_STATUS (*InitPost)(AMD_POST_PARAMS *);
+};
+
+extern const struct OEM_HOOK OemCustomize;
+
+static inline void OemCustomizeInitEarly(AMD_EARLY_PARAMS *EarlyParams)
+{
+	if (OemCustomize.InitEarly)
+		OemCustomize.InitEarly(EarlyParams);
+}
+
+static inline void OemCustomizeInitPost(AMD_POST_PARAMS *PostParams)
+{
+	if (OemCustomize.InitPost)
+		OemCustomize.InitPost(PostParams);
+}
 
 #endif /* _AGESAWRAPPER_H_ */
diff --git a/src/northbridge/amd/agesa/family15/agesawrapper.c b/src/northbridge/amd/agesa/family15/agesawrapper.c
index 9b62d3f..e7ce838 100644
--- a/src/northbridge/amd/agesa/family15/agesawrapper.c
+++ b/src/northbridge/amd/agesa/family15/agesawrapper.c
@@ -35,20 +35,6 @@
 
 #define FILECODE UNASSIGNED_FILE_FILECODE
 
-/* TODO: Function body should be in mainboard directory. */
-void OemCustomizeInitEarly(AMD_EARLY_PARAMS *InitEarly)
-{
-}
-
-void OemCustomizeInitPost(AMD_POST_PARAMS *InitPost)
-{
-#if IS_ENABLED(CONFIG_BOARD_AMD_DINAR)
-	InitPost->MemConfig.UmaMode = UMA_AUTO;
-	InitPost->MemConfig.BottomIo = 0xE0;
-	InitPost->MemConfig.UmaSize = 0xE0-0xC0;
-#endif
-}
-
 AGESA_STATUS agesawrapper_amdinitreset(void)
 {
 	AGESA_STATUS status = AGESA_SUCCESS;



More information about the coreboot-gerrit mailing list