diff options
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/amd/bettong/BiosCallOuts.c | 8 | ||||
-rw-r--r-- | src/mainboard/bap/ode_e20XX/BiosCallOuts.c | 9 | ||||
-rw-r--r-- | src/mainboard/bap/ode_e21XX/BiosCallOuts.c | 9 | ||||
-rw-r--r-- | src/mainboard/pcengines/apu1/BiosCallOuts.c | 10 | ||||
-rw-r--r-- | src/mainboard/pcengines/apu2/BiosCallOuts.c | 10 |
5 files changed, 23 insertions, 23 deletions
diff --git a/src/mainboard/amd/bettong/BiosCallOuts.c b/src/mainboard/amd/bettong/BiosCallOuts.c index d318d0c43f..e9836904d3 100644 --- a/src/mainboard/amd/bettong/BiosCallOuts.c +++ b/src/mainboard/amd/bettong/BiosCallOuts.c @@ -117,9 +117,11 @@ AGESA_STATUS Fch_Oem_config(UINT32 Func, UINTN FchData, VOID *ConfigPtr) static AGESA_STATUS board_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr) { -#ifdef __PRE_RAM__ - int spdAddress; AGESA_READ_SPD_PARAMS *info = ConfigPtr; + int spdAddress; + + if (!ENV_ROMSTAGE) + return AGESA_UNSUPPORTED; DEVTREE_CONST struct device *dev = pcidev_on_root(0x18, 2); @@ -154,6 +156,6 @@ static AGESA_STATUS board_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr) int err = hudson_readSpd(spdAddress, (void *) info->Buffer, 128); if (err) return AGESA_ERROR; -#endif + return AGESA_SUCCESS; } diff --git a/src/mainboard/bap/ode_e20XX/BiosCallOuts.c b/src/mainboard/bap/ode_e20XX/BiosCallOuts.c index 4f5ab88232..abe300e731 100644 --- a/src/mainboard/bap/ode_e20XX/BiosCallOuts.c +++ b/src/mainboard/bap/ode_e20XX/BiosCallOuts.c @@ -191,11 +191,12 @@ void board_FCH_InitEnv(struct sysinfo *cb_NA, FCH_DATA_BLOCK *FchParams_env) static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr) { - AGESA_STATUS Status = AGESA_UNSUPPORTED; -#ifdef __PRE_RAM__ AGESA_READ_SPD_PARAMS *info = ConfigPtr; u8 index; + if (!ENV_ROMSTAGE) + return AGESA_UNSUPPORTED; + if (CONFIG(BAP_E20_DDR3_1066)) index = 1; else /* CONFIG_BAP_E20_DDR3_800 */ @@ -212,7 +213,5 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi if (read_ddr3_spd_from_cbfs((u8 *)info->Buffer, index) < 0) die("No SPD data\n"); - Status = AGESA_SUCCESS; -#endif - return Status; + return AGESA_SUCCESS; } diff --git a/src/mainboard/bap/ode_e21XX/BiosCallOuts.c b/src/mainboard/bap/ode_e21XX/BiosCallOuts.c index 6458b974ff..6ff38cbe77 100644 --- a/src/mainboard/bap/ode_e21XX/BiosCallOuts.c +++ b/src/mainboard/bap/ode_e21XX/BiosCallOuts.c @@ -299,11 +299,12 @@ static AGESA_STATUS Fch_Oem_config(UINT32 Func, UINTN FchData, VOID *ConfigPtr) static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr) { - AGESA_STATUS Status = AGESA_UNSUPPORTED; -#ifdef __PRE_RAM__ AGESA_READ_SPD_PARAMS *info = ConfigPtr; u8 index; + if (!ENV_ROMSTAGE) + return AGESA_UNSUPPORTED; + if (CONFIG(BAP_E21_DDR3_1066)) index = 1; else if (CONFIG(BAP_E21_DDR3_1333)) @@ -322,7 +323,5 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi if (read_ddr3_spd_from_cbfs((u8 *)info->Buffer, index) < 0) die("No SPD data\n"); - Status = AGESA_SUCCESS; -#endif - return Status; + return AGESA_SUCCESS; } diff --git a/src/mainboard/pcengines/apu1/BiosCallOuts.c b/src/mainboard/pcengines/apu1/BiosCallOuts.c index df5f03731b..caaa1f421f 100644 --- a/src/mainboard/pcengines/apu1/BiosCallOuts.c +++ b/src/mainboard/pcengines/apu1/BiosCallOuts.c @@ -50,9 +50,11 @@ static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINTN Data, VOID *ConfigP static AGESA_STATUS board_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; + u8 index = get_spd_offset(); if (info->MemChannelId > 0) @@ -66,7 +68,5 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, index) < 0) die("No SPD data\n"); - Status = AGESA_SUCCESS; -#endif - return Status; + return AGESA_SUCCESS; } diff --git a/src/mainboard/pcengines/apu2/BiosCallOuts.c b/src/mainboard/pcengines/apu2/BiosCallOuts.c index edacb22bee..dff346e16a 100644 --- a/src/mainboard/pcengines/apu2/BiosCallOuts.c +++ b/src/mainboard/pcengines/apu2/BiosCallOuts.c @@ -130,9 +130,11 @@ static AGESA_STATUS Fch_Oem_config(UINT32 Func, UINTN FchData, VOID *ConfigPtr) static AGESA_STATUS board_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; + u8 index = get_spd_offset(); if (info->MemChannelId > 0) @@ -146,7 +148,5 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, index) < 0) die("No SPD data\n"); - Status = AGESA_SUCCESS; -#endif - return Status; + return AGESA_SUCCESS; } |