cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / google / brya / variants / kano / memory.c
blob31837086f82c51dbb4bc6f53df2004251503d3ee
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/variants.h>
4 #include <memory_info.h>
5 #include <string.h>
7 static const struct mb_cfg kano_memcfg = {
8 .type = MEM_TYPE_LP4X,
10 .rcomp = {
11 /* Baseboard uses only 100ohm Rcomp resistors */
12 .resistor = 100,
14 /* Baseboard Rcomp target values */
15 .targets = {40, 30, 30, 30, 30},
18 /* DQ byte map */
19 .lpx_dq_map = {
20 .ddr0 = {
21 .dq0 = { 3, 0, 2, 1, 4, 6, 5, 7, },
22 .dq1 = { 12, 13, 14, 15, 8, 9, 10, 11, },
24 .ddr1 = {
25 .dq0 = { 13, 14, 11, 12, 10, 8, 15, 9, },
26 .dq1 = { 5, 2, 4, 3, 1, 6, 0, 7, },
28 .ddr2 = {
29 .dq0 = { 2, 3, 1, 0, 7, 6, 5, 4, },
30 .dq1 = { 12, 13, 14, 15, 8, 9, 10, 11, },
32 .ddr3 = {
33 .dq0 = { 13, 14, 12, 15, 11, 9, 8, 10, },
34 .dq1 = { 5, 2, 1, 4, 7, 0, 3, 6, },
36 .ddr4 = {
37 .dq0 = { 11, 10, 8, 9, 14, 15, 13, 12, },
38 .dq1 = { 3, 0, 2, 1, 5, 4, 6, 7, },
40 .ddr5 = {
41 .dq0 = { 11, 15, 13, 12, 10, 9, 14, 8, },
42 .dq1 = { 3, 0, 2, 1, 6, 7, 5, 4, },
44 .ddr6 = {
45 .dq0 = { 11, 13, 10, 12, 15, 9, 14, 8, },
46 .dq1 = { 4, 3, 5, 2, 7, 0, 1, 6, },
48 .ddr7 = {
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 */
55 .lpx_dqs_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,
74 .rcomp = {
75 /* Baseboard uses only 100ohm Rcomp resistors */
76 .resistor = 100,
78 /* Baseboard Rcomp target values */
79 .targets = {40, 30, 30, 30, 30},
82 /* DQ byte map */
83 .lpx_dq_map = {
84 .ddr0 = {
85 .dq0 = { 3, 0, 2, 1, 4, 6, 5, 7, },
86 .dq1 = { 12, 13, 14, 15, 8, 9, 10, 11, },
88 .ddr1 = {
89 .dq0 = { 13, 14, 11, 12, 10, 8, 15, 9, },
90 .dq1 = { 5, 2, 4, 3, 1, 6, 0, 7, },
92 .ddr2 = {
93 .dq0 = { 2, 3, 1, 0, 7, 6, 5, 4, },
94 .dq1 = { 12, 13, 14, 15, 8, 9, 10, 11, },
96 .ddr3 = {
97 .dq0 = { 13, 14, 12, 15, 11, 9, 8, 10, },
98 .dq1 = { 5, 2, 1, 4, 7, 0, 3, 6, },
100 .ddr4 = {
101 .dq0 = { 11, 10, 8, 9, 14, 15, 13, 12, },
102 .dq1 = { 3, 0, 2, 1, 5, 4, 6, 7, },
104 .ddr5 = {
105 .dq0 = { 11, 15, 13, 12, 10, 9, 14, 8, },
106 .dq1 = { 3, 0, 2, 1, 6, 7, 5, 4, },
108 .ddr6 = {
109 .dq0 = { 11, 13, 10, 12, 15, 9, 14, 8, },
110 .dq1 = { 4, 3, 5, 2, 7, 0, 1, 6, },
112 .ddr7 = {
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 */
119 .lpx_dqs_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";
143 if (part_num) {
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 &kano_memcfg;