1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/variants.h>
4 #include <memory_info.h>
7 static const struct mb_cfg kano_memcfg
= {
11 /* Baseboard uses only 100ohm Rcomp resistors */
14 /* Baseboard Rcomp target values */
15 .targets
= {40, 30, 30, 30, 30},
21 .dq0
= { 3, 0, 2, 1, 4, 6, 5, 7, },
22 .dq1
= { 12, 13, 14, 15, 8, 9, 10, 11, },
25 .dq0
= { 13, 14, 11, 12, 10, 8, 15, 9, },
26 .dq1
= { 5, 2, 4, 3, 1, 6, 0, 7, },
29 .dq0
= { 2, 3, 1, 0, 7, 6, 5, 4, },
30 .dq1
= { 12, 13, 14, 15, 8, 9, 10, 11, },
33 .dq0
= { 13, 14, 12, 15, 11, 9, 8, 10, },
34 .dq1
= { 5, 2, 1, 4, 7, 0, 3, 6, },
37 .dq0
= { 11, 10, 8, 9, 14, 15, 13, 12, },
38 .dq1
= { 3, 0, 2, 1, 5, 4, 6, 7, },
41 .dq0
= { 11, 15, 13, 12, 10, 9, 14, 8, },
42 .dq1
= { 3, 0, 2, 1, 6, 7, 5, 4, },
45 .dq0
= { 11, 13, 10, 12, 15, 9, 14, 8, },
46 .dq1
= { 4, 3, 5, 2, 7, 0, 1, 6, },
49 .dq0
= { 12, 13, 15, 14, 11, 9, 10, 8, },
50 .dq1
= { 4, 5, 1, 2, 6, 3, 0, 7, },
54 /* DQS CPU<>DRAM map */
56 .ddr0
= { .dqs0
= 0, .dqs1
= 1 },
57 .ddr1
= { .dqs0
= 1, .dqs1
= 0 },
58 .ddr2
= { .dqs0
= 0, .dqs1
= 1 },
59 .ddr3
= { .dqs0
= 1, .dqs1
= 0 },
60 .ddr4
= { .dqs0
= 1, .dqs1
= 0 },
61 .ddr5
= { .dqs0
= 1, .dqs1
= 0 },
62 .ddr6
= { .dqs0
= 1, .dqs1
= 0 },
63 .ddr7
= { .dqs0
= 1, .dqs1
= 0 },
66 .LpDdrDqDqsReTraining
= 1,
68 .ect
= 1, /* Enable Early Command Training */
71 static const struct mb_cfg hynix_memcfg
= {
72 .type
= MEM_TYPE_LP4X
,
75 /* Baseboard uses only 100ohm Rcomp resistors */
78 /* Baseboard Rcomp target values */
79 .targets
= {40, 30, 30, 30, 30},
85 .dq0
= { 3, 0, 2, 1, 4, 6, 5, 7, },
86 .dq1
= { 12, 13, 14, 15, 8, 9, 10, 11, },
89 .dq0
= { 13, 14, 11, 12, 10, 8, 15, 9, },
90 .dq1
= { 5, 2, 4, 3, 1, 6, 0, 7, },
93 .dq0
= { 2, 3, 1, 0, 7, 6, 5, 4, },
94 .dq1
= { 12, 13, 14, 15, 8, 9, 10, 11, },
97 .dq0
= { 13, 14, 12, 15, 11, 9, 8, 10, },
98 .dq1
= { 5, 2, 1, 4, 7, 0, 3, 6, },
101 .dq0
= { 11, 10, 8, 9, 14, 15, 13, 12, },
102 .dq1
= { 3, 0, 2, 1, 5, 4, 6, 7, },
105 .dq0
= { 11, 15, 13, 12, 10, 9, 14, 8, },
106 .dq1
= { 3, 0, 2, 1, 6, 7, 5, 4, },
109 .dq0
= { 11, 13, 10, 12, 15, 9, 14, 8, },
110 .dq1
= { 4, 3, 5, 2, 7, 0, 1, 6, },
113 .dq0
= { 12, 13, 15, 14, 11, 9, 10, 8, },
114 .dq1
= { 4, 5, 1, 2, 6, 3, 0, 7, },
118 /* DQS CPU<>DRAM map */
120 .ddr0
= { .dqs0
= 0, .dqs1
= 1 },
121 .ddr1
= { .dqs0
= 1, .dqs1
= 0 },
122 .ddr2
= { .dqs0
= 0, .dqs1
= 1 },
123 .ddr3
= { .dqs0
= 1, .dqs1
= 0 },
124 .ddr4
= { .dqs0
= 1, .dqs1
= 0 },
125 .ddr5
= { .dqs0
= 1, .dqs1
= 0 },
126 .ddr6
= { .dqs0
= 1, .dqs1
= 0 },
127 .ddr7
= { .dqs0
= 1, .dqs1
= 0 },
130 .LpDdrDqDqsReTraining
= 1,
132 .ect
= 1, /* Enable Early Command Training */
134 .cs_pi_start_high_in_ect
= 1,
137 const struct mb_cfg
*variant_memory_params(void)
139 const char *part_num
= mainboard_get_dram_part_num();
140 const char *hynix_mem1
= "H54G46CYRBX267";
141 const char *hynix_mem2
= "H54G56CYRBX247";
144 if (!strcmp(part_num
, hynix_mem1
) || !strcmp(part_num
, hynix_mem2
)) {
145 printk(BIOS_INFO
, "Enable cs_pi_start_high_in_ect for Hynix memory\n");
146 return &hynix_memcfg
;