13 #include <soc/iomap.h>
14 #include <soc/pci_devs.h>
16 #include <soc/romstage.h>
21 #define FSP_SMBIOS_MEMORY_INFO_GUID \
23 0xd4, 0x71, 0x20, 0x9b, 0x54, 0xb0, 0x0c, 0x4e, \
24 0x8d, 0x09, 0x11, 0xcf, 0x8b, 0x9f, 0x03, 0x23 \
30 int channel, dimm, dimm_max, index;
32 const CONTROLLER_INFO *ctrlr_info;
33 const CHANNEL_INFO *channel_info;
34 const DIMM_INFO *src_dimm;
37 const MEMORY_INFO_DATA_HOB *memory_info_hob;
40 const char *dram_part_num;
41 size_t dram_part_num_len = 0;
42 bool part_num_overridden =
false;
48 if (memory_info_hob ==
NULL || hob_size == 0) {
58 if (mem_info ==
NULL) {
62 memset(mem_info, 0,
sizeof(*mem_info));
67 dram_part_num_len =
strlen(dram_part_num);
68 part_num_overridden =
true;
74 ctrlr_info = &memory_info_hob->Controller[0];
75 for (channel = 0; channel < MAX_CH && index < dimm_max; channel++) {
76 channel_info = &ctrlr_info->ChannelInfo[channel];
79 for (
dimm = 0;
dimm < MAX_DIMM && index < dimm_max;
dimm++) {
80 src_dimm = &channel_info->DimmInfo[
dimm];
81 dest_dimm = &mem_info->
dimm[index];
83 if (src_dimm->Status != DIMM_PRESENT)
86 if (!part_num_overridden) {
88 sizeof(src_dimm->ModulePartNum);
89 dram_part_num = (
const char *)
90 &src_dimm->ModulePartNum[0];
93 u8 memProfNum = memory_info_hob->MemoryProfile;
97 src_dimm->DimmCapacity,
98 memory_info_hob->MemoryType,
99 memory_info_hob->ConfiguredMemoryClockSpeed,
100 src_dimm->RankInDimm,
101 channel_info->ChannelId,
106 memory_info_hob->DataWidth,
107 memory_info_hob->VddVoltage[memProfNum],
108 memory_info_hob->EccSupport,
110 src_dimm->SpdModuleType);
140 if (
CONFIG(SOC_INTEL_CSE_LITE_SKU))
void * memset(void *dstpp, int c, size_t len)
void * cbmem_add(u32 id, u64 size)
void heci_init(uintptr_t tempbar)
#define printk(level,...)
static const uint8_t smbios_memory_info_guid[16]
void fsp_memory_init(bool s3wake)
const void * fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size)
#define HECI1_BASE_ADDRESS
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
void mainboard_romstage_entry(void)
const char * mainboard_get_dram_part_num(void)
void systemagent_early_init(void)
static void save_dimm_info(void)
#define FSP_SMBIOS_MEMORY_INFO_GUID
int pmc_fill_power_state(struct chipset_power_state *ps)
struct chipset_power_state * pmc_get_power_state(void)
void smbus_common_init(void)
void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type, u32 frequency, u8 rank_per_dimm, u8 channel_id, u8 dimm_id, const char *module_part_num, size_t module_part_number_size, const u8 *module_serial_num, u16 data_width, u32 vdd_voltage, bool ecc_support, u16 mod_id, u8 mod_type)
#define SPD_SAVE_OFFSET_SERIAL
size_t strlen(const char *src)
If this table is filled and put in CBMEM, then these info in CBMEM will be used to generate smbios ty...
struct dimm_info dimm[DIMM_INFO_TOTAL]