![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
Utilities for decoding DDR3 SPDs. More...
Go to the source code of this file.
Data Structures | |
union | dimm_flags_ddr3_st |
DIMM flags. More... | |
struct | dimm_attr_ddr3_st |
DIMM characteristics. More... | |
Macros | |
#define | SPD_DIMM_MOD_ID1 117 |
Convenience definitions for SPD offsets. More... | |
#define | SPD_DIMM_MOD_ID2 118 |
#define | SPD_DIMM_SERIAL_NUM 122 |
#define | SPD_DIMM_SERIAL_LEN 4 |
#define | SPD_DIMM_PART_NUM 128 |
#define | SPD_DIMM_PART_LEN 18 |
Typedefs | |
typedef u8 | spd_raw_data[256] |
Enumerations | |
enum | spd_dimm_type_ddr3 { SPD_DDR3_DIMM_TYPE_UNDEFINED = 0x00 , SPD_DDR3_DIMM_TYPE_RDIMM = 0x01 , SPD_DDR3_DIMM_TYPE_UDIMM = 0x02 , SPD_DDR3_DIMM_TYPE_SO_DIMM = 0x03 , SPD_DDR3_DIMM_TYPE_MICRO_DIMM = 0x04 , SPD_DDR3_DIMM_TYPE_MINI_RDIMM = 0x05 , SPD_DDR3_DIMM_TYPE_MINI_UDIMM = 0x06 , SPD_DDR3_DIMM_TYPE_MINI_CDIMM = 0x07 , SPD_DDR3_DIMM_TYPE_72B_SO_UDIMM = 0x08 , SPD_DDR3_DIMM_TYPE_72B_SO_RDIMM = 0x09 , SPD_DDR3_DIMM_TYPE_72B_SO_CDIMM = 0x0a , SPD_DDR3_DIMM_TYPE_LRDIMM = 0x0b , SPD_DDR3_DIMM_TYPE_16B_SO_DIMM = 0x0c , SPD_DDR3_DIMM_TYPE_32B_SO_DIMM = 0x0d , SPD_DDR3_DIMM_TYPE_MASK = 0x0f } |
enum | ddr3_xmp_profile { DDR3_XMP_PROFILE_1 = 0 , DDR3_XMP_PROFILE_2 = 1 } |
Functions | |
u16 | spd_ddr3_calc_crc (u8 *spd, int len) |
Calculate the CRC of a DDR3 SPD. More... | |
u16 | spd_ddr3_calc_unique_crc (u8 *spd, int len) |
Calculate the CRC of a DDR3 SPD unique identifier. More... | |
int | spd_decode_ddr3 (struct dimm_attr_ddr3_st *dimm, spd_raw_data spd_data) |
Decode the raw SPD data. More... | |
int | spd_dimm_is_registered_ddr3 (enum spd_dimm_type_ddr3 type) |
Checks if the DIMM is Registered based on byte[3] of the SPD. More... | |
void | dram_print_spd_ddr3 (const struct dimm_attr_ddr3_st *dimm) |
Print the info in DIMM. More... | |
int | spd_xmp_decode_ddr3 (struct dimm_attr_ddr3_st *dimm, spd_raw_data spd, enum ddr3_xmp_profile profile) |
Decode the raw SPD XMP data. More... | |
enum cb_err | spd_add_smbios17 (const u8 channel, const u8 slot, const u16 selected_freq, const struct dimm_attr_ddr3_st *info) |
Fill cbmem with information for SMBIOS type 17. More... | |
Utilities for decoding DDR3 SPDs.
Definition in file ddr3.h.
#define SPD_DIMM_MOD_ID1 117 |
enum ddr3_xmp_profile |
enum spd_dimm_type_ddr3 |
void dram_print_spd_ddr3 | ( | const struct dimm_attr_ddr3_st * | dimm | ) |
Print the info in DIMM.
Print info about the DIMM. Useful to use when CONFIG(DEBUG_RAM_SETUP) is selected, or for a purely informative output.
dimm | pointer to already decoded dimm_attr structure |
Definition at line 600 of file ddr3.c.
References BIOS_INFO, dimm_attr_ddr3_st::cas_supported, dimm_attr_ddr3_st::col_bits, DIV_ROUND_UP, print_ns(), printk, dimm_attr_ddr3_st::ranks, dimm_attr_ddr3_st::row_bits, dimm_attr_ddr3_st::size_mb, dimm_attr_ddr3_st::tAA, dimm_attr_ddr3_st::tCK, dimm_attr_ddr3_st::tCMD, dimm_attr_ddr3_st::tCWL, dimm_attr_ddr3_st::tFAW, dimm_attr_ddr3_st::tRAS, dimm_attr_ddr3_st::tRC, dimm_attr_ddr3_st::tRCD, dimm_attr_ddr3_st::tRFC, dimm_attr_ddr3_st::tRP, dimm_attr_ddr3_st::tRRD, dimm_attr_ddr3_st::tRTP, dimm_attr_ddr3_st::tWR, and dimm_attr_ddr3_st::tWTR.
Referenced by ddr3_save_dimminfo(), and dram_find_spds_ddr3().
enum cb_err spd_add_smbios17 | ( | const u8 | channel, |
const u8 | slot, | ||
const u16 | selected_freq, | ||
const struct dimm_attr_ddr3_st * | info | ||
) |
Fill cbmem with information for SMBIOS type 17.
channel | Corresponding channel of provided @info |
slot | Corresponding slot of provided @info |
selected_freq | The actual frequency the DRAM is running on |
info | DIMM parameters read from SPD |
Definition at line 397 of file ddr3.c.
References dimm_attr_ddr3_st::cas_supported, DDR3_XMP_PROFILE_1, dimm_attr_ddr3_st::dimms_per_channel, dimm_attr_ddr3_st::dram_type, printram, spd_decode_ddr3(), SPD_MEMORY_TYPE_UNDEFINED, SPD_STATUS_INVALID, SPD_STATUS_OK, dimm_attr_ddr3_st::tAA, dimm_attr_ddr3_st::tCK, dimm_attr_ddr3_st::tCMD, dimm_attr_ddr3_st::tCWL, dimm_attr_ddr3_st::tFAW, dimm_attr_ddr3_st::tRAS, dimm_attr_ddr3_st::tRC, dimm_attr_ddr3_st::tRCD, dimm_attr_ddr3_st::tRFC, dimm_attr_ddr3_st::tRP, dimm_attr_ddr3_st::tRRD, dimm_attr_ddr3_st::tRTP, dimm_attr_ddr3_st::tWR, dimm_attr_ddr3_st::tWTR, and dimm_attr_ddr3_st::voltage.
Referenced by populate_smbios_tables(), and setup_sdram_meminfo().
Calculate the CRC of a DDR3 SPD.
spd | pointer to raw SPD data |
len | length of data in SPD |
Definition at line 48 of file ddr3.c.
References ddr_crc16().
Referenced by spd_decode_ddr3().
Calculate the CRC of a DDR3 SPD unique identifier.
spd | pointer to raw SPD data |
len | length of data in SPD |
Definition at line 74 of file ddr3.c.
References ddr_crc16().
Referenced by ddr3_get_crc(), ddr3_save_dimminfo(), dram_find_spds_ddr3(), and verify_crc16_spds_ddr3().
int spd_decode_ddr3 | ( | struct dimm_attr_ddr3_st * | dimm, |
spd_raw_data | spd | ||
) |
Decode the raw SPD data.
Decodes a raw SPD data from a DDR3 DIMM, and organizes it into a dimm_attr structure. The SPD data must first be read in a contiguous array, and passed to this function.
dimm | pointer to dimm_attr structure where the decoded data is to be stored |
spd | array of raw data previously read from the SPD. |
Definition at line 101 of file ddr3.c.
References dimm_flags_ddr3_st::asr, dimm_attr_ddr3_st::cas_supported, dimm_attr_ddr3_st::col_bits, dimm_attr_ddr3_st::dimm_type, dimm_attr_ddr3_st::dimms_per_channel, dimm_flags_ddr3_st::dll_off_mode, dimm_attr_ddr3_st::dram_type, dimm_flags_ddr3_st::ext_temp_range, dimm_flags_ddr3_st::ext_temp_refresh, dimm_attr_ddr3_st::flags, dimm_flags_ddr3_st::is_ecc, dimm_attr_ddr3_st::manufacturer_id, memcpy(), dimm_flags_ddr3_st::odts, dimm_flags_ddr3_st::operable_1_25V, dimm_flags_ddr3_st::operable_1_35V, dimm_flags_ddr3_st::operable_1_50V, dimm_attr_ddr3_st::part_number, dimm_flags_ddr3_st::pasr, dimm_flags_ddr3_st::pins_mirrored, printram, dimm_attr_ddr3_st::ranks, dimm_flags_ddr3_st::raw, dimm_attr_ddr3_st::reference_card, dimm_attr_ddr3_st::row_bits, dimm_flags_ddr3_st::rzq6_supported, dimm_flags_ddr3_st::rzq7_supported, dimm_attr_ddr3_st::serial, dimm_attr_ddr3_st::size_mb, spd_ddr3_calc_crc(), SPD_DIMM_SERIAL_LEN, SPD_DIMM_SERIAL_NUM, SPD_MEMORY_TYPE_SDRAM_DDR3, SPD_MEMORY_TYPE_UNDEFINED, SPD_STATUS_CRC_ERROR, SPD_STATUS_INVALID, SPD_STATUS_INVALID_FIELD, SPD_STATUS_OK, dimm_attr_ddr3_st::tAA, dimm_attr_ddr3_st::tCK, dimm_attr_ddr3_st::tCMD, dimm_attr_ddr3_st::tCWL, dimm_attr_ddr3_st::tFAW, dimm_flags_ddr3_st::therm_sensor, dimm_attr_ddr3_st::tRAS, dimm_attr_ddr3_st::tRC, dimm_attr_ddr3_st::tRCD, dimm_attr_ddr3_st::tRFC, dimm_attr_ddr3_st::tRP, dimm_attr_ddr3_st::tRRD, dimm_attr_ddr3_st::tRTP, dimm_attr_ddr3_st::tWR, dimm_attr_ddr3_st::tWTR, val, dimm_attr_ddr3_st::voltage, and dimm_attr_ddr3_st::width.
Referenced by ddr3_save_dimminfo(), dram_find_spds_ddr3(), populate_smbios_tables(), and spd_add_smbios17().
int spd_dimm_is_registered_ddr3 | ( | enum spd_dimm_type_ddr3 | type | ) |
Checks if the DIMM is Registered based on byte[3] of the SPD.
Tells if the DIMM type is registered or not.
type | DIMM type. This is byte[3] of the SPD. |
Definition at line 30 of file ddr3.c.
References SPD_DDR3_DIMM_TYPE_72B_SO_RDIMM, SPD_DDR3_DIMM_TYPE_MINI_RDIMM, SPD_DDR3_DIMM_TYPE_RDIMM, and type.
int spd_xmp_decode_ddr3 | ( | struct dimm_attr_ddr3_st * | dimm, |
spd_raw_data | spd, | ||
enum ddr3_xmp_profile | profile | ||
) |
Decode the raw SPD XMP data.
Decodes a raw SPD XMP data from a DDR3 DIMM, and organizes it into a dimm_attr structure. The SPD data must first be read in a contiguous array, and passed to this function.
dimm | pointer to dimm_attr structure where the decoded data is to be stored |
spd | array of raw data previously read from the SPD. |
profile | select one of the profiles to load |
Definition at line 397 of file ddr3.c.
Referenced by dram_find_spds_ddr3().