1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
7 static const struct mb_cfg baseboard_memcfg
= {
11 /* Baseboard uses only 100ohm Rcomp resistors */
14 /* Baseboard Rcomp target values */
15 .targets
= { 40, 36, 35, 35, 35 },
21 .dq0
= { 0, 3, 1, 2, 7, 6, 4, 5, },
22 .dq1
= { 13, 12, 14, 15, 11, 8, 10, 9, },
25 .dq0
= { 7, 6, 5, 4, 2, 1, 0, 3, },
26 .dq1
= { 9, 8, 10, 11, 13, 14, 15, 12, },
29 .dq0
= { 8, 11, 9, 10, 12, 14, 13, 15, },
30 .dq1
= { 5, 7, 6, 4, 1, 2, 3, 0, },
33 .dq0
= { 2, 0, 1, 3, 7, 6, 5, 4, },
34 .dq1
= { 12, 13, 14, 15, 11, 8, 9, 10, },
37 .dq0
= { 0, 3, 1, 2, 7, 5, 6, 4, },
38 .dq1
= { 12, 14, 13, 15, 10, 8, 11, 9, },
41 .dq0
= { 10, 8, 9, 11, 13, 15, 14, 12, },
42 .dq1
= { 7, 6, 5, 4, 3, 1, 0, 2, },
45 .dq0
= { 6, 4, 5, 7, 1, 0, 2, 3, },
46 .dq1
= { 8, 9, 10, 11, 13, 15, 14, 12, },
49 .dq0
= { 1, 2, 0, 3, 5, 6, 7, 4, },
50 .dq1
= { 12, 13, 14, 15, 11, 8, 10, 9, },
54 /* DQS CPU<>DRAM map */
56 .ddr0
= { .dqs0
= 0, .dqs1
= 1 },
57 .ddr1
= { .dqs0
= 0, .dqs1
= 1 },
58 .ddr2
= { .dqs0
= 1, .dqs1
= 0 },
59 .ddr3
= { .dqs0
= 0, .dqs1
= 1 },
60 .ddr4
= { .dqs0
= 0, .dqs1
= 1 },
61 .ddr5
= { .dqs0
= 1, .dqs1
= 0 },
62 .ddr6
= { .dqs0
= 0, .dqs1
= 1 },
63 .ddr7
= { .dqs0
= 0, .dqs1
= 1 }
70 .LpDdrDqDqsReTraining
= 1,
72 .ect
= 1, /* Early Command Training */
76 const struct mb_cfg
*variant_memory_params(void)
78 return &baseboard_memcfg
;
81 int variant_memory_sku(void)
84 * Memory configuration board straps
85 * GPIO_MEM_CONFIG_0 GPP_E11
86 * GPIO_MEM_CONFIG_1 GPP_E2
87 * GPIO_MEM_CONFIG_2 GPP_E1
88 * GPIO_MEM_CONFIG_3 GPP_E12
90 gpio_t spd_gpios
[] = {
97 return gpio_base2_value(spd_gpios
, ARRAY_SIZE(spd_gpios
));
100 bool variant_is_half_populated(void)
102 /* GPIO_MEM_CH_SEL GPP_E13 */
103 return gpio_get(GPP_E13
);