blob: ccc5c1ac5cdd869802db9c42a9f51341f50db0c2 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
2-- Copyright (C) 2015-2016 secunet Security Networks AG
3--
4-- This program is free software; you can redistribute it and/or modify
5-- it under the terms of the GNU General Public License as published by
Nico Huber125a29e2016-10-18 00:23:54 +02006-- the Free Software Foundation; either version 2 of the License, or
7-- (at your option) any later version.
Nico Huber83693c82016-10-08 22:17:55 +02008--
9-- This program is distributed in the hope that it will be useful,
10-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-- GNU General Public License for more details.
13--
14
15private package HW.GFX.GMA.Config
16with
17 Initializes => Valid_Port_GPU
18is
19
20 CPU : constant CPU_Type := <<CPU>>;
21
22 CPU_Var : constant CPU_Variant := <<CPU_VARIANT>>;
23
24 Internal_Display : constant Internal_Type := <<INTERNAL_PORT>>;
25
Nico Huberd55afeb2016-10-21 14:31:10 +020026 Analog_I2C_Port : constant PCH_Port := <<ANALOG_I2C_PORT>>;
27
Nico Huber83693c82016-10-08 22:17:55 +020028 EDP_Low_Voltage_Swing : constant Boolean := False;
29
30 Default_MMIO_Base : constant := <<DEFAULT_MMIO_BASE>>;
31
32 LVDS_Dual_Threshold : constant := 95_000_000;
33
34 ----------------------------------------------------------------------------
35
36 Has_Internal_Display : constant Boolean := Internal_Display /= None;
37 Internal_Is_EDP : constant Boolean := Internal_Display = DP;
38
39 ----- CPU pipe: --------
40 Disable_Trickle_Feed : constant Boolean := not
41 (CPU in Haswell .. Broadwell);
42 Pipe_Enabled_Workaround : constant Boolean := CPU = Broadwell;
43 Has_EDP_Pipe : constant Boolean := CPU >= Haswell;
44 Has_Pipe_DDI_Func : constant Boolean := CPU >= Haswell;
45 Has_Trans_Clk_Sel : constant Boolean := CPU >= Haswell;
46 Has_Pipe_MSA_Misc : constant Boolean := CPU >= Haswell;
47 Has_Pipeconf_Misc : constant Boolean := CPU >= Broadwell;
48 Has_Pipeconf_BPC : constant Boolean := CPU /= Haswell;
49 Has_Plane_Control : constant Boolean := CPU >= Skylake;
50 Has_DSP_Linoff : constant Boolean := CPU <= Ivybridge;
Nico Huber4916e342016-11-04 14:37:53 +010051 Has_PF_Pipe_Select : constant Boolean := CPU in Ivybridge .. Haswell;
Nico Huberfbb42202016-11-07 15:08:26 +010052 VGA_Plane_Workaround : constant Boolean := CPU = Ivybridge;
Nico Huber83693c82016-10-08 22:17:55 +020053
54 ----- Panel power: -----
55 Has_PP_Write_Protection : constant Boolean := CPU <= Ivybridge;
56 Has_PP_Port_Select : constant Boolean := CPU <= Ivybridge;
57 Use_PP_VDD_Override : constant Boolean := CPU <= Ivybridge;
58
59 ----- PCH/FDI: ---------
60 Has_PCH_DAC : constant Boolean := CPU in Ironlake .. Ivybridge or
61 (CPU in Broadwell .. Haswell
62 and CPU_Var = Normal);
63
64 Has_PCH_Aux_Channels : constant Boolean := CPU in Ironlake .. Broadwell;
65
66 VGA_Has_Sync_Disable : constant Boolean := CPU <= Ivybridge;
67
68 Has_Trans_Timing_Ovrrde : constant Boolean := CPU >= Sandybridge;
69
70 Has_DPLL_SEL : constant Boolean := CPU in Ironlake .. Ivybridge;
71 Has_FDI_BPC : constant Boolean := CPU in Ironlake .. Ivybridge;
72 Has_FDI_Composite_Sel : constant Boolean := CPU = Ivybridge;
73 Has_Trans_DP_Ctl : constant Boolean := CPU in
74 Sandybridge .. Ivybridge;
75 Has_FDI_C : constant Boolean := CPU = Ivybridge;
76
77 Has_FDI_RX_Power_Down : constant Boolean := CPU in Haswell .. Broadwell;
78
79 ----- DDI: -------------
80 End_EDP_Training_Late : constant Boolean := CPU in Haswell .. Broadwell;
81 Has_Per_DDI_Clock_Sel : constant Boolean := CPU in Haswell .. Broadwell;
82 Has_HOTPLUG_CTL : constant Boolean := CPU in Haswell .. Broadwell;
83 Has_SHOTPLUG_CTL_A : constant Boolean := (CPU in Haswell .. Broadwell
84 and CPU_Var = ULT) or
85 CPU >= Skylake;
86
87 Has_DDI_D : constant Boolean := (CPU in Haswell .. Broadwell
88 and CPU_Var = Normal)
89 or CPU >= Skylake;
90
91 Has_Low_Voltage_Swing : constant Boolean := CPU >= Skylake;
92
93 Need_DP_Aux_Mutex : constant Boolean := False; -- Skylake & (PSR | GTC)
94
95 Ungate_GMBUS_Unit_Level : constant Boolean := CPU >= Skylake;
96
97 ----- Power: -----------
98 Has_IPS : constant Boolean := (CPU = Haswell and
99 CPU_Var = ULT) or
100 CPU = Broadwell;
101 Has_IPS_CTL_Mailbox : constant Boolean := CPU = Broadwell;
102
103 Has_Per_Pipe_SRD : constant Boolean := CPU >= Broadwell;
104
105 ----- GTT: -----
106 Fold_39Bit_GTT_PTE : constant Boolean := CPU <= Haswell;
107
108 ----------------------------------------------------------------------------
109
110 type Supported_Pipe_Array is array (Config_Index) of Boolean;
111 Supported_Pipe : constant Supported_Pipe_Array :=
112 (Primary => True,
113 Secondary => True,
114 Tertiary => CPU >= Ivybridge);
115
116 type Valid_Per_Port is array (Port_Type) of Boolean;
117 type Valid_Per_GPU is array (CPU_Type) of Valid_Per_Port;
118 Valid_Port_GPU : Valid_Per_GPU :=
119 (Ironlake => Valid_Per_Port'
120 (Disabled => False,
121 Internal => Config.Internal_Display = LVDS,
122 others => True),
123 Sandybridge => Valid_Per_Port'
124 (Disabled => False,
125 Internal => Config.Internal_Display = LVDS,
126 others => True),
127 Ivybridge => Valid_Per_Port'
128 (Disabled => False,
129 Internal => Config.Internal_Display /= None,
130 others => True),
131 Haswell => Valid_Per_Port'
132 (Disabled => False,
133 Internal => Config.Internal_Display = DP,
134 Digital3 => CPU_Var = Normal,
135 DP3 => CPU_Var = Normal,
136 Analog => CPU_Var = Normal,
137 others => True),
138 Broadwell => Valid_Per_Port'
139 (Disabled => False,
140 Internal => Config.Internal_Display = DP,
141 Digital3 => CPU_Var = Normal,
142 DP3 => CPU_Var = Normal,
143 Analog => CPU_Var = Normal,
144 others => True),
145 Skylake => Valid_Per_Port'
146 (Disabled => False,
147 Internal => Config.Internal_Display = DP,
148 Analog => False,
149 others => True))
150 with
151 Part_Of => GMA.Config_State;
152 Valid_Port : Valid_Per_Port renames Valid_Port_GPU (CPU);
153
154 ----------------------------------------------------------------------------
155
156 type FDI_Per_Port is array (GPU_Port) of Boolean;
157 type FDI_Per_GPU is array (CPU_Type) of FDI_Per_Port;
158 FDI_GPU : constant FDI_Per_GPU :=
159 (Ironlake => FDI_Per_Port'
160 (DIGI_A => False, -- directly connected eDP
161 DIGI_B => True,
162 DIGI_C => True,
163 DIGI_D => True,
164 others => False),
165 Sandybridge => FDI_Per_Port'
166 (DIGI_A => False, -- directly connected eDP
167 DIGI_B => True,
168 DIGI_C => True,
169 DIGI_D => True,
170 others => False),
171 Ivybridge => FDI_Per_Port'
172 (DIGI_A => False, -- directly connected eDP
173 DIGI_B => True,
174 DIGI_C => True,
175 DIGI_D => True,
176 others => False),
177 Haswell => FDI_Per_Port'
178 (DIGI_A => False,
179 DIGI_B => False,
180 DIGI_C => False,
181 DIGI_D => False,
182 DIGI_E => True, -- VGA option through FDI
183 others => False),
184 Broadwell => FDI_Per_Port'
185 (DIGI_A => False,
186 DIGI_B => False,
187 DIGI_C => False,
188 DIGI_D => False,
189 DIGI_E => CPU_Var = Normal, -- VGA option through FDI
190 others => False),
191 Skylake => FDI_Per_Port'
192 (others => False));
193 FDI_Port : FDI_Per_Port renames FDI_GPU (CPU);
194
195 type FDI_Lanes_Per_Port is array (GPU_Port) of DP_Lane_Count;
196 FDI_Lane_Count : constant FDI_Lanes_Per_Port :=
197 (DIGI_D => DP_Lane_Count_2,
198 others =>
199 (if CPU in Ironlake .. Ivybridge then
200 DP_Lane_Count_4
201 else
202 DP_Lane_Count_2));
203
204 FDI_Training : constant FDI_Training_Type :=
205 (case CPU is
206 when Ironlake => Simple_Training,
207 when Sandybridge => Full_Training,
208 when others => Auto_Training);
209
Nico Huberf54d0962016-10-20 14:17:18 +0200210 ----------------------------------------------------------------------------
211
Nico Huberabe3de22016-10-20 15:03:46 +0200212 Default_CDClk_Freq : constant Frequency_Type :=
213 (case CPU is
214 when Ironlake |
215 Haswell |
216 Broadwell => 450_000_000,
217 when Sandybridge |
218 Ivybridge => 400_000_000,
219 when Skylake => 337_500_000);
220
Nico Huberf54d0962016-10-20 14:17:18 +0200221 Default_RawClk_Freq : constant Frequency_Type :=
222 (case CPU is
223 when Ironlake |
224 Sandybridge |
225 Ivybridge => 125_000_000,
226 when Haswell |
227 Broadwell => (if CPU_Var = Normal then
228 125_000_000
229 else
230 24_000_000),
231 when Skylake => 24_000_000);
232
Nico Huberdcd274b2016-11-03 20:15:39 +0100233 ----------------------------------------------------------------------------
234
235 -- Maximum source width with enabled scaler. This only accounts
236 -- for simple 1:1 pipe:scaler mappings.
237
238 type Width_Per_Pipe is array (Config_Index) of Width_Type;
239
240 Maximum_Scalable_Width : constant Width_Per_Pipe :=
241 (case CPU is
242 when Ironlake..Haswell =>
243 (Primary => 4096,
244 Secondary => 2048,
245 Tertiary => 2048),
246 when Broadwell..Skylake =>
247 (Primary => 4096,
248 Secondary => 4096,
249 Tertiary => 4096));
250
Nico Huber83693c82016-10-08 22:17:55 +0200251end HW.GFX.GMA.Config;