coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
emi.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef SOC_MEDIATEK_MT8173_EMI_H
4 #define SOC_MEDIATEK_MT8173_EMI_H
5 
6 #include <soc/dramc_common.h>
7 #include <soc/dramc_soc.h>
8 #include <types.h>
9 
10 /* DDR type */
11 enum ram_type {
17 };
18 
19 enum {
20  /*
21  * Vmem voltage adjustment:
22  * 1) HV: high voltage
23  * 2) NV: normal voltage
24  * 3) LV: low voltage
25  */
26  Vmem_HV_LPDDR3 = 0x50, /* 1.300V */
27  Vmem_NV_LPDDR3 = 0x44, /* 1.225V */
28  Vmem_LV_LPDDR3 = 0x36 /* 1.138V */
29 };
30 
31 enum {
32  /*
33  * Vcore voltage adjustment:
34  * 1) HHV: extra high voltage
35  * 2) HV: high voltage
36  * 3) NV: normal voltage
37  * 4) LV: low voltage
38  * 5) LLV: extra low voltage
39  */
40  Vcore_HHV_LPPDR3 = 0x60, /* 1.300V */
41  Vcore_HV_LPPDR3 = 0x48, /* 1.150V */
42  Vcore_NV_LPPDR3 = 0x44, /* 1.125V */
43  Vcore_LV_LPPDR3 = 0x34, /* 1.025V */
44  Vcore_LLV_LPPDR3 = 0x25 /* 0.931V */
45 };
46 
57 };
58 
72 };
73 
104 };
105 
113 };
114 
115 enum {
116  /* CONA = 0x000 */
124 };
125 
129  struct mt8173_emi_params emi_set;
130  struct mt8173_mrs_params mrs_set;
131  enum ram_type type;
132  unsigned int dram_freq;
133 };
134 
135 int complex_mem_test(u8 *start, unsigned int len);
136 void mt_set_emi(const struct mt8173_sdram_params *sdram_params);
137 void mt_mem_init(const struct mt8173_sdram_params *sdram_params);
138 const struct mt8173_sdram_params *get_sdram_config(void);
139 size_t sdram_size(void);
140 #endif
void mt_mem_init(struct dramc_param *dparam)
Definition: memory.c:304
void mt_set_emi(struct dramc_param *dparam)
Definition: emi.c:34
size_t sdram_size(void)
Definition: emi.c:117
int complex_mem_test(u8 *start, unsigned int len)
Definition: memory_test.c:25
#define BIT(nr)
Definition: ec_commands.h:45
@ DQS_NUMBER
Definition: dramc_soc.h:26
@ CHANNEL_NUM
Definition: dramc_soc.h:9
@ CATRAINING_NUM
Definition: dramc_soc.h:20
@ DUAL_RANKS
Definition: dramc_soc.h:19
@ GW_PARAM_NUM
Definition: dramc_soc.h:15
@ Vcore_HHV_LPPDR3
Definition: emi.h:40
@ Vcore_LV_LPPDR3
Definition: emi.h:43
@ Vcore_HV_LPPDR3
Definition: emi.h:41
@ Vcore_LLV_LPPDR3
Definition: emi.h:44
@ Vcore_NV_LPPDR3
Definition: emi.h:42
ram_type
Definition: emi.h:11
@ TYPE_DDR1
Definition: emi.h:13
@ TYPE_LPDDR3
Definition: emi.h:15
@ TYPE_PCDDR3
Definition: emi.h:16
@ TYPE_LPDDR2
Definition: emi.h:14
@ TYPE_INVALID
Definition: emi.h:12
const struct mt8173_sdram_params * get_sdram_config(void)
Definition: sdram_configs.c:85
@ COL_ADDR_BITS_SHIFT
Definition: emi.h:120
@ COL_ADDR_BITS_MASK
Definition: emi.h:121
@ ROW_ADDR_BITS_SHIFT
Definition: emi.h:122
@ CONA_32BIT_EN
Definition: emi.h:118
@ ROW_ADDR_BITS_MASK
Definition: emi.h:123
@ CONA_DUAL_CH_EN
Definition: emi.h:117
@ CONA_DUAL_RANK_EN
Definition: emi.h:119
@ Vmem_LV_LPDDR3
Definition: emi.h:28
@ Vmem_NV_LPDDR3
Definition: emi.h:27
@ Vmem_HV_LPDDR3
Definition: emi.h:26
#define DQS_BIT_NUMBER
Definition: dramc_soc.h:53
uint32_t u32
Definition: stdint.h:51
int8_t s8
Definition: stdint.h:44
uint8_t u8
Definition: stdint.h:45
u8 impedance_drvp
Definition: emi.h:48
u8 datlat_ucfirst
Definition: emi.h:50
s8 ca_train_center[CHANNEL_NUM]
Definition: emi.h:52
s8 wr_level[CHANNEL_NUM][DQS_NUMBER]
Definition: emi.h:53
s8 ca_train[CHANNEL_NUM][CATRAINING_NUM]
Definition: emi.h:51
u32 rx_dq_dly[CHANNEL_NUM][DQS_BIT_NUMBER]
Definition: emi.h:56
u32 rx_dqs_dly[CHANNEL_NUM]
Definition: emi.h:55
u8 impedance_drvn
Definition: emi.h:49
u8 gating_win[CHANNEL_NUM][DUAL_RANKS][GW_PARAM_NUM]
Definition: emi.h:54
u32 mdct_1
Definition: emi.h:85
u32 conm_2
Definition: emi.h:84
u32 conm_1
Definition: emi.h:83
u32 mdct_2
Definition: emi.h:86
enum ram_type type
Definition: emi.h:131
unsigned int dram_freq
Definition: emi.h:132
struct mt8173_mrs_params mrs_set
Definition: emi.h:130
struct mt8173_calib_params calib_params
Definition: emi.h:127
struct mt8173_timing_params ac_timing
Definition: emi.h:128
struct mt8173_emi_params emi_set
Definition: emi.h:129
Defines the SDRAM parameter structure.
Definition: emi.h:15