Am Thu, Apr 15, 2021 at 12:47:44AM +0200 schrieb Patrick Wildt:
> On Wed, Apr 14, 2021 at 11:20:56PM +0200, Patrick Wildt wrote:
> > Am Wed, Apr 14, 2021 at 10:55:14PM +0200 schrieb Mark Kettenis:
> > > > Date: Wed, 14 Apr 2021 22:25:16 +0200
> > > > From: Patrick Wildt <patr...@blueri.se>
> > > > 
> > > > Am Wed, Apr 14, 2021 at 10:17:58PM +0200 schrieb Patrick Wildt:
> > > > > Hi,
> > > > > 
> > > > > Parallels 16 for Mac supports the Apple M1 SoC now, and since it does
> > > > > provide an EFI 'BIOS', our images boot out of the box (once converted
> > > > > to 'hdd' or supplied as USB stick).
> > > > > 
> > > > > Unfortunately virtio doesn't attach, because Parallels seems to 
> > > > > provide
> > > > > a 'new' version 2.  The following diff adds support for version 2 and
> > > > > I used it to install the VM over vio(4) network.  And I was able to
> > > > > install packages over vio(4) network.  Disk is ahci(4), USB 
> > > > > passthrough
> > > > > is xhci(4), so that works nicely out of the box.
> > > > > 
> > > > > Not sure if we want this for 6.9 or not.  I think it wouldn't break 
> > > > > the
> > > > > current version 1, so I think it shouldn't hurt.
> > > > > 
> > > > > If you're wondering why I'm 'so late' with this: jcs@ asked me to have
> > > > > a look at the official Parallels for M1 release, and I just did that.
> > > > > So I couldn't be any faster than this anyway.
> > > > > 
> > > > > Opinions?
> > > > > 
> > > > > Patrick
> > > > 
> > > > Obviously I forgot to pay dmesg tax ;)
> > > > 
> 
> Things change a little when you run 'machine acpi' in efiboot.

And here's the DSDT (thanks to jcs@).  I think audio (HDEF) should be
easy, I believe we only need to attach Azalia to that device, rest
hopefully 'just works'.  PNP0D20 is ehci, that should be easy as
well.  Not sure about video...  There's also an Ethernet device.

Btw, this is just a bit of ACPI info dump, which is unrelated to this
diff.

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20200925 (64-bit version)
 * Copyright (c) 2000 - 2020 Intel Corporation
 * 
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of DSDT.2, Wed Apr 14 17:46:36 2021
 *
 * Original Table Header:
 *     Signature        "DSDT"
 *     Length           0x00000AC6 (2758)
 *     Revision         0x02
 *     Checksum         0x9D
 *     OEM ID           "PRLS  "
 *     OEM Table ID     "PRLS_OEM"
 *     OEM Revision     0x00000003 (3)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20160527 (538314023)
 */
DefinitionBlock ("", "DSDT", 2, "PRLS  ", "PRLS_OEM", 0x00000003)
{
    Scope (_SB)
    {
        OperationRegion (MBOX, SystemMemory, 0x02100000, 0x4000)
        Field (MBOX, DWordAcc, NoLock, Preserve)
        {
            MVER,   32, 
            RAM,    32, 
            CPUM,   32, 
            MUSB,   32, 
            MUFS,   32, 
            MAHC,   32, 
            VRAM,   32, 
            MSER,   32, 
            MHDA,   32, 
            GPU,    32, 
            LOON,   32, 
            TOOL,   32, 
            NET,    32
        }

        Device (CP00)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
        }

        Device (CP01)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
        }

        Device (CP02)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, 0x02)  // _UID: Unique ID
        }

        Device (CP03)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, 0x03)  // _UID: Unique ID
        }

        Device (CP04)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, 0x04)  // _UID: Unique ID
        }

        Device (CP05)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, 0x05)  // _UID: Unique ID
        }

        Device (CP06)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, 0x06)  // _UID: Unique ID
        }

        Device (CP07)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, 0x07)  // _UID: Unique ID
        }

        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C") /* Power Button Device */)  // _HID: 
Hardware ID
        }

        OperationRegion (PWRM, SystemMemory, 0x02108000, 0x4000)
        Field (PWRM, AnyAcc, NoLock, Preserve)
        {
            BATC,   32, 
            PONL,   32, 
            Offset (0x100), 
            Offset (0x110), 
            TEMP,   16, 
            VOLT,   16, 
            CURR,   16, 
            ACUR,   16, 
            Offset (0x11A), 
            Offset (0x11C), 
            Offset (0x11E), 
            REMC,   16, 
            FCAP,   16, 
            Offset (0x124), 
            Offset (0x126), 
            Offset (0x128), 
            Offset (0x12A), 
            Offset (0x12C), 
            BATS,   16, 
            Offset (0x130), 
            DCAP,   16, 
            DVOL,   16, 
            Offset (0x200), 
            VSTR,   264, 
            DSTR,   264, 
            CHEM,   264
        }

        Device (ADP0)
        {
            Name (_HID, "ACPI0003" /* Power Source Device */)  // _HID: 
Hardware ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((BATC == Zero))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PSR, 0, NotSerialized)  // _PSR: Power Source
            {
                If ((BATC == Zero))
                {
                    Return (One)
                }

                If (PONL)
                {
                    Return (One)
                }

                Return (Zero)
            }

            Method (_PCL, 0, NotSerialized)  // _PCL: Power Consumer List
            {
                Return (_SB) /* \_SB_ */
            }
        }

        Device (BAT0)
        {
            Name (_HID, EisaId ("PNP0C0A") /* Control Method Battery */)  // 
_HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((BATC == Zero))
                {
                    Return (Zero)
                }

                Return (0x1F)
            }

            Method (_PCL, 0, NotSerialized)  // _PCL: Power Consumer List
            {
                Return (_SB) /* \_SB_ */
            }

            Name (PBST, Package (0x04)
            {
                Zero, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0xFFFFFFFF
            })
            Method (_BST, 0, NotSerialized)  // _BST: Battery Status
            {
                Local2 = VOLT /* \_SB_.VOLT */
                PBST [0x03] = Local2
                Local0 = CURR /* \_SB_.CURR */
                If ((Local0 & 0x8000))
                {
                    Local0 = ~Local0
                    Local0 = (Local0++ & 0xFFFF)
                }

                Local0 *= Local2
                PBST [One] = (Local0 / 0x03E8)
                Local0 = REMC /* \_SB_.REMC */
                PBST [0x02] = (Local0 * 0x0A)
                Local1 = Zero
                If (PONL)
                {
                    Local0 = BATS /* \_SB_.BATS */
                    If (!(Local0 & 0x20))
                    {
                        Local1 = 0x02
                    }
                }
                Else
                {
                    Local1 = One
                }

                PBST [Zero] = Local1
                Return (PBST) /* \_SB_.BAT0.PBST */
            }

            Name (PBIF, Package (0x0D)
            {
                Zero, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                One, 
                0xFFFFFFFF, 
                0xFA, 
                0x64, 
                0x0A, 
                0x0A, 
                " ", 
                " ", 
                " ", 
                " "
            })
            Method (_BIF, 0, NotSerialized)  // _BIF: Battery Information
            {
                Local0 = DCAP /* \_SB_.DCAP */
                PBIF [One] = (Local0 * 0x0A)
                Local0 = FCAP /* \_SB_.FCAP */
                PBIF [0x02] = (Local0 * 0x0A)
                Local0 = DVOL /* \_SB_.DVOL */
                PBIF [0x04] = Local0
                Local0 = DSTR /* \_SB_.DSTR */
                PBIF [0x09] = Local0
                PBIF [0x0A] = Buffer (One)
                    {
                         0x00                                             // .
                    }
                Local0 = CHEM /* \_SB_.CHEM */
                PBIF [0x0B] = Local0
                Local0 = VSTR /* \_SB_.VSTR */
                PBIF [0x0C] = Local0
                Return (PBIF) /* \_SB_.BAT0.PBIF */
            }
        }

        Device (GPED)
        {
            Name (_HID, "ACPI0013" /* Generic Event Device */)  // _HID: 
Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Interrupt (ResourceConsumer, Edge, ActiveHigh, 
ExclusiveAndWake, ,, )
                {
                    0x00000030,
                }
            })
            OperationRegion (EREG, SystemMemory, 0x02104000, 0x4000)
            Field (EREG, DWordAcc, NoLock, WriteAsZeros)
            {
                ESEL,   32
            }

            Method (_EVT, 1, NotSerialized)  // _EVT: Event
            {
                Local0 = ESEL /* \_SB_.GPED.ESEL */
                If ((Local0 & One))
                {
                    Notify (PWRB, 0x80) // Status Change
                }

                If ((Local0 & 0x04))
                {
                    Notify (ADP0, 0x80) // Status Change
                }

                If ((Local0 & 0x08))
                {
                    Notify (BAT0, 0x80) // Status Change
                }

                If ((Local0 & 0x10))
                {
                    Notify (BAT0, 0x81) // Information Change
                }
            }
        }

        Device (UFS0)
        {
            Name (_HID, "QCOM24A5")  // _HID: Hardware ID
            Name (_CID, "ACPIQCOM24A5")  // _CID: Compatible ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x02130000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                {
                    0x00000021,
                }
            })
            Device (DEV0)
            {
                Method (_ADR, 0, NotSerialized)  // _ADR: Address
                {
                    Return (0x08)
                }

                Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                {
                    Return (Zero)
                }
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((MUFS & 0x02))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }
        }

        Device (HDEF)
        {
            Name (_HID, "PNPB009")  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (MHDA)
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0x04, 
                0x03, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x021B0000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                {
                    0x00000025,
                }
            })
        }

        Device (GPU0)
        {
            Name (_HID, "PRL4005")  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((GPU & 0x02))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0x03, 
                0x02, 
                Zero
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x02170000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0x20000000,         // Address Base
                    0x00000000,         // Address Length
                    _Y00)
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x00000027,
                }
            })
            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.GPU0._Y00._LEN, LFBL)  // _LEN: 
Length
                LFBL = (VRAM << 0x14)
                Return (RBUF) /* \_SB_.GPU0.RBUF */
            }
        }

        Device (TGT0)
        {
            Name (_HID, "PRL4000")  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((TOOL & One))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0xFF, 
                Zero, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x02190000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x00000028,
                }
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x00000029,
                }
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x0000002A,
                }
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x0000002B,
                }
            })
        }

        Device (BLN0)
        {
            Name (_HID, "PRL4006")  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((LOON & One))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0xFF, 
                Zero, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x021A0000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x00000026,
                }
            })
        }

        Device (ETH0)
        {
            Name (_HID, "PRL4009")  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((NET & One))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0x02, 
                Zero, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x021C0000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x0000002C,
                }
            })
        }

        Device (ETH1)
        {
            Name (_HID, "PRL4009")  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((NET & 0x04))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0x02, 
                Zero, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x021D0000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x0000002D,
                }
            })
        }

        Device (ETH2)
        {
            Name (_HID, "PRL4009")  // _HID: Hardware ID
            Name (_UID, 0x02)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((NET & 0x10))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0x02, 
                Zero, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x021E0000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x0000002E,
                }
            })
        }

        Device (ETH3)
        {
            Name (_HID, "PRL4009")  // _HID: Hardware ID
            Name (_UID, 0x03)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((NET & 0x40))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                0x02, 
                Zero, 
                Zero
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x021F0000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
                {
                    0x0000002F,
                }
            })
        }

        Device (EHC0)
        {
            Name (_HID, "PNP0D20" /* EHCI USB Controller without debug */)  // 
_HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((MUSB & 0x02))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x02150000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                {
                    0x00000023,
                }
            })
        }

        Device (AHC0)
        {
            Name (_HID, "MSFT0007")  // _HID: Hardware ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((MAHC & One))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CLS, Package (0x03)  // _CLS: Class Code
            {
                One, 
                0x06, 
                One
            })
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x02140000,         // Address Base
                    0x00002000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                {
                    0x00000022,
                }
            })
        }

        Device (TAAD)
        {
            Name (_HID, "ACPI000E" /* Time and Alarm Device */)  // _HID: 
Hardware ID
            OperationRegion (RTC, SystemMemory, 0x02121000, 0x0100)
            Field (RTC, AnyAcc, NoLock, Preserve)
            {
                Y,      16, 
                M,      8, 
                D,      8, 
                H,      8, 
                MI,     8, 
                S,      8, 
                P,      8, 
                MS,     16, 
                TZ,     16, 
                DL,     8, 
                P2,     24
            }

            Method (_GCP, 0, NotSerialized)  // _GCP: Get Capabilities
            {
                Return (0x04)
            }

            Name (BUFF, Buffer (0x10){})
            Method (_GRT, 0, Serialized)  // _GRT: Get Real Time
            {
                CreateWordField (BUFF, Zero, Y)
                CreateByteField (BUFF, 0x02, M)
                CreateByteField (BUFF, 0x03, D)
                CreateByteField (BUFF, 0x04, H)
                CreateByteField (BUFF, 0x05, MI)
                CreateByteField (BUFF, 0x06, S)
                CreateByteField (BUFF, 0x07, P)
                CreateWordField (BUFF, 0x08, MS)
                CreateWordField (BUFF, 0x0A, TZ)
                CreateByteField (BUFF, 0x0C, DL)
                CreateByteField (BUFF, 0x0D, P2)
                Y = ^Y /* \_SB_.TAAD.Y___ */
                M = ^M /* \_SB_.TAAD.M___ */
                D = ^D /* \_SB_.TAAD.D___ */
                H = ^H /* \_SB_.TAAD.H___ */
                MI = ^MI /* \_SB_.TAAD.MI__ */
                S = ^S /* \_SB_.TAAD.S___ */
                P = ^P /* \_SB_.TAAD.P___ */
                MS = ^MS /* \_SB_.TAAD.MS__ */
                TZ = ^TZ /* \_SB_.TAAD.TZ__ */
                DL = ^DL /* \_SB_.TAAD.DL__ */
                P2 = ^P2 /* \_SB_.TAAD.P2__ */
                Return (BUFF) /* \_SB_.TAAD.BUFF */
            }

            Method (_SRT, 1, NotSerialized)  // _SRT: Set Real Time
            {
                Return (Zero)
            }
        }

        Device (XHC0)
        {
            Name (_HID, "PNP0D10" /* XHCI USB Controller with debug */)  // 
_HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CCA, One)  // _CCA: Cache Coherency Attribute
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((MUSB & 0x04))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0x02160000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                {
                    0x00000024,
                }
            })
        }
    }
}

Reply via email to