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 <delay.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <device/smbus_host.h>
#include <cf9_reset.h>
#include <device/mmio.h>
#include <device/device.h>
#include <lib.h>
#include <pc80/mc146818rtc.h>
#include <spd.h>
#include <string.h>
#include "raminit.h"
#include "i945.h"
#include "chip.h"
#include <device/dram/ddr2.h>
#include <timestamp.h>
Include dependency graph for raminit.c:

Go to the source code of this file.

Data Structures

struct  timings
 

Macros

#define PRINTK_DEBUG(x...)
 
#define RAM_INITIALIZATION_COMPLETE   (1 << 19)
 
#define RAM_COMMAND_SELF_REFRESH   (0x0 << 16)
 
#define RAM_COMMAND_NOP   (0x1 << 16)
 
#define RAM_COMMAND_PRECHARGE   (0x2 << 16)
 
#define RAM_COMMAND_MRS   (0x3 << 16)
 
#define RAM_COMMAND_EMRS   (0x4 << 16)
 
#define RAM_COMMAND_CBR   (0x6 << 16)
 
#define RAM_COMMAND_NORMAL   (0x7 << 16)
 
#define RAM_EMRS_1   (0x0 << 21)
 
#define RAM_EMRS_2   (0x1 << 21)
 
#define RAM_EMRS_3   (0x2 << 21)
 
#define DEFAULT_PCI_MMIO_SIZE   768
 
#define GFX_FREQUENCY_CAP_166MHZ   0x04
 
#define GFX_FREQUENCY_CAP_200MHZ   0x03
 
#define GFX_FREQUENCY_CAP_250MHZ   0x02
 
#define GFX_FREQUENCY_CAP_ALL   0x00
 
#define T_RR_7_8US   2000000
 
#define T_RR_15_6US   4000000
 
#define REFRESH_7_8US   1
 
#define REFRESH_15_6US   0
 
#define CRCLK_166MHz   0x00
 
#define CRCLK_200MHz   0x01
 
#define CRCLK_250MHz   0x03
 
#define CRCLK_400MHz   0x05
 
#define CDCLK_200MHz   0x00
 
#define CDCLK_320MHz   0x40
 
#define VOLTAGE_1_05   0x00
 
#define VOLTAGE_1_50   0x01
 
#define EA_DUALCHANNEL_XOR_BANK_RANK_MODE   (0xd4 << 24)
 
#define EA_DUALCHANNEL_XOR_BANK_MODE   (0xf4 << 24)
 
#define EA_DUALCHANNEL_BANK_RANK_MODE   (0xc2 << 24)
 
#define EA_DUALCHANNEL_BANK_MODE   (0xe2 << 24)
 
#define EA_SINGLECHANNEL_XOR_BANK_RANK_MODE   (0x91 << 24)
 
#define EA_SINGLECHANNEL_XOR_BANK_MODE   (0xb1 << 24)
 
#define EA_SINGLECHANNEL_BANK_RANK_MODE   (0x80 << 24)
 
#define EA_SINGLECHANNEL_BANK_MODE   (0xa0 << 24)
 
#define RTT_ODT_NONE   0
 
#define RTT_ODT_50_OHM   ((1 << 9) | (1 << 5))
 
#define RTT_ODT_75_OHM   (1 << 5)
 
#define RTT_ODT_150_OHM   (1 << 9)
 
#define EMRS_OCD_DEFAULT   ((1 << 12) | (1 << 11) | (1 << 10))
 
#define MRS_CAS_3   (3 << 7)
 
#define MRS_CAS_4   (4 << 7)
 
#define MRS_CAS_5   (5 << 7)
 
#define MRS_TWR_3   (2 << 12)
 
#define MRS_TWR_4   (3 << 12)
 
#define MRS_TWR_5   (4 << 12)
 
#define MRS_BT   (1 << 6)
 
#define MRS_BL4   (2 << 3)
 
#define MRS_BL8   (3 << 3)
 

Enumerations

enum  {
  DQ2030 , DQ2330 , CMD2710 , CMD3210 ,
  CLK2030 , CTL3215 , CTL3220 , NC
}
 

Functions

static int get_dimm_spd_address (struct sys_info *sysinfo, int device)
 
static void do_ram_command (u32 command)
 
static void ram_read32 (uintptr_t offset)
 
void sdram_dump_mchbar_registers (void)
 
static int memclk (void)
 
static u16 fsbclk (void)
 
static int sdram_capabilities_max_supported_memory_frequency (void)
 
static int sdram_capabilities_interleave (void)
 determine whether chipset is capable of dual channel interleaved mode More...
 
static int sdram_capabilities_dual_channel (void)
 determine whether chipset is capable of two memory channels More...
 
static int sdram_capabilities_enhanced_addressing_xor (void)
 
static int sdram_capabilities_core_frequencies (void)
 
static void sdram_detect_errors (struct sys_info *sysinfo)
 
static void gather_common_timing (struct sys_info *sysinfo, struct timings *saved_timings)
 loop over dimms and save maximal timings More...
 
static void choose_tclk (struct sys_info *sysinfo, struct timings *saved_timings)
 
static void derive_timings (struct sys_info *sysinfo, struct timings *saved_timings)
 
static void sdram_get_dram_configuration (struct sys_info *sysinfo)
 Get generic DIMM parameters. More...
 
static void sdram_program_dram_width (struct sys_info *sysinfo)
 
static void sdram_write_slew_rates (u32 offset, const u32 *slew_rate_table)
 
static const u32slew_group_lookup (int dual_channel, int index)
 
static void sdram_rcomp_buffer_strength_and_slew (struct sys_info *sysinfo)
 
static void sdram_enable_rcomp (void)
 
static void sdram_program_dll_timings (struct sys_info *sysinfo)
 
static void sdram_force_rcomp (void)
 
static void sdram_initialize_system_memory_io (struct sys_info *sysinfo)
 
static void sdram_enable_system_memory_io (struct sys_info *sysinfo)
 
static int sdram_program_row_boundaries (struct sys_info *sysinfo)
 
static int sdram_set_row_attributes (struct sys_info *sysinfo)
 
static void sdram_set_bank_architecture (struct sys_info *sysinfo)
 
static void sdram_program_refresh_rate (struct sys_info *sysinfo)
 
static void sdram_program_cke_tristate (struct sys_info *sysinfo)
 
static void sdram_program_odt_tristate (struct sys_info *sysinfo)
 
static void sdram_set_timing_and_control (struct sys_info *sysinfo)
 
static void sdram_set_channel_mode (struct sys_info *sysinfo)
 
static void sdram_program_pll_settings (struct sys_info *sysinfo)
 
static void sdram_program_graphics_frequency (struct sys_info *sysinfo)
 
static void sdram_program_memory_frequency (struct sys_info *sysinfo)
 
static void sdram_program_clock_crossing (void)
 
static void sdram_disable_fast_dispatch (void)
 
static void sdram_pre_jedec_initialization (void)
 
static void sdram_enhanced_addressing_mode (struct sys_info *sysinfo)
 
static void sdram_post_jedec_initialization (struct sys_info *sysinfo)
 
static void sdram_power_management (struct sys_info *sysinfo)
 
static void sdram_thermal_management (void)
 
static void sdram_save_receive_enable (void)
 
static void sdram_recover_receive_enable (void)
 
static void sdram_program_receive_enable (struct sys_info *sysinfo)
 
static void sdram_on_die_termination (struct sys_info *sysinfo)
 Enable On-Die Termination for DDR2. More...
 
static void sdram_enable_memory_clocks (struct sys_info *sysinfo)
 Enable clocks to populated sockets. More...
 
static void sdram_jedec_enable (struct sys_info *sysinfo)
 
static void sdram_init_complete (void)
 
static void sdram_setup_processor_side (void)
 
void sdram_initialize (int boot_path, const u8 *spd_addresses)
 

Variables

static const u32 dq2030 []
 
static const u32 dq2330 []
 
static const u32 cmd2710 []
 
static const u32 cmd3210 []
 
static const u32 clk2030 []
 
static const u32 ctl3215 []
 
static const u32 ctl3220 []
 
static const u32 nc []
 
static const u8 dual_channel_slew_group_lookup []
 
static const u8 single_channel_slew_group_lookup []
 

Macro Definition Documentation

◆ CDCLK_200MHz

#define CDCLK_200MHz   0x00

◆ CDCLK_320MHz

#define CDCLK_320MHz   0x40

◆ CRCLK_166MHz

#define CRCLK_166MHz   0x00

◆ CRCLK_200MHz

#define CRCLK_200MHz   0x01

◆ CRCLK_250MHz

#define CRCLK_250MHz   0x03

◆ CRCLK_400MHz

#define CRCLK_400MHz   0x05

◆ DEFAULT_PCI_MMIO_SIZE

#define DEFAULT_PCI_MMIO_SIZE   768

Definition at line 42 of file raminit.c.

◆ EA_DUALCHANNEL_BANK_MODE

#define EA_DUALCHANNEL_BANK_MODE   (0xe2 << 24)

Definition at line 2011 of file raminit.c.

◆ EA_DUALCHANNEL_BANK_RANK_MODE

#define EA_DUALCHANNEL_BANK_RANK_MODE   (0xc2 << 24)

Definition at line 2010 of file raminit.c.

◆ EA_DUALCHANNEL_XOR_BANK_MODE

#define EA_DUALCHANNEL_XOR_BANK_MODE   (0xf4 << 24)

Definition at line 2009 of file raminit.c.

◆ EA_DUALCHANNEL_XOR_BANK_RANK_MODE

#define EA_DUALCHANNEL_XOR_BANK_RANK_MODE   (0xd4 << 24)

Definition at line 2008 of file raminit.c.

◆ EA_SINGLECHANNEL_BANK_MODE

#define EA_SINGLECHANNEL_BANK_MODE   (0xa0 << 24)

Definition at line 2015 of file raminit.c.

◆ EA_SINGLECHANNEL_BANK_RANK_MODE

#define EA_SINGLECHANNEL_BANK_RANK_MODE   (0x80 << 24)

Definition at line 2014 of file raminit.c.

◆ EA_SINGLECHANNEL_XOR_BANK_MODE

#define EA_SINGLECHANNEL_XOR_BANK_MODE   (0xb1 << 24)

Definition at line 2013 of file raminit.c.

◆ EA_SINGLECHANNEL_XOR_BANK_RANK_MODE

#define EA_SINGLECHANNEL_XOR_BANK_RANK_MODE   (0x91 << 24)

Definition at line 2012 of file raminit.c.

◆ EMRS_OCD_DEFAULT

#define EMRS_OCD_DEFAULT   ((1 << 12) | (1 << 11) | (1 << 10))

Definition at line 2485 of file raminit.c.

◆ GFX_FREQUENCY_CAP_166MHZ

#define GFX_FREQUENCY_CAP_166MHZ   0x04

Definition at line 197 of file raminit.c.

◆ GFX_FREQUENCY_CAP_200MHZ

#define GFX_FREQUENCY_CAP_200MHZ   0x03

Definition at line 198 of file raminit.c.

◆ GFX_FREQUENCY_CAP_250MHZ

#define GFX_FREQUENCY_CAP_250MHZ   0x02

Definition at line 199 of file raminit.c.

◆ GFX_FREQUENCY_CAP_ALL

#define GFX_FREQUENCY_CAP_ALL   0x00

Definition at line 200 of file raminit.c.

◆ MRS_BL4

#define MRS_BL4   (2 << 3)

Definition at line 2497 of file raminit.c.

◆ MRS_BL8

#define MRS_BL8   (3 << 3)

Definition at line 2498 of file raminit.c.

◆ MRS_BT

#define MRS_BT   (1 << 6)

Definition at line 2495 of file raminit.c.

◆ MRS_CAS_3

#define MRS_CAS_3   (3 << 7)

Definition at line 2487 of file raminit.c.

◆ MRS_CAS_4

#define MRS_CAS_4   (4 << 7)

Definition at line 2488 of file raminit.c.

◆ MRS_CAS_5

#define MRS_CAS_5   (5 << 7)

Definition at line 2489 of file raminit.c.

◆ MRS_TWR_3

#define MRS_TWR_3   (2 << 12)

Definition at line 2491 of file raminit.c.

◆ MRS_TWR_4

#define MRS_TWR_4   (3 << 12)

Definition at line 2492 of file raminit.c.

◆ MRS_TWR_5

#define MRS_TWR_5   (4 << 12)

Definition at line 2493 of file raminit.c.

◆ PRINTK_DEBUG

#define PRINTK_DEBUG (   x...)

Definition at line 25 of file raminit.c.

◆ RAM_COMMAND_CBR

#define RAM_COMMAND_CBR   (0x6 << 16)

Definition at line 35 of file raminit.c.

◆ RAM_COMMAND_EMRS

#define RAM_COMMAND_EMRS   (0x4 << 16)

Definition at line 34 of file raminit.c.

◆ RAM_COMMAND_MRS

#define RAM_COMMAND_MRS   (0x3 << 16)

Definition at line 33 of file raminit.c.

◆ RAM_COMMAND_NOP

#define RAM_COMMAND_NOP   (0x1 << 16)

Definition at line 31 of file raminit.c.

◆ RAM_COMMAND_NORMAL

#define RAM_COMMAND_NORMAL   (0x7 << 16)

Definition at line 36 of file raminit.c.

◆ RAM_COMMAND_PRECHARGE

#define RAM_COMMAND_PRECHARGE   (0x2 << 16)

Definition at line 32 of file raminit.c.

◆ RAM_COMMAND_SELF_REFRESH

#define RAM_COMMAND_SELF_REFRESH   (0x0 << 16)

Definition at line 30 of file raminit.c.

◆ RAM_EMRS_1

#define RAM_EMRS_1   (0x0 << 21)

Definition at line 38 of file raminit.c.

◆ RAM_EMRS_2

#define RAM_EMRS_2   (0x1 << 21)

Definition at line 39 of file raminit.c.

◆ RAM_EMRS_3

#define RAM_EMRS_3   (0x2 << 21)

Definition at line 40 of file raminit.c.

◆ RAM_INITIALIZATION_COMPLETE

#define RAM_INITIALIZATION_COMPLETE   (1 << 19)

Definition at line 28 of file raminit.c.

◆ REFRESH_15_6US

#define REFRESH_15_6US   0

◆ REFRESH_7_8US

#define REFRESH_7_8US   1

◆ RTT_ODT_150_OHM

#define RTT_ODT_150_OHM   (1 << 9)

Definition at line 2483 of file raminit.c.

◆ RTT_ODT_50_OHM

#define RTT_ODT_50_OHM   ((1 << 9) | (1 << 5))

Definition at line 2481 of file raminit.c.

◆ RTT_ODT_75_OHM

#define RTT_ODT_75_OHM   (1 << 5)

Definition at line 2482 of file raminit.c.

◆ RTT_ODT_NONE

#define RTT_ODT_NONE   0

Definition at line 2480 of file raminit.c.

◆ T_RR_15_6US

#define T_RR_15_6US   4000000

◆ T_RR_7_8US

#define T_RR_7_8US   2000000

◆ VOLTAGE_1_05

#define VOLTAGE_1_05   0x00

◆ VOLTAGE_1_50

#define VOLTAGE_1_50   0x01

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DQ2030 
DQ2330 
CMD2710 
CMD3210 
CLK2030 
CTL3215 
CTL3220 
NC 

Definition at line 692 of file raminit.c.

Function Documentation

◆ choose_tclk()

static void choose_tclk ( struct sys_info sysinfo,
struct timings saved_timings 
)
static

Definition at line 463 of file raminit.c.

References BIOS_DEBUG, timings::cas_mask, die(), timings::min_tCLK_cas, normalize_tck(), printk, sdram_capabilities_max_supported_memory_frequency(), spd_get_msbs(), TCK_200MHZ, TCK_266MHZ, and TCK_333MHZ.

Referenced by sdram_get_dram_configuration().

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

◆ derive_timings()

static void derive_timings ( struct sys_info sysinfo,
struct timings saved_timings 
)
static

Definition at line 512 of file raminit.c.

References BIOS_DEBUG, die(), DIV_ROUND_UP, timings::max_tRR, timings::min_tRAS, timings::min_tRCD, timings::min_tRFC, timings::min_tRP, timings::min_tWR, printk, REFRESH_15_6US, REFRESH_7_8US, T_RR_15_6US, and T_RR_7_8US.

Referenced by sdram_get_dram_configuration().

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

◆ do_ram_command()

static void do_ram_command ( u32  command)
static

Definition at line 52 of file raminit.c.

References DCC, mchbar_read32(), mchbar_write32(), PRINTK_DEBUG, RAM_COMMAND_NORMAL, RAM_INITIALIZATION_COMPLETE, and udelay().

Referenced by sdram_init_complete(), and sdram_jedec_enable().

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

◆ fsbclk()

static u16 fsbclk ( void  )
static

Definition at line 107 of file raminit.c.

References BIOS_DEBUG, CLKCFG, CONFIG, mchbar_read32(), and printk.

Referenced by sdram_program_clock_crossing(), and sdram_program_pll_settings().

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

◆ gather_common_timing()

static void gather_common_timing ( struct sys_info sysinfo,
struct timings saved_timings 
)
static

loop over dimms and save maximal timings

i945 supports two DIMMs, in two configurations:

  • single channel with two DIMMs
  • dual channel with one DIMM per channel

In practice dual channel mainboards have their SPD at 0x50/0x52 whereas single channel configurations have their SPD at 0x50/0x51.

The capability register knows a lot about the channel configuration but for now we stick with the information we gather via SPD.

There are 5 different possible populations for a DIMM socket: 0. x16 double ranked (X16DS)

  1. x8 double ranked (X8DS)
  2. x16 single ranked (X16SS)
  3. x8 double stacked (X8DDS)
  4. Unpopulated

Definition at line 287 of file raminit.c.

References BIOS_DEBUG, BIOS_INFO, BIOS_WARNING, timings::cas_mask, CONFIG, die(), DIMM_SOCKETS, dram_print_spd_ddr2(), get_dimm_spd_address(), hexdump(), MAX, timings::max_tRR, memset(), MIN, timings::min_tCLK_cas, timings::min_tRAS, timings::min_tRCD, timings::min_tRFC, timings::min_tRP, timings::min_tWR, printk, sdram_capabilities_dual_channel(), smbus_read_byte(), SPD_CAS_LATENCY_DDR2_3, SPD_CAS_LATENCY_DDR2_4, SPD_CAS_LATENCY_DDR2_5, spd_decode_ddr2(), spd_dimm_is_registered_ddr2(), SPD_MEMORY_TYPE, SPD_MEMORY_TYPE_SDRAM_DDR2, SPD_SIZE_MAX_DDR2, SPD_STATUS_OK, SYSINFO_DIMM_NOT_POPULATED, SYSINFO_DIMM_X16DS, SYSINFO_DIMM_X16SS, SYSINFO_DIMM_X8DDS, SYSINFO_DIMM_X8DS, SYSINFO_PACKAGE_STACKED, and UINT32_MAX.

Referenced by sdram_get_dram_configuration().

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

◆ get_dimm_spd_address()

static int get_dimm_spd_address ( struct sys_info sysinfo,
int  device 
)
static

Definition at line 43 of file raminit.c.

References device.

Referenced by gather_common_timing().

Here is the caller graph for this function:

◆ memclk()

static int memclk ( void  )
static

Definition at line 92 of file raminit.c.

References BIOS_DEBUG, CLKCFG, CONFIG, mchbar_read32(), offset, and printk.

Referenced by init_pm(), and sdram_program_clock_crossing().

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

◆ ram_read32()

static void ram_read32 ( uintptr_t  offset)
static

Definition at line 73 of file raminit.c.

References offset, PRINTK_DEBUG, and read32().

Referenced by sdram_jedec_enable().

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

◆ sdram_capabilities_core_frequencies()

static int sdram_capabilities_core_frequencies ( void  )
static

Definition at line 202 of file raminit.c.

References HOST_BRIDGE, and pci_read_config8().

Referenced by sdram_program_graphics_frequency().

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

◆ sdram_capabilities_dual_channel()

static int sdram_capabilities_dual_channel ( void  )
static

determine whether chipset is capable of two memory channels

Returns
1 if dual channel operation is supported, 0 otherwise

Definition at line 176 of file raminit.c.

References HOST_BRIDGE, and pci_read_config32().

Referenced by gather_common_timing(), sdram_jedec_enable(), sdram_rcomp_buffer_strength_and_slew(), and sdram_set_channel_mode().

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

◆ sdram_capabilities_enhanced_addressing_xor()

static int sdram_capabilities_enhanced_addressing_xor ( void  )
static

Definition at line 187 of file raminit.c.

References HOST_BRIDGE, and pci_read_config8().

Referenced by sdram_enhanced_addressing_mode().

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

◆ sdram_capabilities_interleave()

static int sdram_capabilities_interleave ( void  )
static

determine whether chipset is capable of dual channel interleaved mode

Returns
1 if interleaving is supported, 0 otherwise

Definition at line 160 of file raminit.c.

References HOST_BRIDGE, and pci_read_config32().

Referenced by sdram_set_channel_mode().

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

◆ sdram_capabilities_max_supported_memory_frequency()

static int sdram_capabilities_max_supported_memory_frequency ( void  )
static

Definition at line 132 of file raminit.c.

References HOST_BRIDGE, and pci_read_config32().

Referenced by choose_tclk().

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

◆ sdram_detect_errors()

static void sdram_detect_errors ( struct sys_info sysinfo)
static

Definition at line 213 of file raminit.c.

References BIOS_DEBUG, sysinfo::boot_path, BOOT_PATH_RESUME, CONFIG, full_reset(), GEN_PMCON_2, GEN_PMCON_3, mchbar_read8(), mchbar_setbits8, PCI_DEV, pci_or_config8(), pci_read_config8(), pci_write_config8(), printk, SLFRCS, and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

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

◆ sdram_disable_fast_dispatch()

static void sdram_disable_fast_dispatch ( void  )
static

Definition at line 1970 of file raminit.c.

References FSBPMC3, mchbar_read32(), mchbar_write32(), and SBTEST.

Referenced by sdram_initialize().

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

◆ sdram_dump_mchbar_registers()

void sdram_dump_mchbar_registers ( void  )

Definition at line 80 of file raminit.c.

References BIOS_DEBUG, mchbar_read32(), and printk.

Referenced by i945_late_initialization().

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

◆ sdram_enable_memory_clocks()

static void sdram_enable_memory_clocks ( struct sys_info sysinfo)
static

Enable clocks to populated sockets.

Definition at line 2445 of file raminit.c.

References C0DCLKDIS, C1DCLKDIS, mchbar_write8(), and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

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

◆ sdram_enable_rcomp()

static void sdram_enable_rcomp ( void  )
static

Definition at line 954 of file raminit.c.

References GBRCOMPCTL, mchbar_read32(), mchbar_write32(), and udelay().

Referenced by sdram_initialize().

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

◆ sdram_enable_system_memory_io()

static void sdram_enable_system_memory_io ( struct sys_info sysinfo)
static

Definition at line 1082 of file raminit.c.

References BIOS_DEBUG, C0DRC1, C1DRC1, DRTST, mchbar_read32(), mchbar_write32(), printk, RCVENMT, and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

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

◆ sdram_enhanced_addressing_mode()

◆ sdram_force_rcomp()

static void sdram_force_rcomp ( void  )
static

Definition at line 1013 of file raminit.c.

References DCC, GBRCOMPCTL, i945_silicon_revision(), mchbar_read32(), mchbar_write32(), ODTC, and SMSRCTL.

Referenced by sdram_initialize_system_memory_io().

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

◆ sdram_get_dram_configuration()

static void sdram_get_dram_configuration ( struct sys_info sysinfo)
static

Get generic DIMM parameters.

Parameters
sysinfoCentral memory controller information structure

This function gathers several pieces of information for each system DIMM: o DIMM width (x8 / x16) o DIMM rank (single ranked / dual ranked)

Also, some non-supported scenarios are detected.

Definition at line 566 of file raminit.c.

References choose_tclk(), derive_timings(), and gather_common_timing().

Referenced by sdram_initialize().

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

◆ sdram_init_complete()

static void sdram_init_complete ( void  )
static

Definition at line 2661 of file raminit.c.

References do_ram_command(), PRINTK_DEBUG, and RAM_COMMAND_NORMAL.

Referenced by sdram_initialize().

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

◆ sdram_initialize()

◆ sdram_initialize_system_memory_io()

static void sdram_initialize_system_memory_io ( struct sys_info sysinfo)
static

◆ sdram_jedec_enable()

static void sdram_jedec_enable ( struct sys_info sysinfo)
static

◆ sdram_on_die_termination()

static void sdram_on_die_termination ( struct sys_info sysinfo)
static

Enable On-Die Termination for DDR2.

Definition at line 2394 of file raminit.c.

References BIOS_DEBUG, C0ODT, C1ODT, mchbar_read32(), mchbar_write32(), ODTC, printk, and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

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

◆ sdram_post_jedec_initialization()

static void sdram_post_jedec_initialization ( struct sys_info sysinfo)
static

Definition at line 2091 of file raminit.c.

References DCC, FSBPMC3, mchbar_read32(), mchbar_write32(), SBOCC, SBTEST, and sdram_enhanced_addressing_mode().

Referenced by sdram_initialize().

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

◆ sdram_power_management()

static void sdram_power_management ( struct sys_info sysinfo)
static

◆ sdram_pre_jedec_initialization()

static void sdram_pre_jedec_initialization ( void  )
static

Definition at line 1983 of file raminit.c.

References C0AIT, C1AIT, mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), MMARB0, MMARB1, SMVREFC, and WCC.

Referenced by sdram_initialize().

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

◆ sdram_program_cke_tristate()

static void sdram_program_cke_tristate ( struct sys_info sysinfo)
static

Definition at line 1296 of file raminit.c.

References C0DRC1, C1DRC1, mchbar_read32(), and mchbar_write32().

Referenced by sdram_set_timing_and_control().

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

◆ sdram_program_clock_crossing()

static void sdram_program_clock_crossing ( void  )
static

We add the indices according to our clocks from CLKCFG.

Definition at line 1809 of file raminit.c.

References BIOS_DEBUG, C0DCCFT, C1DCCFT, CCCFT, fsbclk(), mchbar_write32(), memclk(), and printk.

Referenced by sdram_initialize().

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

◆ sdram_program_dll_timings()

static void sdram_program_dll_timings ( struct sys_info sysinfo)
static

Definition at line 964 of file raminit.c.

References BIOS_DEBUG, C0R0B00DQST, C1R0B00DQST, CONFIG, DQSMT, mchbar_clrbits16, mchbar_setbits16, mchbar_write32(), mchbar_write8(), and printk.

Referenced by sdram_initialize_system_memory_io().

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

◆ sdram_program_dram_width()

static void sdram_program_dram_width ( struct sys_info sysinfo)
static

Definition at line 575 of file raminit.c.

References C0DRAMW, C1DRAMW, DIMM_SOCKETS, mchbar_write16(), SYSINFO_DIMM_NOT_POPULATED, SYSINFO_DIMM_X16DS, SYSINFO_DIMM_X16SS, SYSINFO_DIMM_X8DDS, and SYSINFO_DIMM_X8DS.

Referenced by sdram_initialize_system_memory_io().

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

◆ sdram_program_graphics_frequency()

◆ sdram_program_memory_frequency()

static void sdram_program_memory_frequency ( struct sys_info sysinfo)
static

Definition at line 1730 of file raminit.c.

References BIOS_DEBUG, CLKCFG, CONFIG, die(), GEN_PMCON_2, mchbar_read32(), mchbar_write32(), sysinfo::mvco4x, offset, pci_and_config8(), PCI_DEV, and printk.

Referenced by sdram_initialize().

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

◆ sdram_program_odt_tristate()

static void sdram_program_odt_tristate ( struct sys_info sysinfo)
static

Definition at line 1327 of file raminit.c.

References C0DRC2, C1DRC2, mchbar_read32(), and mchbar_write32().

Referenced by sdram_set_timing_and_control().

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

◆ sdram_program_pll_settings()

static void sdram_program_pll_settings ( struct sys_info sysinfo)
static

Definition at line 1572 of file raminit.c.

References CPCTL, die(), fsbclk(), mchbar_clrbits16, mchbar_read16(), mchbar_write32(), mchbar_write8(), and PLLMON.

Referenced by sdram_initialize().

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

◆ sdram_program_receive_enable()

static void sdram_program_receive_enable ( struct sys_info sysinfo)
static

Definition at line 2369 of file raminit.c.

References sysinfo::boot_path, BOOT_PATH_RESUME, C0DRC1, C1DRC1, mchbar_clrbits32, mchbar_setbits32, MIPMC3, receive_enable_adjust(), REPC, sdram_recover_receive_enable(), and sdram_save_receive_enable().

Referenced by sdram_initialize().

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

◆ sdram_program_refresh_rate()

static void sdram_program_refresh_rate ( struct sys_info sysinfo)
static

Definition at line 1280 of file raminit.c.

References C0DRC0, C1DRC0, mchbar_clrbits32, mchbar_setbits32, and REFRESH_7_8US.

Referenced by sdram_set_timing_and_control().

Here is the caller graph for this function:

◆ sdram_program_row_boundaries()

static int sdram_program_row_boundaries ( struct sys_info sysinfo)
static

◆ sdram_rcomp_buffer_strength_and_slew()

static void sdram_rcomp_buffer_strength_and_slew ( struct sys_info sysinfo)
static

Definition at line 899 of file raminit.c.

References BIOS_DEBUG, ctl3220, G1SC, G1SRPUT, G2SC, G2SRPUT, G3SC, G3SRPUT, G4SC, G4SRPUT, G5SC, G5SRPUT, G6SC, G6SRPUT, G7SC, G7SRPUT, G8SC, G8SRPUT, mchbar_write8(), nc, printk, sdram_capabilities_dual_channel(), sdram_write_slew_rates(), slew_group_lookup(), and SYSINFO_PACKAGE_STACKED.

Referenced by sdram_initialize_system_memory_io().

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

◆ sdram_recover_receive_enable()

static void sdram_recover_receive_enable ( void  )
static

Definition at line 2343 of file raminit.c.

References C0DRT1, C0WL0REOST, C1DRT1, C1WL0REOST, cmos_read(), mchbar_read32(), mchbar_write32(), mchbar_write8(), and RCVENMT.

Referenced by sdram_program_receive_enable().

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

◆ sdram_save_receive_enable()

static void sdram_save_receive_enable ( void  )
static

Definition at line 2308 of file raminit.c.

References C0DRT1, C0WL0REOST, C1DRT1, C1WL0REOST, cmos_write(), mchbar_read32(), mchbar_read8(), and RCVENMT.

Referenced by sdram_program_receive_enable().

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

◆ sdram_set_bank_architecture()

static void sdram_set_bank_architecture ( struct sys_info sysinfo)
static

Definition at line 1251 of file raminit.c.

References BIOS_SPEW, C0BNKARC, C1BNKARC, DIMM_SOCKETS, mchbar_clrbits16, mchbar_setbits16, printk, and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

Here is the caller graph for this function:

◆ sdram_set_channel_mode()

static void sdram_set_channel_mode ( struct sys_info sysinfo)
static

Definition at line 1524 of file raminit.c.

References BIOS_DEBUG, DCC, mchbar_read32(), mchbar_write32(), printk, PRINTK_DEBUG, sdram_capabilities_dual_channel(), sdram_capabilities_interleave(), and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

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

◆ sdram_set_row_attributes()

static int sdram_set_row_attributes ( struct sys_info sysinfo)
static

Definition at line 1198 of file raminit.c.

References BIOS_DEBUG, C0DRA0, C1DRA0, die(), DIMM_SOCKETS, mchbar_write16(), printk, and SYSINFO_DIMM_NOT_POPULATED.

Referenced by sdram_initialize().

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

◆ sdram_set_timing_and_control()

static void sdram_set_timing_and_control ( struct sys_info sysinfo)
static

◆ sdram_setup_processor_side()

static void sdram_setup_processor_side ( void  )
static

Definition at line 2667 of file raminit.c.

References FSBPMC3, i945_silicon_revision(), mchbar_setbits32, mchbar_setbits8, and SLPCTL.

Referenced by sdram_initialize().

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

◆ sdram_thermal_management()

static void sdram_thermal_management ( void  )
static

Definition at line 2297 of file raminit.c.

References mchbar_write8(), TCO0, and TCO1.

Referenced by sdram_initialize().

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

◆ sdram_write_slew_rates()

static void sdram_write_slew_rates ( u32  offset,
const u32 slew_rate_table 
)
static

Definition at line 628 of file raminit.c.

References mchbar_write32(), and offset.

Referenced by sdram_rcomp_buffer_strength_and_slew().

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

◆ slew_group_lookup()

static const u32* slew_group_lookup ( int  dual_channel,
int  index 
)
static

Definition at line 765 of file raminit.c.

References clk2030, CLK2030, cmd2710, CMD2710, cmd3210, CMD3210, ctl3215, CTL3215, ctl3220, CTL3220, dq2030, DQ2030, dq2330, DQ2330, dual_channel_slew_group_lookup, nc, NC, and single_channel_slew_group_lookup.

Referenced by sdram_rcomp_buffer_strength_and_slew().

Here is the caller graph for this function:

Variable Documentation

◆ clk2030

const u32 clk2030[]
static
Initial value:
= {
0x0e0d0d0c, 0x100f0f0e, 0x100f0e0d, 0x15131211,
0x1d1b1917, 0x2523211f, 0x2a282927, 0x32302e2c,
0x17161514, 0x1b1a1918, 0x1f1e1d1c, 0x23222120,
0x27262524, 0x2d2b2928, 0x3533312f, 0x3d3b3937
}

Definition at line 664 of file raminit.c.

Referenced by slew_group_lookup().

◆ cmd2710

const u32 cmd2710[]
static
Initial value:
= {
0x07060605, 0x0f0d0b09, 0x19171411, 0x1f1f1d1b,
0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f,
0x1110100f, 0x0f0d0b09, 0x19171411, 0x1f1f1d1b,
0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f
}

Definition at line 650 of file raminit.c.

Referenced by slew_group_lookup().

◆ cmd3210

const u32 cmd3210[]
static
Initial value:
= {
0x0f0d0b0a, 0x17151311, 0x1f1d1b19, 0x1f1f1f1f,
0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f,
0x18171615, 0x1f1f1c1a, 0x1f1f1f1f, 0x1f1f1f1f,
0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f, 0x1f1f1f1f
}

Definition at line 657 of file raminit.c.

Referenced by slew_group_lookup().

◆ ctl3215

const u32 ctl3215[]
static
Initial value:
= {
0x01010000, 0x03020101, 0x07060504, 0x0b0a0908,
0x100f0e0d, 0x14131211, 0x18171615, 0x1c1b1a19,
0x05040403, 0x07060605, 0x0a090807, 0x0f0d0c0b,
0x14131211, 0x18171615, 0x1c1b1a19, 0x201f1e1d
}

Definition at line 671 of file raminit.c.

Referenced by slew_group_lookup().

◆ ctl3220

const u32 ctl3220[]
static
Initial value:
= {
0x05040403, 0x07060505, 0x0e0c0a08, 0x1a171411,
0x2825221f, 0x35322f2b, 0x3e3e3b38, 0x3e3e3e3e,
0x09080807, 0x0b0a0a09, 0x0f0d0c0b, 0x1b171311,
0x2825221f, 0x35322f2b, 0x3e3e3b38, 0x3e3e3e3e
}

Definition at line 678 of file raminit.c.

Referenced by sdram_rcomp_buffer_strength_and_slew(), and slew_group_lookup().

◆ dq2030

const u32 dq2030[]
static
Initial value:
= {
0x08070706, 0x0a090908, 0x0d0c0b0a, 0x12100f0e,
0x1a181614, 0x22201e1c, 0x2a282624, 0x3934302d,
0x0a090908, 0x0c0b0b0a, 0x0e0d0d0c, 0x1211100f,
0x19171513, 0x211f1d1b, 0x2d292623, 0x3f393531
}

Definition at line 636 of file raminit.c.

Referenced by slew_group_lookup().

◆ dq2330

const u32 dq2330[]
static
Initial value:
= {
0x08070706, 0x0a090908, 0x0d0c0b0a, 0x12100f0e,
0x1a181614, 0x22201e1c, 0x2a282624, 0x3934302d,
0x0a090908, 0x0c0b0b0a, 0x0e0d0d0c, 0x1211100f,
0x19171513, 0x211f1d1b, 0x2d292623, 0x3f393531
}

Definition at line 643 of file raminit.c.

Referenced by slew_group_lookup().

◆ dual_channel_slew_group_lookup

const u8 dual_channel_slew_group_lookup[]
static
Initial value:
= {
}
@ DQ2030
Definition: raminit.c:693
@ NC
Definition: raminit.c:700
@ CLK2030
Definition: raminit.c:697
@ CMD2710
Definition: raminit.c:695
@ CMD3210
Definition: raminit.c:696
@ CTL3215
Definition: raminit.c:698

Definition at line 703 of file raminit.c.

Referenced by slew_group_lookup().

◆ nc

const u32 nc[]
static
Initial value:
= {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000
}

Definition at line 685 of file raminit.c.

Referenced by sdram_rcomp_buffer_strength_and_slew(), and slew_group_lookup().

◆ single_channel_slew_group_lookup

const u8 single_channel_slew_group_lookup[]
static
Initial value:
= {
}
@ DQ2330
Definition: raminit.c:694

Definition at line 734 of file raminit.c.

Referenced by slew_group_lookup().