Debian Codegraph @

src/mainboard/google/hatch/variants/palkia/memory.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <baseboard/variants.h>
4 #include <baseboard/gpio.h>
5 #include <gpio.h>
6 #include <soc/cnl_memcfg_init.h>
7 #include <string.h>
8 #include <variant/gpio.h>
9
10 static const struct cnl_mb_cfg baseboard_memcfg = {
11 /*
12 * The dqs_map arrays map the SoC pins to the lpddr3 pins
13 * for both channels.
14 *
15 * "The index of the array is CPU byte number, the values are DRAM byte
16 * numbers." - doc #573387
17 *
18 * the index = pin number on SoC
19 * the value = pin number on lpddr3 part
20 */
21 .dqs_map[DDR_CH0] = {4, 7, 5, 6, 0, 3, 2, 1},
22 .dqs_map[DDR_CH1] = {0, 3, 2, 1, 4, 7, 6, 5},
23
24 .dq_map[DDR_CH0] = {
25 {0xf0, 0xf},
26 {0x0, 0xf},
27 {0xf0, 0xf},
28 {0xf0, 0x0},
29 {0xff, 0x0},
30 {0xff, 0x0}
31 },
32 .dq_map[DDR_CH1] = {
33 {0xf, 0xf0},
34 {0x0, 0xf0},
35 {0xf, 0xf0},
36 {0xf, 0x0},
37 {0xff, 0x0},
38 {0xff, 0x0}
39 },
40
41 /* Palkia uses 200, 80.6 and 162 rcomp resistors */
42 .rcomp_resistor = {200, 81, 162},
43
44 /* Palkia Rcomp target values */
45 .rcomp_targets = {100, 40, 40, 23, 40},
46
47 /* Set CaVref config to 0 for LPDDR3 */
48 .vref_ca_config = 0,
49
50 /* Disable Early Command Training */
51 .ect = 0,
52 };
53
54 void variant_memory_params(struct cnl_mb_cfg *bcfg)
55 {
56 memcpy(bcfg, &baseboard_memcfg, sizeof(baseboard_memcfg));
57 }