1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 uint32_t get_ddr_voltage(uint8_t ddr_voltage
)
7 /* SPD Byte 11: Module Nominal Voltage, currently DDR4 only supports 1.2V.
8 Either Bit 0 or Bit 1 is set, return 1.2V */
14 unsigned int get_ddr_millivolt(unsigned int ddr_voltage
)
16 switch (ddr_voltage
) {
26 unsigned int get_max_memory_speed(unsigned int common_tck
)
28 if (common_tck
<= DDR_8400_TCK_MIN
)
30 else if (common_tck
<= DDR_7600_TCK_MIN
)
32 else if (common_tck
<= DDR_7200_TCK_MIN
)
34 else if (common_tck
<= DDR_6800_TCK_MIN
)
36 else if (common_tck
<= DDR_6400_TCK_MIN
)
38 else if (common_tck
<= DDR_6000_TCK_MIN
)
40 else if (common_tck
<= DDR_5600_TCK_MIN
)
42 else if (common_tck
<= DDR_5200_TCK_MIN
)
44 else if (common_tck
<= DDR_4800_TCK_MIN
)
46 else if (common_tck
<= DDR_4400_TCK_MIN
)
48 else if (common_tck
<= DDR_4266_TCK_MIN
)
50 else if (common_tck
<= DDR_4200_TCK_MIN
)
52 else if (common_tck
<= DDR_4000_TCK_MIN
)
54 else if (common_tck
<= DDR_3800_TCK_MIN
)
56 else if (common_tck
<= DDR_3733_TCK_MIN
)
58 else if (common_tck
<= DDR_3600_TCK_MIN
)
60 else if (common_tck
<= DDR_3466_TCK_MIN
)
62 else if (common_tck
<= DDR_3400_TCK_MIN
)
64 else if (common_tck
<= DDR_3200_TCK_MIN
)
66 else if (common_tck
<= DDR_3000_TCK_MIN
)
68 else if (common_tck
<= DDR_2933_TCK_MIN
)
70 else if (common_tck
<= DDR_2800_TCK_MIN
)
72 else if (common_tck
<= DDR_2666_TCK_MIN
)
74 else if (common_tck
<= DDR_2600_TCK_MIN
)
76 else if (common_tck
<= DDR_2400_TCK_MIN
)
78 else if (common_tck
<= DDR_2200_TCK_MIN
)
80 else if (common_tck
<= DDR_2133_TCK_MIN
)
82 else if (common_tck
<= DDR_2000_TCK_MIN
)
84 else if (common_tck
<= DDR_1866_TCK_MIN
)
86 else if (common_tck
<= DDR_1800_TCK_MIN
)
88 else if (common_tck
<= DDR_1600_TCK_MIN
)
90 else if (common_tck
<= DDR_1400_TCK_MIN
)
92 else if (common_tck
<= DDR_1333_TCK_MIN
)
94 else if (common_tck
<= DDR_1200_TCK_MIN
)
96 else if (common_tck
<= DDR_1066_TCK_MIN
)
98 else if (common_tck
<= DDR_1000_TCK_MIN
)
104 __weak
bool mainboard_dimm_slot_exists(uint8_t socket
, uint8_t channel
, uint8_t slot
)