beryllium: Both Tianma and EBBG work now
authorMarijan Limov <marijan.limov@gmail.com>
星期六, 22 Jan 2022 00:43:05 +0000 (01:43 +0100)
committerMarijan Limov <marijan.limov@gmail.com>
星期六, 22 Jan 2022 00:43:05 +0000 (01:43 +0100)
beryllium/DSDT.AML
beryllium/display.asl
beryllium/graphics.asl
beryllium/panelcfg.asl
beryllium/panelcfg2.asl
legacy/beryllium/DSDT.aml
legacy/beryllium/DSDT.dsl

index 02c2e0dfde7589098cbb6eef1abae0af32c74708..2c3b9939c04052e078cc4e371a2bced4ca3244ce 100644 (file)
Binary files a/beryllium/DSDT.AML and b/beryllium/DSDT.AML differ
index 9b09f2c6aa62e4af27d64a8e7d315819c2204b86..bba38fd70684990f5055d12d03890e36718fc7b1 100644 (file)
@@ -1,13 +1,50 @@
 //
 // This file contains the ACPI Extensions for Display Adapters
 //
+
+// Include primary panel specific ROM data
+Include("panelcfg.asl")
+Include("panelcfg2.asl")
+
+//Check if 0x01 on IC15 is present
+//If it is, return tianma panel config
+Method (PNPC, 0, NotSerialized) {
+
+    // OperationRegion(TOP1, GenericSerialBus, 0x00, 0x100) // GenericSerialBus device at command value offset 0
+    // Field(TOP1, BufferAcc, NoLock, Preserve)
+    // {
+    //     Connection(I2cSerialBusV2 (0x0001, ControllerInitiated, 0x00061A80,
+    //                     AddressingMode7Bit, "\\_SB.IC15",
+    //                     0x00, ResourceConsumer, , Exclusive,
+    //                     )),
+    //     AccessAs(BufferAcc, AttribQuick), // Use the GenericSerialBus Read/Write Quick protocol
+    //     FLD0, 8 // Virtual register at command value 0.
+    // }
+    // /* Create the GenericSerialBus data buffer */
+    // Name(BUFF, Buffer(2){}) // Create GenericSerialBus data buffer as BUFF
+    // CreateByteField(BUFF, 0x00, STAT) // STAT = Status (Byte)
+    // /* Signal device (e.g. OFF) */
+    // Store(FLD0, BUFF) // Invoke Read Quick transaction
+    // If(LEqual(STAT, 0x00)) // Successful?
+    // {
+    //     Return(PCFA)
+    // }
+    // Else
+    // {
+    //     Return(PCFB)
+    // }
+
+    Return(PCFB)
+}
+
+
 ///
 // _ROM Method - Used to retrieve proprietary ROM data for primary panel
 //
 Method (_ROM, 3, NotSerialized) {
 
-   // Include primary panel specific ROM data
-   Include("panelcfg.asl")
+
+
 
    //======================================================================================
    //  Based on the panel Id(Arg2), store the buffer object into Local2
@@ -17,7 +54,7 @@ Method (_ROM, 3, NotSerialized) {
    //       All other dynamically detected panel configurations must not use this name
    //======================================================================================
 
-   Local2 = PCFG
+   Local2 = PNPC
 
    // Ensure offset does not exceed the buffer size 
    // otherwise return a Null terminated buffer
index baee7142d942fbec93ea1579de8d1eb58e223e59..fab30f6410215b7f99a6500c1f17ec9261aeb5b2 100644 (file)
@@ -3050,6 +3050,9 @@ Device (GPU0)
     //
     //Include("displayext.asl")
     
+
+    
+
     NAME(_DOD, Package()
     {
         0x00024321,
index b1fd49e4a73f0d8708e1015d11fec8c7ee9d21d6..8793e1411842ef35782390544a1895cf99b7dc22 100644 (file)
@@ -1,4 +1,4 @@
-Name (PCFG, Buffer(){"
+Name (PCFA, Buffer(){"
     <?xml version='1.0' encoding='utf-8'?>
 <PanelName>TIANMA_NT36672A_FHD</PanelName>
 <PanelDescription>Tianma Single DSI Video Mode Panel (1080x2246 24bpp)</PanelDescription>
index ae91c7c6054b3af48106fdb22f3cab8a91b7cbb2..756ce3c8c594158ae201ef138da70d868e9fc709 100644 (file)
@@ -1,7 +1,7 @@
-Name (PCFG, Buffer(){"
+Name (PCFB, Buffer(){"
     <?xml version='1.0' encoding='utf-8'?>
 <PanelName>EBBG</PanelName>
-<PanelDescription>EBBG</PanelDescription>
+<PanelDescription>EBBG (possibly Tianma)</PanelDescription>
 <Group id='Active Timing'>
        <HorizontalActive>1080</HorizontalActive>
        <HorizontalFrontPorch>28</HorizontalFrontPorch>
index 72d9cb0c571879fda9d70c30e670b27eec40df2a..3b3080afa6793011b28b6391c0cadefde8594760 100644 (file)
Binary files a/legacy/beryllium/DSDT.aml and b/legacy/beryllium/DSDT.aml differ
index c12ac1acda7064e3b4c250e8b1d76ae9f14512d8..6e6a107d7b1810dcc9e2c3eea0b6382dcf36d387 100644 (file)
@@ -57721,6 +57721,33 @@ Include("cust_thermal_zones.asl")
                     //        32
                     //    }
                 })
+                               
+                               
+                               OperationRegion(TOP1, GenericSerialBus, 0x00, 0x100) // GenericSerialBus device at command value offset
+                               Field(TOP1, BufferAcc, NoLock, Preserve)
+                               {
+                                       Connection(I2CSerialBusV2(0x5a,,100000,,"\_SB.I2C",,,,,RawDataBuffer(){1,6})),
+                                       AccessAs(BufferAcc, AttribByte), // Use the GenericSerialBus Read/Write Byte protocol
+                                       FLD0, 8, // Virtual register at command value 0.
+                                       FLD1, 8, // Virtual register at command value 1.
+                                       FLD2, 8 // Virtual register at command value 2.
+                               }
+                               // Create the GenericSerialBus data buffer
+                               Name(BUFF, Buffer(3){})
+                               // Create GenericSerialBus data buffer as BUFF
+                               CreateByteField(BUFF, 0x00, STAT) // STAT = Status (Byte)
+                               CreateByteField(BUFF, 0x02, DATA) // DATA = Data (Byte)
+                               // Read a byte of data from the device using command value 1
+                               Store(FLD1, BUFF) // Invoke a Read Byte transaction
+                               If(LEqual(STAT, 0x00)) // Successful?
+                               {
+                                       Store(0x16, DATA) // Save 0x16 into the data buffer
+                                       Store(BUFF, FLD2) // Invoke a Write Byte transaction
+                               }
+                               // Write the byte ‘0x16’ to the device using command value 2
+
+                               
+                               
                 Return (RBUF) /* \_SB_.TSC1._CRS.RBUF */
             }
                        
@@ -57980,6 +58007,229 @@ Include("cust_thermal_zones.asl")
             }
         }
 
+               Scope (\_SB.PEP0)
+        {
+            Method (FPMX, 0, NotSerialized)
+            {
+                Return (FPXC) /* \_SB_.PEP0.FPXC */
+            }
+
+            Name (FPXC, Package (0x01)
+            {
+                Package (0x04)
+                {
+                    "DEVICE", 
+                    "\\_SB.FPRT", 
+                    Package (0x08)
+                    { // beryllium uses an ic with enable pin to control power to fp, while yoga shuts and turns on a regulator
+                        /*"DSTATE", 
+                        Zero, 
+                        Package (0x02)
+                        {
+                            "PMICVREGVOTE", 
+                            Package (0x06)
+                            {
+                                "PPP_RESOURCE_ID_LDO19_A", 
+                                One,                           // Voltage Regulator Type, 1 = LDO
+                                0x002F4D60,    // Voltage (uV)
+                                One,                           // Enable
+                                0x07,                          // Power Mode
+                                Zero                           // Headroom
+                            }
+                        }, */
+
+                                               Package (0x02)//enable
+                        {
+                            "TLMMGPIO", 
+                            Package (0x06)
+                            {
+                                                               94, 
+                                One, 
+                                Zero, 
+                                One, 
+                                Zero, 
+                                One
+                            }
+                        }, 
+
+                        Package (0x02)
+                        {
+                            "DELAY", 
+                            Package (0x01)
+                            {
+                                0x0A
+                            }
+                        }, 
+
+                        Package (0x02)
+                        {
+                            "TLMMGPIO", 
+                            Package (0x06)
+                            {
+                                121,   // TLMM GPIO
+                                One,   // State                                        : 1 = HIGH
+                                Zero,  // Function Select      :  0 = ??
+                                One,   // Direction                    :   0 = INPUT
+                                Zero,  // Pull Type                    :   1 = PULL_DOWN
+                                Zero   // Drive Strength       :   0 = 2mA
+                            }
+                        }, 
+
+                        Package (0x02)
+                        {
+                            "TLMMGPIO", 
+                            Package (0x06)
+                            {
+                                37, 
+                                One, 
+                                Zero, 
+                                One, 
+                                Zero, 
+                                Zero
+                            }
+                        }, 
+
+                        Package (0x02)
+                        {
+                            "DELAY", 
+                            Package (0x01)
+                            {
+                                One
+                            }
+                        }, 
+
+                        Package (0x02)
+                        {
+                            "TLMMGPIO", 
+                            Package (0x06)
+                            {
+                                121, 
+                                One, 
+                                Zero, 
+                                One, 
+                                One, 
+                                Zero
+                            }
+                        }
+                    }, 
+
+                    Package (0x03)
+                    {
+                        /*"DSTATE", 
+                        0x03, 
+                        Package (0x02)
+                        {
+                            "PMICVREGVOTE", 
+                            Package (0x06)
+                            {
+                                "PPP_RESOURCE_ID_LDO19_A", 
+                                One, 
+                                Zero, 
+                                Zero, 
+                                Zero, 
+                                Zero
+                            }
+                        }*/
+                                               
+                                               Package (0x02)//disable
+                        {
+                            "TLMMGPIO", 
+                            Package (0x06)
+                            {
+                                94, 
+                                Zero, 
+                                Zero, 
+                                Zero, 
+                                One, 
+                                Zero
+                            }
+                        }, 
+                                               
+                    }
+                }
+            })
+        }
+
+
+               // needs pin 94 high to get power //power enable pin
+               // Also seems to need VREG_S4A_1P8  (pm8998-smps4) edit:apparently that one is always on
+               Device (FPRT)
+        {
+            Name (_HID, "GXFP55A4")  // _HID: Hardware ID
+            Name (_CID, "GXFP55A4")  // _CID: Compatible ID
+            Name (_UID, "GXFP55A4")  // _UID: Unique ID
+            Name (_DEP, Package (0x03)  // _DEP: Dependencies
+            {
+                \_SB.GIO0, 
+                \_SB.PEP0, 
+                \_SB.TREE
+            })
+            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
+            {
+                Name (BBUF, ResourceTemplate ()
+                {
+                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionNone,
+                        "\\_SB.GIO0", 0x00, ResourceConsumer, ,
+                        )
+                        {   // Pin list
+                            37 //fp_reset //originally 104/0x68
+                        }
+                    GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
+                        "\\_SB.GIO0", 0x00, ResourceConsumer, ,
+                        )
+                        {   // Pin list
+                            121 //fp_int 0x79 //same as on yoga
+                        }
+                })
+                Return (BBUF) /* \_SB_.FPRT._CRS.BBUF */
+            }
+
+            Name (PGID, Buffer (0x0A)
+            {
+                "\\_SB.FPRT"
+            })
+            Name (DBUF, Buffer (DBFL){})
+            CreateByteField (DBUF, Zero, STAT)
+            CreateByteField (DBUF, 0x02, DVAL)
+            CreateField (DBUF, 0x18, 0xA0, DEID)
+            Method (_S1D, 0, NotSerialized)  // _S1D: S1 Device State
+            {
+                Return (0x03)
+            }
+
+            Method (_S2D, 0, NotSerialized)  // _S2D: S2 Device State
+            {
+                Return (0x03)
+            }
+
+            Method (_S3D, 0, NotSerialized)  // _S3D: S3 Device State
+            {
+                Return (0x03)
+            }
+
+            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
+            {
+                DEID = Buffer (ESNL){}
+                DVAL = Zero
+                DEID = PGID /* \_SB_.FPRT.PGID */
+                If (\_SB.ABD.AVBL)
+                {
+                    \_SB.PEP0.FLD0 = DBUF /* \_SB_.FPRT.DBUF */
+                }
+            }
+
+            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
+            {
+                DEID = Buffer (ESNL){}
+                DVAL = 0x03
+                DEID = PGID /* \_SB_.FPRT.PGID */
+                If (\_SB.ABD.AVBL)
+                {
+                    \_SB.PEP0.FLD0 = DBUF /* \_SB_.FPRT.DBUF */
+                }
+            }
+        }
+
         Device (BTNS)
         {
             Name (_HID, "ACPI0011" /* Generic Buttons Device */)  // _HID: Hardware ID