13 #include <soc/iomap.h>
15 #include <soc/romstage.h>
16 #include <soc/soc_chip.h>
19 #define FSP_SMBIOS_MEMORY_INFO_GUID \
21 0xd4, 0x71, 0x20, 0x9b, 0x54, 0xb0, 0x0c, 0x4e, \
22 0x8d, 0x09, 0x11, 0xcf, 0x8b, 0x9f, 0x03, 0x23 \
28 int node, channel, dimm, dimm_max, index;
30 const CONTROLLER_INFO *ctrlr_info;
31 const CHANNEL_INFO *channel_info;
32 const DIMM_INFO *src_dimm;
35 const MEMORY_INFO_DATA_HOB *meminfo_hob;
39 const char *dram_part_num =
NULL;
40 size_t dram_part_num_len = 0;
41 bool is_dram_part_overridden =
false;
47 if (meminfo_hob ==
NULL || hob_size == 0) {
57 if (mem_info ==
NULL) {
61 memset(mem_info, 0,
sizeof(*mem_info));
66 dram_part_num_len =
strlen(dram_part_num);
67 is_dram_part_overridden =
true;
73 for (node = 0; node < MAX_NODE; node++) {
74 ctrlr_info = &meminfo_hob->Controller[node];
75 for (channel = 0; channel < MAX_CH && index < dimm_max;
77 channel_info = &ctrlr_info->ChannelInfo[channel];
81 for (
dimm = 0;
dimm < MAX_DIMM && index < dimm_max;
83 src_dimm = &channel_info->DimmInfo[
dimm];
84 dest_dimm = &mem_info->
dimm[index];
85 if (src_dimm->Status != DIMM_PRESENT)
90 if (!is_dram_part_overridden) {
91 dram_part_num_len =
sizeof(src_dimm->ModulePartNum);
92 dram_part_num = (
const char *)
93 &src_dimm->ModulePartNum[0];
96 u8 memProfNum = meminfo_hob->MemoryProfile;
97 serial_num = src_dimm->SpdSave +
102 src_dimm->DimmCapacity,
103 meminfo_hob->MemoryType,
104 meminfo_hob->ConfiguredMemoryClockSpeed,
105 src_dimm->RankInDimm,
106 channel_info->ChannelId,
111 meminfo_hob->DataWidth,
112 meminfo_hob->VddVoltage[memProfNum],
113 meminfo_hob->EccSupport,
115 src_dimm->SpdModuleType);
146 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)
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
static void save_dimm_info(void)
#define FSP_SMBIOS_MEMORY_INFO_GUID
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]