From 64b1352d05cfb0ddda25673cf88938761e9974db Mon Sep 17 00:00:00 2001 From: Bora Guvendik Date: Mon, 10 May 2021 14:59:25 -0700 Subject: soc/intel/alderlake: Update meminit code due to upd changes FSP 2147 onwards DisableDimmMc0Ch0 upds changed to DisableMc0Ch0 in new FSP releases. The definition of the upd also changed. Changed FSP meminit code to work based on new definition of the UPDs. Before: 0:Enable both DIMMs, 1:Disable DIMM0, 2:Disable DIMM1, 3:Disable both DIMMs After: 0:Enable, 1:Disable TEST=Boot to OS Cq-Depend: chrome-internal:3831865, chrome-internal:3831864, chrome-internal:3831913 Cq-Depend: chromium:TODO Signed-off-by: Bora Guvendik Change-Id: I5af11ae99db3bbe3373a9bd4ce36453b58d62fec Reviewed-on: https://review.coreboot.org/c/coreboot/+/54036 Reviewed-by: Maulik V Vaghela Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- src/soc/intel/alderlake/meminit.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/soc/intel/alderlake') diff --git a/src/soc/intel/alderlake/meminit.c b/src/soc/intel/alderlake/meminit.c index 2c46b07ec5..32496ce773 100644 --- a/src/soc/intel/alderlake/meminit.c +++ b/src/soc/intel/alderlake/meminit.c @@ -132,7 +132,7 @@ static void mem_init_spd_upds(FSP_M_CONFIG *mem_cfg, const struct mem_channel_da [6] = { &mem_cfg->MemorySpdPtr12, &mem_cfg->MemorySpdPtr13, }, [7] = { &mem_cfg->MemorySpdPtr14, &mem_cfg->MemorySpdPtr15, }, }; - uint8_t *disable_dimm_upds[MRC_CHANNELS] = { + uint8_t *disable_channel_upds[MRC_CHANNELS] = { &mem_cfg->DisableMc0Ch0, &mem_cfg->DisableMc0Ch1, &mem_cfg->DisableMc0Ch2, @@ -147,16 +147,17 @@ static void mem_init_spd_upds(FSP_M_CONFIG *mem_cfg, const struct mem_channel_da mem_cfg->MemorySpdDataLen = data->spd_len; for (ch = 0; ch < MRC_CHANNELS; ch++) { - uint8_t *disable_dimm_ptr = disable_dimm_upds[ch]; - *disable_dimm_ptr = 0; + uint8_t *disable_channel_ptr = disable_channel_upds[ch]; + bool enable_channel = 0; for (dimm = 0; dimm < CONFIG_DIMMS_PER_CHANNEL; dimm++) { uint32_t *spd_ptr = spd_upds[ch][dimm]; *spd_ptr = data->spd[ch][dimm]; - if (!*spd_ptr) - *disable_dimm_ptr |= BIT(dimm); + if (*spd_ptr) + enable_channel = 1; } + *disable_channel_ptr = !enable_channel; } } -- cgit v1.2.3