1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
6 #include <soc/romstage.h>
9 static const struct mb_cfg variant_memcfg
= {
10 .type
= MEM_TYPE_LP5X
,
13 /* Baseboard uses only 100ohm Rcomp resistors */
20 .dq0
= { 15, 10, 8, 11, 14, 13, 9, 12 },
21 .dq1
= { 3, 1, 2, 0, 7, 5, 4, 6 },
24 .dq0
= { 7, 0, 3, 2, 1, 4, 6, 5 },
25 .dq1
= { 12, 9, 8, 11, 10, 13, 15, 14 },
28 .dq0
= { 2, 1, 3, 0, 4, 6, 5, 7 },
29 .dq1
= { 8, 9, 10, 11, 13, 14, 12, 15 },
32 .dq0
= { 3, 0, 1, 2, 5, 6, 4, 7 },
33 .dq1
= { 13, 9, 11, 8, 14, 15, 10, 12 },
36 .dq0
= { 15, 10, 8, 11, 14, 13, 9, 12 },
37 .dq1
= { 3, 1, 2, 0, 7, 5, 4, 6 },
40 .dq0
= { 7, 0, 3, 2, 1, 4, 6, 5 },
41 .dq1
= { 12, 9, 8, 11, 10, 13, 15, 14 },
44 .dq0
= { 2, 1, 3, 0, 4, 6, 5, 7 },
45 .dq1
= { 8, 9, 10, 11, 13, 14, 12, 15 },
48 .dq0
= { 3, 0, 1, 2, 5, 6, 4, 7 },
49 .dq1
= { 13, 9, 11, 8, 14, 15, 10, 12 },
53 /* DQS CPU<>DRAM map */
55 .ddr0
= { .dqs0
= 1, .dqs1
= 0 },
56 .ddr1
= { .dqs0
= 0, .dqs1
= 1 },
57 .ddr2
= { .dqs0
= 0, .dqs1
= 1 },
58 .ddr3
= { .dqs0
= 0, .dqs1
= 1 },
59 .ddr4
= { .dqs0
= 1, .dqs1
= 0 },
60 .ddr5
= { .dqs0
= 0, .dqs1
= 1 },
61 .ddr6
= { .dqs0
= 0, .dqs1
= 1 },
62 .ddr7
= { .dqs0
= 0, .dqs1
= 1 },
69 .ect
= 1, /* Early Command Training */
71 .UserBd
= BOARD_TYPE_MOBILE
,
74 const struct mb_cfg
*variant_memory_params(void)
76 return &variant_memcfg
;
79 int variant_memory_sku(void)
82 * Memory configuration board straps
83 * GPIO_MEM_CONFIG_0 GPP_E1
84 * GPIO_MEM_CONFIG_1 GPP_E2
85 * GPIO_MEM_CONFIG_2 GPP_E3
87 gpio_t spd_gpios
[] = {
93 if (board_id() == BOARD_ID_UNKNOWN
)
96 return gpio_base2_value(spd_gpios
, ARRAY_SIZE(spd_gpios
));