8 #include <soc/meminit.h>
11 #define FSP_SMBIOS_MEMORY_INFO_GUID \
13 0x8c, 0x10, 0xa1, 0x01, 0xee, 0x9d, 0x84, 0x49, \
14 0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89 \
19 int channel, dimm, dimm_max, index;
21 const DIMM_INFO *src_dimm;
24 const CHANNEL_INFO *channel_info;
25 const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
30 dram_part_num =
"Unknown";
37 if (memory_info_hob ==
NULL || hob_size == 0) {
47 if (mem_info ==
NULL) {
51 memset(mem_info, 0,
sizeof(*mem_info));
57 for (channel = 0; channel < memory_info_hob->ChannelCount; channel++) {
58 if (index >= dimm_max)
60 channel_info = &memory_info_hob->ChannelInfo[channel];
62 if (index >= dimm_max)
64 src_dimm = &channel_info->DimmInfo[
dimm];
65 dest_dimm = &mem_info->
dimm[index];
67 if (!src_dimm->SizeInMb)
73 memory_info_hob->MemoryType,
74 memory_info_hob->MemoryFrequencyInMHz,
76 channel_info->ChannelId,
81 memory_info_hob->DataWidth,
95 const char *part_num =
NULL;
void * memset(void *dstpp, int c, size_t len)
void * cbmem_add(u32 id, u64 size)
#define printk(level,...)
static const uint8_t smbios_memory_info_guid[16]
const void * fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
static const struct lpddr4_cfg lp4cfg
void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
#define FSP_SMBIOS_MEMORY_INFO_GUID
void save_lpddr4_dimm_info_part_num(const char *dram_part_num)
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)
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...
const struct lpddr4_sku * skus
struct dimm_info dimm[DIMM_INFO_TOTAL]