coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
raminit.c File Reference
#include <arch/hpet.h>
#include <console/console.h>
#include <console/usb.h>
#include <string.h>
#include <cbmem.h>
#include <cbfs.h>
#include <cf9_reset.h>
#include <ip_checksum.h>
#include <memory_info.h>
#include <mrc_cache.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <device/dram/ddr3.h>
#include <northbridge/intel/haswell/chip.h>
#include <northbridge/intel/haswell/haswell.h>
#include <northbridge/intel/haswell/raminit.h>
#include <smbios.h>
#include <spd.h>
#include <security/vboot/vboot_common.h>
#include <commonlib/region.h>
#include <southbridge/intel/lynxpoint/me.h>
#include <southbridge/intel/lynxpoint/pch.h>
#include <timestamp.h>
#include <types.h>
#include "pei_data.h"
Include dependency graph for raminit.c:

Go to the source code of this file.

Macros

#define MRC_CACHE_VERSION   1
 

Functions

static void save_mrc_data (struct pei_data *pei_data)
 
static void prepare_mrc_cache (struct pei_data *pei_data)
 
static void report_memory_config (void)
 
static void sdram_initialize (struct pei_data *pei_data)
 Find PEI executable in coreboot filesystem and execute it. More...
 
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 (struct pei_data *pei_data)
 
static void copy_spd (struct pei_data *pei_data, struct spd_info *spdi)
 
static int make_channel_disabled_mask (const struct pei_data *pd, int ch)
 
static enum pei_usb2_port_location map_to_pei_usb2_location (const enum usb2_port_location loc)
 
static uint8_t map_to_pei_oc_pin (const uint8_t oc_pin)
 
void perform_raminit (const int s3resume)
 

Variables

static const char *const ecc_decoder []
 

Macro Definition Documentation

◆ MRC_CACHE_VERSION

#define MRC_CACHE_VERSION   1

Definition at line 31 of file raminit.c.

Function Documentation

◆ copy_spd()

static void copy_spd ( struct pei_data pei_data,
struct spd_info spdi 
)
static

Definition at line 282 of file raminit.c.

References spd_info::addresses, ARRAY_SIZE, BIOS_DEBUG, BIOS_ERR, cbfs_map(), CONFIG, die(), memcpy(), printk, pei_data::spd_data, spd_info::spd_index, SPD_LEN, and SPD_MEMORY_DOWN.

Referenced by perform_raminit().

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

◆ make_channel_disabled_mask()

static int make_channel_disabled_mask ( const struct pei_data pd,
int  ch 
)
static

Definition at line 318 of file raminit.c.

References ch, and pei_data::spd_addresses.

Referenced by perform_raminit().

Here is the caller graph for this function:

◆ map_to_pei_oc_pin()

static uint8_t map_to_pei_oc_pin ( const uint8_t  oc_pin)
static

Definition at line 337 of file raminit.c.

References PEI_USB_OC_PIN_SKIP, and USB_OC_PIN_SKIP.

Referenced by perform_raminit().

Here is the caller graph for this function:

◆ map_to_pei_usb2_location()

static enum pei_usb2_port_location map_to_pei_usb2_location ( const enum usb2_port_location  loc)
static

Definition at line 318 of file raminit.c.

Referenced by perform_raminit().

Here is the caller graph for this function:

◆ nb_get_ecc_type()

static uint8_t nb_get_ecc_type ( const uint32_t  capid0_a)
static

Definition at line 186 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 201 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 196 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 191 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 ( const int  s3resume)

◆ prepare_mrc_cache()

static void prepare_mrc_cache ( struct pei_data pei_data)
static

Definition at line 40 of file raminit.c.

References BIOS_DEBUG, mrc_cache_current_mmap_leak(), MRC_CACHE_VERSION, pei_data::mrc_input, pei_data::mrc_input_len, MRC_TRAINING_DATA, NULL, and printk.

Referenced by sdram_initialize().

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

◆ report_memory_config()

static void report_memory_config ( void  )
static

Definition at line 70 of file raminit.c.

References BIOS_DEBUG, ecc_decoder, MAD_CHNL, MAD_DIMM, MC_BIOS_DATA, mchbar_read32(), NUM_CHANNELS, and printk.

Referenced by sdram_initialize().

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

◆ save_mrc_data()

static void save_mrc_data ( struct pei_data pei_data)
static

Definition at line 33 of file raminit.c.

References mrc_cache_stash_data(), MRC_CACHE_VERSION, pei_data::mrc_output, pei_data::mrc_output_len, and MRC_TRAINING_DATA.

Referenced by perform_raminit().

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

◆ sdram_initialize()

static void sdram_initialize ( struct pei_data pei_data)
static

Find PEI executable in coreboot filesystem and execute it.

Parameters
pei_dataconfiguration data for UEFI PEI reference code

Definition at line 114 of file raminit.c.

References BIOS_DEBUG, BIOS_EMERG, BIOS_ERR, pei_data::boot_mode, cbfs_ro_map(), CONFIG, die(), die_with_post_code, do_putchar(), MC_INIT_STATE_G, mchbar_read32(), pei_data::mrc_input, MRC_REVISION, NULL, post_code, POST_INVALID_VENDOR_BINARY, POST_RESUME_FAILURE, prepare_mrc_cache(), printk, report_memory_config(), system_reset(), pei_data::tx_byte, usbdebug_hw_init(), and version.

Here is the call graph for this function:

◆ setup_sdram_meminfo()

Variable Documentation

◆ ecc_decoder

const char* const ecc_decoder[]
static
Initial value:
= {
"inactive",
"active on IO",
"disabled on IO",
"active",
}

Definition at line 62 of file raminit.c.

Referenced by report_memory_config().