Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39756 )
Change subject: nb/intel/sandybridge: Add warning to saved structs ......................................................................
nb/intel/sandybridge: Add warning to saved structs
When changing any of the structures that are cached in non-volatile storage, it is necessary to bump MRC_CACHE_VERSION so that the old information is not misinterpreted.
Change-Id: Idefbc38b3a8198b1b5909e775b3c289db689fc0c Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39756 Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Reviewed-by: Patrick Georgi pgeorgi@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/northbridge/intel/sandybridge/raminit.c M src/northbridge/intel/sandybridge/raminit_common.h 2 files changed, 8 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved HAOUAS Elyes: Looks good to me, but someone else must approve
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c index 34fb499..dc99913 100644 --- a/src/northbridge/intel/sandybridge/raminit.c +++ b/src/northbridge/intel/sandybridge/raminit.c @@ -33,8 +33,6 @@ #include "raminit_common.h" #include "sandybridge.h"
-#define MRC_CACHE_VERSION 1 - /* FIXME: no ECC support */ /* FIXME: no support for 3-channel chipsets */
diff --git a/src/northbridge/intel/sandybridge/raminit_common.h b/src/northbridge/intel/sandybridge/raminit_common.h index 516d8f5..18a69af 100644 --- a/src/northbridge/intel/sandybridge/raminit_common.h +++ b/src/northbridge/intel/sandybridge/raminit_common.h @@ -41,15 +41,22 @@ performant and even 1 seems to be enough in practice. */ #define NUM_PATTERNS 4
+/* + * WARNING: Do not forget to increase MRC_CACHE_VERSION when the saved data is changed! + */ +#define MRC_CACHE_VERSION 1 + typedef struct odtmap_st { u16 rttwr; u16 rttnom; } odtmap;
+/* WARNING: Do not forget to increase MRC_CACHE_VERSION when this struct is changed! */ typedef struct dimm_info_st { dimm_attr dimm[NUM_CHANNELS][NUM_SLOTS]; } dimm_info;
+/* WARNING: Do not forget to increase MRC_CACHE_VERSION when this struct is changed! */ struct ram_rank_timings { /* ROUNDT_LAT register: One byte per slotrank */ u8 roundtrip_latency; @@ -72,6 +79,7 @@ } lanes[NUM_LANES]; };
+/* WARNING: Do not forget to increase MRC_CACHE_VERSION when this struct is changed! */ typedef struct ramctr_timing_st { u16 spd_crc[NUM_CHANNELS][NUM_SLOTS]; int sandybridge;