Index: branches/Chimera/version =================================================================== --- branches/Chimera/version (revision 1522) +++ branches/Chimera/version (revision 1523) @@ -1 +1 @@ -2.0 \ No newline at end of file +2.0 Index: branches/Chimera/i386/libsaio/gma.c =================================================================== --- branches/Chimera/i386/libsaio/gma.c (revision 1522) +++ branches/Chimera/i386/libsaio/gma.c (revision 1523) @@ -1,6 +1,8 @@ /* Original patch by Nawcom http://forum.voodooprojects.org/index.php/topic,1029.0.html + + Original Intel HDx000 code from valv */ #include "libsa.h" @@ -21,7 +23,6 @@ #define DBG(x...) #endif - uint8_t GMAX3100_vals[22][4] = { { 0x01,0x00,0x00,0x00 }, { 0x01,0x00,0x00,0x00 }, @@ -46,6 +47,66 @@ { 0x00,0x00,0x00,0x00 } }; +uint8_t HD2000_vals[16][4] = { + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xfa,0x00,0x00,0x00 }, + { 0x2c,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xf4,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, +}; + +uint8_t HD3000_vals[16][4] = { + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xfa,0x00,0x00,0x00 }, + { 0x2c,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xf4,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, +}; + +uint8_t HD2000_tbl_info[18] = { + 0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x01,0x02,0x02,0x02,0x00,0x01,0x02,0x02 +}; +uint8_t HD2000_os_info[20] = { + 0x30,0x49,0x01,0x11,0x11,0x11,0x08,0x00,0x00,0x01, + 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 +}; + +// The following values came from a Sandy Bridge MacBook Air +uint8_t HD3000_tbl_info[18] = { + 0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01 +}; + +// The following values came from a Sandy Bridge MacBook Air +uint8_t HD3000_os_info[20] = { + 0x30,0x49,0x01,0x12,0x12,0x12,0x08,0x00,0x00,0x01, + 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 +}; + + uint8_t reg_TRUE[] = { 0x01, 0x00, 0x00, 0x00 }; uint8_t reg_FALSE[] = { 0x00, 0x00, 0x00, 0x00 }; @@ -67,6 +128,12 @@ { 0x80862A13, "GMAX3100" }, { 0x80862A42, "GMAX3100" }, { 0x80862A43, "GMAX3100" }, + { 0x80860102, "Intel HD Graphics 2000" }, + { 0x80860106, "Intel HD Graphics 2000 Mobile" }, + { 0x80860112, "Intel HD Graphics 3000" }, + { 0x80860116, "Intel HD Graphics 3000 Mobile" }, + { 0x80860122, "Intel HD Graphics 3000" }, + { 0x80860126, "Intel HD Graphics 3000 Mobile" }, }; char *get_gma_model(uint32_t id) { @@ -88,6 +155,7 @@ char *model; uint8_t BuiltIn = 0x00; uint8_t ClassFix[4] = { 0x00, 0x00, 0x03, 0x00 }; + unsigned int device_id; devicepath = get_pci_dev_path(gma_dev); @@ -95,6 +163,7 @@ regs = (uint8_t *) (bar[0] & ~0x0f); model = get_gma_model((gma_dev->vendor_id << 16) | gma_dev->device_id); + device_id = gma_dev->device_id; verbose("Intel %s [%04x:%04x] :: %s\n", model, gma_dev->vendor_id, gma_dev->device_id, devicepath); @@ -155,6 +224,67 @@ devprop_add_value(device, "AAPL01,Stretch", GMAX3100_vals[21], 4); devprop_add_value(device, "class-code", ClassFix, 4); } + else if (model == (char *)"Intel HD Graphics 2000 Mobile") + { + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL00,PixelFormat", HD2000_vals[0], 4); + devprop_add_value(device, "AAPL00,T1", HD2000_vals[1], 4); + devprop_add_value(device, "AAPL00,T2", HD2000_vals[2], 4); + devprop_add_value(device, "AAPL00,T3", HD2000_vals[3], 4); + devprop_add_value(device, "AAPL00,T4", HD2000_vals[4], 4); + devprop_add_value(device, "AAPL00,T5", HD2000_vals[5], 4); + devprop_add_value(device, "AAPL00,T6", HD2000_vals[6], 4); + devprop_add_value(device, "AAPL00,T7", HD2000_vals[7], 4); + devprop_add_value(device, "AAPL00,LinkType", HD2000_vals[8], 4); + devprop_add_value(device, "AAPL00,LinkFormat", HD2000_vals[9], 4); + devprop_add_value(device, "AAPL00,DualLink", HD2000_vals[10], 4); + devprop_add_value(device, "AAPL00,Dither", HD2000_vals[11], 4); + devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4); + devprop_add_value(device, "graphic-options", HD2000_vals[13], 4); + devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); + } + else if (model == (char *)"Intel HD Graphics 3000 Mobile") + { + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL00,PixelFormat", HD3000_vals[0], 4); + devprop_add_value(device, "AAPL00,T1", HD3000_vals[1], 4); + devprop_add_value(device, "AAPL00,T2", HD3000_vals[2], 4); + devprop_add_value(device, "AAPL00,T3", HD3000_vals[3], 4); + devprop_add_value(device, "AAPL00,T4", HD3000_vals[4], 4); + devprop_add_value(device, "AAPL00,T5", HD3000_vals[5], 4); + devprop_add_value(device, "AAPL00,T6", HD3000_vals[6], 4); + devprop_add_value(device, "AAPL00,T7", HD3000_vals[7], 4); + devprop_add_value(device, "AAPL00,LinkType", HD3000_vals[8], 4); + devprop_add_value(device, "AAPL00,LinkFormat", HD3000_vals[9], 4); + devprop_add_value(device, "AAPL00,DualLink", HD3000_vals[10], 4); + devprop_add_value(device, "AAPL00,Dither", HD3000_vals[11], 4); + devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4); + devprop_add_value(device, "graphic-options", HD3000_vals[13], 4); + devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); + } + else if (model == (char *)"Intel HD Graphics 2000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id)); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); + } + else if (model == (char *)"Intel HD Graphics 3000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + device_id = 0x00000126; // Inject a valid mobile GPU device id instead of patching kexts + devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id)); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); + } stringdata = malloc(sizeof(uint8_t) * string->length); if (!stringdata) Index: branches/Chimera/i386/libsaio/nvidia.c =================================================================== --- branches/Chimera/i386/libsaio/nvidia.c (revision 1522) +++ branches/Chimera/i386/libsaio/nvidia.c (revision 1523) @@ -808,6 +808,7 @@ { 0x10DE1081, "GeForce GTX 570" }, { 0x10DE1082, "GeForce GTX 560 Ti" }, { 0x10DE1083, "D13U" }, + { 0x10DE1086, "GeForce GTX 570" }, { 0x10DE1088, "GeForce GTX 590" }, // 1090 - 109F { 0x10DE1098, "D13U" }, Index: branches/Chimera/i386/libsaio/ati.c =================================================================== --- branches/Chimera/i386/libsaio/ati.c (revision 1522) +++ branches/Chimera/i386/libsaio/ati.c (revision 1523) @@ -496,7 +496,9 @@ { 0x68B8, 0x200B1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, { 0x68B8, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, - + + { 0x68BF, 0x220E1458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68C0, 0x1594103C, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6570M", kNull }, { 0x68C1, 0x033E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, @@ -550,11 +552,27 @@ { 0x6718, 0x31301682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kNull }, + { 0x6738, 0x00D01002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x21FA1002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6738, 0x67381002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + + { 0x6738, 0x21FA1458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31031682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31041682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + + { 0x6738, 0xE178174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + + { 0x6738, 0x20101787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x23051787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6739, 0x67391002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, { 0x6739, 0x21F81458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + + { 0x6739, 0x24411462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + + { 0x6739, 0xE177174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, { 0x6740, 0x1657103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, @@ -562,11 +580,24 @@ { 0x6741, 0x05131025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, { 0x6741, 0x1646103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6750M", kNull }, + + { 0x6758, 0x67581002, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x22051458, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + + { 0x6758, 0x31811682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x31831682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + + { 0x6758, 0xE1941746, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6759, 0xE193174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kNull }, { 0x6760, 0x1CB21043, CHIP_FAMILY_RV730, "AMD Radeon HD 6470M", kNull }, + + { 0x6779, 0x64501092, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0xE164174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + /* 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 }, @@ -657,11 +688,13 @@ { 0x6740, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6700M Series", kNull }, { 0x6741, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600M/6700M Series", kNull }, - { 0x6758, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670 Series", kNull }, + { 0x6758, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670 Series", kBulrushes }, { 0x6759, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6500 Series", kNull }, + { 0x6760, 0x00000000, CHIP_FAMILY_RV730, "AMD Radeon HD 6470M", kNull }, + { 0x6770, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400 Series", kNull }, - { 0x6779, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450 Series", kNull }, + { 0x6779, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450 Series", kBulrushes }, { 0x0000, 0x00000000, CHIP_FAMILY_UNKNOW, NULL, kNull } }; @@ -1320,25 +1353,27 @@ { // use the device fb key on radeon_cards, to retrive the default name from card_configs. card->cfg_name = card_configs[card->info->cfg_name].name; - // and leave ports alone! -// card->ports = card_configs[card->info->cfg_name].ports; + // Uncommented the following line and added verbose for debugging AtiPorts issues on some cards + card->ports = card_configs[card->info->cfg_name].ports; + // Report number of ports card reports + verbose("Card reported ports: %d\n", card->ports); // which means one of the fb's or kNull - verbose("Framebuffer set to device's default: %s\n", card->cfg_name); + verbose("Framebuffer set to: %s using device's default.\n", card->cfg_name); } else { // else, use the fb name returned by AtiConfig. - verbose("(AtiConfig) Framebuffer set to: %s\n", card->cfg_name); + verbose("Framebuffer set to: %s using AtiConfig=%s\n", card->cfg_name, card->cfg_name); } - + // Check AtiPorts key for nr of ports, card->ports = getIntForKey(kAtiPorts, &n_ports, &bootInfo->chameleonConfig); // if a value bigger than 0 ?? is found, (do we need >= 0 ?? that's null FB on card_configs) if (n_ports > 0) { card->ports = n_ports; // use it. - verbose("(AtiPorts) Nr of ports set to: %d\n", card->ports); + verbose("Number of ports set to: %d using AtiPorts=%d\n", card->ports, card->ports); } else// if (card->cfg_name > 0) // do we want 0 ports if fb is kNull or mistyped ? { @@ -1347,7 +1382,7 @@ if (strcmp(card->cfg_name, card_configs[i].name) == 0) card->ports = card_configs[i].ports; // default - verbose("Nr of ports set to framebuffer's default: %d\n", card->ports); + verbose("Number of ports set to: %d using framebuffer's default.\n", card->ports); } // else // card->ports = 2/1 ?; // set a min if 0 ports ? Index: branches/Chimera/i386/libsaio/fake_efi.c =================================================================== --- branches/Chimera/i386/libsaio/fake_efi.c (revision 1522) +++ branches/Chimera/i386/libsaio/fake_efi.c (revision 1523) @@ -73,7 +73,7 @@ */ /* Identify ourselves as the EFI firmware vendor */ -static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','0', 0}; +static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','i','m','e','r','a','_','1','.','5', 0}; static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */ /* Default platform system_id (fix by IntVar) */ @@ -434,6 +434,10 @@ static const char const SYSTEM_TYPE_PROP[] = "system-type"; static const char const MODEL_PROP[] = "Model"; static const char const BOARDID_PROP[] = "board-id"; +// Facetime fix from olegpronin @ insanelymac +// Breaks booting from RAID +static const char const BOOT_UUID_PROP[] = "boot-uuid"; +static char uuidStr[64]; /* * Get an smbios option string option to convert to EFI_CHAR16 string @@ -602,6 +606,21 @@ // Fill /efi/device-properties node. setupDeviceProperties(node); + + // Facetime fix from olegpronin @ insanelymac + // Thanks to Lnx2Mac for the idea of using the key SkipFTFix=Yes as a temporary work around for this breaking RAID booting + bool skipFTFix=false; + getBoolForKey(kSkipFTFix, &skipFTFix, &bootInfo->chameleonConfig); + if (!skipFTFix) { + //Facetime temp fix start + Node *ChoosenNode; + if (gBootVolume->fs_getuuid && gBootVolume->fs_getuuid (gBootVolume, uuidStr) == 0) + { + ChoosenNode = DT__FindNode("/chosen", false); + DT__AddProperty(ChoosenNode, BOOT_UUID_PROP, 64, uuidStr); + } + //Facetime fix end + } } /* Index: branches/Chimera/i386/boot2/prompt.c =================================================================== --- branches/Chimera/i386/boot2/prompt.c (revision 1522) +++ branches/Chimera/i386/boot2/prompt.c (revision 1523) @@ -28,7 +28,7 @@ #include -char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chameleon v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n" +char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v1.5.4 r1394" "\n" "Build date: " I386BOOT_BUILDDATE "\n" "%dMB memory\n"; Index: branches/Chimera/i386/boot2/boot.h =================================================================== --- branches/Chimera/i386/boot2/boot.h (revision 1522) +++ branches/Chimera/i386/boot2/boot.h (revision 1523) @@ -101,6 +101,7 @@ #define kSMBIOSdefaults "SMBIOSdefaults" /* smbios_patcher.c */ #define kSystemID "SystemId" /* fake_efi.c */ #define kSystemType "SystemType" /* fake_efi.c */ +#define kSkipFTFix "SkipFTFix" /* fake_efi.c */ //For Work around to bypass olegpronin's Facetime fix #define kUseMemDetect "UseMemDetect" /* platform.c */