1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/variants.h>
4 #include <baseboard/gpio.h>
7 #include <soc/cnl_memcfg_init.h>
9 #include <variant/gpio.h>
11 static const struct cnl_mb_cfg baseboard_memcfg
= {
13 * The dqs_map arrays map the SoC pins to the lpddr3 pins
16 * "The index of the array is CPU byte number, the values are DRAM byte
17 * numbers." - doc #573387
19 * the index = pin number on SoC
20 * the value = pin number on lpddr3 part
22 .dqs_map
[DDR_CH0
] = {4, 7, 5, 6, 0, 3, 2, 1},
23 .dqs_map
[DDR_CH1
] = {0, 3, 2, 1, 4, 7, 6, 5},
42 /* Helios uses 200, 80.6 and 162 rcomp resistors */
43 .rcomp_resistor
= {200, 81, 162},
45 /* Helios Rcomp target values */
46 .rcomp_targets
= {100, 40, 40, 23, 40},
48 /* Set CaVref config to 0 for LPDDR3 */
51 /* Disable Early Command Training */
55 void variant_memory_params(struct cnl_mb_cfg
*bcfg
)
57 memcpy(bcfg
, &baseboard_memcfg
, sizeof(baseboard_memcfg
));
60 int variant_memory_sku(void)
62 const gpio_t spd_gpios
[] = {
69 int val
= gpio_base2_value(spd_gpios
, ARRAY_SIZE(spd_gpios
));
71 if ((board_id() != 0) && (board_id() != BOARD_ID_UNKNOWN
))
75 * For boards with id 0 or unknown, memory straps 3 and 4 are
76 * incorrectly stuffed in hardware. This is a workaround for these
77 * boards to override memory strap 3 to 0 and 4 to 1.