Chameleon

Chameleon Svn Source Tree

Root/branches/Chimera/i386/libsaio/gma.h

1/*
2 * Copyright 2013 Intel Corporation
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the 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
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25
26/*
27 Original patch by Nawcom
28 http://forum.voodooprojects.org/index.php/topic,1029.0.html
29
30 Original Intel HDx000 code from valv
31 Intel HD4xx and HD5xx code by ErmaC http://www.insanelymac.com/forum/topic/288241-intel-hd4000-inject-aaplig-platform-id/
32 */
33
34#ifndef __LIBSAIO_GMA_H
35#define __LIBSAIO_GMA_H
36
37bool setup_gma_devprop(pci_dt_t *gma_dev);
38
39struct intel_gfx_info_t;
40typedef struct{
41 uint32_tmodel;
42char*label_info;
43}intel_gfx_info_t;
44
45#define REG8(reg)((volatile uint8_t *)regs)[(reg)]
46#define REG16(reg)((volatile uint16_t *)regs)[(reg) >> 1]
47#define REG32(reg)((volatile uint32_t *)regs)[(reg) >> 2]
48
49/****************************************************************************
50 * Miscellanious defines
51 ****************************************************************************/
52
53/* Intel gfx Controller models */
54#define GFX_MODEL_CONSTRUCT(vendor, model) (((uint32_t)(model) << 16) | ((vendor##_VENDORID) & 0xffff))
55
56/* Intel */
57#define INTEL_NAME "Intel"
58#define HD_GRAPHICS "HD Graphics"
59#define HD_GRAPHICS_2000 "HD Graphics 2000"
60#define HD_GRAPHICS_2500 "HD Graphics 2500"
61#define HD_GRAPHICS_3000 "HD Graphics 3000"
62#define HD_GRAPHICS_4000 "HD Graphics 4000"
63#define HD_GRAPHICS_4200 "HD Graphics 4200" // MacMan
64#define HD_GRAPHICS_4400 "HD Graphics 4400" // MacMan
65#define HD_GRAPHICS_4600 "HD Graphics 4600"
66#define HD_GRAPHICS_5000 "HD Graphics 5000"
67#define IRIS_5100 "Iris(TM) Graphics 5100"
68#define IRIS_5200 "Iris(TM) Pro Graphics 5200"
69#define INTEL_VENDORID0x8086
70
71/* http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/src/intel_driver.h */
72/* http://people.redhat.com/agk/patches/linux/patches-3.6/git-update1.patch */
73
74#define GMA_I810 GFX_MODEL_CONSTRUCT(INTEL, 0x7121)
75#define GMA_I810_DC100 GFX_MODEL_CONSTRUCT(INTEL, 0x7123)
76#define GMA_I810_E GFX_MODEL_CONSTRUCT(INTEL, 0x7125)
77#define GMA_I815 GFX_MODEL_CONSTRUCT(INTEL, 0x1132)
78/* ==================================== */
79
80#define GMA_I830_M GFX_MODEL_CONSTRUCT(INTEL, 0x3577)
81#define GMA_845_G GFX_MODEL_CONSTRUCT(INTEL, 0x2562)
82#define GMA_I854 GFX_MODEL_CONSTRUCT(INTEL, 0x358E)
83#define GMA_I855_GM GFX_MODEL_CONSTRUCT(INTEL, 0x3582)
84#define GMA_I865_G GFX_MODEL_CONSTRUCT(INTEL, 0x2572)
85/* ==================================== */
86
87#define GMA_I915_G GFX_MODEL_CONSTRUCT(INTEL, 0x2582) // GMA 915
88#define GMA_I915_GM GFX_MODEL_CONSTRUCT(INTEL, 0x2592) // GMA 915
89#define GMA_E7221_G GFX_MODEL_CONSTRUCT(INTEL, 0x258A)
90#define GMA_I945_G GFX_MODEL_CONSTRUCT(INTEL, 0x2772) // Desktop GMA950
91//#define GMA_82945G GFX_MODEL_CONSTRUCT(INTEL, 2776) // Desktop GMA950
92//#define GMA_82915G GFX_MODEL_CONSTRUCT(INTEL, 2782) // GMA 915
93//#define GMA_038000 GFX_MODEL_CONSTRUCT(INTEL, 2792) // Mobile GMA915
94#define GMA_I945_GM GFX_MODEL_CONSTRUCT(INTEL, 0x27A2) // Mobile GMA950
95#define GMA_I945_GME GFX_MODEL_CONSTRUCT(INTEL, 0x27AE) // Mobile GMA950
96//#define GMA_945GM GFX_MODEL_CONSTRUCT(INTEL, 27A6) // Mobile GMA950
97//#define GMA_PINEVIEW_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0xA010)
98#define GMA_PINEVIEW_M GFX_MODEL_CONSTRUCT(INTEL, 0xA011) // Mobile GMA3150
99#define GMA_GMA3150_M GFX_MODEL_CONSTRUCT(INTEL, 0xA012) // Mobile GMA3150
100//#define GMA_PINEVIEW_HB GFX_MODEL_CONSTRUCT(INTEL, 0xA000)
101#define GMA_PINEVIEW_G GFX_MODEL_CONSTRUCT(INTEL, 0xA001) // Mobile GMA3150
102#define GMA_GMA3150_D GFX_MODEL_CONSTRUCT(INTEL, 0xA002) // Desktop GMA3150
103#define GMA_Q35_G GFX_MODEL_CONSTRUCT(INTEL, 0x29B2)
104#define GMA_G33_G GFX_MODEL_CONSTRUCT(INTEL, 0x29C2) // Desktop GMA3100
105// 29C3 // Desktop GMA3100
106#define GMA_Q33_G GFX_MODEL_CONSTRUCT(INTEL, 0x29D2)
107/* ==================================== */
108
109#define GMA_G35_G GFX_MODEL_CONSTRUCT(INTEL, 0x2982)
110#define GMA_I965_Q GFX_MODEL_CONSTRUCT(INTEL, 0x2992)
111#define GMA_I965_G GFX_MODEL_CONSTRUCT(INTEL, 0x29A2)
112#define GMA_I946_GZ GFX_MODEL_CONSTRUCT(INTEL, 0x2972)
113#define GMA_I965_GM GFX_MODEL_CONSTRUCT(INTEL, 0x2A02) // GMAX3100
114#define GMA_I965_GME GFX_MODEL_CONSTRUCT(INTEL, 0x2A12) // GMAX3100
115#define GMA_GM45_GM GFX_MODEL_CONSTRUCT(INTEL, 0x2A42) // GMAX3100
116//#define GMA_GM45_GM2 GFX_MODEL_CONSTRUCT(INTEL, 0x2A43) // GMAX3100
117#define GMA_G45_E_G GFX_MODEL_CONSTRUCT(INTEL, 0x2E02)
118#define GMA_G45_G GFX_MODEL_CONSTRUCT(INTEL, 0x2E22)
119#define GMA_Q45_G GFX_MODEL_CONSTRUCT(INTEL, 0x2E12)
120#define GMA_G41_G GFX_MODEL_CONSTRUCT(INTEL, 0x2E32)
121#define GMA_B43_G GFX_MODEL_CONSTRUCT(INTEL, 0x2E42)
122#define GMA_B43_G1 GFX_MODEL_CONSTRUCT(INTEL, 0x2E92)
123
124#define GMA_IRONLAKE_D_G GFX_MODEL_CONSTRUCT(INTEL, 0x0042) // HD2000
125#define GMA_IRONLAKE_M_G GFX_MODEL_CONSTRUCT(INTEL, 0x0046) // HD2000
126/*
127#define GMA_IRONLAKE_D_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0040)
128#define GMA_IRONLAKE_D2_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0069)
129#define GMA_IRONLAKE_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0044)
130#define GMA_IRONLAKE_MA_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0062)
131#define GMA_IRONLAKE_MC2_HB GFX_MODEL_CONSTRUCT(INTEL, 0x006a)
132*/
133// 004A // HD2000
134/* ==================================== */
135
136/* ========== Sandy Bridge ============ */
137//#define GMA_SANDYBRIDGE_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0100) /* Desktop */
138#define GMA_SANDYBRIDGE_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0102) // HD Graphics 2000 and found in kext
139//#define GMA_SANDYBRIDGE_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0104) /* Mobile */
140#define GMA_SANDYBRIDGE_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0112) // HD Graphics 3000
141#define GMA_SANDYBRIDGE_GT2_PLUSGFX_MODEL_CONSTRUCT(INTEL, 0x0122) // HD Graphics 3000
142#define GMA_SANDYBRIDGE_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0106) // HD Graphics 2000 Mobile and found in kext
143#define GMA_SANDYBRIDGE_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0116) // HD Graphics 3000 Mobile and found in kext
144#define GMA_SANDYBRIDGE_M_GT2_PLUSGFX_MODEL_CONSTRUCT(INTEL, 0x0126) // HD Graphics 3000 Mobile and found in kext
145//#define GMA_SANDYBRIDGE_S_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0108) /* Server */
146#define GMA_SANDYBRIDGE_S_GT GFX_MODEL_CONSTRUCT(INTEL, 0x010A) // HD Graphics
147// 010B // ??
148// 010E // ??
149/* ==================================== */
150
151/* ========== Ivy Bridge ============== */
152//#define GMA_IVYBRIDGE_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0150) /* Desktop */
153//#define GMA_IVYBRIDGE_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0154) /* Mobile */
154#define GMA_IVYBRIDGE_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0156) // HD Graphics 2500 Mobile and found in kext
155#define GMA_IVYBRIDGE_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0166) // HD Graphics 4000 Mobile and found in kext
156#define GMA_IVYBRIDGE_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0152) // HD Graphics 2500 and found in kext
157#define GMA_IVYBRIDGE_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0162) // HD Graphics 4000 and found in kext
158//#define GMA_IVYBRIDGE_S_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0158) /* Server */
159#define GMA_IVYBRIDGE_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x015A) // HD Graphics 4000
160#define GMA_IVYBRIDGE_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x016A) // HD Graphics P4000
161#define GMA_IVYBRIDGE_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x015E) // Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
162#define GMA_IVYBRIDGE_S_GT4 GFX_MODEL_CONSTRUCT(INTEL, 0x0172) // HD Graphics 2500 Mobile // Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
163#define GMA_IVYBRIDGE_S_GT5 GFX_MODEL_CONSTRUCT(INTEL, 0x0176) // HD Graphics 2500 Mobile // 3rd Gen Core processor Graphics Controller
164/* ==================================== */
165
166//#define GMA_VALLEYVIEW_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0F00) /* VLV1 */
167//#define GMA_VALLEYVIEW_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0F30)
168
169/* ============ Haswell =============== */
170// 0090 // AppleIntelHD5000Graphics.kext
171// 0091 // AppleIntelHD5000Graphics.kext
172// 0092 // AppleIntelHD5000Graphics.kext
173//#define GMA_HASWELL_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0400) /* Desktop */
174#define GMA_HASWELL_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0402) // HD Graphics
175#define GMA_HASWELL_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0412) // HD Graphics 4600 and found in kext
176#define GMA_HASWELL_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0422) // HD Graphics 5000
177//#define GMA_HASWELL_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0404) /* Mobile */
178#define GMA_HASWELL_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0406) // HD Graphics Mobile and found in kext
179#define GMA_HASWELL_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0416) // HD Graphics 4600 Mobile and found in kext
180#define GMA_HASWELL_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0426) // HD Graphics 5000 Mobile and found in kext
181#define GMA_HASWELL_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x040A) // HD Graphics
182//#define GMA_HASWELL_S_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0408) /* Server */
183#define GMA_HASWELL_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x041A) // HD Graphics
184#define GMA_HASWELL_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x042A)
185#define GMA_HASWELL_B_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x040B)
186#define GMA_HASWELL_B_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x041B) // HD Graphics
187#define GMA_HASWELL_B_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x042B)
188#define GMA_HASWELL_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x040E)
189#define GMA_HASWELL_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x041E) // HD Graphics 4400
190#define GMA_HASWELL_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x042E)
191
192#define GMA_HASWELL_ULT_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A02)
193#define GMA_HASWELL_ULT_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A12)
194#define GMA_HASWELL_ULT_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A22) // HD Graphics 5000 Iris
195#define GMA_HASWELL_ULT_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A06) // HD Graphics
196#define GMA_HASWELL_ULT_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A16) // HD Graphics 4400 Mobile and found in kext
197#define GMA_HASWELL_ULT_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A26) // HD Graphics 5000 Iris Mobile and found in kext
198#define GMA_HASWELL_ULT_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A0A)
199#define GMA_HASWELL_ULT_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A1A)
200#define GMA_HASWELL_ULT_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A2A)
201#define GMA_HASWELL_ULT_B_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A0B)
202#define GMA_HASWELL_ULT_B_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A1B)
203#define GMA_HASWELL_ULT_B_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A2B)
204#define GMA_HASWELL_ULT_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0A0E) // HD Graphics
205#define GMA_HASWELL_ULT_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0A1E) // HD Graphics 4200 Mobile and found in kext
206#define GMA_HASWELL_ULT_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0A2E) // HD Graphics 5100 Iris Mobile and found in kext
207
208//#define GMA_HASWELL_SDV_D_GT1_IG GFX_MODEL_CONSTRUCT(INTEL, 0C02)
209//#define GMA_HASWELL_E_HB GFX_MODEL_CONSTRUCT(INTEL, 0C04)
210//#define GMA_HASWELL_SDV_M_GT1_IG GFX_MODEL_CONSTRUCT(INTEL, 0C06) // AppleIntelHD5000Graphics.kext
211//#define GMA_HASWELL_SDV_D_GT2_IG GFX_MODEL_CONSTRUCT(INTEL, 0C12)
212//#define GMA_HASWELL_SDV_M_GT2_IG GFX_MODEL_CONSTRUCT(INTEL, 0C16) // AppleIntelHD5000Graphics.kext
213//#define GMA_HASWELL_SDV_D_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0C22) // AppleIntelHD5000Graphics.kext
214//#define GMA_HASWELL_SDV_M_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0C26) // AppleIntelHD5000Graphics.kext
215//#define GMA_HASWELL_SDV_S_GT1_IGGFX_MODEL_CONSTRUCT(INTEL, 0x0C0A)
216//#define GMA_HASWELL_SDV_S_GT2_IGGFX_MODEL_CONSTRUCT(INTEL, 0x0C1A)
217//#define GMA_HASWELL_SDV_S_GT2_PLUS_IGGFX_MODEL_CONSTRUCT(INTEL, 0x0C2A)
218
219#define GMA_HASWELL_CRW_D_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D02)
220#define GMA_HASWELL_CRW_D_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D12) // HD Graphics
221#define GMA_HASWELL_CRW_D_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D22) // HD Graphics 5200 Iris Pro and found in kext
222//#define GMA_HASWELL_CRW_D_GT2_PLUS_IGGFX_MODEL_CONSTRUCT(INTEL, 0x0D32)
223#define GMA_HASWELL_CRW_M_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D06)
224#define GMA_HASWELL_CRW_M_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D16) // HD Graphics 4600 Mobile
225#define GMA_HASWELL_CRW_M_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D26) // HD Graphics 5200 Iris Pro Mobile and found in kext
226#define GMA_HASWELL_CRW_S_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0A)
227#define GMA_HASWELL_CRW_S_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1A)
228#define GMA_HASWELL_CRW_S_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2A) // HD Graphics Iris Pro
229#define GMA_HASWELL_CRW_B_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0B)
230#define GMA_HASWELL_CRW_B_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1B)
231#define GMA_HASWELL_CRW_B_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2B)
232#define GMA_HASWELL_CRW_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0E)
233#define GMA_HASWELL_CRW_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1E)
234#define GMA_HASWELL_CRW_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2E)
235#define GMA_HASWELL_CRW_M_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D36)
236//#define GMA_HASWELL_CRW_S_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D3A)
237
238/* END */
239
240#endif /* !__LIBSAIO_GMA_H */

Archive Download this file

Revision: 2394