Index: branches/Chimera/.config =================================================================== --- branches/Chimera/.config (revision 2263) +++ branches/Chimera/.config (revision 2264) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Chameleon Configuration -# Wed Aug 7 21:43:55 2013 +# Fri Aug 9 19:56:27 2013 # CONFIG_OPTIMIZATION_LEVEL="-Oz" CONFIG_BDMESG=y @@ -22,7 +22,8 @@ # Modules # # CONFIG_RESOLUTION_MODULE is not set -# CONFIG_KLIBC_MODULE is not set +CONFIG_KLIBC_MODULE=y +# CONFIG_UCLIBCXX_MODULE is not set # CONFIG_SATA_MODULE is not set CONFIG_KEYLAYOUT_MODULE=m # CONFIG_ACPICODEC_MODULE is not set Index: branches/Chimera/version =================================================================== --- branches/Chimera/version (revision 2263) +++ branches/Chimera/version (revision 2264) @@ -1 +1 @@ -2.1.2 +2.2.0 Index: branches/Chimera/autoconf.inc =================================================================== --- branches/Chimera/autoconf.inc (revision 2263) +++ branches/Chimera/autoconf.inc (revision 2264) @@ -1,11 +1,12 @@ ; ; Automatically generated make config: don't edit ; Chameleon Configuration -; Wed Aug 7 21:43:55 2013 +; Fri Aug 9 19:56:27 2013 ; +CONFIG_UCLIBCXX_MODULE EQU 0 CONFIG_BOOT1_HFS_DEBUG EQU 0 CONFIG_SATA_MODULE EQU 0 -CONFIG_KLIBC_MODULE EQU 0 +CONFIG_KLIBC_MODULE EQU 1 CONFIG_BOOT0_DEBUG EQU 0 CONFIG_OPENUP EQU 0 CONFIG_BOOT1_HFS_VERBOSE EQU 1 Index: branches/Chimera/i386/libsaio/gma.c =================================================================== --- branches/Chimera/i386/libsaio/gma.c (revision 2263) +++ branches/Chimera/i386/libsaio/gma.c (revision 2264) @@ -14,6 +14,7 @@ #include "gma.h" #include "vbe.h" #include "graphics.h" +#include "stdio.h" #ifndef DEBUG_GMA #define DEBUG_GMA 0 @@ -96,13 +97,13 @@ 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 }; -// The following values came from a Sandy Bridge MacBook Air +// MacMan: 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 +//MacMan: 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 @@ -139,6 +140,10 @@ { 0x80860156, "Intel HD Graphics 2500 Mobile" }, { 0x80860162, "Intel HD Graphics 4000" }, { 0x80860166, "Intel HD Graphics 4000 Mobile" }, + { 0x80860412, "Intel HD Graphics 4600" }, // MacMan + { 0x80860416, "Intel HD Graphics 4600 Mobile" }, // MacMan + { 0x80860422, "Intel HD Graphics 5000" }, // MacMan + { 0x80860426, "Intel HD Graphics 5000 Mobile" }, // MacMan }; char *get_gma_model(uint32_t id) { @@ -154,7 +159,9 @@ bool setup_gma_devprop(pci_dt_t *gma_dev) { - char *devicepath; + int len; + const char *value; + char *devicepath; volatile uint8_t *regs; uint32_t bar[7]; char *model; @@ -163,8 +170,15 @@ uint8_t ClassFix[4] = { 0x00, 0x00, 0x03, 0x00 }; uint8_t hd3k_device_id[4] = { 0x26, 0x01, 0x00, 0x00 }; uint8_t hd4k_device_id[4] = { 0x66, 0x01, 0x00, 0x00 }; - uint8_t ig_id[4] = { 0x0A, 0x00, 0x66, 0x01 }; - uint8_t ig_id_mobile[4] = { 0x09, 0x00, 0x66, 0x01 }; + uint8_t hd4600_device_id[4] = { 0x12, 0x04, 0x00, 0x00 }; // MacMan + uint8_t hd5k_device_id[4] = { 0x16, 0x04, 0x00, 0x00 }; // MacMan + uint8_t snb_id_3k[4] = { 0x10, 0x00, 0x03, 0x00 }; + uint8_t ig_id_2500[4] = { 0x0B, 0x00, 0x66, 0x01 }; // MacMan + uint8_t ig_id_4k[4] = { 0x0A, 0x00, 0x66, 0x01 }; + uint8_t ig_id_4k_mobile[4] = { 0x09, 0x00, 0x66, 0x01 }; // MacMan + uint8_t ig_id_4600[4] = { 0x00, 0x00, 0x16, 0x04 }; // MacMan + uint8_t ig_id_5k[4] = { 0x00, 0x00, 0x26, 0x04 }; // MacMan + uint8_t ig_platform_id[4] = { 0x00, 0x00, 0x00, 0x00 }; // MacMan devicepath = get_pci_dev_path(gma_dev); @@ -240,6 +254,12 @@ 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); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4); + verbose("Setting %s for snb-platform-id\n", value); + } } else if (model == (char *)&"Intel HD Graphics 2000 Mobile") { @@ -261,6 +281,12 @@ devprop_add_value(device, "AAPL00,T7", HD2000_vals[7], 4); devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4); + verbose("Setting %s for snb-platform-id\n", value); + } } else if (model == (char *)&"Intel HD Graphics 3000") { @@ -270,6 +296,16 @@ 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); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4); + verbose("Using %s for snb-platform-id\n", value); + } + else + { + devprop_add_value(device, "AAPL,snb-platform-id", snb_id_3k, 4); + } } else if (model == (char *)&"Intel HD Graphics 3000 Mobile") { @@ -291,23 +327,98 @@ devprop_add_value(device, "AAPL00,T7", HD3000_vals[7], 4); devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,snb-platform-id", ig_platform_id, 4); + verbose("Setting %s for snb-platform-id\n", value); + } } + else if (model == (char *)&"Intel HD Graphics 2500") // MacMan + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd4k_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4); + verbose("Using %s for ig-platform-id\n", value); + } + else + { + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_2500, 4); + } + } else if (model == (char *)&"Intel HD Graphics 4000") { devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); devprop_add_value(device, "device-id", hd4k_device_id, 4); devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); - devprop_add_value(device, "AAPL,ig-platform-id", ig_id, 4); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4); + verbose("Using %s for ig-platform-id\n", value); + } + else + { + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4k, 4); + } } else if (model == (char *)&"Intel HD Graphics 4000 Mobile") { devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); - devprop_add_value(device, "AAPL,ig-platform-id", ig_id_mobile, 4); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) // MacMan + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4); + verbose("Using %s for ig-platform-id\n", value); + } + else + { + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4k_mobile, 4); + } } - + else if (model == (char *)&"Intel HD Graphics 4600") //MacMan + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd4600_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4); + verbose("Using %s for ig-platform-id\n", value); + } + else + { + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_4600, 4); + } + } + else if (model == (char *)&"Intel HD Graphics 5000") //MacMan + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd5k_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + if (getValueForKey(kIGPlatformID, &value, &len, &bootInfo->chameleonConfig)) + { + sscanf(value, "%8x", ig_platform_id); + devprop_add_value(device, "AAPL,ig-platform-id", ig_platform_id, 4); + verbose("Using %s for ig-platform-id\n", value); + } + else + { + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_5k, 4); + } + } + stringdata = malloc(sizeof(uint8_t) * string->length); if (!stringdata) { Index: branches/Chimera/i386/libsaio/cpu.c =================================================================== --- branches/Chimera/i386/libsaio/cpu.c (revision 2263) +++ branches/Chimera/i386/libsaio/cpu.c (revision 2264) @@ -286,7 +286,7 @@ p->CPU.Model != CPU_MODEL_ATOM // MSR is *NOT* available on the Intel Atom CPU ) { - msr = rdmsr64(MSR_CORE_THREAD_COUNT); // Undocumented MSR in Nehalem and newer CPUs + msr = rdmsr64(MSR_CORE_THREAD_COUNT); // MacMan: Undocumented MSR in Nehalem and newer CPUs p->CPU.NoCores = bitfield((uint32_t)msr, 31, 16); // Using undocumented MSR to get actual values p->CPU.NoThreads = bitfield((uint32_t)msr, 15, 0); // Using undocumented MSR to get actual values } @@ -389,7 +389,7 @@ msr = rdmsr64(MSR_PLATFORM_INFO); // DBG("msr(%d): platform_info %08x\n", __LINE__, bitfield(msr, 31, 0)); bus_ratio_max = bitfield(msr, 15, 8); //MacMan: Changed bitfield to match Apple tsc.c - bus_ratio_min = bitfield(msr, 47, 40); //MacMan: Changed bitfield to match Apple tsc.c + bus_ratio_min = bitfield(msr, 47, 40); //MacMan: Changed bitfield to match Apple tsc.c msr = rdmsr64(MSR_FLEX_RATIO); // DBG("msr(%d): flex_ratio %08x\n", __LINE__, bitfield(msr, 31, 0)); if (bitfield(msr, 16, 16)) { @@ -461,7 +461,7 @@ } else { msr = rdmsr64(MSR_IA32_PERF_STATUS); DBG("msr(%d): ia32_perf_stat 0x%08x\n", __LINE__, bitfield(msr, 31, 0)); - currcoef = bitfield(msr, 12, 8); + currcoef = bitfield(msr, 15, 8); //MacMan: Fixed bitfield to Intel documentation /* Non-integer bus ratio for the max-multi*/ maxdiv = bitfield(msr, 46, 46); /* Non-integer bus ratio for the current-multi (undocumented)*/ Index: branches/Chimera/i386/libsaio/pci_setup.c =================================================================== --- branches/Chimera/i386/libsaio/pci_setup.c (revision 2263) +++ branches/Chimera/i386/libsaio/pci_setup.c (revision 2264) @@ -17,13 +17,14 @@ void setup_pci_devs(pci_dt_t *pci_dt) { char *devicepath; - bool do_eth_devprop, do_gfx_devprop, do_enable_hpet; + bool do_eth_devprop, do_gfx_devprop, do_enable_hpet, do_igp_devprop; pci_dt_t *current = pci_dt; do_eth_devprop = do_gfx_devprop = do_enable_hpet = false; getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->chameleonConfig); getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->chameleonConfig); + getBoolForKey(kIGPEnabler, &do_igp_devprop, &bootInfo->chameleonConfig); getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->chameleonConfig); while (current) @@ -43,7 +44,7 @@ break; case PCI_CLASS_DISPLAY_VGA: - if (do_gfx_devprop) + if (do_gfx_devprop){ switch (current->vendor_id) { case PCI_VENDOR_ID_ATI: @@ -59,6 +60,10 @@ break; } break; + } else if (do_igp_devprop){ + setup_gma_devprop(current); + break; + } case PCI_CLASS_SERIAL_USB: notify_usb_dev(current); Index: branches/Chimera/i386/boot2/boot.h =================================================================== --- branches/Chimera/i386/boot2/boot.h (revision 2263) +++ branches/Chimera/i386/boot2/boot.h (revision 2264) @@ -112,6 +112,8 @@ #define kAtiPorts "AtiPorts" /* ati.c */ #define kATYbinimage "ATYbinimage" /* ati.c */ +#define kIGPlatformID "IGPlatformID" /* gma.c */ // MacMan + #define kUseNvidiaROM "UseNvidiaROM" /* nvidia.c */ #define kVBIOS "VBIOS" /* nvidia.c */ #define kDcfg0 "display_0" /* nvidia.c */ @@ -119,6 +121,7 @@ #define kEthernetBuiltIn "EthernetBuiltIn" /* pci_setup.c */ #define kGraphicsEnabler "GraphicsEnabler" /* pci_setup.c */ +#define kIGPEnabler "IGPEnabler" /* pci_setup.c */ // MacMan #define kEnableHDMIAudio "EnableHDMIAudio" /*ati.c && nvidia.c */ #define kForceHPET "ForceHPET" /* pci_setup.c */ Index: branches/Chimera/i386/modules/klibc/Makefile =================================================================== --- branches/Chimera/i386/modules/klibc/Makefile (revision 2263) +++ branches/Chimera/i386/modules/klibc/Makefile (revision 2264) @@ -1,5 +1,5 @@ MODULE_NAME = klibc -MODULE_DESCRIPTION = This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. This is currently only used by the uClibc++ library. +MODULE_DESCRIPTION = Provides a standard c library to link to if the library provided by Chameleon is insufficient. MODULE_AUTHOR = MODULE_VERSION = "1.5.20" MODULE_COMPAT_VERSION = "1.5.20" Index: branches/Chimera/auto.conf =================================================================== --- branches/Chimera/auto.conf (revision 2263) +++ branches/Chimera/auto.conf (revision 2264) @@ -1,8 +1,9 @@ # # Automatically generated make config: don't edit # Chameleon Configuration -# Wed Aug 7 21:43:55 2013 +# Fri Aug 9 19:56:27 2013 # +CONFIG_KLIBC_MODULE=y CONFIG_BOOT1_HFS_VERBOSE=y CONFIG_BOOT1_HFS=y CONFIG_MODULES=y Index: branches/Chimera/autoconf.h =================================================================== --- branches/Chimera/autoconf.h (revision 2263) +++ branches/Chimera/autoconf.h (revision 2264) @@ -1,10 +1,11 @@ // // Automatically generated make config: don't edit // Chameleon Configuration -// Wed Aug 7 21:43:55 2013 +// Fri Aug 9 19:56:27 2013 // #define CONFIG_IS_BUILTIN 1 #define CONFIG_IS_MODULE 2 +#define CONFIG_KLIBC_MODULE CONFIG_IS_BUILTIN #define CONFIG_BOOT1_HFS_VERBOSE CONFIG_IS_BUILTIN #define CONFIG_BOOT1_HFS CONFIG_IS_BUILTIN #define CONFIG_MODULES CONFIG_IS_BUILTIN Index: branches/Chimera/doc/BootHelp.txt =================================================================== --- branches/Chimera/doc/BootHelp.txt (revision 2263) +++ branches/Chimera/doc/BootHelp.txt (revision 2264) @@ -85,7 +85,8 @@ VBIOS=Yes|No Inject NVIDIA VBIOS into device-properties. display_0= Inject alternate value of display-cfg into NVDA,Display-A@0 (HEX). display_1= Inject alternate value of display-cfg into NVDA,Display-B@1 (HEX). - EnableHDMIAudio=Yes Inject HDMI audio for NVIDIA + IGPlatformID= Override or set Intel HD Graphics Platform ID + IGPEnabler=Yes|No Automatic device-properties generation for Intel IGP when GraphicsEnabler=No EthernetBuiltIn=Yes|No Automatic "built-in"=yes device-properties generation for ethernet interfaces. Index: branches/Chimera/CHANGES =================================================================== --- branches/Chimera/CHANGES (revision 2263) +++ branches/Chimera/CHANGES (revision 2264) @@ -1,3 +1,7 @@ +-macman: Chimera 2.2.0 specific changes: + Added suport for Intel HD Graphics 2500, Intel HD Graphics 4600, Intel HD Graphics 4600 Mobile and Intel HD Graphics 5000 + Added new boot key IGPEnabler=Yes|No for automatic device-properties generation for Intel IGP when GraphicsEnabler=No + Added new boot key IGPlatformID= to allow for overriding or setting Intel HD Graphics Platform ID -macman: Chimera 2.1.2 specific changes: Removed all closed source modules -macman: Chimera 2.1.i specific changes: