Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/libsaio/gma.c

1/*
2 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3 * All Rights Reserved.
4 * Copyright © 2010 Intel Corporation
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27/*
28Original patch by Nawcom
29http://forum.voodooprojects.org/index.php/topic,1029.0.html
30
31Original Intel HDx000 code from valv
32Intel Ivy Bridge and Haswell code from ErmaC:
33- http://www.insanelymac.com/forum/topic/288241-intel-hd4000-inject-aaplig-platform-id/
34*/
35
36#include "libsa.h"
37#include "saio_internal.h"
38#include "bootstruct.h"
39#include "pci.h"
40#include "platform.h"
41#include "device_inject.h"
42#include "gma.h"
43#include "vbe.h"
44#include "graphics.h"
45
46#ifndef DEBUG_GMA
47#define DEBUG_GMA 0
48#endif
49
50#if DEBUG_GMA
51#define DBG(x...)printf(x)
52#else
53#define DBG(x...)
54#endif
55
56static booldoit= false;
57static uint8_t default_aapl_ivy[]={ 0x05,0x00,0x62,0x01 }; // ivy_bridge_ig_vals[5]
58#define AAPL_LEN_IVY ( sizeof(default_aapl_ivy) / sizeof(uint8_t) )
59static uint8_t default_aapl_haswell[]={ 0x00,0x00,0x26,0x0c }; // haswell_ig_vals[7]
60#define AAPL_LEN_HSW ( sizeof(default_aapl_haswell) / sizeof(uint8_t) )
61
62uint8_t GMAX3100_vals[23][4] = {
63{ 0x01,0x00,0x00,0x00 },//0 "AAPL,HasPanel"
64{ 0x01,0x00,0x00,0x00 },//1 "AAPL,SelfRefreshSupported"
65{ 0x01,0x00,0x00,0x00 },//2 "AAPL,aux-power-connected"
66{ 0x00,0x00,0x00,0x08 },//3 "AAPL,backlight-control"
67{ 0x64,0x00,0x00,0x00 },//4 "AAPL00,blackscreen-preferences"
68{ 0x00,0x00,0x00,0x08 },//5 "AAPL01,BacklightIntensity"
69{ 0x01,0x00,0x00,0x00 },//6 "AAPL01,blackscreen-preferences"
70{ 0x20,0x00,0x00,0x00 },//7 "AAPL01,DataJustify"
71{ 0x00,0x00,0x00,0x00 },//8 "AAPL01,Depth"
72{ 0x01,0x00,0x00,0x00 },//9 "AAPL01,Dither"
73{ 0x20,0x03,0x00,0x00 },//10 "AAPL01,DualLink"
74{ 0x00,0x00,0x00,0x00 },//11 "AAPL01,Height"
75{ 0x00,0x00,0x00,0x00 },//12 "AAPL01,Interlace"
76{ 0x00,0x00,0x00,0x00 },//13 "AAPL01,Inverter"
77{ 0x08,0x52,0x00,0x00 },//14 "AAPL01,InverterCurrent"
78{ 0x00,0x00,0x00,0x00 },//15 "AAPL01,InverterCurrency"
79{ 0x00,0x00,0x00,0x00 },//16 "AAPL01,LinkFormat"
80{ 0x01,0x00,0x00,0x00 },//17 "AAPL01,LinkType"
81{ 0x01,0x00,0x00,0x00 },//18 "AAPL01,Pipe"
82{ 0x3B,0x00,0x00,0x00 },//19 "AAPL01,PixelFormat"
83{ 0x00,0x00,0x00,0x00 },//20 "AAPL01,Refresh"
84{ 0x6B,0x10,0x00,0x00 },//21 "AAPL01,Stretch"
85{ 0xc8,0x95,0x00,0x00 },//22 "AAPL01,InverterFrequency"
86};
87
88uint8_t ivy_bridge_ig_vals[12][4] = {
89{ 0x00,0x00,0x66,0x01 },//0 "AAPL,ig-platform-id" //FB: 96MB, Pipes: 3, Ports: 4, FBMem: 3
90{ 0x01,0x00,0x66,0x01 },//1 "AAPL,ig-platform-id" //FB: 96MB, Pipes: 3, Ports: 4, FBMem: 3
91{ 0x02,0x00,0x66,0x01 },//2 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 1, FBMem: 1
92{ 0x03,0x00,0x66,0x01 },//3 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 2, Ports: 2, FBMem: 2
93{ 0x04,0x00,0x66,0x01 },//4 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 3, Ports: 1, FBMem: 1
94{ 0x05,0x00,0x62,0x01 },//5 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 2, Ports: 3, FBMem: 2
95{ 0x06,0x00,0x62,0x01 },//6 "AAPL,ig-platform-id" //FB: 0MB, Pipes: 0, Ports: 0, FBMem: 0
96{ 0x07,0x00,0x62,0x01 },//7 "AAPL,ig-platform-id" //FB: 0MB, Pipes: 0, Ports: 0, FBMem: 0
97{ 0x08,0x00,0x66,0x01 },//8 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3
98{ 0x09,0x00,0x66,0x01 },//9 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3
99{ 0x0a,0x00,0x66,0x01 },//10 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 2, Ports: 3, FBMem: 2
100{ 0x0b,0x00,0x66,0x01 }//11 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 2, Ports: 3, FBMem: 2
101};
102
103uint8_t haswell_ig_vals[17][4] = {
104{ 0x00,0x00,0x06,0x04 },// 0 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - mobile GT1
105{ 0x00,0x00,0x06,0x0c },// 1 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - SDV mobile GT1
106{ 0x00,0x00,0x16,0x04 },// 2 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - mobile GT2
107{ 0x00,0x00,0x16,0x0a },// 3 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT mobile GT2
108{ 0x00,0x00,0x16,0x0c },// 4 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - SDV mobile GT2
109{ 0x00,0x00,0x26,0x04 },// 5 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - mobile GT3
110{ 0x00,0x00,0x26,0x0a },// 6 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT mobile GT3
111{ 0x00,0x00,0x26,0x0c },// 7 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - SDV mobile GT3
112{ 0x00,0x00,0x26,0x0d },// 8 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - CRW mobile GT3
113{ 0x02,0x00,0x16,0x04 },// 9 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 1, Ports: 1, FBMem: 1 - mobile GT2
114{ 0x03,0x00,0x22,0x0d },// 10 "AAPL,ig-platform-id" //FB: 0MB, Pipes: 0, Ports: 0, FBMem: 0 - CRW Desktop GT3
115{ 0x05,0x00,0x26,0x0a },// 11 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT mobile GT3
116{ 0x06,0x00,0x26,0x0a },// 12 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT mobile GT3
117{ 0x07,0x00,0x26,0x0d },// 13 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 4, FBMem: 3 - CRW mobile GT3
118{ 0x08,0x00,0x26,0x0a },// 14 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT mobile GT3
119{ 0x08,0x00,0x2e,0x0a },// 15 "AAPL,ig-platform-id" //FB: 64MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT reserved GT3
120{ 0x04,0x00,0x12,0x04 }// 16 "AAPL,ig-platform-id" //FB: 32MB, Pipes: 3, Ports: 3, FBMem: 3 - ULT mobile GT3
121};
122
123uint8_t HD2000_vals[16][4] = {
124{ 0x00,0x00,0x00,0x00 }, //0 "AAPL00,PixelFormat"
125{ 0x00,0x00,0x00,0x00 }, //1 "AAPL00,T1"
126{ 0x14,0x00,0x00,0x00 }, //2 "AAPL00,T2"
127{ 0xfa,0x00,0x00,0x00 }, //3 "AAPL00,T3"
128{ 0x2c,0x01,0x00,0x00 }, //4 "AAPL00,T4"
129{ 0x00,0x00,0x00,0x00 }, //5 "AAPL00,T5"
130{ 0x14,0x00,0x00,0x00 }, //6 "AAPL00,T6"
131{ 0xf4,0x01,0x00,0x00 }, //7 "AAPL00,T7"
132{ 0x00,0x00,0x00,0x00 }, //8 "AAPL00,LinkType"
133{ 0x00,0x00,0x00,0x00 }, //9 "AAPL00,LinkFormat"
134{ 0x00,0x00,0x00,0x00 }, //10 "AAPL00,DualLink"
135{ 0x00,0x00,0x00,0x00 }, //11 "AAPL00,Dither"
136{ 0x00,0x00,0x00,0x00 }, //12 "AAPL00,DataJustify"
137{ 0x00,0x00,0x00,0x00 }, //13 "graphic-options"
138{ 0x00,0x00,0x00,0x00 }, //14
139{ 0x01,0x00,0x00,0x00 } //15
140};
141
142uint8_t HD3000_vals[17][4] = {
143{ 0x00,0x00,0x00,0x00 }, //0 "AAPL00,PixelFormat"
144{ 0x00,0x00,0x00,0x00 }, //1 "AAPL00,T1"
145{ 0x14,0x00,0x00,0x00 }, //2 "AAPL00,T2"
146{ 0xfa,0x00,0x00,0x00 }, //3 "AAPL00,T3"
147{ 0x2c,0x01,0x00,0x00 }, //4 "AAPL00,T4"
148{ 0x00,0x00,0x00,0x00 }, //5 "AAPL00,T5"
149{ 0x14,0x00,0x00,0x00 }, //6 "AAPL00,T6"
150{ 0xf4,0x01,0x00,0x00 }, //7 "AAPL00,T7"
151{ 0x00,0x00,0x00,0x00 }, //8 "AAPL00,LinkType"
152{ 0x00,0x00,0x00,0x00 }, //9 "AAPL00,LinkFormat"
153{ 0x00,0x00,0x00,0x00 }, //10 "AAPL00,DualLink"
154{ 0x00,0x00,0x00,0x00 }, //11 "AAPL00,Dither"
155{ 0x00,0x00,0x00,0x00 }, //12 "AAPL00,DataJustify"
156{ 0x00,0x00,0x00,0x00 }, //13 "graphic-options"
157{ 0x00,0x00,0x00,0x00 }, //14
158{ 0x01,0x00,0x00,0x00 }, //15
159{ 0x00,0x00,0x01,0x00 } //16 AAPL,snb-platform-id
160};
161
162uint8_t HD4000_vals[15][4] = {
163{ 0x00,0x00,0x00,0x00 }, //0 "AAPL00,PixelFormat"
164{ 0x00,0x00,0x00,0x00 }, //1 "AAPL00,T1"
165{ 0x01,0x00,0x00,0x00 }, //2 "AAPL00,T2"
166{ 0xc8,0x00,0x00,0x00 }, //3 "AAPL00,T3"
167{ 0xc8,0x00,0x00,0x00 }, //4 "AAPL00,T4"
168{ 0x01,0x00,0x00,0x00 }, //5 "AAPL00,T5"
169{ 0x00,0x00,0x00,0x00 }, //6 "AAPL00,T6"
170{ 0x90,0x01,0x00,0x00 }, //7 "AAPL00,T7"
171{ 0x01,0x00,0x00,0x00 }, //8 "AAPL00,LinkType"
172{ 0x00,0x00,0x00,0x00 }, //9 "AAPL00,LinkFormat"
173{ 0x01,0x00,0x00,0x00 }, //10 "AAPL00,DualLink"
174{ 0x00,0x00,0x00,0x00 }, //11 "AAPL00,Dither"
175{ 0xc3,0x8c,0x64,0x00 }, //12 "AAPL,gray-value"
176{ 0x01,0x00,0x00,0x00 }, //13 "AAPL,gray-page"
177{ 0x0c,0x00,0x00,0x00 } //14 "graphics-options"
178};
179
180// http://www.insanelymac.com/forum/topic/286092-guide-1st-generation-intel-hd-graphics-qeci/
181uint8_t HDx000_os_info[20] = {
1820x30,0x49,0x01,0x11,0x01,0x10,0x08,0x00,0x00,0x01,
1830x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF
184};
185
186uint8_t HD2000_tbl_info[18] = {
1870x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
1880x00,0x01,0x02,0x02,0x02,0x00,0x01,0x02,0x02
189};
190uint8_t HD2000_os_info[20] = {
1910x30,0x49,0x01,0x11,0x11,0x11,0x08,0x00,0x00,0x01,
1920xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00
193};
194
195// The following values came from a Sandy Bridge MacBook Air
196uint8_t HD3000_tbl_info[18] = {
1970x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
1980x00,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01
199};
200
201// The following values came from a Sandy Bridge MacBook Air
202uint8_t HD3000_os_info[20] = {
2030x30,0x49,0x01,0x12,0x12,0x12,0x08,0x00,0x00,0x01,
2040xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00
205};
206
207
208uint8_t reg_TRUE[]= { 0x01, 0x00, 0x00, 0x00 };
209uint8_t reg_FALSE[] = { 0x00, 0x00, 0x00, 0x00 };
210
211// https://en.wikipedia.org/wiki/Comparison_of_Intel_graphics_processing_units#Seventh_generation
212
213/* http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/src/intel_module.c */
214
215static intel_gfx_info_t intel_gfx_chipsets[] = {
216{GMA_I810,"i810"},
217{GMA_I810_DC100,"i810-dc100"},
218{GMA_I810_E,"i810e"},
219{GMA_I815,"i815"},
220{GMA_I830_M,"i830M"},
221{GMA_845_G,"845G"},
222{GMA_I854,"854"},
223{GMA_I855_GM,"852GM/855GM"},
224{GMA_I865_G,"865G"},
225{GMA_I915_G,"915G"},
226{GMA_E7221_G,"E7221 (i915)"},
227{GMA_I915_GM,"915GM"},
228{GMA_I945_G,"945G"},
229// 2776 /* Desktop GMA950 */
230// 2782 /* GMA 915 */
231// 2792 /* Mobile GMA915 */
232{GMA_I945_GM,"945GM"},
233{GMA_I945_GME,"945GME"},
234// 27A6 /* Mobile GMA950 */
235// 29C3 /* Desktop GMA3100 */
236{GMA_PINEVIEW_M,"Pineview GM"},
237{GMA_GMA3150_M,"Pineview GM"},// A012 /* Mobile GMA3150 */
238{GMA_PINEVIEW_G,"Pineview G"},
239{GMA_GMA3150_D,"Desktop GMA3150"},// A002 /* Desktop GMA3150 */
240{GMA_I965_G,"965G"},
241{GMA_G35_G,"G35"},
242{GMA_I965_Q,"965Q"},
243{GMA_I946_GZ,"946GZ"},
244{GMA_I965_GM,"965GM"},
245{GMA_I965_GME,"965GME/GLE"},
246{GMA_G33_G,"G33"},
247// 2A13 /* GMAX3100 */
248// 2A43 /* GMAX3100 */
249{GMA_Q35_G,"Q35"},
250{GMA_Q33_G,"Q33"},
251{GMA_GM45_GM,"GM45"},
252{GMA_G45_E_G,"4 Series"},
253{GMA_G45_G,"G45/G43"},
254{GMA_Q45_G,"Q45/Q43"},
255{GMA_G41_G,"G41"},
256{GMA_B43_G,"B43"},
257{GMA_B43_G1,"B43"},
258/**/
259{GMA_IRONLAKE_D_G,HD_GRAPHICS},
260{GMA_IRONLAKE_M_G,HD_GRAPHICS},
261// 004A /* HD2000 */
262
263/* Sandy */
264{GMA_SANDYBRIDGE_GT1,HD_GRAPHICS_2000 },
265{GMA_SANDYBRIDGE_GT2,HD_GRAPHICS_3000 },
266{GMA_SANDYBRIDGE_GT2_PLUS,HD_GRAPHICS_3000 },
267{GMA_SANDYBRIDGE_M_GT1,HD_GRAPHICS_2000 },
268{GMA_SANDYBRIDGE_M_GT2,HD_GRAPHICS_3000 },
269{GMA_SANDYBRIDGE_M_GT2_PLUS,HD_GRAPHICS_3000 },
270{GMA_SANDYBRIDGE_S_GT,HD_GRAPHICS },
271// 010B /* ??? */
272// 010E /* ??? */
273
274/* Ivy */
275{GMA_IVYBRIDGE_M_GT1,HD_GRAPHICS_2500 },/* 0156 */
276{GMA_IVYBRIDGE_M_GT2,HD_GRAPHICS_4000 },/* 0166 */
277{GMA_IVYBRIDGE_D_GT1,HD_GRAPHICS_2500 },/* 0152 */
278{GMA_IVYBRIDGE_D_GT2,HD_GRAPHICS_4000 },/* 0162 */
279{GMA_IVYBRIDGE_S_GT1,HD_GRAPHICS },/* 015a */
280{GMA_IVYBRIDGE_S_GT2,"HD Graphics P4000" }, /* 016a */
281{GMA_IVYBRIDGE_S_GT3, HD_GRAPHICS },/* 015e */
282{GMA_IVYBRIDGE_S_GT4,HD_GRAPHICS_2500 },/* 0172 */
283 {GMA_IVYBRIDGE_S_GT5,HD_GRAPHICS_2500 },/* 0176 */
284
285/* Haswell */
286// 0090 /* ??? */
287// 0091 /* ??? */
288// 0092 /* ??? */
289{GMA_HASWELL_D_GT1,HD_GRAPHICS },/* 0422 */
290{GMA_HASWELL_D_GT2,HD_GRAPHICS_4600 },/* 0412 */
291{GMA_HASWELL_D_GT3,HD_GRAPHICS_5000 },/* 0422 */
292{GMA_HASWELL_M_GT1,HD_GRAPHICS },/* 0426 */
293{GMA_HASWELL_M_GT2,HD_GRAPHICS_4600 },/* 0416 */
294{GMA_HASWELL_M_GT3,HD_GRAPHICS_5000 },/* 0426 */
295{GMA_HASWELL_S_GT1,HD_GRAPHICS },/* 040a */
296{GMA_HASWELL_S_GT2,"HD Graphics P4600/P4700" }, /* 041a */
297{GMA_HASWELL_S_GT3,HD_GRAPHICS_5000 },/* 042a */
298{GMA_HASWELL_B_GT1,HD_GRAPHICS },/* 040b */
299{GMA_HASWELL_B_GT2,HD_GRAPHICS },/* 041b */
300{GMA_HASWELL_B_GT3,HD_GRAPHICS },/* 042b */
301{GMA_HASWELL_E_GT1,HD_GRAPHICS },/* 040e */
302{GMA_HASWELL_E_GT2,HD_GRAPHICS_4400 },/* 041e */
303{GMA_HASWELL_E_GT3,HD_GRAPHICS },/* 042e */
304{GMA_HASWELL_ULT_D_GT1,HD_GRAPHICS },/* 0a02 */
305{GMA_HASWELL_ULT_D_GT2,HD_GRAPHICS },/* 0a12 */
306{GMA_HASWELL_ULT_D_GT3,IRIS_5100 },/* 0a22 */
307{GMA_HASWELL_ULT_M_GT1,HD_GRAPHICS },/* 0a06 */
308{GMA_HASWELL_ULT_M_GT2,HD_GRAPHICS_4400 },/* 0a16 */
309{GMA_HASWELL_ULT_M_GT3,HD_GRAPHICS_5000 },/* 0a26 */
310{GMA_HASWELL_ULT_S_GT1,HD_GRAPHICS },/* 0a0a */
311{GMA_HASWELL_ULT_S_GT2,HD_GRAPHICS },/* 0a1a */
312{GMA_HASWELL_ULT_S_GT3,IRIS_5100 },/* 0a2a */
313{GMA_HASWELL_ULT_B_GT1,HD_GRAPHICS },/* 0a0b */
314{GMA_HASWELL_ULT_B_GT2,HD_GRAPHICS },/* 0a1b */
315{GMA_HASWELL_ULT_B_GT3,IRIS_5100 },/* 0a2b */
316{GMA_HASWELL_ULT_E_GT1,HD_GRAPHICS_4400 },/* 0a0e */
317{GMA_HASWELL_ULT_E_GT2,HD_GRAPHICS_4200 },/* 0a1e */
318// 0A2A /* ??? */
319{GMA_HASWELL_ULT_E_GT3,IRIS_5100 },/* 0a2e */
320{GMA_HASWELL_SDV_D_GT1_IG,HD_GRAPHICS },// 0C02 /* Intel Haswell HD Graphics - GTL */
321// 0C04 /* DRAM Controller */
322{GMA_HASWELL_SDV_M_GT1_IG,HD_GRAPHICS },// 0C06 /* Intel Haswell HD Graphics - GTL */
323{GMA_HASWELL_SDV_D_GT2_IG,HD_GRAPHICS },// 0C12 /* Intel Haswell HD Graphics - GTM */
324{GMA_HASWELL_SDV_M_GT2_IG,HD_GRAPHICS },// 0C16 /* Intel Haswell HD Graphics - GTH */
325{GMA_HASWELL_SDV_D_GT2_PLUS_IG,HD_GRAPHICS },// 0C22 /* Intel Haswell HD Graphics - GTH */
326{GMA_HASWELL_SDV_M_GT2_PLUS_IG,HD_GRAPHICS },// 0C26 /* Intel Haswell HD Graphics - GTH */
327
328//{GMA_HASWELL_SDV_S_GT1_IG,HD_GRAPHICS }, /* 0c0a */
329//{GMA_HASWELL_SDV_S_GT2_IG,HD_GRAPHICS }, /* 0c1a */
330//{GMA_HASWELL_SDV_S_GT2_PLUS_IG,HD_GRAPHICS }, /* 0c2a */
331
332{GMA_HASWELL_CRW_D_GT1,HD_GRAPHICS },/* 0d02 */
333{GMA_HASWELL_CRW_D_GT2,HD_GRAPHICS_4600 },/* 0d12 */
334{GMA_HASWELL_CRW_D_GT3,IRIS_5200 },/* 0d22 */
335//{GMA_HASWELL_CRW_D_GT2_PLUS_IG,HD_GRAPHICS },/* 0d32 */
336{GMA_HASWELL_CRW_M_GT1,HD_GRAPHICS },/* 0d06 */
337{GMA_HASWELL_CRW_M_GT2,HD_GRAPHICS_4600 },/* 0d16 */
338{GMA_HASWELL_CRW_M_GT3,IRIS_5200 },/* 0d26 */
339{GMA_HASWELL_CRW_S_GT1,HD_GRAPHICS },/* 0d0a */
340{GMA_HASWELL_CRW_S_GT2,HD_GRAPHICS },/* 0d1a */
341{GMA_HASWELL_CRW_S_GT3,IRIS_5200 },/* 0d2a */
342{GMA_HASWELL_CRW_B_GT1,HD_GRAPHICS },/* 0d0b */
343{GMA_HASWELL_CRW_B_GT2,HD_GRAPHICS },/* 0d1b */
344{GMA_HASWELL_CRW_B_GT3,IRIS_5200 },/* 0d2b */
345{GMA_HASWELL_CRW_E_GT1,HD_GRAPHICS },/* 0d0e */
346{GMA_HASWELL_CRW_E_GT2,HD_GRAPHICS },/* od1e */
347{GMA_HASWELL_CRW_E_GT3,IRIS_5200 },/* 0d2e */
348{GMA_HASWELL_CRW_M_GT2_PLUS_IG,HD_GRAPHICS },/* 0d36 */
349{GMA_HASWELL_CRW_S_GT2_PLUS_IG,HD_GRAPHICS },/* 0d3a */
350
351/* Brodwell */
352{GMA_BRODWELL_BDW_1602,HD_GRAPHICS },/* 1602 */
353{GMA_BRODWELL_BDW_U_GT1,HD_GRAPHICS },/* 1606 */
354{GMA_BRODWELL_BDW_160B,HD_GRAPHICS },/* 160b */
355{GMA_BRODWELL_BDW_160A,HD_GRAPHICS },/* 160a */
356{GMA_BRODWELL_BDW_160D,HD_GRAPHICS },/* 160d */
357{GMA_BRODWELL_BDW_160E,HD_GRAPHICS },/* 160e */
358{GMA_BRODWELL_BDW_1612,HD_GRAPHICS_5600},/* 1612 */
359 {GMA_BRODWELL_BDW_U_GT2,HD_GRAPHICS_5500 },/* 1616 */
360{GMA_BRODWELL_BDW_161B,HD_GRAPHICS },/* 161b */
361{GMA_BRODWELL_BDW_161A,HD_GRAPHICS },/* 161a */
362{GMA_BRODWELL_BDW_161D,HD_GRAPHICS },/* 161d */
363{GMA_BRODWELL_BDW_Y_GT2,HD_GRAPHICS_5300 },/* 161e */
364{GMA_BRODWELL_BDW_1622,IRIS_6200},/* 1622 */
365{GMA_BRODWELL_BDW_U_GT3,HD_GRAPHICS_6000 },/* 1626 */
366{GMA_BRODWELL_BDW_162A,IRIS_6300},/* 162a */
367{GMA_BRODWELL_BDW_U_GT3_2,IRIS_6100 },/* 162b */
368{GMA_BRODWELL_BDW_162D,HD_GRAPHICS },/* 162d */
369{GMA_BRODWELL_BDW_162E,HD_GRAPHICS },/* 162e */
370{GMA_BRODWELL_BDW_1632,HD_GRAPHICS },/* 1632 */
371{GMA_BRODWELL_BDW_1636,HD_GRAPHICS },/* 1636 */
372{GMA_BRODWELL_BDW_163B,HD_GRAPHICS },/* 163b */
373{GMA_BRODWELL_BDW_163A,HD_GRAPHICS },/* 163a */
374{GMA_BRODWELL_BDW_163D,HD_GRAPHICS },/* 163d */
375{GMA_BRODWELL_BDW_163E,HD_GRAPHICS }/* 163e */
376};
377
378#define GFX_DEVICES_LEN (sizeof(intel_gfx_chipsets) / sizeof(intel_gfx_chipsets[0]))
379
380/* END http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/src/intel_module.c */
381
382/* Get Intel GFX device name */
383static char *get_gma_controller_name(uint16_t device_id, uint16_t vendor_id)
384{
385int i = 0;
386static char desc[128];
387
388for (i = 0; i < GFX_DEVICES_LEN; i++)
389{
390if (intel_gfx_chipsets[i].model == ((device_id << 16) | vendor_id))
391{
392snprintf(desc, sizeof(desc), "%s %s", INTEL_NAME, intel_gfx_chipsets[i].label_info);
393return desc;
394}
395}
396snprintf(desc, sizeof(desc), "Unknown %s Graphics card", INTEL_NAME);
397return desc;
398}
399
400bool setup_gma_devprop(pci_dt_t *gma_dev)
401{
402char*devicepath = NULL;
403volatile uint8_t*regs;
404uint32_tbar[7];
405char*model = NULL;
406uint8_t BuiltIn =0x00;
407uint16_tvendor_id = gma_dev->vendor_id;
408uint16_tdevice_id = gma_dev->device_id;
409uint8_t ClassFix[4] = { 0x00, 0x00, 0x03, 0x00 };
410intn_igs = 0;
411intlen;
412const char*value;
413devicepath = get_pci_dev_path(gma_dev);
414
415bar[0] = pci_config_read32(gma_dev->dev.addr, 0x10);
416regs = (uint8_t *) (bar[0] & ~0x0f);
417
418model = get_gma_controller_name(device_id, vendor_id);
419
420verbose("---------------------------------------------\n");
421 verbose("------------ INTEL DEVICE INFO --------------\n");
422verbose("---------------------------------------------\n");
423verbose("Class code: [%04x]\n%s [%04x:%04x] (rev %02x)\nSubsystem: [%04x:%04x] :: %s\n",
424gma_dev->class_id, model, gma_dev->vendor_id, gma_dev->device_id, gma_dev->revision_id, gma_dev->subsys_id.subsys.vendor_id, gma_dev->subsys_id.subsys.device_id, devicepath);
425
426if (!string)
427{
428string = devprop_create_string();
429}
430
431struct DevPropDevice *device = devprop_add_device(string, devicepath);
432if (!device)
433{
434printf("[setup_gma_devprop] Failed initializing dev-prop string dev-entry!\n");
435pause();
436return false;
437}
438
439devprop_add_value(device, "model", (uint8_t *)model, (strlen(model) + 1));
440devprop_add_value(device, "device_type", (uint8_t *)"display", 8);
441
442if (getBoolForKey(kUseIntelHDMI, &doit, &bootInfo->chameleonConfig) && doit)
443{
444devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
445}
446else
447{
448devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-2", 10);
449}
450
451switch ((device_id << 16) | vendor_id)
452{
453case GMA_IRONLAKE_D_G: // 0042
454case GMA_IRONLAKE_M_G: // 0046
455devprop_add_value(device, "built-in",&BuiltIn, 1);
456devprop_add_value(device, "class-code",ClassFix, 4);
457devprop_add_value(device, "AAPL,os-info",HDx000_os_info, 20);
458break;
459/* 27A2, 27AE, 27A6, A001, A011, A012, */
460case GMA_I945_GM: // Mobile GMA950 Mobile GMA3150
461case GMA_I945_GME:
462//case GMA_945GM:
463case GMA_PINEVIEW_G:
464case GMA_PINEVIEW_M:
465case GMA_GMA3150_M:
466devprop_add_value(device, "AAPL,HasPanel",reg_TRUE, 4);
467devprop_add_value(device, "built-in",&BuiltIn, 1);
468devprop_add_value(device, "class-code",ClassFix, 4);
469break;
470
471/* 2772 ,2776, A002 */
472case GMA_I945_G: // Desktop GMA950 Desktop GMA3150
473//case GMA_82945G:
474case GMA_GMA3150_D:
475BuiltIn = 0x01;
476devprop_add_value(device, "built-in",&BuiltIn, 1);
477devprop_add_value(device, "class-code",ClassFix, 4);
478break;
479
480/* 2A02, 2A12, 2A13, 2A42, 2A43 */
481case GMA_I965_GM: // GMAX3100
482case GMA_I965_GME:
483//case 0x80862A13:
484case GMA_GM45_GM:
485//case GMA_GM45_GM2:
486devprop_add_value(device, "AAPL,HasPanel",GMAX3100_vals[0], 4);
487devprop_add_value(device, "AAPL,SelfRefreshSupported",GMAX3100_vals[1], 4);
488devprop_add_value(device, "AAPL,aux-power-connected",GMAX3100_vals[2], 4);
489devprop_add_value(device, "AAPL,backlight-control",GMAX3100_vals[3], 4);
490devprop_add_value(device, "AAPL00,blackscreen-preferences",GMAX3100_vals[4], 4);
491devprop_add_value(device, "AAPL01,BacklightIntensity",GMAX3100_vals[5], 4);
492devprop_add_value(device, "AAPL01,blackscreen-preferences",GMAX3100_vals[6], 4);
493devprop_add_value(device, "AAPL01,DataJustify",GMAX3100_vals[7], 4);
494devprop_add_value(device, "AAPL01,Depth",GMAX3100_vals[8], 4);
495devprop_add_value(device, "AAPL01,Dither",GMAX3100_vals[9], 4);
496devprop_add_value(device, "AAPL01,DualLink",GMAX3100_vals[10], 4);
497devprop_add_value(device, "AAPL01,Height",GMAX3100_vals[11], 4);
498devprop_add_value(device, "AAPL01,Interlace",GMAX3100_vals[12], 4);
499devprop_add_value(device, "AAPL01,Inverter",GMAX3100_vals[13], 4);
500devprop_add_value(device, "AAPL01,InverterCurrent",GMAX3100_vals[14], 4);
501devprop_add_value(device, "AAPL01,InverterCurrency",GMAX3100_vals[15], 4);
502devprop_add_value(device, "AAPL01,LinkFormat",GMAX3100_vals[16], 4);
503devprop_add_value(device, "AAPL01,LinkType",GMAX3100_vals[17], 4);
504devprop_add_value(device, "AAPL01,Pipe",GMAX3100_vals[18], 4);
505devprop_add_value(device, "AAPL01,PixelFormat",GMAX3100_vals[19], 4);
506devprop_add_value(device, "AAPL01,Refresh",GMAX3100_vals[20], 4);
507devprop_add_value(device, "AAPL01,Stretch",GMAX3100_vals[21], 4);
508//devprop_add_value(device, "AAPL01,InverterFrequency",GMAX3100_vals[22], 4);
509devprop_add_value(device, "class-code",ClassFix, 4);
510break;
511
512/* 0106 */
513case GMA_SANDYBRIDGE_M_GT1: // HD Graphics 2000 Mobile
514devprop_add_value(device, "class-code", ClassFix, 4);
515devprop_add_value(device, "AAPL00,PixelFormat",HD2000_vals[0], 4);
516devprop_add_value(device, "AAPL00,T1",HD2000_vals[1], 4);
517devprop_add_value(device, "AAPL00,T2",HD2000_vals[2], 4);
518devprop_add_value(device, "AAPL00,T3",HD2000_vals[3], 4);
519devprop_add_value(device, "AAPL00,T4",HD2000_vals[4], 4);
520devprop_add_value(device, "AAPL00,T5",HD2000_vals[5], 4);
521devprop_add_value(device, "AAPL00,T6",HD2000_vals[6], 4);
522devprop_add_value(device, "AAPL00,T7",HD2000_vals[7], 4);
523devprop_add_value(device, "AAPL00,LinkType",HD2000_vals[8], 4);
524devprop_add_value(device, "AAPL00,LinkFormat",HD2000_vals[9], 4);
525devprop_add_value(device, "AAPL00,DualLink",HD2000_vals[10], 4);
526devprop_add_value(device, "AAPL00,Dither",HD2000_vals[11], 4);
527devprop_add_value(device, "AAPL00,DataJustify",HD3000_vals[12], 4);
528devprop_add_value(device, "graphic-options",HD2000_vals[13], 4);
529devprop_add_value(device, "AAPL,tbl-info",HD2000_tbl_info, 18);
530devprop_add_value(device, "AAPL,os-info",HD2000_os_info, 20);
531break;
532
533/* 0116, 0126 */
534case GMA_SANDYBRIDGE_M_GT2: // HD Graphics 3000 Mobile
535case GMA_SANDYBRIDGE_M_GT2_PLUS:
536devprop_add_value(device, "class-code",ClassFix, 4);
537devprop_add_value(device, "AAPL00,PixelFormat",HD3000_vals[0], 4);
538devprop_add_value(device, "AAPL00,T1",HD3000_vals[1], 4);
539devprop_add_value(device, "AAPL00,T2",HD3000_vals[2], 4);
540devprop_add_value(device, "AAPL00,T3",HD3000_vals[3], 4);
541devprop_add_value(device, "AAPL00,T4",HD3000_vals[4], 4);
542devprop_add_value(device, "AAPL00,T5",HD3000_vals[5], 4);
543devprop_add_value(device, "AAPL00,T6",HD3000_vals[6], 4);
544devprop_add_value(device, "AAPL00,T7",HD3000_vals[7], 4);
545devprop_add_value(device, "AAPL00,LinkType",HD3000_vals[8], 4);
546devprop_add_value(device, "AAPL00,LinkFormat",HD3000_vals[9], 4);
547devprop_add_value(device, "AAPL00,DualLink",HD3000_vals[10], 4);
548devprop_add_value(device, "AAPL00,Dither",HD3000_vals[11], 4);
549devprop_add_value(device, "AAPL00,DataJustify",HD3000_vals[12], 4);
550devprop_add_value(device, "graphic-options",HD3000_vals[13], 4);
551devprop_add_value(device, "AAPL,tbl-info",HD3000_tbl_info, 18);
552devprop_add_value(device, "AAPL,os-info",HD3000_os_info, 20);
553devprop_add_value(device, "AAPL,snb-platform-id",HD3000_vals[16], 4);// previusly commented
554break;
555
556/* 0102 */
557/* HD Graphics 2000 */
558case GMA_SANDYBRIDGE_GT1: // 0102
559device_id = 0x00000102;// Inject a valid mobile GPU device id instead of patching kexts
560devprop_add_value(device, "built-in",&BuiltIn, 1);
561devprop_add_value(device, "class-code",ClassFix, 4);
562devprop_add_value(device, "device-id",(uint8_t *)&device_id, sizeof(device_id));
563devprop_add_value(device, "AAPL,tbl-info",HD2000_tbl_info, 18);
564devprop_add_value(device, "AAPL,os-info",HD2000_os_info, 20);
565break;
566
567/* Sandy Bridge */
568/* HD Graphics 3000 */
569case GMA_SANDYBRIDGE_GT2: // 0112
570case GMA_SANDYBRIDGE_GT2_PLUS: // 0122
571devprop_add_value(device, "built-in",&BuiltIn, 1);
572devprop_add_value(device, "class-code",ClassFix, 4);
573device_id = 0x00000126;// Inject a valid mobile GPU device id instead of patching kexts
574devprop_add_value(device, "device-id",(uint8_t *)&device_id, sizeof(device_id));
575devprop_add_value(device, "AAPL,tbl-info",HD3000_tbl_info, 18);
576devprop_add_value(device, "AAPL,os-info",HD3000_os_info, 20);
577break;
578
579/* Ivy Bridge */
580/* HD Graphics 4000, HD Graphics 4000 Mobile, HD Graphics P4000, HD Graphics 2500 HD, Graphics 2500 Mobile */
581case GMA_IVYBRIDGE_D_GT1: // 0152
582case GMA_IVYBRIDGE_M_GT1: // 0156
583case GMA_IVYBRIDGE_S_GT1: // 015A
584case GMA_IVYBRIDGE_S_GT3: // 015e
585case GMA_IVYBRIDGE_D_GT2: // 0162
586case GMA_IVYBRIDGE_M_GT2: // 0166
587case GMA_IVYBRIDGE_S_GT2: // 016A
588case GMA_IVYBRIDGE_S_GT4: // 0172
589case GMA_IVYBRIDGE_S_GT5: // 0176
590
591if (getValueForKey(kAAPLCustomIG, &value, &len, &bootInfo->chameleonConfig) && len == AAPL_LEN_IVY * 2)
592{
593uint8_t new_aapl0[AAPL_LEN_IVY];
594
595if (hex2bin(value, new_aapl0, AAPL_LEN_IVY) == 0)
596{
597memcpy(default_aapl_ivy, new_aapl0, AAPL_LEN_IVY);
598
599verbose("Using user supplied AAPL,ig-platform-id\n");
600verbose("AAPL,ig-platform-id: %02x%02x%02x%02x\n",
601default_aapl_ivy[0], default_aapl_ivy[1], default_aapl_ivy[2], default_aapl_ivy[3]);
602}
603devprop_add_value(device, "AAPL,ig-platform-id", default_aapl_ivy, AAPL_LEN_IVY);
604}
605else if (getIntForKey(kIntelCapriFB, &n_igs, &bootInfo->chameleonConfig))
606{
607if ((n_igs >= 0) || (n_igs <= 11))
608{
609verbose("AAPL,ig-platform-id was set in org.chameleon.Boot.plist with value %d\n", n_igs);
610devprop_add_value(device, "AAPL,ig-platform-id", ivy_bridge_ig_vals[n_igs], 4);
611}
612else
613{
614verbose("AAPL,ig-platform-id was set in org.chameleon.Boot.plist with bad value please choose a number between 0 and 11.\n");
615}
616}
617else
618{
619uint32_t ig_platform_id;
620uint32_t ram = (((getVBEVideoRam() + 512) / 1024) + 512) / 1024;
621switch (ram)
622{
623case 96:
624ig_platform_id = 0x01660000; // 96mb Mobile
625break;
626
627case 64:
628ig_platform_id = 0x01660009; // 64mb Mobile
629break;
630
631case 32:
632ig_platform_id = 0x01620005; // 32mb Desktop
633break;
634
635default:
636printf("Please specify 96, 64, or 32MB RAM for the HD4000 in the bios.\n"
637"The selected %dMB RAM configuration is not supported for the HD4000.\n", ram);
638pause();
639return false;// Exit early before the AAPL,ig-platform-id property is set.
640break;
641}
642devprop_add_value(device, "AAPL,ig-platform-id", (uint8_t *)&ig_platform_id, 4);
643}
644
645devprop_add_value(device, "AAPL00,DualLink", HD4000_vals[10], 4);
646devprop_add_value(device, "built-in", &BuiltIn, 1);
647devprop_add_value(device, "class-code", ClassFix, 4);
648
649break;
650
651/* Haswell */
652/* HD Graphics 5000, HD Graphics 5000 Mobile, HD Graphics P5000, HD Graphics 4600, HD Graphics 4600 Mobile */
653//case 0x80860090:
654//case 0x80860091:
655//case 0x80860092:
656case GMA_HASWELL_M_GT2: // 0416
657case GMA_HASWELL_E_GT2: // 041e
658case GMA_HASWELL_ULT_M_GT2: // 0a16
659case GMA_HASWELL_ULT_E_GT2: // 0a1e
660verbose("Injecting a valid desktop GPU device id (0x0412) instead of patching kexts.\n");
661device_id = 0x00000412;// Inject a valid desktop GPU device id (0x0412) instead of patching kexts
662devprop_add_value(device, "vendor-id",(uint8_t *)INTEL_VENDORID, 4);
663devprop_add_value(device, "device-id",(uint8_t *)&device_id, sizeof(device_id));
664devprop_add_value(device, "compatible",(uint8_t *)"pci8086,0412", 13); // GT2 Desktop
665devprop_add_value(device, "name",(uint8_t *)"pci8086,0412", 13); // GT2 Desktop
666verbose("Injeting done: was [%04x:%04x] now is [%04x:%04x]\n", gma_dev->vendor_id, gma_dev->device_id, gma_dev->vendor_id, device_id);
667
668case GMA_HASWELL_D_GT1: // 0402
669case GMA_HASWELL_M_GT1: // 0406
670case GMA_HASWELL_S_GT1: // 040a
671case GMA_HASWELL_D_GT2: // 0412
672case GMA_HASWELL_S_GT2: // 041a
673case GMA_HASWELL_E_GT1: // 040e
674case GMA_HASWELL_E_GT3: // 042e
675case GMA_HASWELL_D_GT3: // 0422
676case GMA_HASWELL_M_GT3: // 0426
677case GMA_HASWELL_S_GT3: // 042a
678case GMA_HASWELL_ULT_M_GT1: // 0a06
679case GMA_HASWELL_ULT_E_GT1: // 0a0e
680case GMA_HASWELL_ULT_D_GT3: // 0a22
681case GMA_HASWELL_ULT_M_GT3: // 0a26
682case GMA_HASWELL_ULT_S_GT3: // 0a2a
683case GMA_HASWELL_ULT_E_GT3: // 0a2e
684case GMA_HASWELL_SDV_D_GT1_IG: // 0c02
685case GMA_HASWELL_SDV_M_GT1_IG: // 0c06
686case GMA_HASWELL_SDV_D_GT2_IG: // 0c12
687case GMA_HASWELL_SDV_M_GT2_IG: // 0c16
688case GMA_HASWELL_SDV_D_GT2_PLUS_IG: // 0c22
689case GMA_HASWELL_SDV_M_GT2_PLUS_IG: // 0c26
690case GMA_HASWELL_CRW_D_GT1: // 0d02
691case GMA_HASWELL_CRW_D_GT2: // 0d12
692case GMA_HASWELL_CRW_D_GT3: // 0d22
693case GMA_HASWELL_CRW_M_GT1: // 0d06
694case GMA_HASWELL_CRW_M_GT2: // 0d16
695case GMA_HASWELL_CRW_M_GT3: // 0d26
696case GMA_HASWELL_CRW_S_GT1: // 0d0a
697case GMA_HASWELL_CRW_S_GT2: // 0d1a
698case GMA_HASWELL_CRW_S_GT3: // 0d2a
699case GMA_HASWELL_CRW_B_GT1: // 0d0b
700case GMA_HASWELL_CRW_B_GT2: // 0d1b
701case GMA_HASWELL_CRW_B_GT3: // 0d2b
702case GMA_HASWELL_CRW_E_GT1: // 0d0e
703case GMA_HASWELL_CRW_E_GT2: // 0d1e
704case GMA_HASWELL_CRW_E_GT3: // 0d2e
705case GMA_HASWELL_CRW_M_GT2_PLUS_IG: // 0d36
706case GMA_HASWELL_CRW_S_GT2_PLUS_IG: // 0d3a
707
708if (getValueForKey(kAAPLCustomIG, &value, &len, &bootInfo->chameleonConfig) && len == AAPL_LEN_HSW * 2)
709{
710uint8_t new_aapl0[AAPL_LEN_HSW];
711
712if (hex2bin(value, new_aapl0, AAPL_LEN_HSW) == 0)
713{
714memcpy(default_aapl_haswell, new_aapl0, AAPL_LEN_HSW);
715
716verbose("Using user supplied AAPL,ig-platform-id\n");
717verbose("AAPL,ig-platform-id: %02x%02x%02x%02x\n",
718default_aapl_haswell[0], default_aapl_haswell[1], default_aapl_haswell[2], default_aapl_haswell[3]);
719}
720devprop_add_value(device, "AAPL,ig-platform-id", default_aapl_haswell, AAPL_LEN_HSW);
721}
722else if (getIntForKey(kIntelAzulFB, &n_igs, &bootInfo->chameleonConfig))
723{
724if ((n_igs >= 0) || (n_igs <= 16))
725{
726verbose("AAPL,ig-platform-id was set in org.chameleon.Boot.plist with value %d\n", n_igs);
727devprop_add_value(device, "AAPL,ig-platform-id", haswell_ig_vals[n_igs], 4);
728}
729else
730{
731verbose("AAPL,ig-platform-id was set in org.chameleon.Boot.plist with bad value please choose a number between 0 and 16.\n");
732}
733}
734else
735{
736uint32_t ig_platform_id = 0x0000260c; // set the default platform ig
737devprop_add_value(device, "AAPL,ig-platform-id", (uint8_t *)&ig_platform_id, 4);
738}
739
740devprop_add_value(device, "AAPL00,DualLink", HD4000_vals[10], 4);
741devprop_add_value(device, "built-in", &BuiltIn, 1);
742devprop_add_value(device, "class-code", ClassFix, 4);
743
744break;
745
746default:
747break;
748}
749
750stringdata = malloc(sizeof(uint8_t) * string->length);
751if (!stringdata)
752{
753printf("[setup_gma_devprop] No stringdata!\n");
754pause();
755return false;
756}
757
758verbose("---------------------------------------------\n");
759memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);
760stringlength = string->length;
761
762return true;
763}
764

Archive Download this file

Revision: 2650