diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-19 08:41:50 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-20 12:47:44 +0000 |
commit | 5be75d5311695316f0d34448b98299cbe8b91ea5 (patch) | |
tree | 4c51d81915c6575fc169ac51635f4875d212ed4e /src/drivers | |
parent | 830e0de40187183c34a1f558d83b65068b649e2a (diff) | |
download | coreboot-5be75d5311695316f0d34448b98299cbe8b91ea5.tar.xz |
AGESA,binaryPI: Replace use of __PRE_RAM__
Change-Id: Id878fd33ec3d2de640d9a488058a805be3ccd223
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34997
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/amd/agesa/def_callouts.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/drivers/amd/agesa/def_callouts.c b/src/drivers/amd/agesa/def_callouts.c index fa41500e40..d247e51240 100644 --- a/src/drivers/amd/agesa/def_callouts.c +++ b/src/drivers/amd/agesa/def_callouts.c @@ -160,18 +160,19 @@ AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData, VOID *ConfigPrt) AGESA_STATUS agesa_ReadSpd (UINT32 Func, UINTN Data, VOID *ConfigPtr) { - AGESA_STATUS Status = AGESA_UNSUPPORTED; -#ifdef __PRE_RAM__ - Status = AmdMemoryReadSPD (Func, Data, ConfigPtr); -#endif - return Status; + if (!ENV_ROMSTAGE) + return AGESA_UNSUPPORTED; + + return AmdMemoryReadSPD (Func, Data, ConfigPtr); } AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr) { - AGESA_STATUS Status = AGESA_UNSUPPORTED; -#ifdef __PRE_RAM__ AGESA_READ_SPD_PARAMS *info = ConfigPtr; + + if (!ENV_ROMSTAGE) + return AGESA_UNSUPPORTED; + if (info->MemChannelId > 0) return AGESA_UNSUPPORTED; if (info->SocketId != 0) @@ -183,9 +184,7 @@ AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr) if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, 0) < 0) die("No SPD data\n"); - Status = AGESA_SUCCESS; -#endif - return Status; + return AGESA_SUCCESS; } #if HAS_AGESA_FCH_OEM_CALLOUT |