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 osiris_memcfg
= {
11 /* Baseboard uses only 100ohm Rcomp resistors */
14 /* Baseboard Rcomp target values */
15 .targets
= {40, 30, 30, 30, 30},
21 .dq0
= { 9, 11, 8, 10, 12, 14, 13, 15, },
22 .dq1
= { 4, 7, 6, 5, 2, 3, 0, 1, },
25 .dq0
= { 15, 12, 14, 13, 9, 10, 11, 8, },
26 .dq1
= { 0, 1, 3, 2, 7, 5, 4, 6, },
29 .dq0
= { 2, 3, 1, 0, 6, 7, 5, 4, },
30 .dq1
= { 15, 9, 14, 8, 11, 10, 13, 12, },
33 .dq0
= { 3, 1, 2, 0, 4, 6, 7, 5, },
34 .dq1
= { 13, 15, 14, 12, 11, 9, 8, 10, },
37 .dq0
= { 13, 12, 14, 15, 9, 8, 10, 11, },
38 .dq1
= { 4, 7, 5, 6, 1, 2, 0, 3, },
41 .dq0
= { 5, 0, 6, 4, 3, 1, 7, 2, },
42 .dq1
= { 11, 9, 10, 8, 15, 12, 14, 13, },
45 .dq0
= { 15, 12, 14, 13, 10, 9, 11, 8, },
46 .dq1
= { 0, 1, 2, 3, 5, 6, 4, 7, },
49 .dq0
= { 0, 3, 1, 2, 4, 5, 6, 7, },
50 .dq1
= { 11, 8, 13, 14, 9, 12, 15, 10, },
54 /* DQS CPU<>DRAM map */
56 .ddr0
= { .dqs0
= 1, .dqs1
= 0 },
57 .ddr1
= { .dqs0
= 1, .dqs1
= 0 },
58 .ddr2
= { .dqs0
= 0, .dqs1
= 1 },
59 .ddr3
= { .dqs0
= 0, .dqs1
= 1 },
60 .ddr4
= { .dqs0
= 1, .dqs1
= 0 },
61 .ddr5
= { .dqs0
= 0, .dqs1
= 1 },
62 .ddr6
= { .dqs0
= 1, .dqs1
= 0 },
63 .ddr7
= { .dqs0
= 0, .dqs1
= 1 },
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
= { 9, 11, 8, 10, 12, 14, 13, 15, },
86 .dq1
= { 4, 7, 6, 5, 2, 3, 0, 1, },
89 .dq0
= { 15, 12, 14, 13, 9, 10, 11, 8, },
90 .dq1
= { 0, 1, 3, 2, 7, 5, 4, 6, },
93 .dq0
= { 2, 3, 1, 0, 6, 7, 5, 4, },
94 .dq1
= { 15, 9, 14, 8, 11, 10, 13, 12, },
97 .dq0
= { 3, 1, 2, 0, 4, 6, 7, 5, },
98 .dq1
= { 13, 15, 14, 12, 11, 9, 8, 10, },
101 .dq0
= { 13, 12, 14, 15, 9, 8, 10, 11, },
102 .dq1
= { 4, 7, 5, 6, 1, 2, 0, 3, },
105 .dq0
= { 5, 0, 6, 4, 3, 1, 7, 2, },
106 .dq1
= { 11, 9, 10, 8, 15, 12, 14, 13, },
109 .dq0
= { 15, 12, 14, 13, 10, 9, 11, 8, },
110 .dq1
= { 0, 1, 2, 3, 5, 6, 4, 7, },
113 .dq0
= { 0, 3, 1, 2, 4, 5, 6, 7, },
114 .dq1
= { 11, 8, 13, 14, 9, 12, 15, 10, },
118 /* DQS CPU<>DRAM map */
120 .ddr0
= { .dqs0
= 1, .dqs1
= 0 },
121 .ddr1
= { .dqs0
= 1, .dqs1
= 0 },
122 .ddr2
= { .dqs0
= 0, .dqs1
= 1 },
123 .ddr3
= { .dqs0
= 0, .dqs1
= 1 },
124 .ddr4
= { .dqs0
= 1, .dqs1
= 0 },
125 .ddr5
= { .dqs0
= 0, .dqs1
= 1 },
126 .ddr6
= { .dqs0
= 1, .dqs1
= 0 },
127 .ddr7
= { .dqs0
= 0, .dqs1
= 1 },
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
;
149 return &osiris_memcfg
;