Skip to content
  • Ben Widawsky's avatar
    2a3282c6
    acpi/cxl: Add _OSC implementation (9.14.2) · 2a3282c6
    Ben Widawsky authored
    
    
    CXL 2.0 specification adds 2 new dwords to the existing _OSC definition
    from PCIe. The new dwords are accessed with a new uuid. This
    implementation supports what is in the specification.
    
    iasl -d decodes the result of this patch as:
    
    Name (SUPP, Zero)
    Name (CTRL, Zero)
    Name (SUPC, Zero)
    Name (CTRC, Zero)
    Method (_OSC, 4, NotSerialized)  // _OSC: Operating System Capabilities
    {
        CreateDWordField (Arg3, Zero, CDW1)
        If (((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */) || (Arg0 == ToUUID ("68f2d50b-c469-4d8a-bd3d-941a103fd3fc") /* Unknown UUID */)))
        {
            CreateDWordField (Arg3, 0x04, CDW2)
            CreateDWordField (Arg3, 0x08, CDW3)
            Local0 = CDW3 /* \_SB_.PC0C._OSC.CDW3 */
            Local0 &= 0x1F
            If ((Arg1 != One))
            {
                CDW1 |= 0x08
            }
    
            If ((CDW3 != Local0))
            {
                CDW1 |= 0x10
            }
    
            SUPP = CDW2 /* \_SB_.PC0C._OSC.CDW2 */
            CTRL = CDW3 /* \_SB_.PC0C._OSC.CDW3 */
            CDW3 = Local0
            If ((Arg0 == ToUUID ("68f2d50b-c469-4d8a-bd3d-941a103fd3fc") /* Unknown UUID */))
            {
                CreateDWordField (Arg3, 0x0C, CDW4)
                CreateDWordField (Arg3, 0x10, CDW5)
                SUPC = CDW4 /* \_SB_.PC0C._OSC.CDW4 */
                CTRC = CDW5 /* \_SB_.PC0C._OSC.CDW5 */
                CDW5 |= One
            }
    
            Return (Arg3)
        }
        Else
        {
            CDW1 |= 0x04
            Return (Arg3)
        }
    
    Signed-off-by: default avatarBen Widawsky <ben.widawsky@intel.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Message-Id: <20220429144110.25167-25-Jonathan.Cameron@huawei.com>
    Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    2a3282c6
    acpi/cxl: Add _OSC implementation (9.14.2)
    Ben Widawsky authored
    
    
    CXL 2.0 specification adds 2 new dwords to the existing _OSC definition
    from PCIe. The new dwords are accessed with a new uuid. This
    implementation supports what is in the specification.
    
    iasl -d decodes the result of this patch as:
    
    Name (SUPP, Zero)
    Name (CTRL, Zero)
    Name (SUPC, Zero)
    Name (CTRC, Zero)
    Method (_OSC, 4, NotSerialized)  // _OSC: Operating System Capabilities
    {
        CreateDWordField (Arg3, Zero, CDW1)
        If (((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */) || (Arg0 == ToUUID ("68f2d50b-c469-4d8a-bd3d-941a103fd3fc") /* Unknown UUID */)))
        {
            CreateDWordField (Arg3, 0x04, CDW2)
            CreateDWordField (Arg3, 0x08, CDW3)
            Local0 = CDW3 /* \_SB_.PC0C._OSC.CDW3 */
            Local0 &= 0x1F
            If ((Arg1 != One))
            {
                CDW1 |= 0x08
            }
    
            If ((CDW3 != Local0))
            {
                CDW1 |= 0x10
            }
    
            SUPP = CDW2 /* \_SB_.PC0C._OSC.CDW2 */
            CTRL = CDW3 /* \_SB_.PC0C._OSC.CDW3 */
            CDW3 = Local0
            If ((Arg0 == ToUUID ("68f2d50b-c469-4d8a-bd3d-941a103fd3fc") /* Unknown UUID */))
            {
                CreateDWordField (Arg3, 0x0C, CDW4)
                CreateDWordField (Arg3, 0x10, CDW5)
                SUPC = CDW4 /* \_SB_.PC0C._OSC.CDW4 */
                CTRC = CDW5 /* \_SB_.PC0C._OSC.CDW5 */
                CDW5 |= One
            }
    
            Return (Arg3)
        }
        Else
        {
            CDW1 |= 0x04
            Return (Arg3)
        }
    
    Signed-off-by: default avatarBen Widawsky <ben.widawsky@intel.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Message-Id: <20220429144110.25167-25-Jonathan.Cameron@huawei.com>
    Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Loading