coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ddr4.h File Reference

Utilities for decoding DDR4 SPDs. More...

#include <spd.h>
#include <device/dram/common.h>
#include <types.h>
Include dependency graph for ddr4.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dimm_attr_ddr4_st
 DIMM characteristics. More...
 

Macros

#define SPD_DDR4_PART_OFF   329
 
#define SPD_DDR4_PART_LEN   20
 

Typedefs

typedef u8 spd_raw_data[512]
 

Enumerations

enum  spd_dimm_type_ddr4 {
  SPD_DDR4_DIMM_TYPE_EXTENDED = 0x0 , SPD_DDR4_DIMM_TYPE_RDIMM = 0x1 , SPD_DDR4_DIMM_TYPE_UDIMM = 0x2 , SPD_DDR4_DIMM_TYPE_SO_DIMM = 0x3 ,
  SPD_DDR4_DIMM_TYPE_LRDIMM = 0x4 , SPD_DDR4_DIMM_TYPE_MINI_RDIMM = 0x5 , SPD_DDR4_DIMM_TYPE_MINI_UDIMM = 0x6 , SPD_DDR4_DIMM_TYPE_72B_SO_RDIMM = 0x8 ,
  SPD_DDR4_DIMM_TYPE_72B_SO_UDIMM = 0x9 , SPD_DDR4_DIMM_TYPE_16B_SO_DIMM = 0xc , SPD_DDR4_DIMM_TYPE_32B_SO_DIMM = 0xd , SPD_DDR4_DIMM_TYPE_MASK = 0xf
}
 

Functions

int spd_decode_ddr4 (struct dimm_attr_ddr4_st *dimm, spd_raw_data spd)
 Decode the raw SPD data. More...
 
enum cb_err spd_add_smbios17_ddr4 (const u8 channel, const u8 slot, const u16 selected_freq, const struct dimm_attr_ddr4_st *info)
 
uint16_t ddr4_speed_mhz_to_reported_mts (uint16_t speed_mhz)
 Converts DDR4 clock speed in MHz to the standard reported speed in MT/s. More...
 

Detailed Description

Utilities for decoding DDR4 SPDs.

Definition in file ddr4.h.

Macro Definition Documentation

◆ SPD_DDR4_PART_LEN

#define SPD_DDR4_PART_LEN   20

Definition at line 22 of file ddr4.h.

◆ SPD_DDR4_PART_OFF

#define SPD_DDR4_PART_OFF   329

Definition at line 21 of file ddr4.h.

Typedef Documentation

◆ spd_raw_data

typedef u8 spd_raw_data[512]

Definition at line 64 of file ddr4.h.

Enumeration Type Documentation

◆ spd_dimm_type_ddr4

Enumerator
SPD_DDR4_DIMM_TYPE_EXTENDED 
SPD_DDR4_DIMM_TYPE_RDIMM 
SPD_DDR4_DIMM_TYPE_UDIMM 
SPD_DDR4_DIMM_TYPE_SO_DIMM 
SPD_DDR4_DIMM_TYPE_LRDIMM 
SPD_DDR4_DIMM_TYPE_MINI_RDIMM 
SPD_DDR4_DIMM_TYPE_MINI_UDIMM 
SPD_DDR4_DIMM_TYPE_72B_SO_RDIMM 
SPD_DDR4_DIMM_TYPE_72B_SO_UDIMM 
SPD_DDR4_DIMM_TYPE_16B_SO_DIMM 
SPD_DDR4_DIMM_TYPE_32B_SO_DIMM 
SPD_DDR4_DIMM_TYPE_MASK 

Definition at line 28 of file ddr4.h.

Function Documentation

◆ ddr4_speed_mhz_to_reported_mts()

uint16_t ddr4_speed_mhz_to_reported_mts ( uint16_t  speed_mhz)

Converts DDR4 clock speed in MHz to the standard reported speed in MT/s.

Definition at line 137 of file ddr4.c.

References ARRAY_SIZE, BIOS_ERR, ddr4_speeds, ddr4_speed_attr::max_clock_mhz, ddr4_speed_attr::min_clock_mhz, printk, and ddr4_speed_attr::reported_mts.

Referenced by ddr_speed_mhz_to_reported_mts().

Here is the caller graph for this function:

◆ spd_add_smbios17_ddr4()

◆ spd_decode_ddr4()

int spd_decode_ddr4 ( struct dimm_attr_ddr4_st dimm,
spd_raw_data  spd 
)

Decode the raw SPD data.

Decodes a raw SPD data from a DDR4 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.

Parameters
dimmpointer to dimm_attr structure where the decoded data is to be stored
spdarray of raw data previously read from the SPD.
Returns
spd_status enumerator SPD_STATUS_OK – decoding was successful SPD_STATUS_INVALID – invalid SPD or not a DDR4 SPD SPD_STATUS_CRC_ERROR – checksum mismatch

Definition at line 166 of file ddr4.c.