summaryrefslogtreecommitdiffstats
path: root/src/vendorcode/mediatek/mt8195/include/sv_c_data_traffic.h
blob: 0b7a1ea571b921887822d9ef8a7c0c46181d3add (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/* SPDX-License-Identifier: BSD-3-Clause */

#ifndef __SV_C_DATA_TRAFFIC_H
#define __SV_C_DATA_TRAFFIC_H

#if FOR_DV_SIMULATION_USED
#ifndef STRINGIFY(x)
#define STRINGIFY(x) #x
#endif
#endif
#define TOSTRING(x) STRINGIFY(x)

#define print_svarg(arg) \
({ \
	mcSHOW_DBG_MSG((TOSTRING(arg) "=0x%x\n", psra->arg)); \
})


enum {
	SV_CHN_A = 0,
	SV_CHN_B
};



enum {
	SV_LPDDR = 0,
	SV_LPDDR2,
	SV_PCDDR3,
	SV_LPDDR3,
	SV_LPDDR4,
	SV_LPDDR5
};


enum {
	SV_DDR4266 = 0,
	SV_DDR3200,
	SV_DDR1600,
	SV_DDR3733,
	SV_DDR2400,
	SV_DDR1866,
	SV_DDR1200,
	SV_DDR1333,
	SV_DDR800,
	SV_DDR1066,
	SV_DDR2667,
	SV_DDR4800,
	SV_DDR5500,
	SV_DDR6000,
	SV_DDR6400,
	SV_DDR2750,
	SV_DDR2133
};


typedef struct cal_sv_rand_args {


	int magic;


	int calibration_channel;


	int calibration_rank;


	int dram_type;


	int datarate;


	int dmd;
	int mr2_value;
	int mr3_value;
	int mr13_value;
	int mr12_value;
	int mr16_value;
	int mr18_value;
	int mr20_value;

	int cbt;


	int cbt_phase;


	int cbt_training_mode;


	int rk0_cbt_mode;


	int rk1_cbt_mode;


	int cbt_autok;


	int cbt_atk_respi;


	int new_cbt_mode;


	int pat_v[8];


	int pat_a[8];


	int pat_dmv;


	int pat_dma;


	int pat_cs;


	int cagolden_sel;


	int invert_num;


	int wl;


	int wl_autok;


	int wl_atk_respi;

	int gating;


	int gating_autok;

	int dqsien_autok_pi_offset;
	int dqsien_autok_early_break_en;
	int dqsien_autok_dbg_mode_en;

	int rddqc;

	int low_byte_invert_golden;
	int upper_byte_invert_golden;
	int mr_dq_a_golden;
	int mr_dq_b_golden;
	int lp5_mr20_6_golden;
	int lp5_mr20_7_golden;

	int tx_perbit;


	int tx_auto_cal;

	int tx_atk_pass_pi_thrd;
	int tx_atk_early_break;

	int rx_perbit;


	int rx_auto_cal;

	int rx_atk_cal_step;
	int rx_atk_cal_out_dbg_en;
	int rx_atk_cal_out_dbg_sel;

} cal_sv_rand_args_t;

void set_psra(cal_sv_rand_args_t *psra);
cal_sv_rand_args_t *get_psra(void);
void print_sv_args(cal_sv_rand_args_t *psra);
u8 valid_magic(cal_sv_rand_args_t *psra);
void set_type_freq_by_svargs(DRAMC_CTX_T *p,
	    cal_sv_rand_args_t *psra);

#endif /* __SV_C_DATA_TRAFFIC_H */