coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
raminit.c File Reference
#include <console/console.h>
#include <commonlib/region.h>
#include <cf9_reset.h>
#include <string.h>
#include <arch/cpu.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <device/smbus_host.h>
#include <cbmem.h>
#include <timestamp.h>
#include <mrc_cache.h>
#include <southbridge/intel/bd82x6x/me.h>
#include <southbridge/intel/bd82x6x/pch.h>
#include <cpu/x86/msr.h>
#include <types.h>
#include "raminit_native.h"
#include "raminit_common.h"
#include "sandybridge.h"
Include dependency graph for raminit.c:

Go to the source code of this file.

Functions

static void wait_txt_clear (void)
 
static void disable_channel (ramctr_timing *ctrl, int channel)
 
static uint8_t nb_get_ecc_type (const uint32_t capid0_a)
 
static uint16_t nb_slots_per_channel (const uint32_t capid0_a)
 
static uint16_t nb_number_of_channels (const uint32_t capid0_a)
 
static uint32_t nb_max_chan_capacity_mib (const uint32_t capid0_a)
 
static void setup_sdram_meminfo (ramctr_timing *ctrl)
 
static int verify_crc16_spds_ddr3 (spd_raw_data *spd, ramctr_timing *ctrl)
 
void read_spd (spd_raw_data *spd, u8 addr, bool id_only)
 
static void dram_find_spds_ddr3 (spd_raw_data *spd, ramctr_timing *ctrl)
 
static void save_timings (ramctr_timing *ctrl)
 
static void reinit_ctrl (ramctr_timing *ctrl, const u32 cpuid)
 
static void init_dram_ddr3 (int s3resume, const u32 cpuid)
 
void perform_raminit (int s3resume)
 

Function Documentation

◆ disable_channel()

static void disable_channel ( ramctr_timing ctrl,
int  channel 
)
static

Definition at line 43 of file raminit.c.

References ramctr_timing_st::channel_size_mb, ramctr_timing_st::cmd_stretch, ramctr_timing_st::info, ramctr_timing_st::mad_dimm, memset(), ramctr_timing_st::rank_mirror, ramctr_timing_st::rankmap, and ramctr_timing_st::timings.

Referenced by init_dram_ddr3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_find_spds_ddr3()

◆ init_dram_ddr3()

◆ nb_get_ecc_type()

static uint8_t nb_get_ecc_type ( const uint32_t  capid0_a)
static

Definition at line 56 of file raminit.c.

References CAPID_ECCDIS, MEMORY_ARRAY_ECC_NONE, and MEMORY_ARRAY_ECC_SINGLE_BIT.

Referenced by setup_sdram_meminfo().

Here is the caller graph for this function:

◆ nb_max_chan_capacity_mib()

static uint32_t nb_max_chan_capacity_mib ( const uint32_t  capid0_a)
static

Definition at line 71 of file raminit.c.

References CAPID_DDRSZ, and nb_slots_per_channel().

Referenced by setup_sdram_meminfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nb_number_of_channels()

static uint16_t nb_number_of_channels ( const uint32_t  capid0_a)
static

Definition at line 66 of file raminit.c.

References CAPID_PDCD.

Referenced by setup_sdram_meminfo().

Here is the caller graph for this function:

◆ nb_slots_per_channel()

static uint16_t nb_slots_per_channel ( const uint32_t  capid0_a)
static

Definition at line 61 of file raminit.c.

References CAPID_DDPCD.

Referenced by nb_max_chan_capacity_mib(), and setup_sdram_meminfo().

Here is the caller graph for this function:

◆ perform_raminit()

void perform_raminit ( int  s3resume)

Definition at line 477 of file raminit.c.

References cpu_get_cpuid(), init_dram_ddr3(), and post_code.

Here is the call graph for this function:

◆ read_spd()

void read_spd ( spd_raw_data spd,
u8  addr,
bool  id_only 
)

Definition at line 138 of file raminit.c.

References addr, and smbus_read_byte().

Referenced by mainboard_get_spd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reinit_ctrl()

static void reinit_ctrl ( ramctr_timing ctrl,
const u32  cpuid 
)
static

Definition at line 277 of file raminit.c.

References BIOS_DEBUG, ramctr_timing_st::cpu, cpuid, ramctr_timing_st::ecc_forced, ramctr_timing_st::ecc_supported, get_host_ecc_cap(), get_host_ecc_forced(), memset(), and printk.

Referenced by init_dram_ddr3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_timings()

static void save_timings ( ramctr_timing ctrl)
static

Definition at line 271 of file raminit.c.

References mrc_cache_stash_data(), MRC_CACHE_VERSION, and MRC_TRAINING_DATA.

Referenced by init_dram_ddr3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_sdram_meminfo()

static void setup_sdram_meminfo ( ramctr_timing ctrl)
static

◆ verify_crc16_spds_ddr3()

static int verify_crc16_spds_ddr3 ( spd_raw_data spd,
ramctr_timing ctrl 
)
static

Definition at line 123 of file raminit.c.

References FOR_ALL_CHANNELS, NUM_SLOTS, ramctr_timing_st::spd_crc, and spd_ddr3_calc_unique_crc().

Referenced by init_dram_ddr3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait_txt_clear()

static void wait_txt_clear ( void  )
static

Definition at line 25 of file raminit.c.

References cpuid_ext(), cpuid_result::ecx, read32(), and read8().

Referenced by init_dram_ddr3().

Here is the call graph for this function:
Here is the caller graph for this function: