Martin Roth has uploaded this change for review. ( https://review.coreboot.org/21849
Change subject: Stoney Ridge Platforms: Make AGESA callout tables common ......................................................................
Stoney Ridge Platforms: Make AGESA callout tables common
There was no reason to have the AGESA callout tables in each mainboard, so move them to soc/amd/common. The fch_initenv and fch_initreset functions remain in the mainboard code.
BUG=b:67209686 TEST=Build and boot on Kahlee
Change-Id: Ife9bd90be9eb0ce0a7ce41d75cfef979b11e640b Signed-off-by: Martin Roth martinroth@google.com --- M src/mainboard/amd/gardenia/BiosCallOuts.c M src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c M src/mainboard/google/kahlee/BiosCallOuts.c M src/mainboard/google/kahlee/bootblock/BiosCallOuts.c M src/soc/amd/common/BiosCallOuts.h M src/soc/amd/common/def_callouts.c 6 files changed, 48 insertions(+), 86 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/21849/1
diff --git a/src/mainboard/amd/gardenia/BiosCallOuts.c b/src/mainboard/amd/gardenia/BiosCallOuts.c index c947b0c..d077ff7 100644 --- a/src/mainboard/amd/gardenia/BiosCallOuts.c +++ b/src/mainboard/amd/gardenia/BiosCallOuts.c @@ -43,7 +43,7 @@ memset(&FchParams->Imc.EcStruct, 0, sizeof(FCH_EC)); }
-static AGESA_STATUS fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr) +AGESA_STATUS fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr) { AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
@@ -82,37 +82,3 @@
return AGESA_SUCCESS; } - -const BIOS_CALLOUT_STRUCT BiosCallouts[] = { - /* Required callouts */ - {AGESA_ALLOCATE_BUFFER, agesa_AllocateBuffer }, - {AGESA_DEALLOCATE_BUFFER, agesa_DeallocateBuffer }, - {AGESA_DO_RESET, agesa_Reset }, - {AGESA_LOCATE_BUFFER, agesa_LocateBuffer }, - {AGESA_READ_SPD, agesa_ReadSpd }, - {AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp }, - {AGESA_RUNFUNC_ON_ALL_APS, agesa_RunFcnOnAllAps }, - {AMD_LATE_RUN_AP_TASK, agesa_LateRunApTask }, - {AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl }, - {AGESA_WAIT_FOR_ALL_APS, agesa_WaitForAllApsFinished }, - {AGESA_IDLE_AN_AP, agesa_IdleAnAp }, - - /* Optional callouts */ - {AGESA_GET_IDS_INIT_DATA, agesa_EmptyIdsInitData }, - //AgesaHeapRebase - Hook ID? - {AGESA_HOOKBEFORE_DRAM_INIT, agesa_NoopUnsupported }, - {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopUnsupported }, - {AGESA_EXTERNAL_2D_TRAIN_VREF_CHANGE, agesa_NoopUnsupported }, - {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopUnsupported }, - {AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }, - {AGESA_FCH_OEM_CALLOUT, fch_initenv }, - {AGESA_EXTERNAL_VOLTAGE_ADJUST, agesa_NoopUnsupported }, - {AGESA_GNB_PCIE_CLK_REQ, agesa_NoopUnsupported }, - - /* Deprecated */ - {AGESA_HOOKBEFORE_DRAM_INIT_RECOVERY, agesa_NoopUnsupported}, - {AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported }, - -}; - -const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); diff --git a/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c b/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c index 1b7a341..d0dfbf4 100644 --- a/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c +++ b/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c @@ -45,7 +45,7 @@ {-1} };
-static AGESA_STATUS fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr) +AGESA_STATUS fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr) { AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
@@ -61,10 +61,3 @@
return AGESA_SUCCESS; } - -const BIOS_CALLOUT_STRUCT BiosCallouts[] = { - {AGESA_FCH_OEM_CALLOUT, fch_initreset }, - {AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl } -}; - -const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); diff --git a/src/mainboard/google/kahlee/BiosCallOuts.c b/src/mainboard/google/kahlee/BiosCallOuts.c index 2e57166..681946f 100644 --- a/src/mainboard/google/kahlee/BiosCallOuts.c +++ b/src/mainboard/google/kahlee/BiosCallOuts.c @@ -21,7 +21,7 @@
extern const GPIO_CONTROL oem_kahlee_gpio[];
-static AGESA_STATUS fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr) +AGESA_STATUS fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr) { AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
@@ -63,37 +63,3 @@
return AGESA_SUCCESS; } - -const BIOS_CALLOUT_STRUCT BiosCallouts[] = { - /* Required callouts */ - {AGESA_ALLOCATE_BUFFER, agesa_AllocateBuffer }, - {AGESA_DEALLOCATE_BUFFER, agesa_DeallocateBuffer }, - {AGESA_DO_RESET, agesa_Reset }, - {AGESA_LOCATE_BUFFER, agesa_LocateBuffer }, - {AGESA_READ_SPD, agesa_ReadSpd }, - {AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp }, - {AGESA_RUNFUNC_ON_ALL_APS, agesa_RunFcnOnAllAps }, - {AMD_LATE_RUN_AP_TASK, agesa_LateRunApTask }, - {AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl }, - {AGESA_WAIT_FOR_ALL_APS, agesa_WaitForAllApsFinished }, - {AGESA_IDLE_AN_AP, agesa_IdleAnAp }, - - /* Optional callouts */ - {AGESA_GET_IDS_INIT_DATA, agesa_EmptyIdsInitData }, - //AgesaHeapRebase - Hook ID? - {AGESA_HOOKBEFORE_DRAM_INIT, agesa_NoopUnsupported }, - {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopUnsupported }, - {AGESA_EXTERNAL_2D_TRAIN_VREF_CHANGE, agesa_NoopUnsupported }, - {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopUnsupported }, - {AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }, - {AGESA_FCH_OEM_CALLOUT, fch_initenv }, - {AGESA_EXTERNAL_VOLTAGE_ADJUST, agesa_NoopUnsupported }, - {AGESA_GNB_PCIE_CLK_REQ, agesa_NoopUnsupported }, - - /* Deprecated */ - {AGESA_HOOKBEFORE_DRAM_INIT_RECOVERY, agesa_NoopUnsupported}, - {AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported }, - -}; - -const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); diff --git a/src/mainboard/google/kahlee/bootblock/BiosCallOuts.c b/src/mainboard/google/kahlee/bootblock/BiosCallOuts.c index 4dce042..a86a0e8 100644 --- a/src/mainboard/google/kahlee/bootblock/BiosCallOuts.c +++ b/src/mainboard/google/kahlee/bootblock/BiosCallOuts.c @@ -21,7 +21,7 @@
extern const GPIO_CONTROL oem_kahlee_gpio[];
-static AGESA_STATUS fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr) +AGESA_STATUS fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr) { AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
@@ -37,10 +37,3 @@
return AGESA_SUCCESS; } - -const BIOS_CALLOUT_STRUCT BiosCallouts[] = { - {AGESA_FCH_OEM_CALLOUT, fch_initreset }, - {AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl } -}; - -const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); diff --git a/src/soc/amd/common/BiosCallOuts.h b/src/soc/amd/common/BiosCallOuts.h index c2c5556..846977c 100644 --- a/src/soc/amd/common/BiosCallOuts.h +++ b/src/soc/amd/common/BiosCallOuts.h @@ -60,6 +60,9 @@
AGESA_STATUS GetBiosCallout(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+AGESA_STATUS fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr); +AGESA_STATUS fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr); + typedef struct { UINT32 CalloutName; CALLOUT_ENTRY CalloutPtr; diff --git a/src/soc/amd/common/def_callouts.c b/src/soc/amd/common/def_callouts.c index 4b71d5b..ec16f3d 100644 --- a/src/soc/amd/common/def_callouts.c +++ b/src/soc/amd/common/def_callouts.c @@ -25,6 +25,47 @@ #include <dimmSpd.h> #include <soc/southbridge.h>
+#ifdef __BOOTBLOCK__ +const BIOS_CALLOUT_STRUCT BiosCallouts[] = { + {AGESA_FCH_OEM_CALLOUT, fch_initreset }, + {AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl } +}; +#else +const BIOS_CALLOUT_STRUCT BiosCallouts[] = { + /* Required callouts */ + {AGESA_ALLOCATE_BUFFER, agesa_AllocateBuffer }, + {AGESA_DEALLOCATE_BUFFER, agesa_DeallocateBuffer }, + {AGESA_DO_RESET, agesa_Reset }, + {AGESA_LOCATE_BUFFER, agesa_LocateBuffer }, + {AGESA_READ_SPD, agesa_ReadSpd }, + {AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp }, + {AGESA_RUNFUNC_ON_ALL_APS, agesa_RunFcnOnAllAps }, + {AMD_LATE_RUN_AP_TASK, agesa_LateRunApTask }, + {AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl }, + {AGESA_WAIT_FOR_ALL_APS, agesa_WaitForAllApsFinished }, + {AGESA_IDLE_AN_AP, agesa_IdleAnAp }, + + /* Optional callouts */ + {AGESA_GET_IDS_INIT_DATA, agesa_EmptyIdsInitData }, + //AgesaHeapRebase - Hook ID? + {AGESA_HOOKBEFORE_DRAM_INIT, agesa_NoopUnsupported }, + {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopUnsupported }, + {AGESA_EXTERNAL_2D_TRAIN_VREF_CHANGE, agesa_NoopUnsupported }, + {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopUnsupported }, + {AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }, + {AGESA_FCH_OEM_CALLOUT, fch_initenv }, + {AGESA_EXTERNAL_VOLTAGE_ADJUST, agesa_NoopUnsupported }, + {AGESA_GNB_PCIE_CLK_REQ, agesa_NoopUnsupported }, + + /* Deprecated */ + {AGESA_HOOKBEFORE_DRAM_INIT_RECOVERY, agesa_NoopUnsupported}, + {AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported }, + +}; +#endif + +const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); + AGESA_STATUS GetBiosCallout(UINT32 Func, UINTN Data, VOID *ConfigPtr) { UINTN i;