Chameleon > Patches

Resolution module patch for Core processors

(1/4) > >>

dmazar:
Resolution module needs access to DRAM controller to unlock/lock video bios shadow area. Support for that stuck at Series 4 chipsets and older.

Intel moved DRAM controller to processor on newer systems (Core processors 1st, 2nd, 3rd gen), but it is still present on Pci bus 0, device 0, function 0 like before. PAM registers that control read/write permissions are still there, have the same function and work in the same way as before. They are just moved to different addresses: PAM0 - PAM6 are now at 80h - 86h.

Here is that patch (compiled bins included) for that + some minor fixes and verbose output (accessible with "bdmesg" from OSX).

Works fine on my Core i5-2300 and ATI 5670.

ErmaC:
Thx dmazar.
I merge it into my branch.

Fabio

dmazar:
Just a note: I've written that this code supports Core 1st gen procs (core iX NNN), but this is not true. Added support is only for Sandy and Ivy Bridge. Will try to post solution for 1st gen procs when it proves to be working from Clover users.

And some explanation for new users ... to have it in one place:

- put Resolution.dylib to your Chameleon /Extra/Modules/ folder (create folder Modules if does not exists in Extra)
- restart into Chameleon and list available video resolutions (from menu or type "?video" at boot prompt)
- check if that added native monitor resolution to the list
- if no - well, it does not work. you can boot to OSX and check Chameleon's log with "bdmesg"

- if yes, then try to use new resolution:

/Extra/org.chameleon.Boot.plist - add your resolution
<key>Graphics Mode</key>
<string>1920x1080x32</string> (change to your numbers)

/Extra/Themes/<your theme>/theme.plist: change screen_width, screen_height, boot_width and boot_height to new resolution, and eventually edit devices_max_visible to bigger number to make device menu selection wider if needed

orlian:
I added a simple patch to add support for Core 1st Gen processor:


--- Code: --- case 0x00468086:
type = CT_HD;
            verbose("HD Graphics.\n");
break;

--- End code ---
It detects the graphics card, finds the vbios, finds the mode table, detects 37 entries, but does not interpret any modes.  The vbios dump for both Intel HD Graphics and Sandy Bridge Graphics have very similar mode tables, and obviously the SandyBridge mode tables are being interpreted properly for you. 

Intel HD Graphics VBIOS (first 0x300):

--- Code: ---55 AA 05 00 80 E9 74 EC 30 30 30 30 30 30 30 30 30 30 30 30 D0 22 E9 E9 21 19 40 00 A0 0A 30 30 49 42 4D 20 56 47 41 20 43 6F 6D 70 61 74 69 62 6C 65 20 42 49 4F 53 2E 20 03 5A 00 6A 00 78 00 8B C0 50 43 49 52 86 80 46 00 00 00 18 00 00 00 00 03 80 00 00 00 00 80 00 00 5A 03 00 C0 00 00 00 00 00 00 00 00 00 00 00 00 74 00 00 C0 00 00 00 00 00 00 00 00 1A 00 23 03 00 C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 44 48 F0 04 00 00 03 44 48 F0 04 00 02 0C 44 48 F0 04 00 04 30 44 48 F0 04 00 06 C0 44 49 F0 04 00 00 03 44 49 F0 04 00 02 0C 44 4A F0 04 00 02 0C 44 4A F0 04 00 04 30 44 4A F0 04 00 06 C0 44 49 F0 04 00 04 30 44 49 F0 04 00 06 C0 44 4A F0 04 00 00 03 44 4B F0 04 00 00 03 44 4B F0 04 00 02 0C 44 4B F0 04 00 04 30 04 4C F0 04 00 00 03 04 4C F0 04 00 02 0C 04 4C F0 04 00 04 30 04 4C F0 04 00 06 C0 04 4D F0 04 00 00 03 04 4D F0 04 00 02 0C 30 08 30 02 03 32 08 54 02 06 34 08 78 02 09 38 08 9C 02 0F 3A 08 C0 02 12 3C 08 D2 02 15 41 10 30 02 04 43 10 54 02 07 45 10 78 02 0A 49 10 9C 02 10 4B 10 C0 02 13 4D 10 D2 02 16 50 20 30 02 05 52 20 54 02 08 54 20 78 02 0B 58 20 9C 02 11 5A 20 C0 02 14 5C 20 D2 02 17 60 08 B5 11 00 61 10 B5 11 00 62 20 B5 11 00 63 08 CF 11 00 64 10 CF 11 00 65 20 CF 11 00 66 08 E9 11 00 67 10 E9 11 00 68 20 E9 11 00 69 08 03 12 00 6A 10 03 12 00 6B 20 03 12 00 6C 08 1D 12 00 6D 10 1D 12 00 6E 20 1D 12 00 6F 08 37 12 00 70 10 37 12 00 71 20 37 12 00 7D 08 78 02 00 7E 10 78 02 00 7F 20 78 02 00 FF D6 09 80 A0 20 E0 2D 10 10 60 A2 00 00 00 00 00 00 18 10 0B D0 B4 20 90 31 10 12 6C D2 00 00 00 00 00 00 1C 01 1D 00 72 51 D0 1E 20 6E 28 55 00 C4 8E 21 00 00 1E D6 09 80 90 20 E0 1D 10 08 60 22 00 00 00 00 08 08 18 B6 0D 80 C8 20 E0 14 10 10 40 13 00 00 00 00 00 00 18 A0 0F 20 00 31 58 1C 20 28 80 14 00 00 00 00 00 00 1E 56 13 20 00 31 58 19 20 10 50 13 00 00 00 00 00 00 1E 64 19 00 40 41 00 26 30 18 88 36 00 00 00 00 00 00 18 C3 1E 00 20 41 00 20 30 10 60 13 00 00 00 00 00 00 1E 30 2A 00 98 51 00 2A 40 30 70 13 00 00 00 00 00 00 1E BC 34 00 98 51 00 2A 40 10 90 13 00 00 00 00 00 00 1E 48 3F 40 30 62 B0 32 40 40 C0 13 00 00 00 00 00 00 1E 68 5B 80 A8 72 A0 3C 50 80 D0 13 00 00 00 00 00 00 1C FE FF CE 10 00 11 00 FB FF 00 45 F0 04 00 00 08 FF FF FE FF C4 01 01 02 0F 03 00 04 0E FE FF CE 00 00 01 00 03 84 03 00 04 00 05 00 06 05 07 0F 10 01 11 00 FB FF 00 45 F0 04 00 00 08 FF FF 0C 01 08 00 00 00 00 01 00 02 02 01 00 04 04 01 00 05 02 05 00 08 01 08 00 07 02
--- End code ---
Sandy Bridge Graphics VBIOS (first 0x300):

--- Code: ---55 AA 72 E9 68 DA 30 30 30 30 30 30 30 30 30 30 30 30 1F 23 E9 31 22 4F 40 00 C0 0A 30 30 49 42 4D 20 56 47 41 20 43 6F 6D 70 61 74 69 62 6C 65 20 42 49 4F 53 2E 20 03 74 00 84 00 92 00 8B C0 50 43 49 52 86 80 02 01 1C 00 1C 00 03 00 00 03 80 00 00 00 00 80 80 00 00 00 00 00 02 01 12 01 22 01 0A 01 52 01 5A 01 62 01 6A 01 72 01 82 01 00 00 74 03 00 C0 00 00 00 00 00 00 00 00 00 00 00 00 8E 00 00 C0 00 00 00 00 00 00 00 00 1A 00 3D 03 00 C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 44 48 F0 04 00 00 03 44 48 F0 04 00 02 0C 44 48 F0 04 00 04 30 44 48 F0 04 00 06 C0 44 49 F0 04 00 00 03 44 49 F0 04 00 02 0C 44 4A F0 04 00 02 0C 44 4A F0 04 00 04 30 44 4A F0 04 00 06 C0 44 49 F0 04 00 04 30 44 49 F0 04 00 06 C0 44 4A F0 04 00 00 03 44 4B F0 04 00 00 03 44 4B F0 04 00 02 0C 44 4B F0 04 00 04 30 04 4C F0 04 00 00 03 04 4C F0 04 00 02 0C 04 4C F0 04 00 04 30 04 4C F0 04 00 06 C0 04 4D F0 04 00 00 03 04 4D F0 04 00 02 0C 30 08 4A 02 03 32 08 6E 02 06 34 08 92 02 09 38 08 B6 02 0F 3A 08 DA 02 12 3C 08 EC 02 15 41 10 4A 02 04 43 10 6E 02 07 45 10 92 02 0A 49 10 B6 02 10 4B 10 DA 02 13 4D 10 EC 02 16 50 20 4A 02 05 52 20 6E 02 08 54 20 92 02 0B 58 20 B6 02 11 5A 20 DA 02 14 5C 20 EC 02 17 60 08 35 11 00 61 10 35 11 00 62 20 35 11 00 63 08 4F 11 00 64 10 4F 11 00 65 20 4F 11 00 66 08 69 11 00 67 10 69 11 00 68 20 69 11 00 69 08 83 11 00 6A 10 83 11 00 6B 20 83 11 00 6C 08 9D 11 00 6D 10 9D 11 00 6E 20 9D 11 00 6F 08 B7 11 00 70 10 B7 11 00 71 20 B7 11 00 7D 08 92 02 00 7E 10 92 02 00 7F 20 92 02 00 FF D6 09 80 A0 20 E0 2D 10 10 60 A2 00 00 00 00 00 00 18 10 0B D0 B4 20 90 31 10 12 6C D2 00 00 00 00 00 00 1C 01 1D 00 72 51 D0 1E 20 6E 28 55 00 C4 8E 21 00 00 1E D6 09 80 90 20 E0 1D 10 08 60 22 00 00 00 00 08 08 18 B6 0D 80 C8 20 E0 14 10 10 40 13 00 00 00 00 00 00 18 A0 0F 20 00 31 58 1C 20 28 80 14 00 00 00 00 00 00 1E 56 13 20 00 31 58 19 20 10 50 13 00 00 00 00 00 00 1E 64 19 00 40 41 00 26 30 18 88 36 00 00 00 00 00 00 18 C3 1E 00 20 41 00 20 30 10 60 13 00 00 00 00 00 00 1E 30 2A 00 98 51 00 2A 40 30 70 13 00 00 00 00 00 00 1E BC 34 00 98 51 00 2A 40 10 90 13 00 00 00 00 00 00 1E 48 3F 40 30 62 B0 32 40 40 C0 13 00 00 00 00 00 00 1E 68 5B 80 A8 72 A0 3C 50 80 D0 13 00 00 00 00 00 00 1C FE FF CE 10 00 11 00 FB FF 00 45 F0 04 00 00 08 FF FF FE FF C4 01 01 02 0F 03 00 04 0E FE FF CE 00 00 01 00 02 00 03 00 04 00 05 00 06 05 07 0F 10 01 11 00 FB FF 00 45 F0 04 00 00 08 FF FF 0C 01 08
--- End code ---

@dmazar Do you have any hints on interpreting the modes correctly so it can get to the exciting mode insertion part?

dmazar:
Sorry, but I'm not sure that I understand your patch. Here some info how I see it:

There are two issues with this vbios patching:
1. unlock vbios - you must unlock vbios shadow area (0xC.0000 - 0xD.0000) for writing in order to be able to change vbios in RAM
2. patch vbios in RAM - change some existing mode with data suitable for your monitor

I do not know much about point 2, but know something about point 1. Original code was not able to unlock vbios on newer systems. I have added patch to enable that for Sandy and Ivy Bridge procs. First gen. Core procs are a bit more complicated.

We found some solution when doing the same thing in Clover boot manager. We found out that desktop Core i3,5,7 XXX procs (I call them 1st gen) contain System Address Decoder (SAS) PCI device (part of proc), available at Bus ff or 7f or 3f, Device 0, Func 1, and that SAS device contains PAM registers at 40h-46h for unlocking legacy shadowed areas.

Code for that is attached, but warning: this code is not tested. Compiles fine, but I do not have such proc and can not test if it works from Chameleon.

Includes also solution for LGA-2011 socket procs, where SAS is at Bus X, Dev 12, Func 6 and PAm regs are also at  40h-46h. And X for bus can be found by reading Bus 0, Dev 5, Func 0, reg CPUBUSNO at 108h, bits 15:8.

Regarding mobile Core 1st gen procs - I could not find in their documentation how to access those PAM registers for unlocking vbios, so this thing is unknown.

Anyway, this attached Resolution module should print some debug which can be accessed later from OSX with bdmesg. Like this:

--- Code: ---Resolution:
 Parse Edid: descriptor block 0 is timing descriptor Best mode: 1920x1080x32
 core proc 2nd, 3rd gen identified
 Detected chipset/proc id (DRAM controller): 01008086
 VBios: ATI, BT_ATI_2
 vbios unlocked
 Patching: BT_ATI_2 Parse Edid: descriptor block 0 is timing descriptor
 Edid detailed timing descriptor found: 1920x1080
 vbios mode 0 patched!

--- End code ---
It will test if vbios is really unlocked by trying to change it and will print "vbios unlocked" if this part is done.

That's the best I can do. I can help with this point 1. unlock vbios, but can not help with point 2.

Navigation

[0] Message Index

[#] Next page

Go to full version