soc/intel/xeon_sp/cpx: Allow creating meminfo for empty DIMM slots

Introduce the mainboard-defined `mainboard_dimm_slot_exists()` function
to allow creating SMBIOS type 17 entries for unpopulated DIMM slots.

Change-Id: I1d9c41dd7d981842ca6f0294d9e6b0fedc0c98e4
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64036
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons 2022-05-03 18:37:32 +02:00 committed by Martin L Roth
parent d41f69ccce
commit 3cc20202de
3 changed files with 23 additions and 4 deletions

View File

@ -82,3 +82,8 @@ uint16_t get_max_memory_speed(uint32_t commonTck)
else
return 800;
}
__weak bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t slot)
{
return false;
}

View File

@ -3,7 +3,7 @@
#ifndef _CPX_DDR_H_
#define _CPX_DDR_H_
#include <stdint.h>
#include <types.h>
/* DDR_*_TCK_MIN are in picoseconds */
#define DDR_800_TCK_MIN 2500
@ -48,4 +48,6 @@
uint16_t get_max_memory_speed(uint32_t commonTck);
uint32_t get_ddr_voltage(uint8_t DdrVoltage);
bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t slot);
#endif /* _CPX_DDR_H_ */

View File

@ -81,7 +81,7 @@ void save_dimm_info(void)
struct memory_info *mem_info;
const struct SystemMemoryMapHob *hob;
MEMMAP_DIMM_DEVICE_INFO_STRUCT src_dimm;
int dimm_max, index = 0;
int dimm_max, index = 0, num_dimms = 0;
uint32_t vdd_voltage;
hob = get_system_memory_map();
@ -134,13 +134,25 @@ void save_dimm_info(void)
src_dimm.actKeyByte2,
0);
index++;
num_dimms++;
} else if (mainboard_dimm_slot_exists(0, ch, dimm)) {
if (index >= dimm_max) {
printk(BIOS_WARNING, "Too many DIMMs info for %s.\n",
__func__);
return;
}
dest_dimm = &mem_info->dimm[index];
dest_dimm->dimm_size = 0;
dest_dimm->channel_num = ch;
dest_dimm->dimm_num = dimm;
index++;
}
}
}
/* Save available DIMM information */
/* Save available DIMM slot information */
mem_info->dimm_cnt = index;
printk(BIOS_DEBUG, "%d DIMMs found\n", mem_info->dimm_cnt);
printk(BIOS_DEBUG, "%d out of %d DIMMs found\n", num_dimms, mem_info->dimm_cnt);
}
static void set_cmos_mrc_cold_boot_flag(bool cold_boot_required)