ddr3 spd: Rename read_spd_from_cbfs() to read_ddr3_spd_from_cbfs()
Since it checks for DDR3 style checksums, it's a more appropriate name. Also make its configuration local for a future code move. Change-Id: I417ae165579618d9215b8ca5f0500ff9a61af42f Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/18264 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
ded1e05d11
commit
2e08b59cdc
@ -22,13 +22,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define SPD_SIZE 128
|
#define SPD_SIZE 128
|
||||||
#define SPD_CRC_HI 127
|
|
||||||
#define SPD_CRC_LO 126
|
|
||||||
|
|
||||||
_Static_assert(SPD_SIZE == CONFIG_DIMM_SPD_SIZE, "configured SPD sizes differ");
|
_Static_assert(SPD_SIZE == CONFIG_DIMM_SPD_SIZE, "configured SPD sizes differ");
|
||||||
|
|
||||||
int read_spd_from_cbfs(u8 *buf, int idx)
|
int read_ddr3_spd_from_cbfs(u8 *buf, int idx)
|
||||||
{
|
{
|
||||||
|
const int SPD_CRC_HI = 127;
|
||||||
|
const int SPD_CRC_LO = 126;
|
||||||
|
|
||||||
const char *spd_file;
|
const char *spd_file;
|
||||||
size_t spd_file_len = 0;
|
size_t spd_file_len = 0;
|
||||||
size_t min_len = (idx + 1) * CONFIG_DIMM_SPD_SIZE;
|
size_t min_len = (idx + 1) * CONFIG_DIMM_SPD_SIZE;
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SPD_CACHE)
|
#if IS_ENABLED(CONFIG_SPD_CACHE)
|
||||||
int read_spd_from_cbfs(u8 *buf, int idx);
|
int read_ddr3_spd_from_cbfs(u8 *buf, int idx);
|
||||||
#else
|
#else
|
||||||
static inline int read_spd_from_cbfs(u8 *buf, int idx) { return -1; }
|
static inline int read_ddr3_spd_from_cbfs(u8 *buf, int idx) { return -1; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -239,7 +239,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
|
|||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
||||||
if (read_spd_from_cbfs((u8 *)info->Buffer, index) < 0)
|
if (read_ddr3_spd_from_cbfs((u8 *)info->Buffer, index) < 0)
|
||||||
die("No SPD data\n");
|
die("No SPD data\n");
|
||||||
|
|
||||||
Status = AGESA_SUCCESS;
|
Status = AGESA_SUCCESS;
|
||||||
|
@ -328,7 +328,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
|
|||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
||||||
if (read_spd_from_cbfs((u8 *)info->Buffer, index) < 0)
|
if (read_ddr3_spd_from_cbfs((u8 *)info->Buffer, index) < 0)
|
||||||
die("No SPD data\n");
|
die("No SPD data\n");
|
||||||
|
|
||||||
Status = AGESA_SUCCESS;
|
Status = AGESA_SUCCESS;
|
||||||
|
@ -63,7 +63,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
|
|||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
||||||
if (read_spd_from_cbfs((u8*)info->Buffer, index) < 0)
|
if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, index) < 0)
|
||||||
die("No SPD data\n");
|
die("No SPD data\n");
|
||||||
|
|
||||||
Status = AGESA_SUCCESS;
|
Status = AGESA_SUCCESS;
|
||||||
|
@ -141,7 +141,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *Conf
|
|||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
||||||
if (read_spd_from_cbfs((u8*)info->Buffer, index) < 0)
|
if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, index) < 0)
|
||||||
die("No SPD data\n");
|
die("No SPD data\n");
|
||||||
|
|
||||||
Status = AGESA_SUCCESS;
|
Status = AGESA_SUCCESS;
|
||||||
|
@ -143,7 +143,7 @@ AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
|||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
||||||
if (read_spd_from_cbfs((u8*)info->Buffer, 0) < 0)
|
if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, 0) < 0)
|
||||||
die("No SPD data\n");
|
die("No SPD data\n");
|
||||||
|
|
||||||
Status = AGESA_SUCCESS;
|
Status = AGESA_SUCCESS;
|
||||||
|
@ -132,7 +132,7 @@ AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *ConfigPtr)
|
|||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
/* Read index 0, first SPD_SIZE bytes of spd.bin file. */
|
||||||
if (read_spd_from_cbfs((u8*)info->Buffer, 0) < 0)
|
if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, 0) < 0)
|
||||||
die("No SPD data\n");
|
die("No SPD data\n");
|
||||||
|
|
||||||
Status = AGESA_SUCCESS;
|
Status = AGESA_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user