src/soc/intel/common/smbios: Add addtional infos to dimm_info
Add ECC Support and VDD Voltage to dimm_info struct. Now Bus Width and ECCSupport will be propagated correctly in SMBIOS Type 17 Entry. Change-Id: Ic6f0d4b223f1490ec7aa71a6105603635b514021 Signed-off-by: Christian Walter <christian.walter@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33031 Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
fa36c6c3ee
commit
f972322368
|
@ -372,6 +372,11 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm,
|
|||
dimm->module_part_number[DIMM_INFO_PART_NUMBER_SIZE - 1] = '\0';
|
||||
smbios_fill_dimm_part_number((char *)dimm->module_part_number, t);
|
||||
|
||||
/* Voltage Levels */
|
||||
t->configured_voltage = dimm->vdd_voltage;
|
||||
t->minimum_voltage = dimm->vdd_voltage;
|
||||
t->maximum_voltage = dimm->vdd_voltage;
|
||||
|
||||
/* Synchronous = 1 */
|
||||
t->type_detail = 0x0080;
|
||||
/* no handle for error information */
|
||||
|
|
|
@ -86,6 +86,10 @@ struct dimm_info {
|
|||
* See the smbios.h smbios_memory_bus_width enum.
|
||||
*/
|
||||
uint8_t bus_width;
|
||||
/*
|
||||
* Voltage Level
|
||||
*/
|
||||
uint16_t vdd_voltage;
|
||||
} __packed;
|
||||
|
||||
struct memory_info {
|
||||
|
|
|
@ -91,7 +91,9 @@ void save_lpddr4_dimm_info_part_num(const char *dram_part_num)
|
|||
dram_part_num,
|
||||
strlen(dram_part_num),
|
||||
NULL, /* SPD not available */
|
||||
memory_info_hob->DataWidth);
|
||||
memory_info_hob->DataWidth,
|
||||
0,
|
||||
0);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,9 @@ void save_lpddr4_dimm_info_part_num(const char *dram_part_num)
|
|||
dram_part_num,
|
||||
strlen(dram_part_num),
|
||||
src_dimm->SpdSave + SPD_SAVE_OFFSET_SERIAL,
|
||||
memory_info_hob->DataWidth);
|
||||
memory_info_hob->DataWidth,
|
||||
0,
|
||||
0);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,8 @@ static void save_dimm_info(void)
|
|||
mainboard_get_dram_part_num(&dram_part_num,
|
||||
&dram_part_num_len);
|
||||
|
||||
u8 memProfNum = memory_info_hob->MemoryProfile;
|
||||
|
||||
/* Populate the DIMM information */
|
||||
dimm_info_fill(dest_dimm,
|
||||
src_dimm->DimmCapacity,
|
||||
|
@ -112,7 +114,9 @@ static void save_dimm_info(void)
|
|||
dram_part_num,
|
||||
dram_part_num_len,
|
||||
src_dimm->SpdSave + SPD_SAVE_OFFSET_SERIAL,
|
||||
memory_info_hob->DataWidth);
|
||||
memory_info_hob->DataWidth,
|
||||
memory_info_hob->VddVoltage[memProfNum],
|
||||
memory_info_hob->EccSupport);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
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)
|
||||
const u8 *module_serial_num, u16 data_width, u32 vdd_voltage,
|
||||
bool ecc_support)
|
||||
{
|
||||
dimm->dimm_size = dimm_capacity;
|
||||
dimm->ddr_type = ddr_type;
|
||||
|
@ -30,6 +31,12 @@ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type,
|
|||
dimm->rank_per_dimm = rank_per_dimm;
|
||||
dimm->channel_num = channel_id;
|
||||
dimm->dimm_num = dimm_id;
|
||||
if (vdd_voltage > 0xFFFF) {
|
||||
dimm->vdd_voltage = 0xFFFF;
|
||||
} else {
|
||||
dimm->vdd_voltage = vdd_voltage;
|
||||
}
|
||||
|
||||
strncpy((char *)dimm->module_part_number,
|
||||
module_part_num,
|
||||
min(sizeof(dimm->module_part_number),
|
||||
|
@ -57,4 +64,7 @@ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type,
|
|||
printk(BIOS_NOTICE, "Incorrect DIMM Data width: %u\n",
|
||||
(unsigned int)data_width);
|
||||
}
|
||||
|
||||
if (ecc_support)
|
||||
dimm->bus_width |= 0x8;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
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);
|
||||
const u8 *module_serial_num, u16 data_width, u32 vdd_voltage,
|
||||
bool ecc_support);
|
||||
|
||||
#endif /* _COMMON_SMBIOS_H_ */
|
||||
|
|
|
@ -86,6 +86,8 @@ static void save_dimm_info(void)
|
|||
if (src_dimm->Status != DIMM_PRESENT)
|
||||
continue;
|
||||
|
||||
u8 memProfNum = memory_info_hob->MemoryProfile;
|
||||
|
||||
/* Populate the DIMM information */
|
||||
dimm_info_fill(dest_dimm,
|
||||
src_dimm->DimmCapacity,
|
||||
|
@ -97,7 +99,9 @@ static void save_dimm_info(void)
|
|||
(const char *)src_dimm->ModulePartNum,
|
||||
sizeof(src_dimm->ModulePartNum),
|
||||
src_dimm->SpdSave + SPD_SAVE_OFFSET_SERIAL,
|
||||
memory_info_hob->DataWidth);
|
||||
memory_info_hob->DataWidth,
|
||||
memory_info_hob->VddVoltage[memProfNum],
|
||||
memory_info_hob->EccSupport);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ static void save_dimm_info(void)
|
|||
ddr_type = MEMORY_TYPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
u8 memProfNum = memory_info_hob->MemoryProfile;
|
||||
|
||||
/* Populate the DIMM information */
|
||||
dimm_info_fill(dest_dimm,
|
||||
|
@ -126,7 +127,9 @@ static void save_dimm_info(void)
|
|||
(const char *)src_dimm->ModulePartNum,
|
||||
sizeof(src_dimm->ModulePartNum),
|
||||
src_dimm->SpdSave + SPD_SAVE_OFFSET_SERIAL,
|
||||
memory_info_hob->DataWidth);
|
||||
memory_info_hob->DataWidth,
|
||||
memory_info_hob->VddVoltage[memProfNum],
|
||||
memory_info_hob->EccSupport);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue