23 asm volatile (
"sfence");
95 die(
"Unsupported DIMM combination. DIMMS do not support common CAS latency");
98 die(
"No valid DIMMs found");
187 .overclock_tXPDLL = ctrl->
tXPDLL >= 32,
195 const u32 val32 =
MIN((ctrl->
tREFI * 89) / 10, (70000 << 8) / ctrl->
tCK);
200 .tREFIx9 = val32 / 1024,
208 .tMOD = ctrl->
tMOD - 8,
251 if (
info->dimm[channel][0].size_mb >=
info->dimm[channel][1].size_mb) {
252 dimmA = &
info->dimm[channel][0];
253 dimmB = &
info->dimm[channel][1];
256 dimmA = &
info->dimm[channel][1];
257 dimmB = &
info->dimm[channel][0];
261 if (dimmA && (dimmA->
ranks > 0)) {
262 reg |= (dimmA->
size_mb / 256) << 0;
263 reg |= (dimmA->
ranks - 1) << 17;
264 reg |= (dimmA->
width / 8 - 1) << 19;
267 if (dimmB && (dimmB->
ranks > 0)) {
268 reg |= (dimmB->
size_mb / 256) << 8;
269 reg |= (dimmB->
ranks - 1) << 18;
270 reg |= (dimmB->
width / 8 - 1) << 20;
282 if ((dimmA && (dimmA->
ranks > 0)) || (dimmB && (dimmB->
ranks > 0))) {
296 ecc = training ? (1 << 24) : (3 << 24);
310 u32 reg, ch0size, ch1size;
323 if (ch0size >= ch1size) {
326 reg = (reg & ~0xff000000) |
val << 24;
327 reg = (reg & ~0x00ff0000) | (2 *
val) << 16;
334 reg = (reg & ~0xff000000) |
val << 24;
335 reg = (reg & ~0x00ff0000) | (2 *
val) << 16;
351 return !!(reg32 & (1 << 24));
364 return !(reg32 & (1 << 25));
367 #define DEFAULT_PCI_MMIO_SIZE 2048
371 u32 reg,
val, reclaim, tom, gfxstolen, gttsize;
372 size_t tsegbase, toludbase, remapbase, gfxstolenbase, mmiosize, gttbase;
373 size_t tsegsize, touudbase, remaplimit, mestolenbase, tsegbasedelta;
380 gfxstolen = ((ggc >> 3) & 0x1f) * 32;
381 gttsize = ((ggc >> 8) & 0x3);
387 tsegsize = CONFIG_SMM_TSEG_SIZE >> 20;
391 mestolenbase = tom - me_uma_size;
393 toludbase =
MIN(4096 - mmiosize + gfxstolen + gttsize + tsegsize, tom - me_uma_size);
395 gfxstolenbase = toludbase - gfxstolen;
396 gttbase = gfxstolenbase - gttsize;
398 tsegbase = gttbase - tsegsize;
401 tsegbasedelta = tsegbase & (tsegsize - 1);
402 tsegbase &= ~(tsegsize - 1);
404 gttbase -= tsegbasedelta;
405 gfxstolenbase -= tsegbasedelta;
406 toludbase -= tsegbasedelta;
409 if (tom - me_uma_size > toludbase) {
412 remapbase =
MAX(4096, tom - me_uma_size);
413 remaplimit = remapbase +
MIN(4096, tom - me_uma_size) - toludbase - 1;
414 touudbase = remaplimit + 1;
418 touudbase = tom - me_uma_size;
427 reg = (reg & ~0xfff00000) | (
val << 20);
432 val = tom & 0xfffff000;
433 reg = (reg & ~0x000fffff) | (
val >> 12);
439 val = toludbase & 0xfff;
440 reg = (reg & ~0xfff00000) | (
val << 20);
446 val = touudbase & 0xfff;
447 reg = (reg & ~0xfff00000) | (
val << 20);
453 val = touudbase & 0xfffff000;
454 reg = (reg & ~0x000fffff) | (
val >> 12);
469 val = tsegbase & 0xfff;
470 reg = (reg & ~0xfff00000) | (
val << 20);
476 val = gfxstolenbase & 0xfff;
477 reg = (reg & ~0xfff00000) | (
val << 20);
483 val = gttbase & 0xfff;
484 reg = (reg & ~0xfff00000) | (
val << 20);
490 val = (0x80000 - me_uma_size) & 0xfffff000;
491 reg = (reg & ~0x000fffff) | (
val >> 12);
497 val = mestolenbase & 0xfff;
498 reg = (reg & ~0xfff00000) | (
val << 20);
503 val = mestolenbase & 0xfffff000;
504 reg = (reg & ~0x000fffff) | (
val >> 12);
510 val = (0x80000 - me_uma_size) & 0xfff;
511 reg = (reg & ~0xfff00000) | (
val << 20);
521 int channel, slotrank;
524 channel = (ctrl->
rankmap[0]) ? 0 : 1;
529 slotrank = (ctrl->
rankmap[channel] & 1) ? 0 : 2;
548 }
while ((reg & 0x14) == 0);
583 reg = (reg & ~0xf0) | (ctrl->
rankmap[channel] << 4);
597 *bank = ((*bank >> 1) & 1) | ((*bank << 1) & 2);
654 .post_ssq_wait = ctrl->
tMOD,
687 u16 mr0reg, mch_cas, mch_wr;
688 static const u8 mch_wr_t[12] = { 1, 2, 3, 4, 0, 5, 0, 6, 0, 7, 0, 0 };
695 if (ctrl->
CAS < 12) {
696 mch_cas = (
u16) ((ctrl->
CAS - 4) << 1);
698 mch_cas = (
u16) (ctrl->
CAS - 12);
699 mch_cas = ((mch_cas << 1) | 0x1);
703 mch_wr = mch_wr_t[ctrl->
tWR - 5];
708 mr0reg |= (mch_cas & 0x1) << 2;
709 mr0reg |= (mch_cas & 0xe) << 3;
710 mr0reg |= mch_wr << 9;
713 mr0reg |= !slow_exit << 12;
725 int dimms_per_ch = (ctrl->
rankmap[channel] & 1) + ((ctrl->
rankmap[channel] >> 2) & 1);
727 if (dimms_per_ch == 1) {
728 return (
const odtmap){60, 60};
730 return (
const odtmap){120, 30};
738 return (1 << 9) | (1 << 2);
774 const u16 cwl = ctrl->
CWL - 5;
786 mr2reg |= (odt.
rttwr / 60) << 9;
793 reg32 &= 3 << 14 | 3 << 6;
795 reg32 |= mr2reg & ~(3 << 6);
798 reg32 |= 1 << (
rank / 2 + 6);
801 reg32 |= 1 << (
rank / 2 + 14);
832 const struct iosav_ssq zqcl_sequence[] = {
860 .post_ssq_wait = 400,
891 slotrank = (ctrl->
rankmap[channel] & 1) ? 0 : 2;
908 #define CCC_MAX_PI (2 * QCLK_PI - 1)
912 u32 reg_roundtrip_latency, reg_io_latency;
921 u32 clk_logic_dly = 0;
931 printk(
BIOS_ERR,
"C%d command delay overflow: %d\n", channel, cmd_delay);
935 for (slot = 0; slot <
NUM_SLOTS; slot++) {
939 const u8 slot_map = (ctrl->
rankmap[channel] >> (2 * slot)) & 3;
942 ctl_delay[slot] += pi_coding_0 + cmd_delay;
945 ctl_delay[slot] += pi_coding_1 + cmd_delay;
949 ctl_delay[slot] /= 2;
953 channel, slot, ctl_delay[slot]);
969 channel, slotrank, clk_delay);
976 clk_pi_coding |= (clk_delay %
QCLK_PI) << (6 * slotrank);
977 clk_logic_dly |= (clk_delay /
QCLK_PI) << slotrank;
998 reg_io_latency &= ~0xffff;
1000 reg_roundtrip_latency = 0;
1003 reg_io_latency |= ctrl->
timings[channel][slotrank].
io_latency << (4 * slotrank);
1005 reg_roundtrip_latency |=
1014 .rx_dqs_p_pi_code = dqs_p,
1016 .rx_dqs_n_pi_code = dqs_n,
1025 .tx_dqs_pi_code = tx_dqs %
QCLK_PI,
1026 .tx_dqs_logic_delay = tx_dqs /
QCLK_PI,
1027 .tx_dq_logic_delay = tx_dq /
QCLK_PI,
1070 for (i = 0; i < 2 * sz; i++)
1087 ret.
start = bs % sz;
1088 ret.
end = (bs + bl - 1) % sz;
1089 ret.
middle = (bs + (bl - 1) / 2) % sz;
1096 #define RCVEN_COARSE_PI_LENGTH (2 * QCLK_PI)
1113 statistics[lane][
rcven] =
1120 upperA[lane] = rn.
end;
1121 if (upperA[lane] < rn.
middle)
1124 printram(
"rcven: %d, %d, %d: % 4d-% 4d-% 4d\n",
1135 for (rcven_delta = -25; rcven_delta <= 25; rcven_delta++) {
1139 = upperA[lane] + rcven_delta +
QCLK_PI;
1143 for (i = 0; i < 100; i++) {
1146 statistics[lane][rcven_delta + 25] +=
1152 int last_zero, first_all;
1154 for (last_zero = -25; last_zero <= 25; last_zero++)
1155 if (statistics[lane][last_zero + 25])
1159 for (first_all = -25; first_all <= 25; first_all++)
1160 if (statistics[lane][first_all + 25] == 100)
1163 printram(
"lane %d: %d, %d\n", lane, last_zero, first_all);
1166 (last_zero + first_all) / 2 + upperA[lane];
1168 printram(
"Aval: %d, %d, %d: % 4d\n", channel, slotrank,
1185 int all_works = 1, some_works = 0;
1236 printram(
"increment %d, %d, %d\n", channel, slotrank, lane);
1245 u16 logic_delay_min = 7;
1246 u16 logic_delay_max = 0;
1251 logic_delay_min =
MIN(logic_delay_min, logic_delay);
1252 logic_delay_max =
MAX(logic_delay_max, logic_delay);
1255 if (logic_delay_max < logic_delay_min) {
1257 logic_delay_max, logic_delay_min, channel, slotrank);
1260 assert(logic_delay_max >= logic_delay_min);
1262 return logic_delay_max - logic_delay_min;
1267 int latency_offset = 0;
1273 latency_offset = +1;
1275 else if (prev > post)
1276 latency_offset = -1;
1283 printram(
"4024 += %d;\n", latency_offset);
1284 printram(
"4028 += %d;\n", latency_offset);
1291 u16 logic_delay_min = 7;
1297 logic_delay_min =
MIN(logic_delay_min, logic_delay);
1300 if (logic_delay_min >= 2) {
1302 logic_delay_min, channel, slotrank);
1309 printram(
"4028 -= %d;\n", logic_delay_min);
1314 int channel, slotrank, lane;
1318 int all_high, some_high;
1330 .training_rank_sel = slotrank,
1358 }
else if (some_high) {
1383 printram(
"4/8: %d, %d, % 4d, % 4d\n", channel, slotrank,
1389 printram(
"Aval: %d, %d, %d: % 4d\n", channel, slotrank, lane,
1416 MAX(ctrl->
tRRD, (ctrl->
tFAW >> 2) + 1), 4, 4, 500, 18);
1430 for (i = 1; i <
count; i++) {
1437 int threshold = min / 2 + max / 2;
1438 for (i = 0; i <
count; i++)
1439 data[i] = data[i] > threshold;
1441 printram(
"threshold=%d min=%d max=%d\n", threshold, min, max);
1456 for (tx_dq = 0; tx_dq <=
MAX_TX_DQ; tx_dq++) {
1472 channel, slotrank, lane);
1486 printram(
"tx_dq: %d, %d, %d: % 4d-% 4d-% 4d\n",
1494 int channel, ret = 0;
1514 for (j = 0; j < 16; j++) {
1515 addr = 0x04000000 + channel_offset + 4 * j;
1539 for (j = 0; j < 16; j++) {
1540 addr = 0x04000000 + channel_offset + j * 4;
1543 for (j = 0; j < 16; j++) {
1544 addr = 0x04000000 + channel_offset + channel_step + j * 4;
1552 #define TX_DQS_PI_LENGTH (2 * QCLK_PI)
1562 .training_rank_sel = slotrank,
1565 .force_drive_enable = 1,
1569 u32 mr1reg =
make_mr1(ctrl, slotrank, channel) | 1 << 7;
1590 (tx_dqs % 32)) & 1);
1604 if ((rn.
start & 0x3f) == 0x3e)
1606 else if ((rn.
start & 0x3f) == 0x3f)
1612 channel, slotrank, lane);
1616 printram(
"tx_dqs: %d, %d, %d: % 4d-% 4d-% 4d\n",
1626 if (
val == 0xffffffffffffffffLL)
1628 if (
val >= 0xf000000000000000LL) {
1630 for (i = 0; i < 8; i++)
1631 if (
val << (8 * (7 - i) + 4))
1635 for (i = 0; i < 8; i++)
1636 if (
val >> (8 * (7 - i) + 4))
1644 int channel, slotrank, lane, old;
1665 const struct iosav_ssq rd_sequence[] = {
1673 .cmd_executions = 1,
1675 .post_ssq_wait = ctrl->
tRP,
1676 .data_direction =
SSQ_NA,
1695 .cmd_executions = 1,
1697 .post_ssq_wait = ctrl->
tRCD,
1698 .data_direction =
SSQ_NA,
1714 .cmd_executions = 1,
1716 .post_ssq_wait = ctrl->
tRP +
1719 .data_direction =
SSQ_RD,
1742 printram(
"High adjust %d:%016llx\n", lane, res);
1743 printram(
"Bval+: %d, %d, %d, % 4d -> % 4d\n", channel, slotrank, lane,
1756 const int slotrank = !(ctrl->
rankmap[channel] & 1) ? 2 : 0;
1788 int channel, slotrank;
1797 make_mr1(ctrl, slotrank, channel) | 1 << 12 | 1 << 7);
1804 .force_drive_enable = 1,
1846 int channel, slotrank;
1894 for (tx_dq_delta = -5; tx_dq_delta <= 5; tx_dq_delta++) {
1921 lanes_ok |= 1 << lane;
1924 if (lanes_ok == ((1 << ctrl->
lanes) - 1))
1928 ctrl->
timings[channel][slotrank] = saved_rt;
1930 return lanes_ok != ((1 << ctrl->
lanes) - 1);
1941 u8 base8 = 0x80 >> ((patno - 1) % 8);
1942 u32 base = base8 | (base8 << 8) | (base8 << 16) | (base8 << 24);
1943 for (i = 0; i < 32; i++) {
1944 for (j = 0; j < 16; j++) {
1947 if (
invert[patno - 1][i] & (1 << (j / 2)))
1950 addr = (1 << 26) +
offset + i * step + j * 4;
1956 for (j = 0; j < 16; j++) {
1958 addr = (1 << 26) +
offset + i * step + j * 4;
1981 #define CT_MIN_PI (-CCC_MAX_PI)
1982 #define CT_MAX_PI (+CCC_MAX_PI + 1)
1983 #define CT_PI_LENGTH (CT_MAX_PI - CT_MIN_PI + 1)
1985 #define MIN_C320C_LEN 13
1995 printram(
"Trying cmd_stretch %d on channel %d\n", cmd_stretch, channel);
1998 saved_timings[channel][slotrank] = ctrl->
timings[channel][slotrank];
2030 stat[slotrank][command_pi -
CT_MIN_PI] =
2038 printram(
"cmd_stretch: %d, %d: % 4d-% 4d-% 4d\n",
2043 ctrl->
timings[channel][slotrank] =
2044 saved_timings[channel][slotrank];
2080 cmdrate = ((ctrl->
rankmap[channel] & 0x5) == 0x5);
2085 for (; cmdrate < 2; cmdrate++) {
2097 printram(
"Using CMD rate %uT on channel %u\n", cmdrate + 1, channel);
2128 channel, slotrank, ctrl->
tMOD, 500, 4, 1, ctrl->
CAS + 8);
2147 printram(
"eval %d, %d, %d: % 4d\n", channel, slotrank, lane, edges[lane]);
2173 channel, slotrank, ctrl->
tMOD, 3, 4, 1, ctrl->
CAS + 8);
2191 channel, slotrank, ctrl->
tMOD, 3, 4, 1, ctrl->
CAS + 8);
2208 int channel, slotrank, lane;
2230 falling_edges[channel][slotrank]);
2240 rising_edges[channel][slotrank]);
2249 falling_edges[channel][slotrank][lane];
2251 rising_edges[channel][slotrank][lane];
2266 const int rd_vref_offsets[] = { 0, 0xc, 0x2c };
2271 int lane, i, read_pi, pat;
2278 for (i = 0; i <
ARRAY_SIZE(rd_vref_offsets); i++) {
2287 printram(
"using pattern %d\n", pat);
2323 stats[read_pi] = !!(raw_stats[read_pi] & (1 << lane));
2327 printram(
"edges: %d, %d, %d: % 4d-% 4d-% 4d, "
2328 "% 4d-% 4d\n", channel, slotrank, i, rn.
start,
2335 edges[lane] = (lower[lane] + upper[lane]) / 2;
2336 if (rn.
all || (lower[lane] > upper[lane])) {
2338 "%d, %d, %d\n", channel, slotrank, lane);
2356 int channel, slotrank, lane, err;
2367 falling_edges[channel][slotrank]);
2377 rising_edges[channel][slotrank]);
2386 falling_edges[channel][slotrank][lane];
2389 rising_edges[channel][slotrank][lane];
2415 const u8 wr_vref_offsets[3] = { 0, 0x0f, 0x2f };
2420 int channel, slotrank, lane;
2430 lower[channel][slotrank][lane] = 0;
2431 upper[channel][slotrank][lane] =
MAX_TX_DQ;
2437 if (enable_iosav_opt)
2440 printram(
"Aggressive write training:\n");
2442 for (i = 0; i <
ARRAY_SIZE(wr_vref_offsets); i++) {
2457 for (tx_dq = 0; tx_dq <
MAX_TX_DQ; tx_dq++) {
2459 ctrl->
timings[channel][slotrank]
2471 for (tx_dq = 0; tx_dq <
MAX_TX_DQ; tx_dq++) {
2472 stats[tx_dq] = !!(raw_stats[tx_dq]
2479 "write training failed: "
2480 "%d, %d, %d\n", channel,
2487 "% 4d-% 4d\n", channel, slotrank,
2492 lower[channel][slotrank][lane] =
2494 lower[channel][slotrank][lane]);
2496 upper[channel][slotrank][lane] =
2498 upper[channel][slotrank][lane]);
2512 if (enable_iosav_opt)
2518 printram(
"tx_dq %d, %d, %d: % 4d\n", channel, slotrank, lane,
2519 (lower[channel][slotrank][lane] +
2520 upper[channel][slotrank][lane]) / 2);
2523 (lower[channel][slotrank][lane] +
2524 upper[channel][slotrank][lane]) / 2;
2534 int channel, slotrank, lane;
2542 printram(
"normalize %d, %d, %d: mat %d\n",
2543 channel, slotrank, lane, mat);
2546 printram(
"normalize %d, %d, %d: delta %d\n",
2547 channel, slotrank, lane, delta);
2560 int channel, slotrank, lane;
2572 for (slotrank = 0; slotrank < 4; slotrank++)
2574 if (ctrl->
rankmap[channel] & (1 << slotrank)) {
2588 channel, slotrank, lane);
2597 int channel, slotrank, row, rowsize;
2616 rowsize = 1 << ctrl->
info.dimm[channel][slotrank >> 1].row_bits;
2617 for (bank = 0; bank < 8; bank++) {
2618 for (row = 0; row < rowsize; row += 16) {
2632 .cmd_executions = 1,
2633 .cmd_delay_gap = gap,
2634 .post_ssq_wait = ctrl->
tRCD,
2635 .data_direction =
SSQ_NA,
2659 .cmd_executions = 129,
2661 .post_ssq_wait = ctrl->
tWTR +
2663 .data_direction =
SSQ_WR,
2686 .cmd_executions = 1,
2688 .post_ssq_wait = ctrl->
tRP,
2689 .data_direction =
SSQ_NA,
2718 {0x00009a36, 0xbafcfdcf, 0x46d1ab68},
2719 {0x00028bfa, 0x53fe4b49, 0x19ed5483}
2759 int channel, slotrank;
2763 int max_pi = -10000;
2802 return (ns + 499) / 500;
2809 int t1_cycles = 0, t1_ns = 0, t2_ns;
2834 switch (ctrl->
rankmap[channel]) {
2874 if (r32 & (1 << 17))
2875 t1_cycles += (r32 & 0xfff);
2877 t1_ns = t1_cycles * ctrl->
tCK / 256 + 544;
2878 if (!(r32 & (1 << 17)))
2946 }
while ((reg & 0x14) == 0);
2958 reg = (reg & ~0x0f) | ctrl->
rankmap[channel];
2965 reg = (reg & ~0xf0) | (ctrl->
rankmap[channel] << 4);
static void write32(void *addr, uint32_t val)
#define assert(statement)
static const u32 pattern[8]
#define DIV_ROUND_UP(x, y)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
static struct smmstore_params_info info
#define mchbar_setbits32(addr, set)
static __always_inline void mchbar_write8(const uintptr_t offset, const uint8_t value)
static __always_inline void mchbar_write32(const uintptr_t offset, const uint32_t value)
static __always_inline void mchbar_clrsetbits32(uintptr_t offset, uint32_t clear, uint32_t set)
static __always_inline uint32_t mchbar_read32(const uintptr_t offset)
#define mchbar_clrbits32(addr, clear)
#define printram(x,...)
Convenience macro for enabling printk with CONFIG(DEBUG_RAM_SETUP)
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
static __always_inline u16 pci_read_config16(const struct device *dev, u16 reg)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
@ SPD_MEMORY_TYPE_SDRAM_DDR3
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_EMERG
BIOS_EMERG - Emergency / Fatal.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
#define IS_SANDY_CPU_C(x)
#define IS_SANDY_CPU_D0(x)
#define IS_SANDY_CPU_D1(x)
enum platform_type get_platform_type(void)
static const u32 lane_base[]
static int jedec_write_leveling(ramctr_timing *ctrl)
static void dram_mr2(ramctr_timing *ctrl, u8 rank, int channel)
static void dram_mr1(ramctr_timing *ctrl, u8 rank, int channel)
static u32 make_mr0(ramctr_timing *ctrl, u8 rank)
void normalize_training(ramctr_timing *ctrl)
static int write_level_rank(ramctr_timing *ctrl, int channel, int slotrank)
static int try_cmd_stretch(ramctr_timing *ctrl, int channel, int cmd_stretch)
void dram_memorymap(ramctr_timing *ctrl, int me_uma_size)
static int does_lane_work(ramctr_timing *ctrl, int channel, int slotrank, int lane)
int command_training(ramctr_timing *ctrl)
static enum power_down_mode get_power_down_mode(ramctr_timing *ctrl)
static int find_agrsv_read_margin(ramctr_timing *ctrl, int channel, int slotrank, int *edges)
bool get_host_ecc_cap(void)
static int align_rt_io_latency(ramctr_timing *ctrl, int channel, int slotrank, int prev)
int aggressive_write_training(ramctr_timing *ctrl)
static void set_write_vref(const int channel, const u8 wr_vref)
int aggressive_read_training(ramctr_timing *ctrl)
static void fill_pattern0(ramctr_timing *ctrl, int channel, u32 a, u32 b)
static int tx_dq_write_leveling(ramctr_timing *ctrl, int channel, int slotrank)
static void find_predefined_pattern(ramctr_timing *ctrl, const int channel)
#define RCVEN_COARSE_PI_LENGTH
void dram_dimm_set_mapping(ramctr_timing *ctrl, int training)
static void test_rcven(ramctr_timing *ctrl, int channel, int slotrank)
void set_read_write_timings(ramctr_timing *ctrl)
#define DEFAULT_PCI_MMIO_SIZE
void dram_mrscommands(ramctr_timing *ctrl)
static odtmap get_ODT(ramctr_timing *ctrl, int channel)
static struct run get_longest_zero_run(int *seq, int sz)
static void write_reset(ramctr_timing *ctrl)
static void toggle_io_reset(void)
static void train_write_flyby(ramctr_timing *ctrl)
void set_normal_operation(ramctr_timing *ctrl)
static void fill_pattern5(ramctr_timing *ctrl, int channel, int patno)
static void find_rcven_pi_coarse(ramctr_timing *ctrl, int channel, int slotrank, int *upperA)
void restore_timings(ramctr_timing *ctrl)
static u32 make_mr1(ramctr_timing *ctrl, u8 rank, int channel)
static u32 get_XOVER_CMD(u8 rankmap)
void dram_find_common_params(ramctr_timing *ctrl)
void program_timings(ramctr_timing *ctrl, int channel)
static int encode_wm(int ns)
static u32 get_XOVER_CLK(u8 rankmap)
static void disable_refresh_machine(ramctr_timing *ctrl)
void prepare_training(ramctr_timing *ctrl)
void final_registers(ramctr_timing *ctrl)
static void ddr3_mirror_mrreg(int *bank, u32 *addr)
static int get_precedening_channels(ramctr_timing *ctrl, int target_channel)
void channel_scrub(ramctr_timing *ctrl)
void dram_xover(ramctr_timing *ctrl)
static int test_command_training(ramctr_timing *ctrl, int channel, int slotrank)
static void fill_pattern1(ramctr_timing *ctrl, int channel)
static int find_read_mpr_margin(ramctr_timing *ctrl, int channel, int slotrank, int *edges)
static u32 encode_odt(u32 odt)
static int find_roundtrip_latency(ramctr_timing *ctrl, int channel, int slotrank, int *upperA)
int read_mpr_training(ramctr_timing *ctrl)
bool get_host_ecc_forced(void)
static void test_aggressive_write(ramctr_timing *ctrl, int channel, int slotrank)
void dram_dimm_mapping(ramctr_timing *ctrl)
static void dram_mr0(ramctr_timing *ctrl, u8 rank, int channel)
void dram_zones(ramctr_timing *ctrl, int training)
static void program_wdb_pattern_length(int channel, const unsigned int num_cachelines)
int channel_test(ramctr_timing *ctrl)
static void dram_odt_stretch(ramctr_timing *ctrl, int channel)
void dram_jedecreset(ramctr_timing *ctrl)
static int get_logic_delay_delta(ramctr_timing *ctrl, int channel, int slotrank)
static void fine_tune_rcven_pi(ramctr_timing *ctrl, int channel, int slotrank, int *upperA)
static void test_tx_dq(ramctr_timing *ctrl, int channel, int slotrank)
static void tx_dq_threshold_process(int *data, const int count)
void set_wmm_behavior(const u32 cpu)
static void reprogram_320c(ramctr_timing *ctrl)
static void write_mrreg(ramctr_timing *ctrl, int channel, int slotrank, int reg, u32 val)
void dram_timing_regs(ramctr_timing *ctrl)
static int num_of_channels(const ramctr_timing *ctrl)
static void compute_final_logic_delay(ramctr_timing *ctrl, int channel, int slotrank)
int receive_enable_calibration(ramctr_timing *ctrl)
int write_training(ramctr_timing *ctrl)
static int get_dqs_flyby_adjust(u64 val)
void set_scrambling_seed(ramctr_timing *ctrl)
static void dram_mr3(ramctr_timing *ctrl, u8 rank, int channel)
void iosav_write_prea_sequence(int channel, int slotrank, u32 post, u32 wrap)
void iosav_run_queue(const int ch, const u8 loops, const u8 as_timer)
void iosav_write_aggressive_write_read_sequence(ramctr_timing *ctrl, int channel, int slotrank)
void iosav_write_command_training_sequence(ramctr_timing *ctrl, int channel, int slotrank, unsigned int address)
void iosav_write_memory_test_sequence(ramctr_timing *ctrl, int channel, int slotrank)
void iosav_write_read_mpr_sequence(int channel, int slotrank, u32 tMOD, u32 loops, u32 gap, u32 loops2, u32 post2)
void iosav_write_zqcs_sequence(int channel, int slotrank, u32 gap, u32 post, u32 wrap)
void iosav_write_misc_write_sequence(ramctr_timing *ctrl, int channel, int slotrank, u32 gap0, u32 loops0, u32 gap1, u32 loops2, u32 wrap2)
void iosav_run_once_and_wait(const int ch)
void iosav_write_prea_act_read_sequence(ramctr_timing *ctrl, int channel, int slotrank)
void wait_for_iosav(int channel)
void iosav_write_sequence(const int ch, const struct iosav_ssq *seq, const unsigned int length)
#define FOR_ALL_POPULATED_RANKS
void iosav_write_data_write_sequence(ramctr_timing *ctrl, int channel, int slotrank)
#define FOR_ALL_POPULATED_CHANNELS
void iosav_write_jedec_write_leveling_sequence(ramctr_timing *ctrl, int channel, int slotrank, int bank, u32 mr1reg)
const u8 use_base[63][32]
#define WMM_READ_CONFIG
Opportunistic reads configuration during write-major-mode (WMM)
#define GDCRCKLOGICDELAY_ch(ch)
#define PM_CMD_PWR_ch(ch)
#define SCRAMBLING_SEED_2_LO_ch(ch)
#define MEM_TRML_ESTIMATION_CONFIG
#define MC_INIT_STATE_ch(ch)
#define GDCRCKPICODE_ch(ch)
#define SCHED_SECOND_CBIT_ch(ch)
#define GDCRTRAININGRESULT(ch, y)
#define MEM_TRML_INTERRUPT
#define IOSAV_BYTE_SERROR_C_ch(ch)
#define GDCRTRAININGMOD_ch(ch)
#define IOSAV_By_ERROR_COUNT(y)
#define GDCRCMDDEBUGMUXCFG_Cz_S(ch)
#define MCMNTS_SPARE
Auxiliary register in mcmnts synthesis FUB (Functional Unit Block).
#define GDCRTRAININGRESULT2(ch)
#define IOSAV_STATUS_ch(ch)
#define IOSAV_By_BW_SERROR_C(y)
#define SC_IO_LATENCY_ch(ch)
#define PM_BW_LIMIT_CONFIG
#define IOSAV_n_ADDRESS_LFSR_ch(ch, y)
#define IOSAV_By_BW_MASK_ch(ch, y)
#define IOSAV_By_BW_SERROR_C_ch(ch, y)
#define SCRAMBLING_SEED_1_ch(ch)
#define SCHED_CBIT_ch(ch)
#define SCRAMBLING_SEED_2_HI_ch(ch)
#define MEM_TRML_THRESHOLDS_CONFIG
#define SC_ROUNDT_LAT_ch(ch)
#define TC_MR2_SHADOW_ch(ch)
#define SAPMTIMERS2_IVB
WARNING: Only applies to Ivy Bridge!
#define TC_DTP_ch(ch)
WARNING: Only applies to Ivy Bridge!
#define PM_TRML_M_CONFIG_ch(ch)
#define GDCRCMDPICODING_ch(ch)
#define GDCRTRAININGRESULT1(ch)
#define IOSAV_DATA_CTL_ch(ch)
#define IOSAV_By_ERROR_COUNT_ch(ch, y)
#define IOSAV_By_BW_SERROR_ch(ch, y)
enum spd_memory_type dram_type
If this table is filled and put in CBMEM, then these info in CBMEM will be used to generate smbios ty...
union iosav_ssq::@334 sp_cmd_ctrl
struct ram_rank_timings::ram_lane_timings lanes[NUM_LANES]
int extended_temperature_range
int rank_mirror[NUM_CHANNELS][NUM_SLOTRANKS]
u32 cmd_stretch[NUM_CHANNELS]
int ref_card_offset[NUM_CHANNELS]
int channel_size_mb[NUM_CHANNELS]
u32 mad_dimm[NUM_CHANNELS]
struct ram_rank_timings timings[NUM_CHANNELS][NUM_SLOTRANKS]
void rcven(struct sysinfo *s)