1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/variants.h>
5 #include <soc/romstage.h>
7 static const struct mb_cfg variant_memcfg
= {
11 /* Baseboard uses only 100ohm Rcomp resistors */
18 .dq0
= { 11, 15, 13, 12, 9, 10, 14, 8 },
19 .dq1
= { 3, 1, 2, 0, 4, 7, 5, 6 },
22 .dq0
= { 3, 1, 2, 0, 4, 7, 5, 6 },
23 .dq1
= { 13, 9, 8, 11, 10, 14, 15, 12 },
26 .dq0
= { 2, 1, 3, 0, 4, 6, 5, 7 },
27 .dq1
= { 8, 9, 10, 11, 13, 14, 12, 15 },
30 .dq0
= { 3, 0, 1, 2, 5, 6, 4, 7 },
31 .dq1
= { 13, 9, 11, 8, 14, 15, 10, 12 },
34 .dq0
= { 11, 15, 13, 12, 9, 10, 14, 8 },
35 .dq1
= { 3, 1, 2, 0, 4, 7, 5, 6 },
38 .dq0
= { 3, 1, 2, 0, 4, 7, 5, 6 },
39 .dq1
= { 13, 9, 8, 11, 10, 14, 15, 12 },
42 .dq0
= { 2, 1, 3, 0, 4, 6, 5, 7 },
43 .dq1
= { 8, 9, 10, 11, 13, 14, 12, 15 },
46 .dq0
= { 3, 0, 1, 2, 5, 6, 4, 7 },
47 .dq1
= { 13, 9, 11, 8, 14, 15, 10, 12 },
51 /* DQS CPU<>DRAM map */
53 .ddr0
= { .dqs0
= 1, .dqs1
= 0 },
54 .ddr1
= { .dqs0
= 0, .dqs1
= 1 },
55 .ddr2
= { .dqs0
= 0, .dqs1
= 1 },
56 .ddr3
= { .dqs0
= 0, .dqs1
= 1 },
57 .ddr4
= { .dqs0
= 1, .dqs1
= 0 },
58 .ddr5
= { .dqs0
= 0, .dqs1
= 1 },
59 .ddr6
= { .dqs0
= 0, .dqs1
= 1 },
60 .ddr7
= { .dqs0
= 0, .dqs1
= 1 },
67 .ect
= 1, /* Early Command Training */
69 .UserBd
= BOARD_TYPE_MOBILE
,
72 const struct mb_cfg
*variant_memory_params(void)
74 return &variant_memcfg
;
77 int variant_memory_sku(void)
80 * Memory configuration board straps
81 * GPIO_MEM_CONFIG_0 GPP_E2
82 * GPIO_MEM_CONFIG_1 GPP_E1
83 * GPIO_MEM_CONFIG_2 GPP_E12
84 * GPIO_MEM_CONFIG_3 GPP_E13
86 gpio_t spd_gpios
[] = {
93 return gpio_base2_value(spd_gpios
, ARRAY_SIZE(spd_gpios
));
96 bool variant_is_half_populated(void)
99 * Ideally half_populated is used in platforms with multiple channels to
100 * enable only one half of the channel. Alder Lake-N has single channel,
101 * and it would require for new structures to be defined in meminit block
102 * driver for LPx memory configurations. In order to avoid adding new
103 * structures, set half_populated to true. This has the same effect as
104 * having single channel with 64-bit width.
109 void variant_get_spd_info(struct mem_spd
*spd_info
)
111 spd_info
->topo
= MEM_TOPO_MEMORY_DOWN
;
112 spd_info
->cbfs_index
= variant_memory_sku();