blob: 1508c91ddd52b7d65ccf492ce96a29cac37c09b2 [file] [log] [blame]
Angel Pons60ec3652020-04-03 01:22:13 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lijian Zhaof3496722018-08-21 10:50:16 -07002
3#include <baseboard/variants.h>
4#include <baseboard/gpio.h>
Lijian Zhaof3496722018-08-21 10:50:16 -07005#include <gpio.h>
6#include <soc/cnl_memcfg_init.h>
7
8static const struct cnl_mb_cfg baseboard_memcfg_cfg = {
Philip Chen0d4200f2019-04-29 10:18:24 -07009 /* Access memory info through SMBUS. */
10 .spd[0] = {
11 .read_type = READ_SMBUS,
12 .spd_spec = {.spd_smbus_address = 0xA0}
13 },
14 .spd[1] = {
15 .read_type = READ_SMBUS,
16 .spd_spec = {.spd_smbus_address = 0xA2}
17 },
18 .spd[2] = {
19 .read_type = READ_SMBUS,
20 .spd_spec = {.spd_smbus_address = 0xA4}
21 },
22 .spd[3] = {
23 .read_type = READ_SMBUS,
24 .spd_spec = {.spd_smbus_address = 0xA6}
25 },
Lijian Zhaof3496722018-08-21 10:50:16 -070026 /*
27 * The dqs_map arrays map the ddr4 pins to the SoC pins
28 * for both channels.
29 *
30 * the index = pin number on ddr4 part
31 * the value = pin number on SoC
32 */
Philip Chen0d4200f2019-04-29 10:18:24 -070033 .dqs_map[DDR_CH0] = {0, 1, 3, 2, 4, 5, 6, 7},
34 .dqs_map[DDR_CH1] = {1, 0, 4, 5, 2, 3, 6, 7},
Lijian Zhaof3496722018-08-21 10:50:16 -070035
36 /* Baseboard uses 121, 81 and 100 rcomp resistors */
Philip Chen0d4200f2019-04-29 10:18:24 -070037 .rcomp_resistor = {121, 81, 100},
Lijian Zhaof3496722018-08-21 10:50:16 -070038
39 /*
40 * Baseboard Rcomp target values.
41 */
Philip Chen0d4200f2019-04-29 10:18:24 -070042 .rcomp_targets = {100, 40, 20, 20, 26},
Lijian Zhaof3496722018-08-21 10:50:16 -070043
44 /* Baseboard is an interleaved design */
45 .dq_pins_interleaved = 1,
46
47 /* Baseboard is using config 2 for vref_ca */
48 .vref_ca_config = 2,
49
50 /* Disable Early Command Training */
51 .ect = 0,
52};
53
54const struct cnl_mb_cfg *__weak variant_memcfg_config(void)
55{
56 return &baseboard_memcfg_cfg;
57}