13 #include <soc/iomap.h>
14 #include <soc/pci_devs.h>
16 #include <soc/romstage.h>
17 #include <soc/soc_chip.h>
20 #define FSP_SMBIOS_MEMORY_INFO_GUID \
22 0xd4, 0x71, 0x20, 0x9b, 0x54, 0xb0, 0x0c, 0x4e, \
23 0x8d, 0x09, 0x11, 0xcf, 0x8b, 0x9f, 0x03, 0x23 \
36 int channel, dimm, dimm_max, index;
39 const CONTROLLER_INFO *ctrlr_info;
40 const CHANNEL_INFO *channel_info;
41 const DIMM_INFO *src_dimm;
44 const MEMORY_INFO_DATA_HOB *memory_info_hob;
52 if (memory_info_hob ==
NULL || hob_size == 0) {
62 if (mem_info ==
NULL) {
66 memset(mem_info, 0,
sizeof(*mem_info));
71 ctrlr_info = &memory_info_hob->Controller[0];
72 for (channel = 0; channel < MAX_CH && index < dimm_max; channel++) {
73 channel_info = &ctrlr_info->ChannelInfo[channel];
76 for (
dimm = 0;
dimm < MAX_DIMM && index < dimm_max;
dimm++) {
77 src_dimm = &channel_info->DimmInfo[
dimm];
78 dest_dimm = &mem_info->
dimm[index];
80 if (src_dimm->Status != DIMM_PRESENT)
83 switch (memory_info_hob->MemoryType) {
84 case MRC_DDR_TYPE_DDR4:
87 case MRC_DDR_TYPE_DDR3:
90 case MRC_DDR_TYPE_LPDDR3:
97 u8 memProfNum = memory_info_hob->MemoryProfile;
101 src_dimm->DimmCapacity,
103 memory_info_hob->ConfiguredMemoryClockSpeed,
104 src_dimm->RankInDimm,
105 channel_info->ChannelId,
107 (
const char *)src_dimm->ModulePartNum,
108 sizeof(src_dimm->ModulePartNum),
110 memory_info_hob->DataWidth,
111 memory_info_hob->VddVoltage[memProfNum],
112 memory_info_hob->EccSupport,
114 src_dimm->SpdModuleType);
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)
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
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]