Debian Codegraph @

src/northbridge/intel/haswell/native_raminit/raminit_native.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #ifndef HASWELL_RAMINIT_NATIVE_H
4 #define HASWELL_RAMINIT_NATIVE_H
5
6 #include <assert.h>
7 #include <device/dram/ddr3.h>
8 #include <northbridge/intel/haswell/haswell.h>
9 #include <string.h>
10 #include <types.h>
11
12 #include "reg_structs.h"
13
14 /* Each channel has 4 ranks, spread across 2 slots */
15 #define NUM_SLOTRANKS 4
16
17 #define NUM_GROUPS 2
18
19 /* 8 data lanes + 1 ECC lane */
20 #define NUM_LANES 9
21 #define NUM_LANES_NO_ECC 8
22
23 #define NUM_BITS 8
24
25 #define COMP_INT 10
26
27 /* Always use 12 legs for emphasis (not trained) */
28 #define TXEQFULLDRV (3 << 4)
29
30 #define LOOPCOUNT_INFINITE 0xff
31
32 /* DDR3 mode register bits */
33 #define MR0_DLL_RESET BIT(8)
34
35 #define MR1_WL_ENABLE BIT(7)
36 #define MR1_QOFF_ENABLE BIT(12) /* If set, output buffers disabled */
37
38 #define RTTNOM_MASK (BIT(9) | BIT(6) | BIT(2))
39
40 /* Margin parameter limits */
41 #define MAX_POSSIBLE_TIME 31
42 #define MAX_POSSIBLE_VREF 54
43
44 #define MAX_POSSIBLE_BOTH MAX_POSSIBLE_VREF
45
46 #define MIN_TIME (-MAX_POSSIBLE_TIME)
47 #define MAX_TIME (MAX_POSSIBLE_TIME)
48
49 #define MIN_VREF (-MAX_POSSIBLE_VREF)
50 #define MAX_VREF (MAX_POSSIBLE_VREF)
51
52 #define BASIC_VA_PAT_SPREAD_8 0x01010101
53
54 #define WDB_CACHE_LINE_SIZE 8
55
56 #define NUM_WDB_CL_MUX_SEEDS 3
57 #define NUM_CADB_MUX_SEEDS 3
58
59 /* Specified in PI ticks. 64 PI ticks == 1 qclk */
60 #define tDQSCK_DRIFT 64
61
62 /* Maximum additional latency */
63 #define MAX_ADD_DELAY 2
64
65 enum margin_parameter {
66 RcvEna,
67 RdT,
68 WrT,
69 WrDqsT,
70 RdV,
71 };
72
73 enum opt_param {
74 OptWrDS = 0,
75 OptRdOdt,
76 OptSComp,
77 OptTComp,
78 OptTxEq,
79 OptRxEq,
80 OptRxBias,
81 OptDimmOdt,
82 OptDimmOdtWr,
83 OptDimmRon,
84 OptDefault,
85 };
86
87 enum global_comp_offset {
88 RdOdt,
89 WrDS,
90 WrDSCmd,
91 WrDSCtl,
92 WrDSClk,
93 SCompDq,
94 SCompCmd,
95 SCompCtl,
96 SCompClk,
97 DisOdtStatic,
98 };
99
100 /* ZQ calibration types */
101 enum {
102 ZQ_INIT, /* DDR3: ZQCL with tZQinit, LPDDR3: ZQ Init with tZQinit */
103 ZQ_LONG, /* DDR3: ZQCL with tZQoper, LPDDR3: ZQ Long with tZQCL */
104 ZQ_SHORT, /* DDR3: ZQCS with tZQCS, LPDDR3: ZQ Short with tZQCS */
105 ZQ_RESET, /* DDR3: not used, LPDDR3: ZQ Reset with tZQreset */
106 };
107
108 /* REUT initialisation modes */
109 enum {
110 REUT_MODE_IDLE = 0,
111 REUT_MODE_TEST = 1,
112 REUT_MODE_MRS = 2,
113 REUT_MODE_NOP = 3, /* Normal operation mode */
114 };
115
116 /* REUT error counter control */
117 enum {
118 COUNT_ERRORS_PER_CHANNEL = 0,
119 COUNT_ERRORS_PER_LANE = 1,
120 COUNT_ERRORS_PER_BYTE_GROUP = 2,
121 COUNT_ERRORS_PER_CHUNK = 3,
122 };
123
124 enum wdb_dq_pattern {
125 BASIC_VA = 0,
126 SEGMENT_WDB,
127 CADB,
128 TURN_AROUND,
129 LMN_VA,
130 TURN_AROUND_WR,
131 TURN_AROUND_ODT,
132 RD_RD_TA,
133 RD_RD_TA_ALL,
134 };
135
136 enum reut_cmd_pat {
137 PAT_WR_RD,
138 PAT_WR,
139 PAT_RD,
140 PAT_RD_WR_TA,
141 PAT_WR_RD_TA,
142 PAT_ODT_TA,
143 };
144
145 /* REUT mux control */
146 enum {
147 REUT_MUX_LMN = 0,
148 REUT_MUX_BTBUFFER = 1,
149 REUT_MUX_LFSR = 2,
150 };
151
152 /* Increment scale */
153 enum {
154 SCALE_LOGARITHM = 0,
155 SCALE_LINEAR = 1,
156 };
157
158 enum test_stop {
159 NSOE = 0, /* Never stop on error */
160 NTHSOE = 1, /* Stop on the nth error (we use n = 1) */
161 ABGSOE = 2, /* Stop on all byte groups error */
162 ALSOE = 3, /* Stop on all lanes error */
163 };
164
165 enum rxt_subfield {
166 RXT_RCVEN = 0,
167 RXT_RXDQS_P = 1,
168 RXT_RX_EQ = 2,
169 RXT_RXDQS_N = 3,
170 RXT_RX_VREF = 4,
171 RXT_RXDQS_BOTH = 5,
172 RXT_RESTORE = 255,
173 };
174
175 enum txt_subfield {
176 TXT_TX_DQ = 0,
177 TXT_TXDQS = 1,
178 TXT_TX_EQ = 2,
179 TXT_DQDQS_OFF = 3,
180 TXT_RESTORE = 255,
181 };
182
183 enum regfile_mode {
184 REG_FILE_USE_RANK, /* Used when changing parameters for each rank */
185 REG_FILE_USE_START, /* Used when changing parameters before the test */
186 REG_FILE_USE_CURRENT, /* Used when changing parameters after the test */
187 };
188
189 struct register_save_frame;
190
191 struct wdb_pat {
192 uint32_t start_ptr; /* Starting pointer in WDB */
193 uint32_t stop_ptr; /* Stopping pointer in WDB */
194 uint16_t inc_rate; /* How quickly the WDB walks through cachelines */
195 uint8_t dq_pattern; /* DQ pattern to use (see enum wdb_dq_pattern above) */
196 };
197
198 struct reut_pole {
199 uint16_t start;
200 uint16_t stop;
201 uint16_t order;
202 uint32_t inc_rate;
203 uint16_t inc_val;
204 bool wrap_trigger;
205 };
206
207 struct reut_box {
208 struct reut_pole rank;
209 struct reut_pole bank;
210 struct reut_pole row;
211 struct reut_pole col;
212 };
213
214 enum command_training_iteration {
215 CT_ITERATION_CLOCK = 0,
216 CT_ITERATION_CMD_NORTH,
217 CT_ITERATION_CMD_SOUTH,
218 CT_ITERATION_CKE,
219 CT_ITERATION_CTL,
220 CT_ITERATION_CMD_VREF,
221 MAX_CT_ITERATION,
222 };
223
224 enum raminit_boot_mode {
225 BOOTMODE_COLD,
226 BOOTMODE_WARM,
227 BOOTMODE_S3,
228 BOOTMODE_FAST,
229 };
230
231 enum raminit_status {
232 RAMINIT_STATUS_SUCCESS = 0,
233 RAMINIT_STATUS_NO_MEMORY_INSTALLED,
234 RAMINIT_STATUS_UNSUPPORTED_MEMORY,
235 RAMINIT_STATUS_MPLL_INIT_FAILURE,
236 RAMINIT_STATUS_POLL_TIMEOUT,
237 RAMINIT_STATUS_REUT_ERROR,
238 RAMINIT_STATUS_SAMP_OFFSET_FAILURE,
239 RAMINIT_STATUS_RCVEN_FAILURE,
240 RAMINIT_STATUS_RMPR_FAILURE,
241 RAMINIT_STATUS_JWRL_FAILURE,
242 RAMINIT_STATUS_INVALID_CACHE,
243 RAMINIT_STATUS_UNSPECIFIED_ERROR, /** TODO: Deprecated in favor of specific values **/
244 };
245
246 enum generic_stepping {
247 STEPPING_A0 = 1,
248 STEPPING_B0 = 2,
249 STEPPING_C0 = 3,
250 };
251
252 struct mrc_data {
253 const void *buffer;
254 size_t buffer_len;
255 };
256
257 struct raminit_dimm_info {
258 spd_ddr3_raw_data raw_spd;
259 struct dimm_attr_ddr3_st data;
260 uint8_t spd_addr;
261 bool valid;
262 };
263
264 struct vref_margin {
265 uint8_t low;
266 uint8_t center;
267 uint8_t high;
268 };
269
270 struct sysinfo {
271 enum raminit_boot_mode bootmode;
272 enum generic_stepping stepping;
273 uint32_t cpu; /* CPUID value */
274
275 bool dq_pins_interleaved;
276 bool restore_mrs;
277
278 /** TODO: ECC support untested **/
279 bool is_ecc;
280
281 /**
282 * FIXME: LPDDR support is incomplete. The largest chunks are missing,
283 * but some LPDDR-specific variations in algorithms have been handled.
284 * LPDDR-specific functions have stubs which will halt upon execution.
285 */
286 bool lpddr;
287 bool lpddr_dram_odt;
288 uint8_t lpddr_cke_rank_map[NUM_CHANNELS];
289 uint8_t dq_byte_map[NUM_CHANNELS][MAX_CT_ITERATION][2];
290
291 struct raminit_dimm_info dimms[NUM_CHANNELS][NUM_SLOTS];
292 union dimm_flags_ddr3_st flags;
293 uint16_t cas_supported;
294
295 /* Except for tCK, everything is eventually stored in DCLKs */
296 uint32_t tCK;
297 uint32_t tAA; /* Also known as tCL */
298 uint32_t tWR;
299 uint32_t tRCD;
300 uint32_t tRRD;
301 uint32_t tRP;
302 uint32_t tRAS;
303 uint32_t tRC;
304 uint32_t tRFC;
305 uint32_t tWTR;
306 uint32_t tRTP;
307 uint32_t tFAW;
308 uint32_t tCWL;
309 uint32_t tCMD;
310
311 uint32_t tREFI;
312 uint32_t tXP;
313
314 uint8_t lanes; /* 8 or 9 */
315 uint8_t chanmap;
316 uint8_t dpc[NUM_CHANNELS]; /* DIMMs per channel */
317 uint8_t rankmap[NUM_CHANNELS];
318 uint8_t rank_mirrored[NUM_CHANNELS];
319 uint32_t channel_size_mb[NUM_CHANNELS];
320
321 uint8_t base_freq; /* Memory base frequency, either 100 or 133 MHz */
322 uint32_t multiplier;
323 uint32_t mem_clock_mhz;
324 uint32_t mem_clock_fs; /* Memory clock period in femtoseconds */
325 uint32_t qclkps; /* Quadrature clock period in picoseconds */
326
327 uint16_t vdd_mv;
328
329 union ddr_scram_misc_control_reg misc_control_0;
330
331 union ddr_comp_ctl_0_reg comp_ctl_0;
332 union ddr_comp_ctl_1_reg comp_ctl_1;
333
334 union ddr_data_vref_adjust_reg dimm_vref;
335
336 union sc_roundt_lat_reg rt_latency[NUM_CHANNELS];
337
338 uint8_t io_latency[NUM_CHANNELS][NUM_SLOTRANKS];
339 uint32_t rt_io_comp[NUM_CHANNELS];
340
341 uint32_t data_offset_train[NUM_CHANNELS][NUM_LANES];
342 union ddr_data_offset_comp_reg data_offset_comp[NUM_CHANNELS][NUM_LANES];
343
344 uint32_t dq_control_0[NUM_CHANNELS];
345 uint32_t dq_control_1[NUM_CHANNELS][NUM_LANES];
346 uint32_t dq_control_2[NUM_CHANNELS][NUM_LANES];
347
348 uint16_t tx_dq[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
349 uint16_t txdqs[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
350 uint8_t tx_eq[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
351
352 uint16_t rcven[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
353 uint8_t rx_eq[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
354 uint8_t rxdqsp[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
355 uint8_t rxdqsn[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
356 int8_t rxvref[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES];
357
358 struct vref_margin rxdqvrefpb[NUM_CHANNELS][NUM_SLOTRANKS][NUM_LANES][NUM_BITS];
359
360 uint8_t clk_pi_code[NUM_CHANNELS][NUM_SLOTRANKS];
361 uint8_t ctl_pi_code[NUM_CHANNELS][NUM_SLOTRANKS];
362 uint8_t cke_pi_code[NUM_CHANNELS][NUM_SLOTRANKS];
363
364 uint8_t cke_cmd_pi_code[NUM_CHANNELS][NUM_GROUPS];
365 uint8_t cmd_north_pi_code[NUM_CHANNELS][NUM_GROUPS];
366 uint8_t cmd_south_pi_code[NUM_CHANNELS][NUM_GROUPS];
367
368 union tc_bank_reg tc_bank[NUM_CHANNELS];
369 union tc_bank_rank_a_reg tc_bankrank_a[NUM_CHANNELS];
370 union tc_bank_rank_b_reg tc_bankrank_b[NUM_CHANNELS];
371 union tc_bank_rank_c_reg tc_bankrank_c[NUM_CHANNELS];
372 union tc_bank_rank_d_reg tc_bankrank_d[NUM_CHANNELS];
373
374 uint16_t mr0[NUM_CHANNELS][NUM_SLOTS];
375 uint16_t mr1[NUM_CHANNELS][NUM_SLOTS];
376 uint16_t mr2[NUM_CHANNELS][NUM_SLOTS];
377 uint16_t mr3[NUM_CHANNELS][NUM_SLOTS];
378
379 uint8_t dq_pat;
380
381 uint8_t dq_pat_lc;
382 };
383
384 static inline int8_t sign_of(const int32_t val)
385 {
386 return val < 0 ? -1 : 1;
387 }
388
389 static inline bool is_hsw_ult(void)
390 {
391 return CONFIG(INTEL_LYNXPOINT_LP);
392 }
393
394 static inline bool rank_in_mask(uint8_t rank, uint8_t rankmask)
395 {
396 assert(rank < NUM_SLOTRANKS);
397 return !!(BIT(rank) & rankmask);
398 }
399
400 static inline bool does_ch_exist(const struct sysinfo *ctrl, uint8_t channel)
401 {
402 return !!ctrl->dpc[channel];
403 }
404
405 static inline bool does_rank_exist(const struct sysinfo *ctrl, uint8_t rank)
406 {
407 return rank_in_mask(rank, ctrl->rankmap[0] | ctrl->rankmap[1]);
408 }
409
410 static inline bool rank_in_ch(const struct sysinfo *ctrl, uint8_t rank, uint8_t channel)
411 {
412 assert(channel < NUM_CHANNELS);
413 return rank_in_mask(rank, ctrl->rankmap[channel]);
414 }
415
416 /** TODO: Handling of data_offset_train could be improved, also coupled with reg updates **/
417 static inline void clear_data_offset_train_all(struct sysinfo *ctrl)
418 {
419 memset(ctrl->data_offset_train, 0, sizeof(ctrl->data_offset_train));
420 }
421
422 static inline uint32_t get_data_train_feedback(const uint8_t channel, const uint8_t byte)
423 {
424 return mchbar_read32(DDR_DATA_TRAIN_FEEDBACK(channel, byte));
425 }
426
427 static inline uint16_t get_byte_group_errors(const uint8_t channel)
428 {
429 return mchbar_read32(4 + REUT_ch_ERR_MISC_STATUS(channel)) & 0x1ff;
430 }
431
432 /* Number of ticks to wait in units of 69.841279 ns (citation needed) */
433 static inline void tick_delay(const uint32_t delay)
434 {
435 /* Just perform reads to a random register */
436 for (uint32_t start = 0; start <= delay; start++)
437 mchbar_read32(REUT_ERR_DATA_STATUS);
438 }
439
440 /*
441 * 64-bit MCHBAR registers need to be accessed atomically. If one uses
442 * two 32-bit ops instead, there will be problems with the REUT's CADB
443 * (Command Address Data Buffer): hardware automatically advances the
444 * pointer into the register file after a write to the input register.
445 */
446 static inline uint64_t mchbar_read64(const uintptr_t x)
447 {
448 const uint64_t *offset = (uint64_t *)(CONFIG_FIXED_MCHBAR_MMIO_BASE + x);
449 uint64_t mmxsave, v;
450 asm volatile (
451 "\n\t movq %%mm0, %0"
452 "\n\t movq %2, %%mm0"
453 "\n\t movq %%mm0, %1"
454 "\n\t movq %3, %%mm0"
455 "\n\t emms"
456 : "=m"(mmxsave),
457 "=m"(v)
458 : "m"(offset[0]),
459 "m"(mmxsave));
460 return v;
461 }
462
463 static inline void mchbar_write64(const uintptr_t x, const uint64_t v)
464 {
465 const uint64_t *offset = (uint64_t *)(CONFIG_FIXED_MCHBAR_MMIO_BASE + x);
466 uint64_t mmxsave;
467 asm volatile (
468 "\n\t movq %%mm0, %0"
469 "\n\t movq %2, %%mm0"
470 "\n\t movq %%mm0, %1"
471 "\n\t movq %3, %%mm0"
472 "\n\t emms"
473 : "=m"(mmxsave)
474 : "m"(offset[0]),
475 "m"(v),
476 "m"(mmxsave));
477 }
478
479 void raminit_main(enum raminit_boot_mode bootmode);
480
481 enum raminit_status collect_spd_info(struct sysinfo *ctrl);
482 enum raminit_status initialise_mpll(struct sysinfo *ctrl);
483 enum raminit_status convert_timings(struct sysinfo *ctrl);
484 enum raminit_status configure_mc(struct sysinfo *ctrl);
485 enum raminit_status configure_memory_map(struct sysinfo *ctrl);
486 enum raminit_status do_jedec_init(struct sysinfo *ctrl);
487 enum raminit_status train_sense_amp_offset(struct sysinfo *ctrl);
488 enum raminit_status train_receive_enable(struct sysinfo *ctrl);
489 enum raminit_status train_read_mpr(struct sysinfo *ctrl);
490 enum raminit_status train_jedec_write_leveling(struct sysinfo *ctrl);
491 enum raminit_status optimise_comp(struct sysinfo *ctrl);
492 enum raminit_status save_training_values(struct sysinfo *ctrl);
493 enum raminit_status restore_training_values(struct sysinfo *ctrl);
494 enum raminit_status save_non_training(struct sysinfo *ctrl);
495 enum raminit_status restore_non_training(struct sysinfo *ctrl);
496 enum raminit_status exit_selfrefresh(struct sysinfo *ctrl);
497 enum raminit_status normal_state(struct sysinfo *ctrl);
498 enum raminit_status activate_mc(struct sysinfo *ctrl);
499 enum raminit_status raminit_done(struct sysinfo *ctrl);
500
501 void configure_timings(struct sysinfo *ctrl);
502 void configure_refresh(struct sysinfo *ctrl);
503
504 struct register_save_frame *reg_frame_ptr(void);
505 size_t reg_frame_size(void);
506 uint32_t reg_frame_rev(void);
507
508 uint32_t get_tCKE(uint32_t mem_clock_mhz, bool lpddr);
509 uint32_t get_tXPDLL(uint32_t mem_clock_mhz);
510 uint32_t get_tAONPD(uint32_t mem_clock_mhz);
511 uint32_t get_tMOD(uint32_t mem_clock_mhz);
512 uint32_t get_tXS_offset(uint32_t mem_clock_mhz);
513 uint32_t get_tZQOPER(uint32_t mem_clock_mhz, bool lpddr);
514 uint32_t get_tZQCS(uint32_t mem_clock_mhz, bool lpddr);
515
516 enum raminit_status io_reset(void);
517 enum raminit_status wait_for_first_rcomp(void);
518 void force_rcomp_and_wait_us(unsigned int usecs);
519
520 uint16_t encode_ddr3_rttnom(uint32_t rttnom);
521 void ddr3_program_mr1(struct sysinfo *ctrl, uint8_t wl_mode, uint8_t q_off);
522 enum raminit_status ddr3_jedec_init(struct sysinfo *ctrl);
523
524 void reut_issue_mrs(
525 struct sysinfo *ctrl,
526 uint8_t channel,
527 uint8_t rankmask,
528 uint8_t mr,
529 uint16_t val);
530
531 void reut_issue_mrs_all(
532 struct sysinfo *ctrl,
533 uint8_t channel,
534 uint8_t mr,
535 const uint16_t val[NUM_SLOTS]);
536
537 enum raminit_status reut_issue_zq(struct sysinfo *ctrl, uint8_t chanmask, uint8_t zq_type);
538
539 void write_wdb_fixed_pat(
540 const struct sysinfo *ctrl,
541 const uint8_t patterns[],
542 const uint8_t pat_mask[],
543 uint8_t spread,
544 uint16_t start);
545
546 void write_wdb_va_pat(
547 const struct sysinfo *ctrl,
548 uint32_t agg_mask,
549 uint32_t vic_mask,
550 uint8_t vic_rot,
551 uint16_t start);
552
553 void program_wdb_lfsr(const struct sysinfo *ctrl, bool cleanup);
554 void setup_wdb(const struct sysinfo *ctrl);
555
556 void program_seq_addr(uint8_t channel, const struct reut_box *reut_addr, bool log_seq_addr);
557 void program_loop_count(const struct sysinfo *ctrl, uint8_t channel, uint8_t lc_exp);
558
559 void setup_io_test(
560 struct sysinfo *ctrl,
561 uint8_t chanmask,
562 enum reut_cmd_pat cmd_pat,
563 uint16_t num_cl,
564 uint8_t lc,
565 const struct reut_box *reut_addr,
566 enum test_stop soe,
567 const struct wdb_pat *pat,
568 uint8_t en_cadb,
569 uint8_t subseq_wait);
570
571 void setup_io_test_cadb(struct sysinfo *ctrl, uint8_t chanmask, uint8_t lc, enum test_stop soe);
572 void setup_io_test_basic_va(struct sysinfo *ctrl, uint8_t chm, uint8_t lc, enum test_stop soe);
573 void setup_io_test_mpr(struct sysinfo *ctrl, uint8_t chanmask, uint8_t lc, enum test_stop soe);
574
575 uint8_t select_reut_ranks(struct sysinfo *ctrl, uint8_t channel, uint8_t rankmask);
576
577 void run_mpr_io_test(bool clear_errors);
578 uint8_t run_io_test(struct sysinfo *ctrl, uint8_t chanmask, uint8_t dq_pat, bool clear_errors);
579
580 void update_rxt(
581 struct sysinfo *ctrl,
582 uint8_t channel,
583 uint8_t rank,
584 uint8_t byte,
585 enum rxt_subfield subfield,
586 int32_t value);
587
588 void update_txt(
589 struct sysinfo *ctrl,
590 uint8_t channel,
591 uint8_t rank,
592 uint8_t byte,
593 enum txt_subfield subfield,
594 int32_t value);
595
596 void download_regfile(
597 struct sysinfo *ctrl,
598 uint8_t channel,
599 bool multicast,
600 uint8_t rank,
601 enum regfile_mode regfile,
602 uint8_t byte,
603 bool read_rf_rd,
604 bool read_rf_wr);
605
606 void change_margin(
607 struct sysinfo *ctrl,
608 const enum margin_parameter param,
609 const int32_t value0,
610 const bool en_multicast,
611 const uint8_t channel,
612 const uint8_t rank,
613 const uint8_t byte,
614 const bool update_ctrl,
615 const enum regfile_mode regfile);
616
617 void change_1d_margin_multicast(
618 struct sysinfo *ctrl,
619 const enum margin_parameter param,
620 const int32_t value0,
621 const uint8_t rank,
622 const bool update_ctrl,
623 const enum regfile_mode regfile);
624
625 uint32_t update_comp_global_offset(
626 struct sysinfo *ctrl,
627 const enum global_comp_offset param,
628 const int32_t offset,
629 const uint8_t update_ctrl);
630
631 void update_opt_param_offset(
632 struct sysinfo *ctrl,
633 const uint8_t channel,
634 const uint8_t ranks,
635 const uint8_t byte,
636 const enum opt_param optparam,
637 const int16_t off_in,
638 const bool update_ctrl);
639
640 uint8_t get_rx_bias(const struct sysinfo *ctrl);
641
642 uint8_t get_tCWL(uint32_t mem_clock_mhz);
643 uint32_t get_tREFI(uint32_t mem_clock_mhz);
644 uint32_t get_tXP(uint32_t mem_clock_mhz);
645
646 #endif