InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   SATA hotplugging problems with DSDT fix (http://infinitemac.com/showthread.php?t=4501)

CEOS 10-23-2009 07:53 PM

SATA hotplugging problems with DSDT fix
 
i loose the SATA AHCI Hotplugging ability if i patch the SATA as intern using this patch:
Code:

Device (SATA)
    {
        Name (_ADR, 0x001F0002)
                Name (_SUN, One)
        Device (PRT0)
        {
            Name (_ADR, Zero)
                        Method (_GTF, 0, NotSerialized)
            {
                    Name (PIB0, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
                })
                Return (PIB0)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                               
                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 1"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
                       
        }

        Device (PRT1)
        {
            Name (_ADR, One)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB1, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                })
                Return (PIB1)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                                                                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 2"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
                       
        }

        Device (PRT2)
        {
            Name (_ADR, 0x02)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB2, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
                })
                Return (PIB2)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                                "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 3"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

        Device (PRT3)
        {
            Name (_ADR, 0x03)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB3, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                })
                Return (PIB3)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                       
                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 4"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

        Device (PRT4)
        {
            Name (_ADR, 0x04)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB4, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
                })
                Return (PIB4)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {       
                                                                                       
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 5"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

        Device (PRT5)
        {
            Name (_ADR, 0x05)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB5, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                })
                Return (PIB5)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                                                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 6"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

                Method (_DSM, 4, NotSerialized)
        {
            Store (Package (0x06)
                {
                    "device_type",
                    Buffer (0x10)
                    {
                        "AHCI Controller"
                    },
                                                                                               
                    "model",
                    Buffer (0x1C)
                    {
                        "ICH9-R SATA/AHCI Controller"
                    },

                    "name",
                    Buffer (0x1C)
                    {
                        "ICH9-R SATA/AHCI Controller"
                    }
                }, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }
    }

my mainboard is using ICH10 SATA controller.
is this the Problem ?

thorazine74 10-24-2009 02:45 PM

I think Apple has no official support for hot plugging but it sounds logical that internal devices not to bo hot plugged.
Try using the patch only for the ports you dont need hot plugging functionality.

CEOS 10-24-2009 08:00 PM

That was my first thought, too :)

but the problem is that the SATA part of the fix looks totally different than the one from my DSDT
iīm not sure how to find e.g SATA port 4, caus i donīt know were in the DSDT/Fix code it get configured.

this is how regonization looks in my dsdt:
Code:

            Device (IDE1)
            {
                Name (_ADR, 0x001F0002)
                OperationRegion (PCI, PCI_Config, 0x40, 0x20)
                Field (PCI, DWordAcc, NoLock, Preserve)
                {
                    ITM0,  16,
                    ITM1,  16,
                    SIT0,  4,
                    SIT1,  4,
                            Offset (0x08),
                    UDC0,  2,
                    UDC1,  2,
                            Offset (0x0A),
                    UDT0,  8,
                    UDT1,  8,
                            Offset (0x14),
                    ICF0,  2,
                    ICF1,  2,
                        ,  6,
                    WPPE,  1,
                        ,  1,
                    FAS0,  2,
                    FAS1,  2
                }

           
                Device (PRIM)
                {
                    Name (_ADR, Zero)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Store (GTM (ITM0, SIT0, UDC0, UDT0, ICF0, FAS0), Local0)
                        Return (Local0)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        Store (STM (Arg0, Arg1, Arg2), Local0)
                        CreateDWordField (Local0, Zero, ITM)
                        CreateDWordField (Local0, 0x04, SIT)
                        CreateDWordField (Local0, 0x08, UDC)
                        CreateDWordField (Local0, 0x0C, UDT)
                        CreateDWordField (Local0, 0x10, ICF)
                        CreateDWordField (Local0, 0x14, FAS)
                        Store (UDC, UDC0)
                        Store (UDT, UDT0)
                        Store (ICF, ICF0)
                        Store (FAS, FAS0)
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, Zero)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF0 (ITM0, SIT0, UDC0, UDT0, ICF0, H15F, FAS0), Local0)
                            Return (Local0)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, One)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF1 (ITM0, SIT0, UDC0, UDT0, ICF0, H15F, FAS0), Local0)
                            Return (Local0)
                        }
                    }
                }

                Device (SECD)
                {
                    Name (_ADR, One)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Store (GTM (ITM1, SIT1, UDC1, UDT1, ICF1, FAS1), Local0)
                        Return (Local0)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        Store (STM (Arg0, Arg1, Arg2), Local0)
                        CreateDWordField (Local0, Zero, ITM)
                        CreateDWordField (Local0, 0x04, SIT)
                        CreateDWordField (Local0, 0x08, UDC)
                        CreateDWordField (Local0, 0x0C, UDT)
                        CreateDWordField (Local0, 0x10, ICF)
                        CreateDWordField (Local0, 0x14, FAS)
                        Store (UDC, UDC1)
                        Store (UDT, UDT1)
                        Store (ICF, ICF1)
                        Store (FAS, FAS1)
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, Zero)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF0 (ITM1, SIT1, UDC1, UDT1, ICF1, H15F, FAS1), Local0)
                            Return (Local0)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, One)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF1 (ITM1, SIT1, UDC1, UDT1, ICF1, H15F, FAS1), Local0)
                            Return (Local0)
                        }
                    }
                }
            }

            Device (IDE2)
            {
                Name (_ADR, 0x001F0005)
                OperationRegion (PCI, PCI_Config, 0x40, 0x20)
                Field (PCI, DWordAcc, NoLock, Preserve)
                {
                    ITM0,  16,
                    ITM1,  16,
                    SIT0,  4,
                    SIT1,  4,
                            Offset (0x08),
                    UDC0,  1,
                        ,  1,
                    UDC1,  1,
                            Offset (0x0A),
                    UDT0,  8,
                    UDT1,  8,
                            Offset (0x14),
                    ICF0,  2,
                    ICF1,  2,
                        ,  6,
                    WPPE,  1,
                        ,  1,
                    FAS0,  2,
                    FAS1,  2
                }

                Device (PRIM)
                {
                    Name (_ADR, Zero)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Store (GTM (ITM0, SIT0, UDC0, UDT0, ICF0, FAS0), Local0)
                        Return (Local0)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        Store (STM (Arg0, Arg1, Arg2), Local0)
                        CreateDWordField (Local0, Zero, ITM)
                        CreateDWordField (Local0, 0x04, SIT)
                        CreateDWordField (Local0, 0x08, UDC)
                        CreateDWordField (Local0, 0x0C, UDT)
                        CreateDWordField (Local0, 0x10, ICF)
                        CreateDWordField (Local0, 0x14, FAS)
                        Store (UDC, UDC0)
                        Store (UDT, UDT0)
                        Store (ICF, ICF0)
                        Store (FAS, FAS0)
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, Zero)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF0 (ITM0, SIT0, UDC0, UDT0, ICF0, H15F, FAS0), Local0)
                            Return (Local0)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, One)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF1 (ITM0, SIT0, UDC0, UDT0, ICF0, H15F, FAS0), Local0)
                            Return (Local0)
                        }
                    }
                }

                Device (SECD)
                {
                    Name (_ADR, One)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Store (GTM (ITM1, SIT1, UDC1, UDT1, ICF1, FAS1), Local0)
                        Return (Local0)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        Store (STM (Arg0, Arg1, Arg2), Local0)
                        CreateDWordField (Local0, Zero, ITM)
                        CreateDWordField (Local0, 0x04, SIT)
                        CreateDWordField (Local0, 0x08, UDC)
                        CreateDWordField (Local0, 0x0C, UDT)
                        CreateDWordField (Local0, 0x10, ICF)
                        CreateDWordField (Local0, 0x14, FAS)
                        Store (UDC, UDC1)
                        Store (UDT, UDT1)
                        Store (ICF, ICF1)
                        Store (FAS, FAS1)
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, Zero)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF0 (ITM1, SIT1, UDC1, UDT1, ICF1, H15F, FAS1), Local0)
                            Return (Local0)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, One)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF1 (ITM1, SIT1, UDC1, UDT1, ICF1, H15F, FAS1), Local0)
                            Return (Local0)
                        }
                    }
                }
            }

it would really help if someone could point me were SATA 5 port is in my DSDT and were it is in the patch code

CEOS 10-25-2009 12:05 PM

Update:

Ok, i thinki found out were the 4th SATA bay is configured.
This is the code for it:
Code:

Device (PRT3)
                {
                    Name (_ADR, 0x03)
                    Method (_GTF, 0, NotSerialized)
                    {
                        Name (PIB3, Buffer (0x07)
                        {
                            0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                        })
                        Return (PIB3)
                    }

                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x02)
                            {
                                "io-device-location",
                                Buffer (0x06)
                                {
                                    "Bay 4"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }

the code let the 4th SATA port to be detected as integrated.
i want to modify it to let OSX recognize it as normal SATA port (like it did without the DSDT patch)

how can i do this ?

thorazine74 10-25-2009 06:44 PM

I'm not sure if I follow you, by default os x will think all the ports are external, the patch will make them look as internal, if you just want port 3 as external just keep its code untouched and put the patched code just in ports 0,1,2.

CEOS 10-26-2009 03:27 PM

thank you for your quick reply.

Quote:

by default os x will think all the ports are external, the patch will make them look as internal, if you just want port 3 as external just keep its code untouched and put the patched code just in ports 0,1,2.
would be great if it should be so easy.
sadly it isnīt

i will try to explain it a bit more detailed:

I dont want the internal HHDīs to have orange icons, thatīs why i patched the DSDT.
to patch it, i use this "fix":
Code:

Device (SATA)
    {
        Name (_ADR, 0x001F0002)
                Name (_SUN, One)
        Device (PRT0)
        {
            Name (_ADR, Zero)
                        Method (_GTF, 0, NotSerialized)
            {
                    Name (PIB0, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
                })
                Return (PIB0)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                               
                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 1"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
                       
        }

        Device (PRT1)
        {
            Name (_ADR, One)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB1, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                })
                Return (PIB1)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                                                                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 2"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
                       
        }

        Device (PRT2)
        {
            Name (_ADR, 0x02)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB2, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
                })
                Return (PIB2)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                                "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 3"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

        Device (PRT3)
        {
            Name (_ADR, 0x03)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB3, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                })
                Return (PIB3)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                       
                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 4"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

        Device (PRT4)
        {
            Name (_ADR, 0x04)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB4, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF5
                })
                Return (PIB4)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {       
                                                                                       
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 5"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

        Device (PRT5)
        {
            Name (_ADR, 0x05)
                        Method (_GTF, 0, NotSerialized)
            {
                Name (PIB5, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xF5
                })
                Return (PIB5)
            }
            Method (_DSM, 4, NotSerialized)
            {
                Store (Package (0x02)
                    {
                                                                                               
                        "io-device-location",
                        Buffer (0x06)
                        {
                            "Bay 6"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }

                Method (_DSM, 4, NotSerialized)
        {
            Store (Package (0x06)
                {
                    "device_type",
                    Buffer (0x10)
                    {
                        "AHCI Controller"
                    },
                                                                                               
                    "model",
                    Buffer (0x1C)
                    {
                        "ICH9-R SATA/AHCI Controller"
                    },

                    "name",
                    Buffer (0x1C)
                    {
                        "ICH9-R SATA/AHCI Controller"
                    }
                }, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }
    }


i delete the the complete SATA Part of the DSDT and copy&paste the fix into it
the fix patched all 6 SATA Ports of my mainboard to work as integrated (=>all loose their hot plugging abilities)

when i tryed to connect my esata HDD, nothing happens.

so i decidet that one SATA Port has to stay unfixed, caus without the patch SATA hot plugging works.

here is werte problem start:
as i said before I completely delete the original SATA Part and replace it with the "fix".
but the original DSDT sata part looks totally different than the "fix"

here is the original part:
Code:

            Device (IDE1)
            {
                Name (_ADR, 0x001F0002)
                OperationRegion (PCI, PCI_Config, 0x40, 0x20)
                Field (PCI, DWordAcc, NoLock, Preserve)
                {
                    ITM0,  16,
                    ITM1,  16,
                    SIT0,  4,
                    SIT1,  4,
                            Offset (0x08),
                    UDC0,  2,
                    UDC1,  2,
                            Offset (0x0A),
                    UDT0,  8,
                    UDT1,  8,
                            Offset (0x14),
                    ICF0,  2,
                    ICF1,  2,
                        ,  6,
                    WPPE,  1,
                        ,  1,
                    FAS0,  2,
                    FAS1,  2
                }

                Device (PRIM)
                {
                    Name (_ADR, Zero)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Store (GTM (ITM0, SIT0, UDC0, UDT0, ICF0, FAS0), Local0)
                        Return (Local0)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        Store (STM (Arg0, Arg1, Arg2), Local0)
                        CreateDWordField (Local0, Zero, ITM)
                        CreateDWordField (Local0, 0x04, SIT)
                        CreateDWordField (Local0, 0x08, UDC)
                        CreateDWordField (Local0, 0x0C, UDT)
                        CreateDWordField (Local0, 0x10, ICF)
                        CreateDWordField (Local0, 0x14, FAS)
                        Store (UDC, UDC0)
                        Store (UDT, UDT0)
                        Store (ICF, ICF0)
                        Store (FAS, FAS0)
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, Zero)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF0 (ITM0, SIT0, UDC0, UDT0, ICF0, H15F, FAS0), Local0)
                            Return (Local0)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, One)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF1 (ITM0, SIT0, UDC0, UDT0, ICF0, H15F, FAS0), Local0)
                            Return (Local0)
                        }
                    }
                }

                Device (SECD)
                {
                    Name (_ADR, One)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Store (GTM (ITM1, SIT1, UDC1, UDT1, ICF1, FAS1), Local0)
                        Return (Local0)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        Store (STM (Arg0, Arg1, Arg2), Local0)
                        CreateDWordField (Local0, Zero, ITM)
                        CreateDWordField (Local0, 0x04, SIT)
                        CreateDWordField (Local0, 0x08, UDC)
                        CreateDWordField (Local0, 0x0C, UDT)
                        CreateDWordField (Local0, 0x10, ICF)
                        CreateDWordField (Local0, 0x14, FAS)
                        Store (UDC, UDC1)
                        Store (UDT, UDT1)
                        Store (ICF, ICF1)
                        Store (FAS, FAS1)
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, Zero)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF0 (ITM1, SIT1, UDC1, UDT1, ICF1, H15F, FAS1), Local0)
                            Return (Local0)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, One)
                        Name (H15F, Zero)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Store (GTF1 (ITM1, SIT1, UDC1, UDT1, ICF1, H15F, FAS1), Local0)
                            Return (Local0)
                        }
                    }
                }
            }

now i dont know how to merge the Original code with the "fix" because they look so different