1 /* SPDX-License-Identifier: GPL-2.0-only */
12 /* [REG_178][CHANNEL][2 * SLOT + RANK][LANE] */
16 } timing_bounds_t
[2][2][2][9];
18 #define MRC_CACHE_VERSION 3
21 /* [TM][CHANNEL][SLOT][RANK][LANE] */
22 u16 lane_timings
[4][2][2][2][9];
29 timing_bounds_t timing_bounds
[2];
30 u16 timing_offset
[2][2][2][9];
31 u16 timing2_offset
[2][2][2][9];
32 u16 timing2_bounds
[2][2][2][9][2];
33 u8 reg274265
[2][3]; /* [CHANNEL][REGISTER] */
40 u16 clock_speed_index
; /* clock_speed (REAL, not DDR) / 133.(3) - 3 */
41 u16 fsb_frequency
; /* in 1.(1)/2 MHz. */
42 u8 is_x16_module
[2][2]; /* [CHANNEL][SLOT] */
43 u8 density
[2][2]; /* [CHANNEL][SLOT] */
44 u8 populated_ranks
[2][2][2]; /* [CHANNEL][SLOT][RANK] */
45 int rank_start
[2][2][2];
47 u8 board_lane_delay
[9];
50 u8 max_supported_clock_speed_index
;
52 u8 spd
[2][2][151]; /* [CHANNEL][SLOT][BYTE] */
54 u8 populated_ranks_mask
[2];
55 u8 max_slots_used_in_channel
;
59 unsigned int total_memory_mb
;
60 unsigned int interleaved_part_mb
;
61 unsigned int non_interleaved_part_mb
;
63 unsigned int memory_reserved_for_heci_mb
;
65 struct ram_training training
;
66 u32 last_500_command
[2];
71 u8 some_delay_1_cycle_floor
;
72 u8 some_delay_2_halfcycles_ceil
;
73 u8 some_delay_3_ps_rounded
;
75 const struct ram_training
*cached_training
;
78 static inline unsigned int fsbcycle_ps(struct raminfo
*info
)
80 return 900000 / info
->fsb_frequency
;
83 /* The time of DDR transfer in ps. */
84 static inline unsigned int halfcycle_ps(struct raminfo
*info
)
86 return 3750 / (info
->clock_speed_index
+ 3);
89 /* Frequency in 1.(1)=10/9 MHz units. */
90 static inline unsigned int frequency_11(struct raminfo
*info
)
92 return (info
->clock_speed_index
+ 3) * 120;
95 void chipset_init(const int s3resume
);
96 /* spd_addrmap is array of 4 elements:
101 0 means "not present"
103 void raminit(const int s3resume
, const u8
*spd_addrmap
);
105 u16
get_max_timing(struct raminfo
*info
, int channel
);
106 void early_quickpath_init(struct raminfo
*info
, const u8 x2ca8
);
107 void late_quickpath_init(struct raminfo
*info
, const int s3resume
);
109 #endif /* RAMINIT_H */