blob: 721252bfecf6c83df69692bee30036b56fe29029 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
Nico Huber3d06de82018-05-29 01:35:04 +02002-- Copyright (C) 2015-2018 secunet Security Networks AG
Nico Huber83693c82016-10-08 22:17:55 +02003--
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
Nico Huber27088aa2018-06-10 13:28:05 +020015private package HW.GFX.GMA.Config is
Nico Huber83693c82016-10-08 22:17:55 +020016
Nico Huber6621a142018-06-07 23:56:54 +020017 Gen : constant Generation := <<GEN>>;
18
Nico Huberd7809ab2018-06-10 15:44:23 +020019 CPU_First : constant CPU_Type :=
20 (case Gen is
21 when G45 => G45,
22 when Ironlake => Ironlake,
23 when Haswell => Haswell,
24 when Broxton => Broxton,
25 when Skylake => Skylake);
26 CPU_Last : constant CPU_Type :=
27 (case Gen is
28 when G45 => G45,
29 when Ironlake => Ivybridge,
30 when Haswell => Broadwell,
31 when Broxton => Broxton,
32 when Skylake => Skylake);
33 CPU_Var_Last : constant CPU_Variant :=
34 (case Gen is
35 when Haswell | Skylake => ULT,
36 when others => Normal);
37 subtype Gen_CPU_Type is CPU_Type range CPU_First .. CPU_Last;
38 subtype Gen_CPU_Variant is CPU_Variant range Normal .. CPU_Var_Last;
Nico Huber83693c82016-10-08 22:17:55 +020039
Nico Huberd7809ab2018-06-10 15:44:23 +020040 CPU : constant Gen_CPU_Type := <<CPU>>;
41
42 CPU_Var : constant Gen_CPU_Variant := <<CPU_VARIANT>>;
Nico Huber83693c82016-10-08 22:17:55 +020043
44 Internal_Display : constant Internal_Type := <<INTERNAL_PORT>>;
45
Nico Huberd55afeb2016-10-21 14:31:10 +020046 Analog_I2C_Port : constant PCH_Port := <<ANALOG_I2C_PORT>>;
47
Nico Huber83693c82016-10-08 22:17:55 +020048 EDP_Low_Voltage_Swing : constant Boolean := False;
49
Nico Huber247adf32017-06-12 14:39:11 +020050 DDI_HDMI_Buffer_Translation : constant Integer := -1;
51
Nico Huber83693c82016-10-08 22:17:55 +020052 Default_MMIO_Base : constant := <<DEFAULT_MMIO_BASE>>;
53
54 LVDS_Dual_Threshold : constant := 95_000_000;
55
56 ----------------------------------------------------------------------------
57
Nico Huber30e84082018-06-10 13:28:05 +020058 type Valid_Port_Array is array (Port_Type) of Boolean;
59 type Variable_Config is record
60 Valid_Port : Valid_Port_Array;
61 Raw_Clock : Frequency_Type;
Nico Huberadfe11f2018-06-10 14:59:04 +020062 Dyn_CPU : Gen_CPU_Type;
63 Dyn_CPU_Var : Gen_CPU_Variant;
Nico Huber30e84082018-06-10 13:28:05 +020064 end record;
65
Nico Huber27088aa2018-06-10 13:28:05 +020066 Initial_Settings : constant Variable_Config :=
Nico Huber30e84082018-06-10 13:28:05 +020067 (Valid_Port => (others => False),
Nico Huberadfe11f2018-06-10 14:59:04 +020068 Raw_Clock => Frequency_Type'First,
69 Dyn_CPU => Gen_CPU_Type'First,
70 Dyn_CPU_Var => Gen_CPU_Variant'First);
Nico Huber27088aa2018-06-10 13:28:05 +020071
72 Variable : Variable_Config with Part_Of => GMA.Config_State;
Nico Huber30e84082018-06-10 13:28:05 +020073
74 Valid_Port : Valid_Port_Array renames Variable.Valid_Port;
75 Raw_Clock : Frequency_Type renames Variable.Raw_Clock;
Nico Huberadfe11f2018-06-10 14:59:04 +020076 CPU : Gen_CPU_Type renames Variable.Dyn_CPU;
77 CPU_Var : Gen_CPU_Variant renames Variable.Dyn_CPU_Var;
Nico Huber30e84082018-06-10 13:28:05 +020078
79 ----------------------------------------------------------------------------
80
Nico Huberd9365612018-06-10 14:59:04 +020081 -- To support both static configurations, that are compiled for a
82 -- fixed CPU, and dynamic configurations, where the CPU and its
83 -- variant are detected at runtime, all derived config values are
84 -- tagged based on their dependencies.
85 --
86 -- Booleans that only depend on the generation should be tagged
87 -- <genbool>. Those that may depend on the CPU are tagged with the
88 -- generations where that is the case. For instance `CPU_Ivybridge`
89 -- can be decided purely based on the generation unless the gene-
90 -- ration is Ironlake, thus, it is tagged <ilkbool>.
91 --
92 -- For non-boolean constants, per generation tags <...var> are
93 -- used (e.g. <ilkvar>).
94 --
95 -- To ease parsing, all multiline expressions of tagged config
96 -- values start after a line break.
Nico Huber6621a142018-06-07 23:56:54 +020097
Nico Huberd9365612018-06-10 14:59:04 +020098 Gen_G45 : <genbool> := Gen = G45;
99 Gen_Ironlake : <genbool> := Gen = Ironlake;
100 Gen_Haswell : <genbool> := Gen = Haswell;
101 Gen_Broxton : <genbool> := Gen = Broxton;
102 Gen_Skylake : <genbool> := Gen = Skylake;
Nico Huber6621a142018-06-07 23:56:54 +0200103
Nico Huberd9365612018-06-10 14:59:04 +0200104 Up_To_Ironlake : <genbool> := Gen <= Ironlake;
105 Ironlake_On : <genbool> := Gen >= Ironlake;
106 Haswell_On : <genbool> := Gen >= Haswell;
107 Broxton_On : <genbool> := Gen >= Broxton;
108 Skylake_On : <genbool> := Gen >= Skylake;
Nico Huber998ee2b2018-06-12 23:02:17 +0200109
Nico Huberd9365612018-06-10 14:59:04 +0200110 CPU_Ironlake : <ilkbool> := Gen_Ironlake and then CPU = Ironlake;
111 CPU_Sandybridge : <ilkbool> := Gen_Ironlake and then CPU = Sandybridge;
112 CPU_Ivybridge : <ilkbool> := Gen_Ironlake and then CPU = Ivybridge;
113 CPU_Haswell : <hswbool> := Gen_Haswell and then CPU = Haswell;
114 CPU_Broadwell : <hswbool> := Gen_Haswell and then CPU = Broadwell;
115
116 Sandybridge_On : <ilkbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200117 ((Gen_Ironlake and then CPU >= Sandybridge) or Haswell_On);
Nico Huberd9365612018-06-10 14:59:04 +0200118 Ivybridge_On : <ilkbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200119 ((Gen_Ironlake and then CPU >= Ivybridge) or Haswell_On);
Nico Huberd9365612018-06-10 14:59:04 +0200120 Broadwell_On : <hswbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200121 ((Gen_Haswell and then CPU >= Broadwell) or Broxton_On);
122
Nico Huber6621a142018-06-07 23:56:54 +0200123 ----------------------------------------------------------------------------
124
Nico Huber117db372018-06-09 17:56:05 +0200125 Have_HDMI_Buf_Override : constant Boolean := DDI_HDMI_Buffer_Translation >= 0;
Nico Huber2b6f6992017-07-09 18:11:34 +0200126 Default_MMIO_Base_Set : constant Boolean := Default_MMIO_Base /= 0;
127
Nico Huber83693c82016-10-08 22:17:55 +0200128 Has_Internal_Display : constant Boolean := Internal_Display /= None;
Nico Huber318bca12018-06-09 19:22:52 +0200129 Internal_Is_LVDS : constant Boolean := Internal_Display = LVDS;
Nico Huber83693c82016-10-08 22:17:55 +0200130 Internal_Is_EDP : constant Boolean := Internal_Display = DP;
Nico Huber1bc496f2017-06-09 22:23:28 +0200131 Have_DVI_I : constant Boolean := Analog_I2C_Port /= PCH_DAC;
Nico Huberd9365612018-06-10 14:59:04 +0200132
133 Has_Presence_Straps : <genbool> := not Gen_Broxton;
134 Is_ULT : <hswsklbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200135 ((Gen_Haswell or Gen_Skylake) and then CPU_Var = ULT);
Nico Huber83693c82016-10-08 22:17:55 +0200136
Nico Huberd9365612018-06-10 14:59:04 +0200137 ---------- CPU pipe: ---------
138 Has_Tertiary_Pipe : <ilkbool> := Ivybridge_On;
139 Disable_Trickle_Feed : <genbool> := not Gen_Haswell;
140 Pipe_Enabled_Workaround : <hswbool> := CPU_Broadwell;
141 Has_EDP_Transcoder : <genbool> := Haswell_On;
142 Use_PDW_For_EDP_Scaling : <hswbool> := CPU_Haswell;
143 Has_Pipe_DDI_Func : <genbool> := Haswell_On;
144 Has_Trans_Clk_Sel : <genbool> := Haswell_On;
145 Has_Pipe_MSA_Misc : <genbool> := Haswell_On;
146 Has_Pipeconf_Misc : <hswbool> := Broadwell_On;
147 Has_Pipeconf_BPC : <hswbool> := not CPU_Haswell;
148 Has_Plane_Control : <genbool> := Broxton_On;
149 Has_DSP_Linoff : <genbool> := Up_To_Ironlake;
150 Has_PF_Pipe_Select : <ilkhswbool> := CPU_Ivybridge or CPU_Haswell;
151 Has_Cursor_FBC_Control : <ilkbool> := Ivybridge_On;
152 VGA_Plane_Workaround : <ilkbool> := CPU_Ivybridge;
153 Has_GMCH_DP_Transcoder : <genbool> := Gen_G45;
154 Has_GMCH_VGACNTRL : <genbool> := Gen_G45;
155 Has_GMCH_PFIT_CONTROL : <genbool> := Gen_G45;
Nico Huber83693c82016-10-08 22:17:55 +0200156
Nico Huberd9365612018-06-10 14:59:04 +0200157 --------- Panel power: -------
158 Has_PP_Write_Protection : <genbool> := Up_To_Ironlake;
159 Has_PP_Port_Select : <genbool> := Up_To_Ironlake;
160 Use_PP_VDD_Override : <genbool> := Up_To_Ironlake;
161 Has_PCH_Panel_Power : <genbool> := Ironlake_On;
Nico Huber83693c82016-10-08 22:17:55 +0200162
Nico Huberd9365612018-06-10 14:59:04 +0200163 ----------- PCH/FDI: ---------
164 Has_PCH : <genbool> := not Gen_Broxton and not Gen_G45;
165 Has_PCH_DAC : <hswbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200166 (Gen_Ironlake or (Gen_Haswell and then not Is_ULT));
Nico Huber83693c82016-10-08 22:17:55 +0200167
Nico Huberd9365612018-06-10 14:59:04 +0200168 Has_PCH_Aux_Channels : <genbool> := Gen_Ironlake or Gen_Haswell;
Nico Huber83693c82016-10-08 22:17:55 +0200169
Nico Huberd9365612018-06-10 14:59:04 +0200170 VGA_Has_Sync_Disable : <genbool> := Up_To_Ironlake;
Nico Huber83693c82016-10-08 22:17:55 +0200171
Nico Huberd9365612018-06-10 14:59:04 +0200172 Has_Trans_Timing_Ovrrde : <ilkbool> := Sandybridge_On;
Nico Huber83693c82016-10-08 22:17:55 +0200173
Nico Huberd9365612018-06-10 14:59:04 +0200174 Has_DPLL_SEL : <genbool> := Gen_Ironlake;
175 Has_FDI_BPC : <genbool> := Gen_Ironlake;
176 Has_FDI_Composite_Sel : <ilkbool> := CPU_Ivybridge;
177 Has_New_FDI_Sink : <ilkbool> := Sandybridge_On;
178 Has_New_FDI_Source : <ilkbool> := Ivybridge_On;
179 Has_Trans_DP_Ctl : <ilkbool> := CPU_Sandybridge or CPU_Ivybridge;
180 Has_FDI_C : <ilkbool> := CPU_Ivybridge;
Nico Huber83693c82016-10-08 22:17:55 +0200181
Nico Huberd9365612018-06-10 14:59:04 +0200182 Has_FDI_RX_Power_Down : <genbool> := Gen_Haswell;
Nico Huber83693c82016-10-08 22:17:55 +0200183
Nico Huberd9365612018-06-10 14:59:04 +0200184 Has_GMCH_RawClk : <genbool> := Gen_G45;
Arthur Heymans73ea0322018-03-28 17:17:07 +0200185
Nico Huberd9365612018-06-10 14:59:04 +0200186 ----------- DDI: -------------
187 End_EDP_Training_Late : <genbool> := Gen_Haswell;
188 Has_Per_DDI_Clock_Sel : <genbool> := Gen_Haswell;
189 Has_HOTPLUG_CTL : <genbool> := Gen_Haswell;
190 Has_SHOTPLUG_CTL_A : <hswbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200191 ((Gen_Haswell and then Is_ULT) or Skylake_On);
Nico Huber83693c82016-10-08 22:17:55 +0200192
Nico Huberd9365612018-06-10 14:59:04 +0200193 Has_DDI_PHYs : <genbool> := Gen_Broxton;
Nico Huber19729a72017-07-30 01:05:05 +0200194
Nico Huberd9365612018-06-10 14:59:04 +0200195 Has_DDI_D : <hswsklbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200196 ((Gen_Haswell or Gen_Skylake) and then not Is_ULT);
Nico Huberd9365612018-06-10 14:59:04 +0200197 -- might be disabled by x4 eDP:
198 Has_DDI_E : <hswsklbool> := Has_DDI_D;
Nico Huber83693c82016-10-08 22:17:55 +0200199
Nico Huberd9365612018-06-10 14:59:04 +0200200 Has_DDI_Buffer_Trans : <genbool> := Haswell_On and not Has_DDI_PHYs;
201 Has_Low_Voltage_Swing : <genbool> := Broxton_On;
202 Has_Iboost_Config : <genbool> := Skylake_On;
Nico Huber83693c82016-10-08 22:17:55 +0200203
Nico Huberd9365612018-06-10 14:59:04 +0200204 Need_DP_Aux_Mutex : <genbool> := False; -- Skylake & (PSR | GTC)
Nico Huber83693c82016-10-08 22:17:55 +0200205
Nico Huberd9365612018-06-10 14:59:04 +0200206 ----------- GMBUS: -----------
207 Ungate_GMBUS_Unit_Level : <genbool> := Skylake_On;
208 GMBUS_Alternative_Pins : <genbool> := Gen_Broxton;
209 Has_PCH_GMBUS : <genbool> := Ironlake_On;
Nico Huber83693c82016-10-08 22:17:55 +0200210
Nico Huberd9365612018-06-10 14:59:04 +0200211 ----------- Power: -----------
212 Has_IPS : <hswbool> :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200213 (Gen_Haswell and then
214 ((CPU_Haswell and Is_ULT) or CPU_Broadwell));
Nico Huberd9365612018-06-10 14:59:04 +0200215 Has_IPS_CTL_Mailbox : <hswbool> := CPU_Broadwell;
Nico Huber83693c82016-10-08 22:17:55 +0200216
Nico Huberd9365612018-06-10 14:59:04 +0200217 Has_Per_Pipe_SRD : <hswbool> := Broadwell_On;
Nico Huber83693c82016-10-08 22:17:55 +0200218
Nico Huberd9365612018-06-10 14:59:04 +0200219 ----------- GTT: -------------
220 Has_64bit_GTT : <hswbool> := Broadwell_On;
Nico Huber83693c82016-10-08 22:17:55 +0200221
222 ----------------------------------------------------------------------------
223
Nico Huberd9365612018-06-10 14:59:04 +0200224 Max_Pipe : <ilkvar> Pipe_Index :=
Nico Huberd58de7d2018-06-07 23:06:55 +0200225 (if Has_Tertiary_Pipe then Tertiary else Secondary);
Nico Huber83693c82016-10-08 22:17:55 +0200226
Nico Huberd9365612018-06-10 14:59:04 +0200227 Last_Digital_Port : <hswsklvar> Digital_Port :=
Nico Huber208857d2017-07-29 21:30:24 +0200228 (if Has_DDI_E then DIGI_E else DIGI_C);
Nico Huberac455ad2017-02-14 14:41:19 +0100229
Nico Huber83693c82016-10-08 22:17:55 +0200230 ----------------------------------------------------------------------------
231
Nico Huber3c544ee2016-11-20 04:56:58 +0100232 type FDI_Per_Port is array (Port_Type) of Boolean;
Nico Huberd9365612018-06-10 14:59:04 +0200233 Is_FDI_Port : <hswvar> FDI_Per_Port :=
Nico Huber6621a142018-06-07 23:56:54 +0200234 (Disabled => False,
235 Internal => Gen_Ironlake and Internal_Is_LVDS,
236 DP1 .. HDMI3 => Gen_Ironlake,
237 Analog => Has_PCH_DAC);
Nico Huber83693c82016-10-08 22:17:55 +0200238
239 type FDI_Lanes_Per_Port is array (GPU_Port) of DP_Lane_Count;
240 FDI_Lane_Count : constant FDI_Lanes_Per_Port :=
241 (DIGI_D => DP_Lane_Count_2,
Nico Huber6621a142018-06-07 23:56:54 +0200242 others => (if Gen_Ironlake then DP_Lane_Count_4 else DP_Lane_Count_2));
Nico Huber83693c82016-10-08 22:17:55 +0200243
Nico Huberd9365612018-06-10 14:59:04 +0200244 FDI_Training : <ilkvar> FDI_Training_Type :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200245 (if CPU_Ironlake then Simple_Training
246 elsif CPU_Sandybridge then Full_Training
247 else Auto_Training);
Nico Huber83693c82016-10-08 22:17:55 +0200248
Nico Huberf54d0962016-10-20 14:17:18 +0200249 ----------------------------------------------------------------------------
250
Nico Huberd9365612018-06-10 14:59:04 +0200251 Default_DDI_HDMI_Buffer_Translation : <hswvar> DDI_HDMI_Buf_Trans_Range :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200252 (if CPU_Haswell then 6
253 elsif CPU_Broadwell then 7
254 elsif Broxton_On then 8
255 else 0);
Nico Huber247adf32017-06-12 14:39:11 +0200256
257 ----------------------------------------------------------------------------
258
Nico Huberd9365612018-06-10 14:59:04 +0200259 Default_CDClk_Freq : <ilkvar> Frequency_Type :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200260 (if Gen_G45 then 320_000_000 -- unused
261 elsif CPU_Ironlake or Gen_Haswell then 450_000_000
262 elsif CPU_Sandybridge or CPU_Ivybridge then 400_000_000
263 elsif Gen_Broxton then 288_000_000
264 elsif Gen_Skylake then 337_500_000
265 else Frequency_Type'First);
Nico Huberabe3de22016-10-20 15:03:46 +0200266
Nico Huberd9365612018-06-10 14:59:04 +0200267 Default_RawClk_Freq : <hswvar> Frequency_Type :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200268 (if Gen_G45 then 100_000_000 -- unused, depends on FSB
269 elsif Gen_Ironlake then 125_000_000
270 elsif Gen_Haswell then (if Is_ULT then 24_000_000 else 125_000_000)
271 elsif Gen_Broxton then Frequency_Type'First -- none needed
272 elsif Gen_Skylake then 24_000_000
273 else Frequency_Type'First);
Nico Huberf54d0962016-10-20 14:17:18 +0200274
Nico Huberdcd274b2016-11-03 20:15:39 +0100275 ----------------------------------------------------------------------------
276
277 -- Maximum source width with enabled scaler. This only accounts
278 -- for simple 1:1 pipe:scaler mappings.
279
Nico Huberc5c767a2018-06-03 01:09:04 +0200280 type Width_Per_Pipe is array (Pipe_Index) of Width_Type;
Nico Huberdcd274b2016-11-03 20:15:39 +0100281
Nico Huberd9365612018-06-10 14:59:04 +0200282 Maximum_Scalable_Width : <hswvar> Width_Per_Pipe :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200283 (if Gen_G45 then -- TODO: Is this true?
284 (Primary => 4096,
285 Secondary => 2048,
286 Tertiary => Pos32'First)
287 elsif Gen_Ironlake or CPU_Haswell then
288 (Primary => 4096,
289 Secondary => 2048,
290 Tertiary => 2048)
291 else
292 (Primary => 4096,
293 Secondary => 4096,
294 Tertiary => 4096));
Nico Huberdcd274b2016-11-03 20:15:39 +0100295
Nico Hubera02b2c62018-01-09 15:58:34 +0100296 -- Maximum X position of hardware cursors
Nico Huberd9365612018-06-10 14:59:04 +0200297 Maximum_Cursor_X : constant :=
298 (case Gen is
299 when G45 .. Ironlake => 4095,
300 when Haswell .. Skylake => 8191);
Nico Hubera02b2c62018-01-09 15:58:34 +0100301
302 Maximum_Cursor_Y : constant := 4095;
303
Nico Huber74ec9622016-11-19 03:00:43 +0100304 ----------------------------------------------------------------------------
305
Nico Huber21da5742017-01-20 14:00:53 +0100306 -- FIXME: Unknown for Broxton, Linux' i915 contains a fixme too :-D
Nico Huber74ec9622016-11-19 03:00:43 +0100307 HDMI_Max_Clock_24bpp : constant Frequency_Type :=
Nico Huber6621a142018-06-07 23:56:54 +0200308 (if Haswell_On then 300_000_000 else 225_000_000);
Nico Huber74ec9622016-11-19 03:00:43 +0100309
Nico Huberb8ae6182017-07-15 20:03:56 +0200310 ----------------------------------------------------------------------------
311
Nico Huberadfe11f2018-06-10 14:59:04 +0200312 GTT_PTE_Size : <hswvar> Natural := (if Has_64bit_GTT then 8 else 4);
Nico Huberb8ae6182017-07-15 20:03:56 +0200313
Nico Huberadfe11f2018-06-10 14:59:04 +0200314 Fence_Base : <ilkvar> Natural :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200315 (if not Sandybridge_On then 16#0000_3000# else 16#0010_0000#);
Nico Huberb03c8f12017-08-25 13:29:08 +0200316
Nico Huberadfe11f2018-06-10 14:59:04 +0200317 Fence_Count : <ilkvar> Natural :=
Nico Huber998ee2b2018-06-12 23:02:17 +0200318 (if not Ivybridge_On then 16 else 32);
Nico Huberb03c8f12017-08-25 13:29:08 +0200319
Nico Hubere7ac6eb2017-09-04 23:54:13 +0200320 ----------------------------------------------------------------------------
321
322 use type HW.Word16;
323
324 function Is_Broadwell_H (Device_Id : Word16) return Boolean is
325 (Device_Id = 16#1612# or Device_Id = 16#1622# or Device_Id = 16#162a#);
326
327 function Is_Skylake_U (Device_Id : Word16) return Boolean is
328 (Device_Id = 16#1906# or Device_Id = 16#1916# or Device_Id = 16#1923# or
329 Device_Id = 16#1926# or Device_Id = 16#1927#);
330
331 -- Rather catch too much here than too little,
332 -- it's only used to distinguish generations.
333 function Is_GPU (Device_Id : Word16; CPU : CPU_Type; CPU_Var : CPU_Variant)
334 return Boolean is
335 (case CPU is
Arthur Heymans73ea0322018-03-28 17:17:07 +0200336 when G45 => (Device_Id and 16#ff02#) = 16#2e02# or
337 (Device_Id and 16#fffe#) = 16#2a42#,
Nico Hubere7ac6eb2017-09-04 23:54:13 +0200338 when Ironlake => (Device_Id and 16#fff3#) = 16#0042#,
339 when Sandybridge => (Device_Id and 16#ffc2#) = 16#0102#,
340 when Ivybridge => (Device_Id and 16#ffc3#) = 16#0142#,
341 when Haswell =>
342 (case CPU_Var is
343 when Normal => (Device_Id and 16#ffc3#) = 16#0402# or
344 (Device_Id and 16#ffc3#) = 16#0d02#,
345 when ULT => (Device_Id and 16#ffc3#) = 16#0a02#),
346 when Broadwell => ((Device_Id and 16#ffc3#) = 16#1602# or
347 (Device_Id and 16#ffcf#) = 16#160b# or
348 (Device_Id and 16#ffcf#) = 16#160d#) and
349 (case CPU_Var is
350 when Normal => Is_Broadwell_H (Device_Id),
351 when ULT => not Is_Broadwell_H (Device_Id)),
352 when Broxton => (Device_Id and 16#fffe#) = 16#5a84#,
353 when Skylake => ((Device_Id and 16#ffc3#) = 16#1902# or
354 (Device_Id and 16#ffcf#) = 16#190b# or
355 (Device_Id and 16#ffcf#) = 16#190d# or
356 (Device_Id and 16#fff9#) = 16#1921#) and
357 (case CPU_Var is
358 when Normal => not Is_Skylake_U (Device_Id),
359 when ULT => Is_Skylake_U (Device_Id)));
360
361 function Compatible_GPU (Device_Id : Word16) return Boolean is
362 (Is_GPU (Device_Id, CPU, CPU_Var));
363
Nico Huber6a996dc2018-06-17 16:30:33 +0200364 pragma Warnings (GNATprove, Off, "subprogram ""Detect_CPU"" has no effect",
365 Reason => "only effective in dynamic cpu config");
366 procedure Detect_CPU (Device : Word16)<cpunull>;
367
Nico Huber83693c82016-10-08 22:17:55 +0200368end HW.GFX.GMA.Config;