coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
memory.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <soc/clk.h>
4 #include <soc/dmc.h>
5 #include <soc/gpio.h>
6 #include <soc/setup.h>
7 
8 const struct mem_timings mem_timings = {
10  .mem_type = DDR_MODE_DDR3,
11  .frequency_mhz = 800,
12  .direct_cmd_msr = {
13  0x00020018, 0x00030000, 0x00010046, 0x00000d70,
14  0x00000c70
15  },
16  .timing_ref = 0x000000bb,
17  .timing_row = 0x6836650f,
18  .timing_data = 0x3630580b,
19  .timing_power = 0x41000a26,
20  .phy0_dqs = 0x08080808,
21  .phy1_dqs = 0x08080808,
22  .phy0_dq = 0x08080808,
23  .phy1_dq = 0x08080808,
24  .phy0_tFS = 0x8,
25  .phy1_tFS = 0x8,
26  .phy0_pulld_dqs = 0xf,
27  .phy1_pulld_dqs = 0xf,
28 
29  .lpddr3_ctrl_phy_reset = 0x1,
30  .ctrl_start_point = 0x10,
31  .ctrl_inc = 0x10,
32  .ctrl_start = 0x1,
33  .ctrl_dll_on = 0x1,
34  .ctrl_ref = 0x8,
35 
36  .ctrl_force = 0x1a,
37  .ctrl_rdlat = 0x0b,
38  .ctrl_bstlen = 0x08,
39 
40  .fp_resync = 0x8,
41  .iv_size = 0x7,
42  .dfi_init_start = 1,
43  .aref_en = 1,
44 
45  .rd_fetch = 0x3,
46 
47  .zq_mode_dds = 0x7,
48  .zq_mode_term = 0x1,
49  .zq_mode_noterm = 1,
50 
51  /*
52  * Dynamic Clock: Always Running
53  * Memory Burst length: 8
54  * Number of chips: 1
55  * Memory Bus width: 32 bit
56  * Memory Type: DDR3
57  * Additional Latancy for PLL: 0 Cycle
58  */
59  .memcontrol = DMC_MEMCONTROL_CLK_STOP_DISABLE |
70  /*
71  * For channel interleaving, the chip_base needs to be set to
72  * half the bus address. So for a base address of 0x2000_0000,
73  * the chip_base value is 0x20 without interleaving and 0x10
74  * with channel interleaving. See note in section 17.14.
75  */
76  .membaseconfig0 = (0x10 << 16) | DMC_CHIP_MASK_1GB,
81  .prechconfig_tp_cnt = 0xff,
82  .dpwrdn_cyc = 0xff,
83  .dsref_cyc = 0xffff,
89  .dmc_channels = 1,
90  .chips_per_channel = 1,
91  .chips_to_configure = 1,
92  .send_zq_init = 1,
94 };
@ MEM_MANUF_SAMSUNG
Definition: dmc.h:187
@ DDR_MODE_DDR3
Definition: dmc.h:162
#define DMC_MEMCONTROL_MEM_TYPE_DDR3
Definition: setup.h:72
#define DMC_MEMCONTROL_NUM_CHIP_1
Definition: setup.h:77
#define DMC_MEMCONTROL_ADD_LAT_PALL_CYCLE(x)
Definition: setup.h:69
#define DMC_MEMCONTROL_BL_8
Definition: setup.h:80
#define DMC_MEMCONTROL_MRR_BYTE_7_0
Definition: setup.h:85
#define DMC_MEMCONTROL_CLK_STOP_DISABLE
Definition: setup.h:63
#define DMC_CONCONTROL_AREF_EN_DISABLE
Definition: setup.h:127
#define DMC_MEMCONTROL_DSREF_DISABLE
Definition: setup.h:67
#define DMC_MEMCONFIGx_CHIP_ROW_15
Definition: setup.h:94
#define DMC_CONCONTROL_DFI_INIT_START_DISABLE
Definition: setup.h:132
#define DMC_CONCONTROL_RD_FETCH_DISABLE
Definition: setup.h:130
#define DMC_MEMCONFIGx_CHIP_COL_10
Definition: setup.h:92
#define DMC_MEMCONTROL_DPWRDN_DISABLE
Definition: setup.h:64
#define DMC_MEMCONTROL_PZQ_DISABLE
Definition: setup.h:83
#define DMC_MEMCONTROL_DPWRDN_ACTIVE_PRECHARGE
Definition: setup.h:65
#define DMC_MEMCONTROL_MEM_WIDTH_32BIT
Definition: setup.h:75
#define DMC_CONCONTROL_TIMEOUT_LEVEL0
Definition: setup.h:131
#define DMC_CONCONTROL_IO_PD_CON_DISABLE
Definition: setup.h:126
#define DMC_MEMCONFIGx_CHIP_BANK_8
Definition: setup.h:95
#define DMC_CHIP_MASK_1GB
Definition: setup.h:747
#define DMC_MEMCONFIG_CHIP_MAP_SPLIT
Definition: setup.h:117
uint8_t send_zq_init
Definition: dmc.h:327
uint8_t gate_leveling_enable
Definition: dmc.h:329
enum mem_manuf mem_manuf
Definition: dmc.h:247
unsigned int prechconfig_tp_cnt
Definition: dmc.h:319
unsigned int memconfig
Definition: dmc.h:315
uint8_t chips_per_channel
Definition: dmc.h:325
uint8_t dmc_channels
Definition: dmc.h:324
unsigned int dpwrdn_cyc
Definition: dmc.h:320
uint8_t chips_to_configure
Definition: dmc.h:326
unsigned int concontrol
Definition: dmc.h:322
unsigned int dsref_cyc
Definition: dmc.h:321