coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
common.h File Reference
#include <console/console.h>
#include <stdint.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NS2MHZ_DIV256   (1000 << 8)
 Convenience definitions for TCK values. More...
 
#define TCK_1333MHZ   192
 
#define TCK_1200MHZ   212
 
#define TCK_1100MHZ   232
 
#define TCK_1066MHZ   240
 
#define TCK_1000MHZ   256
 
#define TCK_933MHZ   274
 
#define TCK_900MHZ   284
 
#define TCK_800MHZ   320
 
#define TCK_700MHZ   365
 
#define TCK_666MHZ   384
 
#define TCK_533MHZ   480
 
#define TCK_400MHZ   640
 
#define TCK_333MHZ   768
 
#define TCK_266MHZ   960
 
#define TCK_200MHZ   1280
 
#define printram(x, ...)
 Convenience macro for enabling printk with CONFIG(DEBUG_RAM_SETUP) More...
 

Enumerations

enum  spd_status { SPD_STATUS_OK = 0 , SPD_STATUS_INVALID , SPD_STATUS_CRC_ERROR , SPD_STATUS_INVALID_FIELD }
 Result of the SPD decoding process. More...
 

Functions

u16 ddr_crc16 (const u8 *ptr, int n_crc)
 Calculate the CRC of a DDR SPD data. More...
 

Macro Definition Documentation

◆ NS2MHZ_DIV256

#define NS2MHZ_DIV256   (1000 << 8)

Convenience definitions for TCK values.

Different values for tCK, representing standard DDR3 frequencies. These values are in 1/256 ns units.

Definition at line 16 of file common.h.

◆ printram

#define printram (   x,
  ... 
)

Convenience macro for enabling printk with CONFIG(DEBUG_RAM_SETUP)

Use this macro instead of printk(); for verbose RAM initialization messages. When CONFIG(DEBUG_RAM_SETUP) is not selected, these messages are automatically disabled.

Definition at line 46 of file common.h.

◆ TCK_1000MHZ

#define TCK_1000MHZ   256

Definition at line 22 of file common.h.

◆ TCK_1066MHZ

#define TCK_1066MHZ   240

Definition at line 21 of file common.h.

◆ TCK_1100MHZ

#define TCK_1100MHZ   232

Definition at line 20 of file common.h.

◆ TCK_1200MHZ

#define TCK_1200MHZ   212

Definition at line 19 of file common.h.

◆ TCK_1333MHZ

#define TCK_1333MHZ   192

Definition at line 18 of file common.h.

◆ TCK_200MHZ

#define TCK_200MHZ   1280

Definition at line 32 of file common.h.

◆ TCK_266MHZ

#define TCK_266MHZ   960

Definition at line 31 of file common.h.

◆ TCK_333MHZ

#define TCK_333MHZ   768

Definition at line 30 of file common.h.

◆ TCK_400MHZ

#define TCK_400MHZ   640

Definition at line 29 of file common.h.

◆ TCK_533MHZ

#define TCK_533MHZ   480

Definition at line 28 of file common.h.

◆ TCK_666MHZ

#define TCK_666MHZ   384

Definition at line 27 of file common.h.

◆ TCK_700MHZ

#define TCK_700MHZ   365

Definition at line 26 of file common.h.

◆ TCK_800MHZ

#define TCK_800MHZ   320

Definition at line 25 of file common.h.

◆ TCK_900MHZ

#define TCK_900MHZ   284

Definition at line 24 of file common.h.

◆ TCK_933MHZ

#define TCK_933MHZ   274

Definition at line 23 of file common.h.

Enumeration Type Documentation

◆ spd_status

enum spd_status

Result of the SPD decoding process.

Enumerator
SPD_STATUS_OK 
SPD_STATUS_INVALID 
SPD_STATUS_CRC_ERROR 
SPD_STATUS_INVALID_FIELD 

Definition at line 51 of file common.h.

Function Documentation

◆ ddr_crc16()

u16 ddr_crc16 ( const u8 ptr,
int  n_crc 
)

Calculate the CRC of a DDR SPD data.

Parameters
spdpointer to raw SPD data
lenlength of data in SPD
Returns
the CRC of the SPD data

Definition at line 14 of file ddr_common.c.

Referenced by mainboard_memory_init_params(), spd_ddr2_calc_unique_crc(), spd_ddr3_calc_crc(), spd_ddr3_calc_unique_crc(), and verify_block().

Here is the caller graph for this function: