[coreboot-gerrit] Patch set updated for coreboot: ddr3 spd: Rename read_spd_from_cbfs() to read_ddr3_spd_from_cbfs()
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Fri Feb 10 16:52:53 CET 2017
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18264
-gerrit
commit fa56c370929c8afc944963883199fd15247e1842
Author: Patrick Georgi <pgeorgi at chromium.org>
Date: Sat Jan 28 15:26:43 2017 +0100
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 at chromium.org>
---
src/device/dram/spd_cache.c | 7 ++++---
src/include/spd_cache.h | 4 ++--
src/mainboard/bap/ode_e20XX/BiosCallOuts.c | 2 +-
src/mainboard/bap/ode_e21XX/BiosCallOuts.c | 2 +-
src/mainboard/pcengines/apu1/BiosCallOuts.c | 2 +-
src/mainboard/pcengines/apu2/BiosCallOuts.c | 2 +-
src/northbridge/amd/agesa/def_callouts.c | 2 +-
src/northbridge/amd/pi/def_callouts.c | 2 +-
8 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/device/dram/spd_cache.c b/src/device/dram/spd_cache.c
index 3bdd9c1..a74e4a7 100644
--- a/src/device/dram/spd_cache.c
+++ b/src/device/dram/spd_cache.c
@@ -22,13 +22,14 @@
#include <string.h>
#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");
-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;
size_t spd_file_len = 0;
size_t min_len = (idx + 1) * CONFIG_DIMM_SPD_SIZE;
diff --git a/src/include/spd_cache.h b/src/include/spd_cache.h
index 669639b..912aa64 100644
--- a/src/include/spd_cache.h
+++ b/src/include/spd_cache.h
@@ -18,9 +18,9 @@
#include <stdint.h>
#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
-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
diff --git a/src/mainboard/bap/ode_e20XX/BiosCallOuts.c b/src/mainboard/bap/ode_e20XX/BiosCallOuts.c
index 9880b60..2ceb5c8 100644
--- a/src/mainboard/bap/ode_e20XX/BiosCallOuts.c
+++ b/src/mainboard/bap/ode_e20XX/BiosCallOuts.c
@@ -239,7 +239,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
return AGESA_UNSUPPORTED;
/* 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");
Status = AGESA_SUCCESS;
diff --git a/src/mainboard/bap/ode_e21XX/BiosCallOuts.c b/src/mainboard/bap/ode_e21XX/BiosCallOuts.c
index 41603da..10ec422 100644
--- a/src/mainboard/bap/ode_e21XX/BiosCallOuts.c
+++ b/src/mainboard/bap/ode_e21XX/BiosCallOuts.c
@@ -328,7 +328,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
return AGESA_UNSUPPORTED;
/* 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");
Status = AGESA_SUCCESS;
diff --git a/src/mainboard/pcengines/apu1/BiosCallOuts.c b/src/mainboard/pcengines/apu1/BiosCallOuts.c
index 536ec5f..f35cbd2 100644
--- a/src/mainboard/pcengines/apu1/BiosCallOuts.c
+++ b/src/mainboard/pcengines/apu1/BiosCallOuts.c
@@ -63,7 +63,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
return AGESA_UNSUPPORTED;
/* 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");
Status = AGESA_SUCCESS;
diff --git a/src/mainboard/pcengines/apu2/BiosCallOuts.c b/src/mainboard/pcengines/apu2/BiosCallOuts.c
index fe64d64..221b315 100644
--- a/src/mainboard/pcengines/apu2/BiosCallOuts.c
+++ b/src/mainboard/pcengines/apu2/BiosCallOuts.c
@@ -141,7 +141,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *Conf
return AGESA_UNSUPPORTED;
/* 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");
Status = AGESA_SUCCESS;
diff --git a/src/northbridge/amd/agesa/def_callouts.c b/src/northbridge/amd/agesa/def_callouts.c
index a2e12a9..953774a 100644
--- a/src/northbridge/amd/agesa/def_callouts.c
+++ b/src/northbridge/amd/agesa/def_callouts.c
@@ -143,7 +143,7 @@ AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return AGESA_UNSUPPORTED;
/* 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");
Status = AGESA_SUCCESS;
diff --git a/src/northbridge/amd/pi/def_callouts.c b/src/northbridge/amd/pi/def_callouts.c
index 61b5c8b..e38d807 100644
--- a/src/northbridge/amd/pi/def_callouts.c
+++ b/src/northbridge/amd/pi/def_callouts.c
@@ -132,7 +132,7 @@ AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *ConfigPtr)
return AGESA_UNSUPPORTED;
/* 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");
Status = AGESA_SUCCESS;
More information about the coreboot-gerrit
mailing list