Debian Codegraph @

src/mainboard/google/zork/variants/baseboard/trembyle/fsps.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <platform_descriptors.h>
6 #include <soc/soc_util.h>
7
8 void __weak variant_get_dxio_ddi_descriptors(const fsp_dxio_descriptor **dxio_descs,
9 size_t *dxio_num,
10 const fsp_ddi_descriptor **ddi_descs,
11 size_t *ddi_num)
12 {
13 *dxio_descs = baseboard_get_dxio_descriptors(dxio_num);
14 *ddi_descs = baseboard_get_ddi_descriptors(ddi_num);
15 }
16
17 /* FP5 package can support Type 1 (Picasso) and Type 2 (Dali), however some
18 * Type 1 parts, while reporting as Picasso through cpuid, are fused like a Dali.
19 * Those parts need to be configured as Type 2. */
20
21 static const fsp_dxio_descriptor pco_dxio_descriptors[] = {
22 {
23 // NVME SSD
24 .port_present = true,
25 .engine_type = PCIE_ENGINE,
26 .start_logical_lane = 0,
27 .end_logical_lane = 3,
28 .device_number = 1,
29 .function_number = 7,
30 .link_aspm = ASPM_L1,
31 .link_aspm_L1_1 = true,
32 .link_aspm_L1_2 = true,
33 .turn_off_unused_lanes = true,
34 .clk_req = CLK_REQ4,
35 },
36 {
37 // WLAN
38 .port_present = true,
39 .engine_type = PCIE_ENGINE,
40 .start_logical_lane = 4,
41 .end_logical_lane = 4,
42 .device_number = 1,
43 .function_number = 2,
44 .link_aspm = ASPM_L1,
45 .link_aspm_L1_1 = true,
46 .link_aspm_L1_2 = true,
47 .turn_off_unused_lanes = true,
48 .clk_req = CLK_REQ0,
49 },
50 {
51 // SD Reader
52 .port_present = true,
53 .engine_type = PCIE_ENGINE,
54 .start_logical_lane = 5,
55 .end_logical_lane = 5,
56 .device_number = 1,
57 .function_number = 3,
58 .link_aspm = ASPM_L1,
59 .link_aspm_L1_1 = true,
60 .link_aspm_L1_2 = true,
61 .turn_off_unused_lanes = true,
62 .clk_req = CLK_REQ1,
63 }
64 };
65
66 static const fsp_dxio_descriptor dali_dxio_descriptors[] = {
67 {
68 // NVME SSD
69 .port_present = true,
70 .engine_type = PCIE_ENGINE,
71 .start_logical_lane = 0,
72 .end_logical_lane = 1,
73 .device_number = 1,
74 .function_number = 7,
75 .link_aspm = ASPM_L1,
76 .link_aspm_L1_1 = true,
77 .link_aspm_L1_2 = true,
78 .turn_off_unused_lanes = true,
79 .clk_req = CLK_REQ4,
80 },
81 {
82 // WLAN
83 .port_present = true,
84 .engine_type = PCIE_ENGINE,
85 .start_logical_lane = 4,
86 .end_logical_lane = 4,
87 .device_number = 1,
88 .function_number = 2,
89 .link_aspm = ASPM_L1,
90 .link_aspm_L1_1 = true,
91 .link_aspm_L1_2 = true,
92 .turn_off_unused_lanes = true,
93 .clk_req = CLK_REQ0,
94 },
95 {
96 // SD Reader
97 .port_present = true,
98 .engine_type = PCIE_ENGINE,
99 .start_logical_lane = 5,
100 .end_logical_lane = 5,
101 .device_number = 1,
102 .function_number = 3,
103 .link_aspm = ASPM_L1,
104 .link_aspm_L1_1 = true,
105 .link_aspm_L1_2 = true,
106 .turn_off_unused_lanes = true,
107 .clk_req = CLK_REQ1,
108 }
109 };
110
111 const fsp_dxio_descriptor *baseboard_get_dxio_descriptors(size_t *num)
112 {
113 /* Type 2 or Type 1 fused like Type 2. */
114 if (soc_is_reduced_io_sku()) {
115 *num = ARRAY_SIZE(dali_dxio_descriptors);
116 return dali_dxio_descriptors;
117 } else {
118 /* Type 1 */
119 *num = ARRAY_SIZE(pco_dxio_descriptors);
120 return pco_dxio_descriptors;
121 }
122 }
123
124 static const fsp_ddi_descriptor pco_ddi_descriptors[] = {
125 {
126 // DDI0, DP0, eDP
127 .connector_type = EDP,
128 .aux_index = AUX1,
129 .hdp_index = HDP1
130 },
131 {
132 // DDI1, DP1, DB OPT1 HDMI
133 .connector_type = HDMI,
134 .aux_index = AUX2,
135 .hdp_index = HDP2
136 },
137 {
138 // DDI2, DP2, DB OPT1 USB-C1
139 .connector_type = DP,
140 .aux_index = AUX3,
141 .hdp_index = HDP3,
142 },
143 {
144 // DDI3, DP3, USB-C0
145 .connector_type = DP,
146 .aux_index = AUX4,
147 .hdp_index = HDP4,
148 }
149 };
150
151 static const fsp_ddi_descriptor dali_ddi_descriptors[] = {
152 {
153 // DDI0, DP0, eDP
154 .connector_type = EDP,
155 .aux_index = AUX1,
156 .hdp_index = HDP1
157 },
158 {
159 // DDI1, DP1, DB OPT2 USB-C1 / DB OPT3 MST hub
160 .connector_type = DP,
161 .aux_index = AUX2,
162 .hdp_index = HDP2
163 },
164 {
165 // DDI2, DP3, USB-C0
166 .connector_type = DP,
167 .aux_index = AUX4,
168 .hdp_index = HDP4,
169 }
170 };
171
172 const fsp_ddi_descriptor *baseboard_get_ddi_descriptors(size_t *num)
173 {
174 /* Type 2 or Type 1 fused like Type 2. */
175 if (soc_is_reduced_io_sku()) {
176 *num = ARRAY_SIZE(dali_ddi_descriptors);
177 return dali_ddi_descriptors;
178 } else {
179 /* Type 1 */
180 *num = ARRAY_SIZE(pco_ddi_descriptors);
181 return pco_ddi_descriptors;
182 }
183 }