coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <commonlib/helpers.h>
#include <stdint.h>
#include <arch/cpu.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <device/pci_def.h>
#include <device/device.h>
#include <device/smbus_host.h>
#include <spd.h>
#include <console/console.h>
#include <lib.h>
#include <delay.h>
#include <timestamp.h>
#include "gm45.h"
#include "chip.h"
Go to the source code of this file.
Data Structures | |
struct | spdinfo_t |
Macros | |
#define | DEFAULT_PCI_MMIO_SIZE 2048 |
#define | HOST_BRIDGE PCI_DEVFN(0, 0) |
Variables | |
static const gmch_gfx_t | gmch_gfx_types [][5] |
|
static |
Definition at line 455 of file raminit.c.
References BIOS_SPEW, timings::CAS, spdinfo_t::channel, spdinfo_t::chip_capacity, sysinfo::dimms, DIV_ROUND_UP, FOR_EACH_POPULATED_CHANNEL, timings::fsb_clock, FSB_CLOCK_1067MHz, FSB_CLOCK_667MHz, FSB_CLOCK_800MHz, timings::mem_clock, MEM_CLOCK_1067MT, spdinfo_t::page_size, printk, sysinfo::selected_timings, spdinfo_t::tRAS, timings::tRAS, spdinfo_t::tRCD, timings::tRCD, timings::tRFC, spdinfo_t::tRP, timings::tRP, timings::tRRD, spdinfo_t::tWR, and timings::tWR.
Referenced by collect_dimm_config().
|
static |
Definition at line 1084 of file raminit.c.
References ch, CHANNEL_IS_CARDF, FOR_EACH_CHANNEL, FSB_CLOCK_1067MHz, FSB_CLOCK_800MHz, mchbar_write32(), MEM_CLOCK_667MT, and MEM_CLOCK_800MT.
Referenced by raminit().
|
static |
Definition at line 361 of file raminit.c.
References die(), MEM_CLOCK_333MHz, MEM_CLOCK_400MHz, and MEM_CLOCK_533MHz.
Referenced by find_common_clock_cas().
Definition at line 306 of file raminit.c.
References config, mask, smbus_read_byte(), and sysinfo::spd_map.
Referenced by collect_dimm_config().
Definition at line 566 of file raminit.c.
References spdinfo_t::banks, dimminfo::banks, BIOS_DEBUG, BIOS_SPEW, calculate_derived_timings(), dimminfo::card_type, spdinfo_t::cas_latencies, spdinfo_t::channel, CHANNEL_IS_POPULATED, CHANNEL_MODE_DUAL_INTERLEAVED, CHANNEL_MODE_SINGLE, spdinfo_t::chip_capacity, dimminfo::chip_capacity, collect_ddr3(), spdinfo_t::cols, DDR2, DDR3, die(), spdinfo_t::dimm_mask, sysinfo::dimms, find_common_clock_cas(), FOR_EACH_CHANNEL, IF_CHANNEL_POPULATED, spdinfo_t::page_size, dimminfo::page_size, printk, dimminfo::rank_capacity_mb, spdinfo_t::ranks, dimminfo::ranks, spdinfo_t::raw_card, spdinfo_t::rows, sysinfo::selected_timings, smbus_read_byte(), sysinfo::spd_map, sysinfo::spd_type, spdinfo_t::tAAmin, spdinfo_t::tCKmin, verify_ddr3(), and spdinfo_t::width.
Referenced by raminit().
|
static |
Definition at line 816 of file raminit.c.
References ch, CxDRC0_MCHBAR, CxDRC0_RANKEN, CxDRC0_RANKEN_MASK, CxDRC0_RMS_78US, CxDRC0_RMS_MASK, CxDRC1_MCHBAR, CxDRC1_MUSTWR, CxDRC1_NOTPOP, CxDRC1_NOTPOP_MASK, CxDRC2_CLK1067MT, CxDRC2_MCHBAR, CxDRC2_MUSTWR, CxDRC2_NOTPOP, CxDRC2_NOTPOP_MASK, FOR_EACH_CHANNEL, FOR_EACH_POPULATED_RANK_IN_CHANNEL, mchbar_read32(), mchbar_write32(), timings::mem_clock, and MEM_CLOCK_1067MT.
Referenced by raminit().
Definition at line 1592 of file raminit.c.
References CxDRT6_MCHBAR, DCC_MCHBAR, mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), and udelay().
Referenced by raminit().
|
static |
Definition at line 1405 of file raminit.c.
References addr, base, ch, die(), FOR_EACH_POPULATED_CHANNEL, mchbar_read32(), mchbar_write32(), MEM_CLOCK_1067MT, MEM_CLOCK_667MT, and MEM_CLOCK_800MT.
Referenced by memory_io_init().
|
static |
Definition at line 1305 of file raminit.c.
References ch, CHANNEL_IS_CARDF, CHANNEL_IS_POPULATED, die(), FOR_EACH_POPULATED_CHANNEL, mchbar_read32(), mchbar_write32(), MEM_CLOCK_1067MT, stepping, and STEPPING_B1.
Referenced by memory_io_init().
|
static |
Definition at line 1339 of file raminit.c.
References ch, CHANNEL_IS_CARDF, CHANNEL_IS_POPULATED, CxWRTy_MCHBAR, die(), FOR_EACH_POPULATED_CHANNEL, mchbar_write32(), MEM_CLOCK_1067MT, stepping, STEPPING_B1, and STEPPING_CONVERSION_A1.
Referenced by memory_io_init().
|
static |
Definition at line 1643 of file raminit.c.
References ch, CxDRC1_DS, CxDRC1_MCHBAR, CxDRC1_SS, CxDRC1_SSDS_MASK, FOR_EACH_POPULATED_CHANNEL, mchbar_read32(), and mchbar_write32().
Referenced by raminit().
|
static |
Definition at line 899 of file raminit.c.
References CLKCFG_MCHBAR, mchbar_clrbits32, mchbar_clrsetbits32(), mchbar_setbits32, and udelay().
Referenced by raminit().
|
static |
Definition at line 1001 of file raminit.c.
References dimminfo_t::banks, ch, CxDRA_BANKS, CxDRA_BANKS_MASK, CxDRA_MCHBAR, CxDRT1_MCHBAR, FOR_EACH_CHANNEL, FOR_EACH_POPULATED_RANK_IN_CHANNEL, IF_CHANNEL_POPULATED, mchbar_read32(), and mchbar_write32().
Referenced by raminit().
Definition at line 915 of file raminit.c.
References timings::CAS, CxDRT0_BtB_WtP_MASK, CxDRT0_BtB_WtP_SHIFT, CxDRT0_BtB_WtR_MASK, CxDRT0_BtB_WtR_SHIFT, CxDRT0_MCHBAR, CxDRT1_MCHBAR, CxDRT2_MCHBAR, CxDRT3_MCHBAR, CxDRT4_MCHBAR, CxDRT5_MCHBAR, CxDRT6_MCHBAR, FOR_EACH_CHANNEL, mchbar_read32(), mchbar_write32(), timings::mem_clock, MEM_CLOCK_1067MT, timings::tRAS, timings::tRCD, timings::tRFC, timings::tRP, timings::tRRD, and timings::tWR.
Referenced by raminit().
Definition at line 191 of file raminit.c.
References BIOS_INFO, BIOS_WARNING, gm45_early_reset(), PCI_DEV, pci_read_config8(), pci_write_config8(), and printk.
Referenced by mainboard_romstage_entry().
|
static |
Definition at line 387 of file raminit.c.
References BIOS_SPEW, timings::CAS, CAS, spdinfo_t::cas_latencies, spdinfo_t::channel, clock_index(), DDR3_MAX_CAS, die(), sysinfo::dimms, DIV_ROUND_UP, FOR_EACH_POPULATED_CHANNEL, timings::fsb_clock, FSB_CLOCK_1067MHz, FSB_CLOCK_667MHz, FSB_CLOCK_800MHz, lower_clock(), sysinfo::max_ddr3_mt, timings::mem_clock, MIN, normalize_clock(), printk, read_fsb_clock(), sysinfo::selected_timings, spdinfo_t::tAAmin, and spdinfo_t::tCKmin.
Referenced by collect_dimm_config().
Definition at line 31 of file raminit.c.
References BIOS_DEBUG, BIOS_SPEW, sysinfo::cores, cpuid_ext(), D0F0_CAPID0, die(), cpuid_result::eax, GMCH_GE45, gmch_gfx_types, GMCH_GL40, GMCH_GL43, GMCH_GM45, GMCH_GM47, GMCH_GM49, GMCH_GS40, GMCH_GS45, GMCH_PM45, GMCH_UNKNOWN, sysinfo::max_ddr2_mhz, sysinfo::max_ddr3_mt, sysinfo::max_fsb, sysinfo::max_fsb_mhz, sysinfo::max_render_mhz, PCI_CLASS_REVISION, PCI_DEV, pci_read_config16(), pci_read_config32(), pci_read_config8(), printk, STEPPING_B3, STEPPING_CONVERSION_A1, and sysinfo::txt_enabled.
Referenced by mainboard_romstage_entry().
Definition at line 1146 of file raminit.c.
References device::chip_info, DEFAULT_PCI_MMIO_SIZE, HOST_BRIDGE, NULL, northbridge_intel_gm45_config::pci_mmio_size, and pcidev_path_on_root().
Referenced by program_memory_map().
|
static |
Definition at line 1538 of file raminit.c.
References BIOS_DEBUG, timings::CAS, CAS, ch, DCC_CMD_MASK, DCC_CMD_NOP, DCC_MCHBAR, DCC_SET_EREG_MASK, DCC_SET_EREGx, DCC_SET_MREG, die(), FOR_EACH_POPULATED_RANK, mchbar_clrsetbits32(), mchbar_setbits32, pci_and_config8(), PCI_DEV, pci_or_config8(), printk, raminit_get_rank_addr(), read32(), timings::tWR, and udelay().
Referenced by raminit().
Definition at line 382 of file raminit.c.
References normalize_clock().
Referenced by find_common_clock_cas().
|
static |
Definition at line 1439 of file raminit.c.
References ddr3_read_io_init(), ddr3_select_clock_mux(), ddr3_write_io_init(), die(), mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), MEM_CLOCK_1067MT, MEM_CLOCK_667MT, MEM_CLOCK_800MT, stepping, and STEPPING_B1.
Referenced by raminit().
|
static |
Definition at line 1065 of file raminit.c.
References mchbar_clrsetbits32(), mchbar_clrsetbits8(), mchbar_setbits8, stepping, and STEPPING_B1.
Referenced by raminit().
Definition at line 371 of file raminit.c.
Referenced by find_common_clock_cas(), and lower_clock().
Definition at line 1021 of file raminit.c.
References timings::CAS, ch, CxODT_HIGH, CxODT_LOW, FOR_EACH_CHANNEL, mchbar_read32(), mchbar_write32(), timings::mem_clock, MEM_CLOCK_1067MT, MEM_CLOCK_667MT, and MEM_CLOCK_800MT.
Referenced by raminit().
|
static |
Definition at line 1611 of file raminit.c.
References mchbar_clrbits32, mchbar_clrsetbits32(), mchbar_setbits32, and mchbar_write32().
Referenced by raminit().
|
static |
Definition at line 1295 of file raminit.c.
References CHANNEL_MODE_DUAL_ASYNC, CHANNEL_MODE_DUAL_INTERLEAVED, DCC_MCHBAR, DCC_NO_CHANXOR, mchbar_setbits32, and program_memory_map().
Referenced by raminit().
|
static |
Definition at line 1163 of file raminit.c.
References base, BIOS_DEBUG, BIOS_SPEW, ch, CHANNEL_MODE_DUAL_ASYNC, CHANNEL_MODE_DUAL_INTERLEAVED, CHANNEL_MODE_SINGLE, CxDRA_MCHBAR, CxDRA_PAGESIZE, CxDRA_PAGESIZE_MASK, CxDRBy_BOUND_MB, CxDRBy_MCHBAR, D0F0_CAPID0, D0F0_ESMRAMC, D0F0_REMAPBASE, D0F0_REMAPLIMIT, D0F0_TOLUD, D0F0_TOM, D0F0_TOUUD, DCC_INTERLEAVED, DCC_MCHBAR, DCC_NO_CHANXOR, decode_igd_gtt_size(), decode_igd_memory_size(), FOR_EACH_CHANNEL, FOR_EACH_POPULATED_RANK_IN_CHANNEL, get_mmio_size(), IF_RANK_POPULATED, log2(), mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), dimminfo_t::page_size, PCI_CLASS_REVISION, PCI_DEV, pci_read_config32(), pci_read_config8(), pci_update_config8(), pci_write_config16(), printk, dimminfo_t::rank_capacity_mb, RANKS_PER_CHANNEL, TOLUD, TOM, and TOUUD.
Referenced by prejedec_memory_map(), and raminit().
Definition at line 1691 of file raminit.c.
References ch, clock_crossing_setup(), collect_dimm_config(), configure_dram_control_mode(), sysinfo::cores, CxDCLKDIS_ENABLE, CxDCLKDIS_MCHBAR, CxDRT3_MCHBAR, CxDRT5_MCHBAR, DCC_MCHBAR, DDR2, DDR3, ddr3_calibrate_zq(), sysinfo::dimms, dram_optimizations(), dram_powerup(), dram_program_banks(), dram_program_timings(), FOR_EACH_POPULATED_CHANNEL, timings::fsb_clock, sysinfo::ggc, igd_compute_ggc(), init_igd(), jedec_init(), mchbar_clrsetbits32(), mchbar_read32(), mchbar_setbits32, mchbar_setbits8, timings::mem_clock, MEM_CLOCK_1067MT, memory_io_init(), misc_settings(), odt_setup(), pci_and_config8(), PCI_DEV, pci_or_config8(), post_jedec_sequence(), prejedec_memory_map(), program_memory_map(), raminit_read_training(), raminit_receive_enable_calibration(), raminit_thermal(), raminit_write_training(), rcomp_initialization(), read8(), reset_on_bad_warmboot(), sysinfo::selected_timings, set_igd_memory_frequencies(), set_system_memory_frequency(), sysinfo::spd_type, timestamp_add_now(), TS_INITRAM_END, TS_INITRAM_START, sysinfo::txt_enabled, and vc1_program_timings().
Definition at line 1660 of file raminit.c.
References CxDRBy_BOUND_MASK, CxDRBy_BOUND_SHIFT, CxDRBy_MCHBAR, and mchbar_read32().
Referenced by jedec_init(), perform_read_training(), perform_write_training(), and read_dqs_level().
int raminit_read_vco_index | ( | void | ) |
Definition at line 733 of file raminit.c.
References die(), HPLLVCO_MCHBAR, mchbar_read8(), VCO_2666, VCO_3200, VCO_4000, and VCO_5333.
Referenced by enable_igd(), and init_freq_scaling().
Definition at line 1677 of file raminit.c.
References mchbar_clrbits32, and mchbar_setbits32.
Referenced by raminit_read_training(), raminit_receive_enable_calibration(), and raminit_write_training().
|
static |
Definition at line 851 of file raminit.c.
References die(), mchbar_clrbits32, mchbar_clrbits8, mchbar_clrsetbits32(), mchbar_read32(), mchbar_setbits32, mchbar_write8(), raminit_rcomp_calibration(), and stepping.
Referenced by raminit().
|
static |
Definition at line 348 of file raminit.c.
References CLKCFG_FSBCLK_MASK, CLKCFG_MCHBAR, die(), FSB_CLOCK_1067MHz, FSB_CLOCK_667MHz, FSB_CLOCK_800MHz, and mchbar_read32().
Referenced by find_common_clock_cas().
Definition at line 665 of file raminit.c.
References BIOS_INFO, gm45_early_reset(), mchbar_read32(), mchbar_write32(), PMSTS_BOTH_SELFREFRESH, PMSTS_MCHBAR, PMSTS_WARM_RESET, and printk.
Referenced by raminit().
Definition at line 678 of file raminit.c.
References BIOS_DEBUG, CLKCFG_MCHBAR, CLKCFG_MEMCLK_MASK, CLKCFG_MEMCLK_SHIFT, CLKCFG_UPDATE, timings::fsb_clock, FSB_CLOCK_1067MHz, mchbar_clrbits16, mchbar_clrbits32, mchbar_clrsetbits32(), mchbar_read16(), mchbar_read32(), mchbar_setbits32, mchbar_write32(), mchbar_write8(), timings::mem_clock, MEM_CLOCK_667MT, printk, SSKPD_CLK_MASK, SSKPD_CLK_SHIFT, and SSKPD_MCHBAR.
Referenced by raminit().
|
static |
Definition at line 220 of file raminit.c.
References addr, smbus_read_byte(), and sysinfo::spd_map.
Referenced by verify_ddr3_dimm().
|
static |
Definition at line 1131 of file raminit.c.
References epbar_write32(), epbar_write8(), EPVC1IST, and EPVC1ITC.
Referenced by raminit().
Definition at line 270 of file raminit.c.
References mask, and verify_ddr3_dimm().
Referenced by collect_dimm_config().
Definition at line 227 of file raminit.c.
References die(), and test_dimm().
Referenced by verify_ddr3().
|
static |