Debian Codegraph @

src/mainboard/intel/glkrvp/variants/baseboard/memory.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <baseboard/variants.h>
4 #include <gpio.h>
5 #include <soc/meminit.h>
6 #include <variant/gpio.h>
7
8 const struct lpddr4_swizzle_cfg baseboard_lpddr4_swizzle = {
9 /* CH0_DQA[0:31] SoC pins -> U22 LPDDR4 module pins */
10 .phys[LP4_PHYS_CH0A] = {
11 /* DQA[0:7] pins of LPDDR4 module. */
12 .dqs[LP4_DQS0] = { 6, 7, 5, 4, 3, 1, 0, 2 },
13 /* DQA[8:15] pins of LPDDR4 module. */
14 .dqs[LP4_DQS1] = { 12, 10, 11, 13, 14, 8, 9, 15 },
15 /* DQB[0:7] pins of LPDDR4 module with offset of 16. */
16 .dqs[LP4_DQS2] = { 16, 22, 23, 20, 18, 17, 19, 21 },
17 /* DQB[7:15] pins of LPDDR4 module with offset of 16. */
18 .dqs[LP4_DQS3] = { 30, 28, 29, 25, 24, 26, 27, 31 },
19 },
20 .phys[LP4_PHYS_CH0B] = {
21 /* DQA[0:7] pins of LPDDR4 module. */
22 .dqs[LP4_DQS0] = { 7, 3, 5, 2, 6, 0, 1, 4 },
23 /* DQA[8:15] pins of LPDDR4 module. */
24 .dqs[LP4_DQS1] = { 9, 14, 12, 13, 10, 11, 8, 15 },
25 /* DQB[0:7] pins of LPDDR4 module with offset of 16. */
26 .dqs[LP4_DQS2] = { 20, 22, 23, 16, 19, 17, 18, 21 },
27 /* DQB[7:15] pins of LPDDR4 module with offset of 16. */
28 .dqs[LP4_DQS3] = { 28, 24, 26, 27, 29, 30, 31, 25 },
29 },
30 .phys[LP4_PHYS_CH1A] = {
31 /* DQA[0:7] pins of LPDDR4 module. */
32 .dqs[LP4_DQS0] = { 2, 1, 6, 7, 5, 4, 3, 0 },
33 /* DQA[8:15] pins of LPDDR4 module. */
34 .dqs[LP4_DQS1] = { 11, 10, 8, 9, 12, 15, 13, 14 },
35 /* DQB[0:7] pins of LPDDR4 module with offset of 16. */
36 .dqs[LP4_DQS2] = { 17, 23, 19, 16, 21, 22, 20, 18 },
37 /* DQB[7:15] pins of LPDDR4 module with offset of 16. */
38 .dqs[LP4_DQS3] = { 31, 29, 26, 25, 28, 27, 24, 30 },
39 },
40 .phys[LP4_PHYS_CH1B] = {
41 /* DQA[0:7] pins of LPDDR4 module. */
42 .dqs[LP4_DQS0] = { 4, 3, 7, 5, 6, 1, 0, 2 },
43 /* DQA[8:15] pins of LPDDR4 module. */
44 .dqs[LP4_DQS1] = { 15, 9, 8, 11, 14, 13, 12, 10 },
45 /* DQB[0:7] pins of LPDDR4 module with offset of 16. */
46 .dqs[LP4_DQS2] = { 20, 23, 22, 21, 18, 19, 16, 17 },
47 /* DQB[7:15] pins of LPDDR4 module with offset of 16. */
48 .dqs[LP4_DQS3] = { 25, 28, 30, 31, 26, 27, 24, 29 },
49 },
50 };
51
52 static const struct lpddr4_sku skus[] = {
53 /*
54 * K4F6E304HB-MGCJ - both logical channels While the parts
55 * are listed at 16Gb there are 2 ranks per channel so indicate
56 * the density as 8Gb per rank.
57 */
58 [0] = {
59 .speed = LP4_SPEED_2400,
60 .ch0_rank_density = LP4_8Gb_DENSITY,
61 .ch1_rank_density = LP4_8Gb_DENSITY,
62 .ch0_dual_rank = 1,
63 .ch1_dual_rank = 1,
64 .part_num = "K4F6E304HB-MGCJ",
65 },
66 /* K4F8E304HB-MGCJ - both logical channels */
67 [1] = {
68 .speed = LP4_SPEED_2400,
69 .ch0_rank_density = LP4_8Gb_DENSITY,
70 .ch1_rank_density = LP4_8Gb_DENSITY,
71 .part_num = "K4F8E304HB-MGCJ",
72 },
73 /*
74 * MT53B512M32D2NP-062WT:C - both logical channels. While the parts
75 * are listed at 16Gb there are 2 ranks per channel so indicate
76 * the density as 8Gb per rank.
77 */
78 [2] = {
79 .speed = LP4_SPEED_2400,
80 .ch0_rank_density = LP4_8Gb_DENSITY,
81 .ch1_rank_density = LP4_8Gb_DENSITY,
82 .ch0_dual_rank = 1,
83 .ch1_dual_rank = 1,
84 .part_num = "MT53B512M32D2NP",
85 .disable_periodic_retraining = 1,
86 },
87 /* MT53B256M32D1NP-062 WT:C - both logical channels */
88 [3] = {
89 .speed = LP4_SPEED_2400,
90 .ch0_rank_density = LP4_8Gb_DENSITY,
91 .ch1_rank_density = LP4_8Gb_DENSITY,
92 .part_num = "MT53B256M32D1NP",
93 .disable_periodic_retraining = 1,
94 },
95 /*
96 * H9HCNNNBPUMLHR-NLE - both logical channels. While the parts
97 * are listed at 16Gb there are 2 ranks per channel so indicate the
98 * density as 8Gb per rank.
99 */
100 [4] = {
101 .speed = LP4_SPEED_2400,
102 .ch0_rank_density = LP4_8Gb_DENSITY,
103 .ch1_rank_density = LP4_8Gb_DENSITY,
104 .ch0_dual_rank = 1,
105 .ch1_dual_rank = 1,
106 .part_num = "H9HCNNNBPUMLHR",
107 },
108 /* H9HCNNN8KUMLHR-NLE - both logical channels */
109 [5] = {
110 .speed = LP4_SPEED_2400,
111 .ch0_rank_density = LP4_8Gb_DENSITY,
112 .ch1_rank_density = LP4_8Gb_DENSITY,
113 .part_num = "H9HCNNN8KUMLHR",
114 },
115 };
116
117 static const struct lpddr4_cfg lp4cfg = {
118 .skus = skus,
119 .num_skus = ARRAY_SIZE(skus),
120 .swizzle_config = &baseboard_lpddr4_swizzle,
121 };
122
123 const struct lpddr4_cfg * __weak variant_lpddr4_config(void)
124 {
125 return &lp4cfg;
126 }
127
128 size_t __weak variant_memory_sku(void)
129 {
130 return 0;
131 }