Jump to content

Clover test and patches for Polaris GPU


fantomas
279 posts in this topic

Recommended Posts

My CSM is always enabled (cause OS is set to Other OS instead of Windows 8).

I tried to boot with a Clover Stick made for Legacy BIOS:

On Recovery HD absolutely nothing changed.

On normal macOS HD the fans slow down at the point the driver will load. I see the well known coloured dots.

 

I found another interesting BIOS setting: With Fast Boot enabled, I can set the VGA mode to EFI and Auto. On Auto it says: It will load only Legacy OpROM for Legacy OS (no Logo will be shown), but it will still load EFI driver for EFI OS. I played a while with that setting, but it seems not really to work because I always see the Gigabyte Logo. It does not change anything in macOS, I still see the dots, also with Full Screen LOGO Show disabled.

Link to comment
Share on other sites

In my system, if I don't turn off CSM(disable legacy boot) I won't be able to reach recovery mode, also with CSM off these dots gone.

 

Also, with CSM disabled, if I turn off the monitor, count for Clover timer(I have a wait time of 10s), hit enter, then turn on the monitor. I am able to see correct Apple logo and progress bar finished but then goes into a black screen. I am not familiar with layout-id/framebuffer settings, so I am not sure what happened.

 

Since Pavo said he is able to get things working, it may worth to try and find out the exact way to prevent GOP loading using monitor switch and BIOS settings.

 

I am not familiar with your board, but I don't have any OS related settings in my BIOS, I have grub2 efi and clover both worked fine with or w/o CSM.

 

 

 

 

My CSM is always enabled (cause OS is set to Other OS instead of Windows 8).

I tried to boot with a Clover Stick made for Legacy BIOS:

On Recovery HD absolutely nothing changed.

On normal macOS HD the fans slow down at the point the driver will load. I see the well known coloured dots.

 

I found another interesting BIOS setting: With Fast Boot enabled, I can set the VGA mode to EFI and Auto. On Auto it says: It will load only Legacy OpROM for Legacy OS (no Logo will be shown), but it will still load EFI driver for EFI OS. I played a while with that setting, but it seems not really to work because I always see the Gigabyte Logo. It does not change anything in macOS, I still see the dots, also with Full Screen LOGO Show disabled.

Link to comment
Share on other sites

In my system, if I don't turn off CSM(disable legacy boot) I won't be able to reach recovery mode, also with CSM off these dots gone.

 

Also, with CSM disabled, if I turn off the monitor, count for Clover timer(I have a wait time of 10s), hit enter, then turn on the monitor. I am able to see correct Apple logo and progress bar finished but then goes into a black screen. I am not familiar with layout-id/framebuffer settings, so I am not sure what happened.

 

Since Pavo said he is able to get things working, it may worth to try and find out the exact way to prevent GOP loading using monitor switch and BIOS settings.

 

I am not familiar with your board, but I don't have any OS related settings in my BIOS, I have grub2 efi and clover both worked fine with or w/o CSM.

ok first off the way I do it is I use auto boot last booted OS with Clover which will always boot macOS, timeout is only 3 secs and I don't inject Intel or use a ig-platform, since I have iGPU disabled in bios, and you have to make sure your gfx card has UEFI vbios before disabling CSM, if you don't have UEFI vbios and you disable CSM, CSM will re-enable itself just because it doesn't see a UEFI vbios on the gfx card. I turn the "power" off on my monitor only, still DP cable connected, once I think Clover has already started booting macOS I turn the "power" to my monitor back on, by the time it takes my monitor to power back on macOS is on the secondary apple logo and goes to desktop. I have turned my monitor power on before the secondary apple logo before and it didn't work, gave the same 3 dots and black screen like normal. have to make sure that its past that secondary apple logo before turning the power on the monitor back on. I will record this process that I do just so everyone can get a general idea.

Link to comment
Share on other sites

@slice

 

I may need your help again. I know this code snippet in "ati.c" is for collecting the connector-data from FramebufferPatch:

// get connectors from ATIConnectorsPatch
BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier)
{
  UINT8 *ct;
  INTN Len;
  //Connector types:
  //0x10:  VGA
  //0x04:  DL DVI-I
  //0x800: HDMI
  //0x400: DisplayPort
  //0x02:  LVDS
  
  if ((CurrentPatches == NULL) || (CurrentPatches->KPATIConnectorsDataLen == 0)) {
    return FALSE;
  }
  ct = CurrentPatches->KPATIConnectorsPatch;
  Len = Sier?24:16;
  
  val->type = kCst;
  val->size = 4;
  val->data = (UINT8*)&ct[index * Len];
  
  return TRUE;
}

Is it possible to create similar code to collect the ControlFlag-data from FramebufferPatch? I would like to test something here, but not able to code it myself.

Thanx in advance if you could help me with it. <--- or to anyone else, who is able to help.

 

To get it explained of what i need, take a look at my frambuffer-patch:

 

0004 0000 0403 000000010100000000001204060100000000
0004 0000 0403 000000010200000000002205040300000000
0008 0000 0402 000000010300000000001102010200000000
0008 0000 0402 000000010400000000002103050400000000
0400 0000 0004 000000010500000000001000030600000000

 

So all i want to collect are the GREEN marked values.

  • Like 2
Link to comment
Share on other sites

So all i want to collect are the GREEN marked values.

 

My C is rusty, but I think something like

  val->data = (UINT8*)&ct[index * Len + 4];

might do the trick. If I read this correctly the function usually puts the first two bytes (4 hex digits) of a column into val->data, so moving over 4 bytes to the right should do the same for the green values.

Link to comment
Share on other sites

My C is rusty, but I think something like

  val->data = (UINT8*)&ct[index * Len + 4];
might do the trick.

 

Don't forget to set the size:

  val->size = 2;

...the function usually puts the first two bytes (4 hex digits) of a column into val->data, so moving over 4 bytes to the right should do the same for the green values.

I think you mean the get_conntype_val function puts the first 4 bytes (8 hex digits) of a row into val->data. So for your new get_controlflag_val function, skipping the first 4 bytes will get the green values (the next two bytes).
Link to comment
Share on other sites

Back again with some news:

 

first of all thank you to "sdfewfe": your tip was right and doing this: "val->data = (UINT8*)&ct[index * Len + 4];" did exactly was i was looking for.

 

So here is what i have tested the last couple hours:

 

i was taking a look into "ati.c" file to get a conclusion of what might be injected to the driver if you use CLOVERs "injectATI" function, and this is what it looks like:

 

 

 

AtiDevProp ati_devprop_list[] = {
  {FLAGTRUE, FALSE, "@0,AAPL,boot-display",  get_bootdisplay_val, NULVAL    },
  // {FLAGTRUE, FALSE, "@0,ATY,EFIDisplay",  NULL,     STRVAL("TMDSA")   },
  
  //{FLAGTRUE, TRUE, "@0,AAPL,vram-memory",  get_vrammemory_val,  NULVAL    },
  {FLAGTRUE, TRUE, "AAPL00,override-no-connect",  get_edid_val,       NULVAL        },
  {FLAGNOTFAKE, TRUE, "@0,compatible",              get_name_val,       NULVAL    },
  {FLAGTRUE, TRUE, "@0,connector-type",          get_conntype_val,  NULVAL        },
  {FLAGTRUE, TRUE, "@0,device_type",             NULL,     STRVAL("display")   },
  // {FLAGTRUE, FALSE, "@0,display-connect-flags", NULL,    DWRVAL(0)   },
  
  //some set of properties for mobile radeons
  {FLAGMOBILE, FALSE, "@0,display-link-component-bits",  NULL,  DWRVAL(6) },
  {FLAGMOBILE, FALSE, "@0,display-pixel-component-bits", NULL,  DWRVAL(6) },
  {FLAGMOBILE, FALSE, "@0,display-dither-support",       NULL,  DWRVAL(0) },
  {FLAGMOBILE, FALSE, "@0,backlight-control",       NULL,  DWRVAL(1) },
  {FLAGTRUE,   FALSE, "AAPL00,Dither", NULL,  DWRVAL(0) },
  
  
  //  {FLAGTRUE, TRUE, "@0,display-type",          NULL,     STRVAL("NONE")   },
  {FLAGTRUE, TRUE, "@0,name",                    get_name_val,   NULVAL          },
  {FLAGTRUE, TRUE, "@0,VRAM,memsize",   get_vrammemsize_val, NULVAL          },
  //  {FLAGTRUE, TRUE, "@0,ATY,memsize",     get_vrammemsize_val, NULVAL          },
  
  {FLAGTRUE, FALSE, "AAPL,aux-power-connected", NULL,     DWRVAL(1)  },
  {FLAGTRUE, FALSE, "AAPL00,DualLink",          get_dual_link_val,   NULVAL  },
  {FLAGMOBILE, FALSE, "AAPL,HasPanel",          NULL,     DWRVAL(1)   },
  {FLAGMOBILE, FALSE, "AAPL,HasLid",            NULL,     DWRVAL(1)   },
  {FLAGMOBILE, FALSE, "AAPL,backlight-control", NULL,     DWRVAL(1)   },
  {FLAGTRUE, FALSE, "AAPL,overwrite_binimage", get_binimage_owr,  NULVAL    },
  {FLAGTRUE, FALSE, "ATY,bin_image",            get_binimage_val,  NULVAL    },
  {FLAGTRUE, FALSE, "ATY,Copyright", NULL, STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2011") },
  {FLAGTRUE, FALSE, "ATY,EFIVersion", NULL, STRVAL("01.00.3180")                  },
  {FLAGTRUE, FALSE, "ATY,Card#",   get_romrevision_val, NULVAL                },
  //  {FLAGTRUE, FALSE, "ATY,Rom#", NULL, STRVAL("www.amd.com")                  },
  {FLAGNOTFAKE, FALSE, "ATY,VendorID",  NULL,     WRDVAL(0x1002)        },
  {FLAGNOTFAKE, FALSE, "ATY,DeviceID",  get_deviceid_val,  NULVAL                  },
  
  // {FLAGTRUE, FALSE, "ATY,MCLK",     get_mclk_val,   NULVAL       },
  // {FLAGTRUE, FALSE, "ATY,SCLK",     get_sclk_val,   NULVAL       },
  {FLAGTRUE, FALSE, "ATY,RefCLK",    get_refclk_val,   DWRVAL(0x0a8c)  },
  
  {FLAGTRUE, FALSE, "ATY,PlatformInfo",   get_platforminfo_val, NULVAL     },
  {FLAGOLD,  FALSE, "compatible",      get_name_pci_val,     NULVAL       },
  {FLAGTRUE, FALSE, "name",      get_nameparent_val,     NULVAL       },
  {FLAGTRUE, FALSE, "device_type",  get_nameparent_val,     NULVAL       },
  {FLAGTRUE, FALSE, "model",     get_model_val,          STRVAL("ATI Radeon")},
  //  {FLAGTRUE, FALSE, "VRAM,totalsize", get_vramtotalsize_val, NULVAL              },
  
  {FLAGTRUE, FALSE, NULL, NULL, NULVAL}
};

 

 

 

So here you could see that device-id, vendor-id, model, name, connector-type and some other values will be submitted to the driver if you use "injectATI".

After this i rebooted my machine with RX480 as primary only gfx and used "injectATI" with FakeID 0x67EF1002 - cause i use vanilla AMDRadeonX4100.kext

You all know the summary: no screen, it seems like its hanging in verbose mode with the garbled pixels mentioned earlier in this thread by someone else.

But the machine isn't hanging - it just shows no picture on screen. So i connected via SSH from my MacBook and make a dump with "system_profiler" in terminal and got this for the framebuffersection:

    | |   |   | +-o ATY,Berbice@0  <class AtiFbStub, id 0x100000327, registered, matched, active, busy 0 (27 ms), retain 8>
    | |   |   | | | {
    | |   |   | | |   "compatible" = <706369313030322c36376566>
    | |   |   | | |   "IOFBDependentIndex" = 0x0
    | |   |   | | |   "connector-type" = <0004>
    | |   |   | | |   "IOFBDependentID" = 0x1000001ed
    | |   |   | | |   "device_type" = "display"
    | |   |   | | |   "name" = "ATY,Berbice"
    | |   |   | | | }

These are not all entrys, just the relevant ones. Than i switched on IGPU as primary, RX480 as secondary, CSM enabled in BIOS and rebooted. Again with injectATI enabled and FakeID 0x67EF1002 to get full accelaration.

Again connected via SSH from Macbook and "system_profiler" via terminal. This time i got this for the frambuffersection:

    | |   |   | +-o ATY,Berbice@0  <class AtiFbStub, id 0x10000038c, registered, matched, active, busy 0 (33 ms), retain 8>
    | |   |   | | | {
    | |   |   | | |   "display-type" = "LCD"
    | |   |   | | |   "compatible" = <706369313030322c36376566>
    | |   |   | | |   "connector-type" = 0x400
    | |   |   | | |   "ATY,ActiveFlags" = 0x100
    | |   |   | | |   "IOFBDependentIndex" = 0x0
    | |   |   | | |   "audio-codec-info" = <00010b00>
    | |   |   | | |   "dpcd-post-training" = <770001002200>
    | |   |   | | |   "IOFBDependentID" = 0x1000001ee
    | |   |   | | |   "ATY,ControlFlags" = 0x304
    | |   |   | | |   "device_type" = "display"
    | |   |   | | |   "AAPL,gray-page" = <01000000>
    | |   |   | | |   "av-signal-type" = <10000000>
    | |   |   | | |   "AAPL,gray-value" = <00000000>
    | |   |   | | |   "display-connect-flags" = <00000000>
    | |   |   | | |   "name" = "ATY,Berbice"
    | |   |   | | |   "port-number" = 0x0
    | |   |   | | | }

As you can see, a few more entries, but this is NOT the relevant part. More interesting for me was, that this time we have entries for "connector-type" and "ATY-ControlFlags" - and not only this. As you may notice, their values this time are as integer "0x400" and "0x304"a nd not as data like above for the connector-type = <0004>

 

As you may know i was asking how to get a routine for the connectors-flag as we already have for the connctors-type, and i was getting a hint on how to do it. So now i am able to set also values for the connector-flags, which than looks like this:

    | |   |   | +-o ATY,Berbice@0  <class AtiFbStub, id 0x100000327, registered, matched, active, busy 0 (27 ms), retain 8>
    | |   |   | | | {
    | |   |   | | |   "compatible" = <706369313030322c36376566>
    | |   |   | | |   "IOFBDependentIndex" = 0x0
    | |   |   | | |   "connector-type" = <0004>
    | |   |   | | |   "ATY,ControlFlags" = <0403>
    | |   |   | | |   "IOFBDependentID" = 0x1000001ed
    | |   |   | | |   "device_type" = "display"
    | |   |   | | |   "name" = "ATY,Berbice"
    | |   |   | | | }

Than i was asking myself, if we don't get a screenoutput when RX480 is main and only gfx, cause the values for connector-type and connector-flag are of type "data" instead of type "integer"?

And also: how to change the code to make them given as integer?

 

Then i did the following test: what kind of values will be given to the driver, if we boot with RX480 as primary and only gfx, CSM disabled and also set "injectATI" within CLOVER to disabled?

Did this and noticed after SSH connection and "system_profiler" dump via terminal i got this for frambuffersection:

    | |   |   | +-o ATY,AMD,RadeonFramebuffer@0  <class AtiFbStub, id 0x100000327, registered, matched, active, busy 0 (38 ms), retain 8>
    | |   |   | | | {
    | |   |   | | |   "IOFBDependentIndex" = 0x0
    | |   |   | | |   "IOFBDependentID" = 0x1000001ed
    | |   |   | | |   "name" = "ATY,AMD,RadeonFramebuffer"
    | |   |   | | |   "device_type" = "display"
    | |   |   | | | }

You could see: also no given entries for "connector-type" or "ATY,ControlFlags". Just the name for framebuffer and the device-type, which CLOVER injects also if enabled.

 

So if there is someone who could explain me on how to make the values for connector-type and -flags as type "integer" instead of type "data" and if this might help, i would take a couple of minutes to test it for us.

 

EDIT#1:

 

i just noticed, that the values for connector-type and connector-flags will be given as "integer" as long as no AMDRadeonX4100.kext was loaded.

Also as "integer" if we use IGPU or any othe helpercard as primary gfx.

  • Like 3
Link to comment
Share on other sites

So if there is someone who could explain me on how to make the values for connector-type and -flags as type "integer" instead of type "data" and if this might help, i would take a couple of minutes to test it for us.

You have to look at the ways properties can be added.

 

1) EFI Device Properties (or "efi strings") most of the Clover inject methods use this. An EFI property has a EFI device path (defined by the device path protocol as described in the UEFI specification http://uefi.org/specifications), a property name, and an untyped string of bytes. Apple's boot loader parses this information when building the IO registry. The binary data containing the EFI properties is copied to the IO registry at /efi/device-properties . You can use the GfxUtil command in Terminal.app to parse that information. There's also a php script version of GfxUtil at http://www.insanelymac.com/forum/topic/311808-php-gfxutil/ Note that these don't support all device path types, but I think they handle all the types Apple uses in it's EFI strings.

 

2) DSDT - AppleACPIPlatform.kext uses _DSM methods in the DSDT to add untyped properties to the IO registry. Read about _DSM in the ACPI 6.1 specification pdf. Apple's _DSM methods will call a method named DTGP with a buffer containing properties to be added. DTGP checks the UUID (gDSM_GET_PROP_UUID) and Revision ID (1) parameters that are passed to _DSM, then returns the buffer (when function is 0) or just 1 (when function is 1). DTGP can be added automatically to the DSDT by Clover since it is not included in non-Apple DSDT's. Some injections made by Clover will add a _DSM method to the DSDT (such as for audio) that requires the DTGP method. See FixBiosDsdt.c

 

3) kext - A kext can add typed properties anywhere in the IORegistry. HDMIAudio.kext does that to make AppleHDA.kext do audio for displays.

 

 

So I guess you'll want to try different binary data and sizes in EFI strings or _DSM buffers to see how Mac OS adds them to IO registry (as integer or data or string or whatever).

  • Like 4
Link to comment
Share on other sites

  • 1 month later...

well I think this order will be working RX480 when Primary boot up.

 

1. Save Over Clocked ROM BIOS on GPU-Z (in Windows OS)

2. Open the OC BIOS on Polaris Editor 141

3. Change Device id "67df" to "67ef" then save it (this bios will be called "Faked Device ID BIOS:FID BIOS")

3-1. I recommend a Shapphire Nitro OC + Setting and so other vendor will dump it like this.

3-2. Vendor ID : 0x1002, Device ID : 0x67EF, Sub ID : 0xE347, Sub Vendor ID : 0x174B

4. Open the "FID BIOS" on Atiwinflash then write it before must be change a bios switch to different rom bank!

5. Enter a CMOS Bios and change a "CSM disable"
6. Change a Primary inspection gnu node at PCIe 1 (you can disable IGPU)

 

finally we couldn't see Clover boot loader screen and  Apple logo when boot up.

but working as well without helper and igpu. (must be unplug a video cable off the helper and igpu (plugged RX480 only: 10.12/10.13)

 

** please uncheck a "inject intel and helper gpu" if you want to run the FCP X without any errors.

 

btw must be remove a Fake ID, inject AMD, 3 patches of KextToPatch(AMD setup), FB Name at 10.13 beta.

Sierra 10.12 need to set it up with FB name:Ellesmere, Inject AMD, Fake ID:0x67EF1002, 3 patches of KextToPatch(AMD Setup)

 

 

at the moment you can heard up the beep sound when first boot but no worry.

because of that sound mean was "UEFI/GOP VBIOS Failed".

 

so don't forget about the Force boot up even if found a error when booting. : )

 

good luck!

 

 

**

How to work it RX480 for Korean users https://x86.co.kr/index.php?mid=tip&search_target=nick_name&search_keyword=ZISQO&document_srl=1590613 : 10.12.5

https://x86.co.kr/tip/1619075: 10.13 beta 1

  • Like 1
Link to comment
Share on other sites

AMD VEGA GPU Support has been arrived into HIGH SIERRA DB2 in form of the following Kexts:

 

AMD10000Controller.kext ( supportet DeviceIds: 6860, 6867 and 687F)

AMDRadeonX5000.kext (supported DeviceIDs: 6860, 6867 and 687F), containing AMD VEGA10 GraphicsAccelerator

 

and another improvement: HDMI-Sound now fully works (also with CSM enabled in BIOS)!

  • Like 4
Link to comment
Share on other sites

  • 4 weeks later...

can you guys test this clover patch + AMDSupport.kext (10.12.5) ?

 

 

in clover settings:

 

- enable options "Load Vbios" and "Inject ATI"

- remove any framebuffer names/connectors patch from clover or dsdt

 

if u get a black screen remove the OpenGL.kext from S/L/E (e.g. AMDRadeonX4000GLDriver.bundle)

if use using AMDLegacySupport.kext just move it away.

 

plz post clover log and ioreg if this works

 

slice where can i find the RadeonPCI.kext source code? 

Archive.zip

Link to comment
Share on other sites

can you guys test this clover patch + AMDSupport.kext (10.12.5) ?

 

 

in clover settings:

 

- enable options "Load Vbios" and "Inject ATI"

- remove any framebuffer names/connectors patch from clover or dsdt

 

if u get a black screen remove the OpenGL.kext from S/L/E (e.g. AMDRadeonX4000GLDriver.bundle)

if use using AMDLegacySupport.kext just move it away.

 

plz post clover log and ioreg if this works

 

slice where can i find the RadeonPCI.kext source code? 

 

I would like to test it, but I'm on a Ryzen rig, did you used the source of the latest clover?

Link to comment
Share on other sites

can you guys test this clover patch + AMDSupport.kext (10.12.5) ?

 

 

in clover settings:

 

- enable options "Load Vbios" and "Inject ATI"

- remove any framebuffer names/connectors patch from clover or dsdt

 

if u get a black screen remove the OpenGL.kext from S/L/E (e.g. AMDRadeonX4000GLDriver.bundle)

if use using AMDLegacySupport.kext just move it away.

 

plz post clover log and ioreg if this works

 

slice where can i find the RadeonPCI.kext source code? 

 

Tried it, but doesn't seem to make a difference for me, with or without AMDRadeonX4000GLDriver.bundle and AMDLegacySupport.kext.

 

edit: Oh, yeah, needless to say if there's any information I could provide or anything I can try out that would be helpful, let me know. I've pretty much given up on OS X for the time being, but still have it installed and would be more than happy to help in any way I can.

Link to comment
Share on other sites

Holly Cow!

 

I just installed macOS Sierra 10.12.6 on my old EP45-DS3R rig with Sapphire 7790 and it works!!!!!!

 

You guys are the best!!

 

:thumbsup_anim:  :hysterical:  :frantics:

 

Thanks guys I'm speechless :thanks_speechbubble:


@vandroiy2012 @vit9696 @RemB

 

This is amazing :) Thanks for all your efforts 

Link to comment
Share on other sites

  • 3 weeks later...

Holly Cow!

 

I just installed macOS Sierra 10.12.6 on my old EP45-DS3R rig with Sapphire 7790 and it works!!!!!!

 

You guys are the best!!

 

:thumbsup_anim:  :hysterical:  :frantics:

 

Thanks guys I'm speechless :thanks_speechbubble:

@vandroiy2012 @vit9696 @RemB

 

This is amazing :) Thanks for all your efforts 

 

Can you please share your clover efi folder (with config and what clover files you use and maybe WhateverGreen kext config (for AMD)  for me, also GA-EP user / cpu with  no gpu?

Until now i use chameleon with sierra and some try to switch to clover wasnt with success.

You also can PM me if you dont want to share the .zipped clover efi folder / whatevergreen here and may want to send per email.

THANKS

Link to comment
Share on other sites

A great thing it 's that the boot time with my SSD is about 12 seconds : more faster than before with GT730 about 20 and as reported wake and sleep works fine with keyboard.

Link to comment
Share on other sites

Can you please share your clover efi folder (with config and what clover files you use and maybe WhateverGreen kext config (for AMD)  for me, also GA-EP user / cpu with  no gpu?

Until now i use chameleon with sierra and some try to switch to clover wasnt with success.

You also can PM me if you dont want to share the .zipped clover efi folder / whatevergreen here and may want to send per email.

THANKS

Sure thing :)

There you go

GA-EP45DS3R Sierra r4126 EFI.zip

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...