Chameleon

Chameleon Commit Details

Date:2011-08-01 05:02:17 (8 years 2 months ago)
Author:Azimutz
Commit:1250
Parents: 1249
Message:Sync with trunk (r1248).
Changes:
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/AMDGraphicsEnabler/ati.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.h
M/branches/azimutz/trunkGraphicsEnablerModules/CHANGES
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/stringTable.c
M/branches/azimutz/trunkGraphicsEnablerModules/doc/BootHelp.txt
M/branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/ATiGraphicsEnabler/ati.c
M/branches/azimutz/trunkGraphicsEnablerModules

File differences

branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/stringTable.c
650650
651651
652652
653
653
654654
655655
656656
"bt(0,0)/Extra/org.chameleon.Boot.plist",
"rd(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */
"/Extra/com.apple.Boot.plist" /* DEPRECIATED */
"/Extra/com.apple.Boot.plist", /* DEPRECIATED */
"bt(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */
};
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c
428428
429429
430430
431
431432
432433
433434
434435
435436
436437
437
438
438439
439440
440441
441442
442443
443
444
445
444
446445
447446
448447
......
481480
482481
483482
483
484484
485
485486
486487
487488
} else {
archCpuType = CPU_TYPE_I386;
}
if (getValueForKey(karch, &val, &len, &bootInfo->chameleonConfig)) {
if (strncmp(val, "i386", 4) == 0) {
archCpuType = CPU_TYPE_I386;
}
}
if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig)) {
if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig)) {
if (strncmp(val, "i386", 4) == 0) {
archCpuType = CPU_TYPE_I386;
}
}
//archCpuType = CPU_TYPE_I386;
// Notify moduals that we are attempting to boot
// Notify modules that we are attempting to boot
execute_hook("PreBoot", NULL, NULL, NULL, NULL);
if (!getBoolForKey (kWake, &tryresume, &bootInfo->chameleonConfig)) {
break;
if (!forceresume && ((sleeptime+3)<bvr->modTime)) {
#if DEBUG
printf ("Hibernate image is too old by %d seconds. Use ForceWake=y to override\n",bvr->modTime-sleeptime);
#endif
break;
}
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.h
106106
107107
108108
109
110
111
112
113
114
115
116
117
118109
119110
120111
#define kPCIRootUID"PCIRootUID"/* pci_root.c */
//#define kUseAtiROM"UseAtiROM"/* ati.c */
//#define kAtiConfig"AtiConfig"/* ati.c */
//#define kATYbinimage"ATYbinimage"/* ati.c */
//#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
//#define kVBIOS"VBIOS"/* nvidia.c */
//#define kDcfg0"display_0"/* nvidia.c */
//#define kDcfg1"display_1"/* nvidia.c */
#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
#define kForceHPET"ForceHPET"/* pci_setup.c */
branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/ATiGraphicsEnabler/ati.c
114114
115115
116116
117
117
118
119
118120
119121
120122
......
181183
182184
183185
184
186
187
188
185189
186190
187191
......
228232
229233
230234
231
235
232236
233237
234238
// Known cards as of 2008/08/26
static struct ati_chipsets_t ATIKnownChipsets[] = {
{ 0x00000000, "Unknown" } ,
//{ 0x10027181, "ATI Radeon 1300 Series"} ,
{ 0x10027181, "ATI Radeon X1600 Series"},
{ 0x10027183, "ATI Radeon X1550 Series"}, // Beej
{ 0x10029589, "ATI Radeon 2600 Series"} ,
{ 0x10029588, "ATI Radeon 2600 Series"} ,
{ 0x100294C3, "ATI Radeon 2400 Series"} ,
static struct ati_chipsets_t ATIKnownFramebuffers[] = {
{ 0x00000000, "Megalodon" },
//{ 0x10027181, "Caretta" },
{ 0x10027181, "Caretta" },
{ 0x10027183, "Caretta" },
{ 0x10029589, "Lamna"} ,
{ 0x10029588, "Lamna"} ,
{ 0x100294C3, "Iago"} ,
{ 0x10029490, "Peregrine"} ,
{ 0x10029498, "Peregrine"} ,
{ 0x1002949E, "Peregrine"} ,
{ 0x10029480, "Shrike"}, // akbar
{ 0x10029480, "Gliff"}, // Peregrine <= 10.6.7
{ 0x10029488, "Peregrine"} ,
{ 0x10029540, "Peregrine"} ,
{ 0x10029541, "Peregrine"} ,
branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/AMDGraphicsEnabler/ati.c
1717
1818
1919
20
2021
2122
2223
......
4647
4748
4849
49
50
5051
5152
5253
......
5556
5657
5758
58
5959
6060
6161
6262
63
64
65
66
63
6764
6865
6966
......
9289
9390
9491
95
9692
9793
9894
9995
10096
101
102
103
10497
10598
10699
......
217210
218211
219212
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238213
239
240
241214
242215
243216
......
272245
273246
274247
248
249
250
251
275252
276253
277254
......
354331
355332
356333
357
358
359334
360335
361
362336
337
338
339
340
363341
364342
365343
......
367345
368346
369347
348
349
370350
371351
372352
......
435415
436416
437417
418
419
438420
439421
440422
......
444426
445427
446428
429
430
431
432
433
434
447435
448436
449437
......
457445
458446
459447
460
461448
449
450
451
452
462453
463454
464
465455
466
467
468456
457
458
469459
470460
471
472
461
473462
474463
475464
......
480469
481470
482471
472
473
474
483475
484476
477
478
485479
486480
487481
......
540534
541535
542536
543
544
545537
546538
547539
......
587579
588580
589581
590
582
591583
592584
593585
......
11451137
11461138
11471139
1148
1149
1150
1151
1140
1141
1142
1143
1144
11521145
11531146
11541147
......
12011194
12021195
12031196
1204
1197
12051198
1206
1207
1208
1209
1210
1211
1212
1213
12141199
12151200
12161201
......
12241209
12251210
12261211
1227
1228
1229
1230
1212
1213
1214
1215
1216
12311217
1218
1219
1220
1221
12321222
12331223
12341224
#define kUseAtiROM"UseAtiROM"
#define kAtiConfig"AtiConfig"
#define kAtiPorts"AtiPorts"
#define kATYbinimage"ATYbinimage"
#define Reg32(reg)(*(volatile uint32_t *)(card->mmio + reg))
CHIP_FAMILY_RS880,
/* R700 */
CHIP_FAMILY_RV770,
CHIP_FAMILY_RV730, // review - see read_disabled_vbios
CHIP_FAMILY_RV730,
CHIP_FAMILY_RV710,
CHIP_FAMILY_RV740,
/* Evergreen */
CHIP_FAMILY_JUNIPER,
CHIP_FAMILY_CYPRESS,
CHIP_FAMILY_HEMLOCK,
//CHIP_FAMILY_GRANVILLE, //Azi: review
/* Northern Islands */
CHIP_FAMILY_BARTS,
CHIP_FAMILY_CAICOS,
CHIP_FAMILY_CAYMAN,
CHIP_FAMILY_TURKS, // review - just 6758 & 6759 dev ids
// mobility
//CHIP_FAMILY_M96, // RV730
//---
CHIP_FAMILY_TURKS,
CHIP_FAMILY_LAST
} chip_family_t;
"Juniper",// RV840
"Cypress",// RV870
"Hemlock",
//"Granville"//Azi:---
/* Northern Islands */
"Barts",
"Caicos",
"Cayman",
"Turks",
// mobility
//"M96",
//---
""
};
} radeon_card_info_t;
static radeon_card_info_t radeon_cards[] = {
//Azi: added devices
// temporary placement
// FredWst
{ 0x954F,0xE990174B,CHIP_FAMILY_RV710,"Sapphire Radeon HD4350",kNull}, // review model
// dickhouse
{ 0x6760,0x1CB21043,CHIP_FAMILY_RV730,"AMD Radeon HD 6470M",kNull},
// Akbar
{ 0x9480,0x3628103C,CHIP_FAMILY_RV730,/*M96*/"ATI Radeon HD 4650M",kShrike}, // hp OK
// issue #88
{ 0x6741,0x1646103C,CHIP_FAMILY_TURKS,"AMD Radeon HD 6750M",kNull}, // - review turks
// issue #121
{ 0x6741,0x050E1025,CHIP_FAMILY_TURKS,"AMD Radeon HD 6650M",kNull}, // acer - review turks
// issue #89
{ 0x68A8,0x050E1025,CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M",kUakari}, //Azi: CHIP_FAMILY_GRANVILLE ?? review
// issue #90
{ 0x68E4,0x1c921043,CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470M",kEulemur}, // asus - confirm model, chipset
// issue #91
{ 0x68C0,0x1594103C,CHIP_FAMILY_REDWOOD,"AMD Radeon HD 6570M",kNull}, // confirm model, chipset
//==================================//================================//============================//
/* Earlier cards are not supported */
{ 0x9400,0x30001002, CHIP_FAMILY_R600,"ATI Radeon HD 2900 PRO",kNull},
{ 0x9400,0x25521002, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x944E,0x30101787, CHIP_FAMILY_RV770,"ATI Radeon HD 4810 Series",kMotmot},
{ 0x944E,0x31001787, CHIP_FAMILY_RV770,"ATI Radeon HD 4820",kMotmot},
{ 0x9480,0x3628103C,CHIP_FAMILY_RV730,"ATI Radeon HD 4650M",kGliff},
{ 0x9480,0x9035104D,CHIP_FAMILY_RV730,"ATI Radeon HD 4650M",kGliff},
{ 0x9490,0x20031787, CHIP_FAMILY_RV730,"ATI Radeon HD 4670",kFlicker},
{ 0x9490,0x30501787, CHIP_FAMILY_RV730,"ATI Radeon HD 4710",kNull},
{ 0x9490,0x4710174B, CHIP_FAMILY_RV730,"ATI Radeon HD 4710",kNull},
{ 0x9490,0x300017AF, CHIP_FAMILY_RV730,"ATI Radeon HD 4710",kNull},
{ 0x954F,0x29201682, CHIP_FAMILY_RV710,"ATI Radeon HD 4550",kNull},
{ 0x954F,0x29211682, CHIP_FAMILY_RV710,"ATI Radeon HD 4550",kNull},
{ 0x954F,0x30901682, CHIP_FAMILY_RV710,"XFX Radeon HD 4570",kNull},
{ 0x954F,0x4450174B, CHIP_FAMILY_RV710,"ATI Radeon HD 4450",kNull},
{ 0x954F,0x3000174B, CHIP_FAMILY_RV710,"ATI Radeon HD 4520",kNull},
{ 0x954F,0x30501787, CHIP_FAMILY_RV710,"ATI Radeon HD 4450",kNull},
{ 0x954F,0x31001787, CHIP_FAMILY_RV710,"ATI Radeon HD 4520",kNull},
{ 0x954F,0x4570174B, CHIP_FAMILY_RV710,"Sapphire Radeon HD4570",kNull},
{ 0x954F,0x301017AF, CHIP_FAMILY_RV710,"ATI Radeon HD 4450",kNull},
{ 0x954F,0x4450174B, CHIP_FAMILY_RV710,"ATI Radeon HD 4450",kNull},
{ 0x954F,0x3000174B, CHIP_FAMILY_RV710,"ATI Radeon HD 4520",kNull},
{ 0x954F,0x4570174B, CHIP_FAMILY_RV710,"Sapphire Radeon HD 4570",kNull},
{ 0x954F,0xE990174B,CHIP_FAMILY_RV710,"Sapphire Radeon HD 4350",kNull},
{ 0x9552,0x3000148C, CHIP_FAMILY_RV710,"ATI Radeon HD 4300/4500 Series",kNull},
{ 0x9552,0x3000174B, CHIP_FAMILY_RV710,"ATI Radeon HD 4300/4500 Series",kNull},
{ 0x9552,0x300017AF, CHIP_FAMILY_RV710,"ATI Radeon HD 4300/4500 Series",kNull},
{ 0x9552,0x04341028, CHIP_FAMILY_RV710,"ATI Mobility Radeon 4330",kShrike},
{ 0x9553,0x1B321043, CHIP_FAMILY_RV710,"ATI Mobility Radeon HD 4570",kShrike/*??*/},
{ 0x9581,0x95811002, CHIP_FAMILY_RV630,"ATI Radeon HD 3600 Series",kNull},
{ 0x9581,0x3000148C, CHIP_FAMILY_RV630,"ATI Radeon HD 3600 Series",kNull},
{ 0x689C,0x039E1043, CHIP_FAMILY_HEMLOCK,"ASUS EAH5870 Series",kUakari},
{ 0x689C,0x30201682, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5970",kUakari},
{ 0x68A8,0x050E1025,CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M",kUakari}, // issue #89
{ 0x68B8,0xE147174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x21D71458, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x1482174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x22881787, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x00CF106B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kHoolock},
{ 0x68C0,0x1594103C,CHIP_FAMILY_REDWOOD,"AMD Radeon HD 6570M",kNull}, // issue #91
//Azi: from Slice { 0x100268C0, "ATI Radeon 5670 Series", "Galago"}
// http://www.insanelymac.com/forum/index.php?s=&showtopic=255866&view=findpost&p=1695482
{ 0x68C1,0x033E1025,CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kNull},
{ 0x68D8,0x301117AF, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5690",kNull},
{ 0x68D8,0x301017AF, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5730",kNull},
{ 0x68D8,0x30001787, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5730",kNull},
{ 0x68DA,0x30001787, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5630",kNull},
{ 0x68DA,0x5630174B, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5630",kNull},
{ 0x68E0,0x04561028, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470M",kEulemur},
{ 0x68E1,0x1426103C, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5430M",kEulemur},
{ 0x68E0,0x1433103C, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470M",kEulemur},
{ 0x68E0,0x04561028, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470M",kEulemur},
{ 0x68F9, 0x20091787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur },
{ 0x68F9, 0x22911787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur },
{ 0x68F9,0x301317AF, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470",kNull},
{ 0x68F9,0x301117AF, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470",kNull},
{ 0x68F9,0x301217AF, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x30001787, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470",kNull},
{ 0x68F9,0x30021787, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x30011787, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5530",kNull},
{ 0x68F9,0x5470174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470",kNull},
{ 0x68F9,0x301217AF, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x30021787, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x5490174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x5530174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5530",kNull},
{ 0x68F9, 0x20091787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, // issue 119
{ 0x68F9, 0x22911787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, // HIS
{ 0x68F9,0x30011787, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5530",kNull},
/* Northen Islands */
{ 0x6718,0x0B001002,CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6739,0x67391002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x21F81458,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6741,0x050E1025,CHIP_FAMILY_TURKS,"AMD Radeon HD 6650M",kNull}, // issue 121
{ 0x6741,0x1646103C,CHIP_FAMILY_TURKS,"AMD Radeon HD 6750M",kNull}, // issue 88
{ 0x6759,0xE193174B,CHIP_FAMILY_TURKS,"AMD Radeon HD 6570",kNull},
{ 0x6760,0x1CB21043,CHIP_FAMILY_RV730,"AMD Radeon HD 6470M",kNull},
/* standard/default models */
{ 0x9400,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x9405,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 GT",kNull},
{ 0x68B9,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5600 Series",kVervet},
{ 0x68B8,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5700 Series",kVervet},
{ 0x68BE,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5700 Series",kVervet},
//Azi: from Slice { 0x100268C0, "ATI Radeon 5670 Series", "Galago"}
// http://www.insanelymac.com/forum/index.php?s=&showtopic=255866&view=findpost&p=1695482
{ 0x68D8,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5600 Series",kBaboon},
{ 0x68D9,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5500 Series",kBaboon},
#define FLAGTRUEMKFLAG(0)
#define EVERGREENMKFLAG(1)
static uint8_t atN = 0;
//static uint8_t atN = 0;
typedef struct {
type_ttype;
static bool init_card(pci_dt_t *pci_dev)
{
char name[24];
char name_parent[24];
int i;
bool add_vbios = true;
booladd_vbios = true;
charname[24];
charname_parent[24];
inti;
intn_ports = 0;
card = malloc(sizeof(card_t));
if (!card)
}
}
card->ports = 2; // default
//atN = 0;
if (card->info->chip_family >= CHIP_FAMILY_CEDAR)
{
card->flags |= EVERGREEN;
card->ports = 3;
}
atN = 0;
card->cfg_name = getStringForKey(kAtiConfig, &bootInfo->chameleonConfig);
if (!card->cfg_name)
{
card->ports = card_configs[i].ports;
}
//Azi: http://forum.voodooprojects.org/index.php/topic,1959.msg10402.html#msg10402
// get around this...
if (pci_dev->device_id == 0x9552 && pci_dev->subsys_id.subsys_id == 0x04341028 )
card->ports = 2;
if (card->info->chip_family >= CHIP_FAMILY_CEDAR)
{
card->flags |= EVERGREEN;
card->ports = 3; //Azi: not sure of the usefulness ??
}
getIntForKey(kAtiPorts, &n_ports, &bootInfo->bootConfig);
if (n_ports > 0)
card->ports = n_ports;
sprintf(name, "ATY,%s", card->cfg_name);
aty_name.type = kStr;
aty_name.size = strlen(name) + 1;
branches/azimutz/trunkGraphicsEnablerModules/doc/BootHelp.txt
7272
7373
7474
75
75
76
7677
7778
7879
ignore /E/E and /S/L/E/Extensions.mkext.
GraphicsEnabler=Yes|No Automatic device-properties generation for gfx cards.
AtiConfig=<cardcfg> Use a different card config
AtiConfig=<cardcfg> Use a different card config, e.g. AtiConfig=Megalodon.
AtiPorts=<value> Specify the number of ports, e.g. AtiPorts=2.
UseAtiROM=Yes|No Use an alternate Ati ROM image
(path: /Extra/<vendorid>_<devid>_<subsysid>.rom)
UseNvidiaROM=Yes|No Use an alternate Nvidia ROM image
branches/azimutz/trunkGraphicsEnablerModules/CHANGES
1
2
3
4
5
16
27
38
- Added AtiPorts option to GraphicsEnabler, so users can override the default number of ports. It proved
to be useful when used to limit the number of ports that a framebuffer registers, which seems to be a
requirement on laptops that can only use 2 ports at the same time.
Thanks to Akbar for testing and AniV also for the tip:
http://forum.voodooprojects.org/index.php/topic,1959.msg10402.html#msg10402
- Added NVidia ION AHCI controllers dev id to AHCIPortInjector kext.
Forgot to mention source on the commit: http://forum.voodooprojects.org/index.php/topic,1170.0.html
- Renamed com.apple.Boot.plist to org.chameleon.Boot.plist.

Archive Download the corresponding diff file

Revision: 1250