Skip to content

Constructing

Ausdauersportler edited this page Apr 12, 2022 · 30 revisions

We will step by step construct an EFI BIOS for the W5170M card. This is an AMD Venus GPU and the only Apple Mac which has used this type of GPU is the Apple MacBookPro 15" Mid 2015. You need to get a recent firmware update or you may fetch the firmware from such a system using the app RomTool.

  • get the EG2, EDIDParser, and CoreEG2 parts from an suitable Apple Mac (efi module)

Use the UEFITool-NE, open the firmware dump and search for the ASCII string ATY (which will occur within the particular module several times, and hopefully only in a single module). Another indicator is the size of approximately 185344 bytes. Some firmware files contain several graphics modules because the corresponding Apple models were offered (BTO) with different graphics options, like the iMac 2014 and 2015 models.

Finding the Apple video BIOS

Select the PE32 image section and right click Extract Body, the section will be safe with extension efi. We are ready to go. Load the file into the hex editor Hexfiend.

Now find frame buffer name and change if with fantasy name to force the usage of the generic radeon framebuffer, which honors the connector information we changed in the original BIOS in the OBJ_INFO module. Search for text Parent and get ATY,RamenParent, the frame buffer is called Ramen. To avoid any changes in size just select a five letter code like AMDFB and make it to ATY,AMDFBParent. There may be more where the original Apple frame buffer name Ramen is used, search it and replace all strings starting with ATY,Ramen to ATY,AMDFB. In this particular case it will be only a single other one. Save and rename the file to M370.efi after making al changes.

Changing the frame buffer name

The list of supported device IDs of this software are right behind the spot you just found when searching for Parent, it is 20682168 25682768 23682B68, here we have to honor the endian and change bytes. We get the list of 6820 6821 6825 6827 6823 682B. The W5170M has the device-id of 6820, which fits perfectly.

Since the EDIDParser and CoreEG2 can be re-used in all EFI BIOS I will simply add the files to the repository instead of describing the extraction in detail. It follows the same scheme as just described from the same source file.

  • compress the efi module into an compatible EG2 BIOS

  • replaces the GOP with the newly created EG2 part

  • either add the EDIDParser and CoreEG2 to OpenCore drivers section or the iMac firmware, in the latter case you the the EFI boot picker functionality on boot by pressing alt/option

  • coming around the 128k (0x20000) size limitation