Jump to content

Dell Radeon R7 350X framebuffer patching


DKnoto
 Share

4 posts in this topic

Recommended Posts

Hi,

I have been trying to run this card in macOS Catalina 10.15.7 on a Dell OptiPlex 7040 for a long time. I use Clover 5127, Lilu 1.5.0 and WhateverGreen 1.4.6. In the first attempt, I only tried to change the PCI ID to match the AMD7000Controller and AMD8000Controller drivers.  My SSDT-GPU-SPOOF looks like this:

 

//
//  GPU: AMD Radeon R7 350X from Dell, PCI-ID: 0x6610
//
DefinitionBlock ("", "SSDT", 2, "DKNOTO", "AMDGPU", 0x00001000)
{
    External (_SB_.PCI0, DeviceObj)
    External (_SB_.PCI0.PEG0.PEGP, DeviceObj)
    Scope (\_SB_.PCI0.PEG0.PEGP)
    {
        if (_OSI ("Darwin"))
        {
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                Local0 = Package (0x04)
                {
                    "device-id",
                    Buffer (0x04)
                    {
                        0x2B, 0x68, 0x02, 0x10
                    },
                    "model",
                    Buffer ()
                    {
                        "AMD Radeon R7 350X"
                    }
                }
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
         }
    }
    Scope (\_SB.PCI0)
    {
        Method (DTGP, 5, NotSerialized)
        {
            If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
            {
                If (LEqual (Arg1, One))
                {
                    If (LEqual (Arg2, Zero))
                    {
                        Store (Buffer (One)
                            {
                                 0x03
                            }, Arg4)
                        Return (One)
                    }
                    If (LEqual (Arg2, One))
                    {
                        Return (One)
                    }
                }
            }
            Store (Buffer (One)
                {
                     0x00
                }, Arg4)
            Return (Zero)
        }
    }
}

 

After these changes, the system restarts for the PCI-ID from the set contained in the AMD7000Controller drivers. For the PCI-IDs contained in the AMD8000Controller driver, the system works but the DP and DVI-I graphics outputs are not activated. System boot logs view mode remains, -v option in bootargs. I can log into the system via SSH and shut it down safely. AMD drivers are loaded.

 

dop7040-R7-350X-SSH-Shell.thumb.png.7f8c85471355a67e7a40c5feb2307467.png

 

In the second try I dumped the video card BIOS and decoded it.

ATOM BIOS Rom:
        SubsystemVendorID: 0x1028 SubsystemID: 0x0081
        IOBaseAddress: 0xe000
        Filename: C8720100.101
        BIOS Bootup Message:
Samoa XT C87201 4GB DDR3 256Mx16 DELL

PCI ID: 1002:6610
Connector at index 0
        Type [@offset 42614]: DisplayPort (10)
        Encoder [@offset 42618]: INTERNAL_UNIPHY (0x1e, 0x)
        i2cid [@offset 42680]: 0x90, OSX senseid: 0x1
        HotPlugID: 1
Connector at index 1
        Type [@offset 42624]: DVI-I (2)
        Encoder [@offset 42628]: INTERNAL_UNIPHY (0x1e, 0x)
        i2cid [@offset 42717]: 0x91, OSX senseid: 0x2
        HotPlugID: 2
Connector at index 2
        Type [@offset 42634]: DVI-I (2)
        Encoder [@offset 42638]: INTERNAL_KLDSCP_DAC1 (0x15, 0x)
        i2cid [@offset 42717]: 0x91, OSX senseid: 0x2
        HotPlugID: 2

 

C8720100.101:

Samoa XT C87201 4GB DDR3 256Mx16 DELL

Subsystem Vendor ID: 1028
       Subsystem ID: 81
Object Header Structure Size: 187
Connector Object Table Offset: 34
Router Object Table Offset: 0
Encoder Object Table Offset: 88
Display Path Table Offset: 12
Connector Object Id [19] which is [DISPLAY_PORT]
        encoder obj id [0x1e] which is [INTERNAL_UNIPHY (osx txmit 0x10 [duallink 0x0] enc 0x0)] linkb: false
Connector Object Id [1] which is [DVI_I]
        encoder obj id [0x1e] which is [INTERNAL_UNIPHY (osx txmit 0x20 [duallink 0x0] enc 0x1)] linkb: true
Connector Object Id [1] which is [DVI_I]
        encoder obj id [0x15] which is [INTERNAL_KLDSCP_DAC1 (osx txmit 0x00 enc 0x10?)] linkb: false

I calculated the code to correct the outputs:

 

01 [DISPLAY PORT]

    redsock_bios_decoder:
    enc obj 0x1e transmitter 0x10 dual link 0x0 enc 0x0

    radeon_bios_decoder:
    Connector at index 0
    Type [@offset 42614]: DisplayPort (10)
    Encoder [@offset 42618]: INTERNAL_UNIPHY (0x1e, 0x)
    i2cid [@offset 42680]: 0x90, OSX senseid: 0x1

    code: 10 00 01 01

02 [DVI-I]

    redsock_bios_decoder:
    enc obj 0x1e transmitter 0x20 dual link 0x0 enc 0x1

    radeon_bios_decoder:
    Type [@offset 42624]: DVI-I (2)
    Encoder [@offset 42628]: INTERNAL_UNIPHY (0x1e, 0x)
    i2cid [@offset 42717]: 0x91, OSX senseid: 0x2

    code: 20 01 02 02

 

And I added the appropriate sections to the DSDT:

 

Local0 = Package (0x08)
{
    "device-id",
    Buffer (0x04)
    {
        0x2B, 0x68, 0x02, 0x10
    },
    "model",
    Buffer ()
    {
        "AMD Radeon R7 350X"
    },
    "connectors",
    Buffer ()
    {
        0x00, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x10, 0x00, 0x01, 0x01,
        0x04, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x20, 0x01, 0x02, 0x02
    },
    "connector-count",
    Buffer ()
    {
        0x02, 0x00, 0x00, 0x00
    }
}

 

Unfortunately, these changes did not have a positive effect. The system behaves the same as before the changes to the connection description.

 

I would be grateful for any ideas to solve this problem.

 

Best regards.

 

Link to comment
Share on other sites

When creating the line for fixing the connector definition, I used the Baladi framebuffer:

macOS Mojave 10.14.4 beta 1

-------------------------AMD8000Controller.kext-------------------------

Baladi (6) @ 0x5a3f0
DP, DP, DP, DP, DP, DP
000400000403000000010300000000001204030300000000
000400000403000000010100000000001102010100000000
000400000403000000010200000000002103020200000000
000400000403000000010400000000002205040400000000
000400000403000000010500000000001000050500000000
000400000403000000010600000000002001060600000000

 

Many thanks for encouraging me to continue my experiments. I did tests of this card on High Sierra. The first configuration how it worked is as follows:

Boot args   : ... radpg=15 -raddvi
SSDT/PCI-ID : 0x683D

HighSierra-Radeon-R7-350X-About.png.9df43928be1923002e031a32c9541103.pngHighSierra-Radeon-R7-350X-RapSys.png.517a6af07998b5ca6530f207d2e6dbaa.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...