From: Xilin Wu Date: 星期一, 17 Jan 2022 14:06:36 +0000 (+0800) Subject: Revert "Made code compilable with lastest iasl" X-Git-Url: https://git.renegade-project.org/?a=commitdiff_plain;h=e2c1a2e322c5567fda6eac521a4c2df736d6787c;p=edk2-sdm845-acpi.git Revert "Made code compilable with lastest iasl" DSDT built using iasl breaks Modern Standby and some power configuration This reverts commit b1b0550175d97e19a9611894fdb6251a92b9ea9f. --- diff --git a/Common/pcie.asl b/Common/pcie.asl index d725d1d..10503a5 100644 --- a/Common/pcie.asl +++ b/Common/pcie.asl @@ -755,7 +755,7 @@ Device (PCI0) { If(LNotEqual(And(SUPP, 0x16), 0x16)) { - And(CTRL,0x1E,CTRL) // Give control of everything to the OS //Fixed syntax. + And(CTRL,0x1E) // Give control of everything to the OS } And(CTRL,0x15,CTRL) diff --git a/Common/pcie1.asl b/Common/pcie1.asl index e702c4b..0ef7bf3 100644 --- a/Common/pcie1.asl +++ b/Common/pcie1.asl @@ -1007,7 +1007,7 @@ Device (PCI1) { If(LNotEqual(And(SUPP, 0x16), 0x16)) { - And(CTRL,0x1E,CTRL) // Give control of everything to the OS //Fixed syntax. + And(CTRL,0x1E) // Give control of everything to the OS } And(CTRL,0x15,CTRL) diff --git a/Common/pmic_core.asl b/Common/pmic_core.asl index 5ee5b89..b99a3f8 100644 --- a/Common/pmic_core.asl +++ b/Common/pmic_core.asl @@ -157,7 +157,7 @@ Device (PMAP) Device (PRTC) { Name(_HID, "ACPI000E") - Name(_DEP, Package() {PMAP}) // PRTC is dependent on PMAP which implements the RTC Functions + Name(_DEP, Package() {"\\_SB.PMAP"}) // PRTC is dependent on PMAP which implements the RTC Functions //Get the capabilities of the time and alarm device Method(_GCP) diff --git a/polaris/DSDT.AML b/polaris/DSDT.AML index 2a018e7..df5cb95 100644 Binary files a/polaris/DSDT.AML and b/polaris/DSDT.AML differ diff --git a/polaris/display2.asl b/polaris/display2.asl index c16e08d..b8724ef 100644 --- a/polaris/display2.asl +++ b/polaris/display2.asl @@ -17,15 +17,13 @@ Method (ROM2, 3, NotSerialized) { // PCFG is buffer name for all default panel configurations // All other dynamically detected panel configurations must not use this name //====================================================================================== -// Switch ( ToInteger (Arg2) ) -// { -// // Default case -// Default { -// Store (PCFG, Local2) -// } -// } - -Store (PCFG, Local2) //It's the default above, looks like it gets run always. TAO_Croatia + Switch ( ToInteger (Arg2) ) + { + // Default case + Default { + Store (PCFG, Local2) + } + } // Ensure offset does not exceed the buffer size // otherwise return a Null terminated buffer diff --git a/polaris/graphics.asl b/polaris/graphics.asl index 2055be9..e92ac7e 100644 --- a/polaris/graphics.asl +++ b/polaris/graphics.asl @@ -1449,7 +1449,7 @@ Device (GPU0) "BANDWIDTH", // Resource Type 13, // Num P-States in Set 0, // Num CustomData fields in Set - "TRUE", // Has Thermal Thresholds //Put it in quotes so compiler doesn't complain. TAO_Croatia + TRUE, // Has Thermal Thresholds 4, // Initial P-State 3, // Stable Power P-State @@ -2962,7 +2962,7 @@ Device (GPU0) "CORE_CLOCK", // Resource Type 9, // Num P-States in Set 1, // Num CustomData fields in Set - "TRUE", // Has Thermal Thresholds + TRUE, // Has Thermal Thresholds 5, // Initial P-State 3, // Stable Power P-State @@ -3001,7 +3001,7 @@ Device (GPU0) "CORE_CLOCK", // Resource Type 2, // Num P-States in Set 1, // Num CustomData fields in Set - "TRUE", // Has Thermal Thresholds + TRUE, // Has Thermal Thresholds 0, // Initial P-State 0, // Stable Power P-State diff --git a/polaris/nfc.asl b/polaris/nfc.asl index 6e1d4a7..8445d32 100644 --- a/polaris/nfc.asl +++ b/polaris/nfc.asl @@ -1,217 +1,172 @@ -Device (NFCD) +// +// NFC entry. +// +Device(NFCD) { - Name (_HID, "NXP1001") // _HID: Hardware ID - Name (_CID, "ACPI\NXP1001") // _CID: Compatible ID - Alias (\_SB.PSUB, _SUB) - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + Name(_HID, "NXP1001") + Name(_CID, "ACPI\NXP1001") + Alias(\_SB.PSUB, _SUB) + Name(_CRS, ResourceTemplate() { - I2cSerialBusV2 (0x0028, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\\_SB.I2C4", - 0x00, ResourceConsumer, , Exclusive, - ) - GpioInt (Level, ActiveHigh, Exclusive, PullDefault, 0x0000, - "\\_SB.GIO0", 0x00, ResourceConsumer, , - ) - { // Pin list - 0x003F - } + I2CSerialBus(0x28, ControllerInitiated, 400000, AddressingMode7Bit, "\\_SB.I2C4", 0, ResourceConsumer, , ) + GpioInt(Level, ActiveHigh, Exclusive, PullDefault, 0, "\\_SB.GIO0", 0, ResourceConsumer, , ) {63} }) // ESE SPI GPIO - Name (NFCS, ResourceTemplate () + Name(NFCS, ResourceTemplate() { - GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionNone, - "\\_SB.GIO0", 0x00, ResourceConsumer, , - ) - { // Pin list - 0x0074 - } + GpioIO(Exclusive, PullDefault, 0, 0, IoRestrictionNone, "\\_SB.GIO0", 0, ResourceConsumer, , ) {116} }) // NFCC VEN GPIO - Name (NFCP, ResourceTemplate () + Name(NFCP, ResourceTemplate() { - GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionNone, - "\\_SB.GIO0", 0x00, ResourceConsumer, , - ) - { // Pin list - 0x000C - } + GpioIO(Exclusive, PullDefault, 0, 0, IoRestrictionNone, "\\_SB.GIO0", 0, ResourceConsumer, , ) {12} }) - Scope (GIO0) - { - OperationRegion (NFPO, GeneralPurposeIo, Zero, One) - } - - Field (\_SB.GIO0.NFPO, ByteAcc, NoLock, Preserve) - { - Connection (\_SB.NFCD.NFCP), - MGPE, 1 - } - - Method (POON, 0, NotSerialized) - { - MGPE = One - } - - Method (POOF, 0, NotSerialized) - { - MGPE = Zero - } + Scope(GIO0) + { + OperationRegion(NFPO, GeneralPurposeIO, Zero, One) + } + Field(\_SB_.GIO0.NFPO, ByteAcc, NoLock, Preserve) + { + Connection(\_SB_.NFCD.NFCP), + MGPE, 1 + } + Method(POON, 0x0, NotSerialized) + { + Store(One, MGPE) + } + Method(POOF, 0x0, NotSerialized) + { + Store(Zero, MGPE) + } //NFCC FW DOWNLOAD GPIO - Name (NFCF, ResourceTemplate () + Name(NFCF, ResourceTemplate() { - GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionNone, - "\\_SB.GIO0", 0x00, ResourceConsumer, , - ) - { // Pin list - 0x0058 - } + GpioIO(Exclusive, PullDefault, 0, 0, IoRestrictionNone, "\\_SB.GIO0", 0, ResourceConsumer, , ) {88} // Download }) - Scope (GIO0) - { - OperationRegion (NFFO, GeneralPurposeIo, Zero, One) - } - - Field (\_SB.GIO0.NFFO, ByteAcc, NoLock, Preserve) - { - Connection (\_SB.NFCD.NFCF), - MGFE, 1 - } - - Method (FWON, 0, NotSerialized) - { - MGFE = One - } - - Method (FWOF, 0, NotSerialized) - { - MGFE = Zero - } - - Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method - { - Debug = "Method NFC _DSM begin" - If ((Arg0 == ToUUID ("a2e7f6c4-9638-4485-9f12-6b4e20b60d63") /* Unknown UUID */)) + Scope(GIO0) { - If ((Arg2 == Zero)) + OperationRegion(NFFO, GeneralPurposeIO, Zero, One) + } + Field(\_SB_.GIO0.NFFO, ByteAcc, NoLock, Preserve) + { + Connection(\_SB_.NFCD.NFCF), + MGFE, 1 + } + Method(FWON, 0x0, NotSerialized) { - Debug = "Method NFC _DSM QUERY" - If ((Arg1 == One)) - { - \_SB.NFCD.POOF () - Sleep (0x14) - Return (Buffer (One) - { - 0x0F // . - }) - } + Store(One, MGFE) } - - If ((Arg2 == 0x02)) + Method(FWOF, 0x0, NotSerialized) { - Debug = "Method NFC _DSM SETPOWERMODE" - If ((Arg3 == One)) - { - \_SB.NFCD.POON () - Sleep (0x14) - } - - If ((Arg3 == Zero)) - { - \_SB.NFCD.POOF () - Sleep (0x14) - } + Store(Zero, MGFE) } - - If ((Arg2 == One)) + Method(_DSM, 0x4, NotSerialized) { - Debug = "Method NFC _DSM SETFWMODE" + Store("Method NFC _DSM begin", Debug) + If(LEqual(Arg0, Buffer(0x10) + { + 0xc4, 0xf6, 0xe7, 0xa2, 0x38, 0x96, 0x85, 0x44, 0x9f, 0x12, 0x6b, 0x4e, + 0x20, 0xb6, 0x0d, 0x63 + })) + { + If(LEqual(Arg2, Zero)) + { + Store("Method NFC _DSM QUERY", Debug) + If(LEqual(Arg1, One)) + { + \_SB_.NFCD.POOF() + Sleep(0x14) + Return(Buffer(One) + { + 0x0f + }) + } + } + If(LEqual(Arg2, 0x2)) + { + Store("Method NFC _DSM SETPOWERMODE", Debug) + If(LEqual(Arg3, One)) + { + \_SB_.NFCD.POON() + Sleep(0x14) + } + If(LEqual(Arg3, Zero)) + { + \_SB_.NFCD.POOF() + Sleep(0x14) + } + } + If(LEqual(Arg2, One)) + { + Store("Method NFC _DSM SETFWMODE", Debug) // // Set the firmware mode to ON. // - If ((Arg3 == One)) - { - \_SB.NFCD.FWON () + If(LEqual(Arg3, One)) + { + \_SB_.NFCD.FWON() // // Provide any delay required by the controller before toggling the power GPIO line. // - Sleep (0x14) - \_SB.NFCD.POOF () - Sleep (0x14) - \_SB.NFCD.POON () - Sleep (0x14) - } + Sleep(0x14) + \_SB_.NFCD.POOF() + Sleep(0x14) + \_SB_.NFCD.POON() + Sleep(0x14) + } // // Set the firmware mode to OFF. // - If ((Arg3 == Zero)) - { - \_SB.NFCD.FWOF () - Sleep (0x14) - \_SB.NFCD.POOF () - Sleep (0x14) - \_SB.NFCD.POON () - Sleep (0x14) + If(LEqual(Arg3, Zero)) + { + \_SB_.NFCD.FWOF() + Sleep(0x14) + \_SB_.NFCD.POOF() + Sleep(0x14) + \_SB_.NFCD.POON() + Sleep(0x14) + } + } + If(LEqual(Arg2, 0x3)) + { + Store("Method NFC _DSM EEPROM Config", Debug) + Return(Buffer(0x13) + { + 0x9c, 0x1f, 0x38, 0x19, 0xa8, 0xb9, 0x4b, 0xab, 0xa1, 0xba, 0xd0, 0x20, + 0x76, 0x88, 0x2a, 0xe0, 0x03, 0x01, 0x11 + }) + } } } - - If ((Arg2 == 0x03)) +//PEP Proxy Support + Name(PGID, Buffer(10) {"\\_SB.NFCD"}) // Device ID buffer - PGID( Pep given ID ) + Name(DBUF, Buffer(DBFL) {}) // Device ID buffer - PGID( Pep given ID ) + CreateByteField(DBUF, 0x0, STAT) // STATUS 1 BYTE + // HIDDEN 1 BYTE ( SIZE ) + CreateByteField(DBUF, 2, DVAL ) // Packet value, 1 BYTES Device Status + CreateField(DBUF, 24, 160, DEID) // Device ID, 20 BYTES(160 Bits) + Method (_S1D, 0) { Return (3) } // S1 => D3 + Method (_S2D, 0) { Return (3) } // S2 => D3 + Method (_S3D, 0) { Return (3) } // S3 => D3 + + Method(_PS0, 0x0, NotSerialized) { - Debug = "Method NFC _DSM EEPROM Config" - Return (Buffer (0x13) - { - /* 0000 */ 0x9C, 0x1F, 0x38, 0x19, 0xA8, 0xB9, 0x4B, 0xAB, // ..8...K. - /* 0008 */ 0xA1, 0xBA, 0xD0, 0x20, 0x76, 0x88, 0x2A, 0xE0, // ... v.*. - /* 0010 */ 0x03, 0x01, 0x11 // ... - }) + Store(Buffer(ESNL){}, DEID) + Store(0, DVAL) + Store(PGID, DEID) + If(\_SB.ABD.AVBL) + { + Store(DBUF, \_SB.PEP0.FLD0) + } } - } - } -//PEP Proxy Support - Name (PGID, Buffer (0x0A) // Device ID buffer - PGID( Pep given ID ) - { - "\\_SB.NFCD" - }) - Name (DBUF, Buffer (DBFL) {}) // Device ID buffer - PGID( Pep given ID ) - CreateByteField (DBUF, Zero, STAT) // STATUS 1 BYTE - // HIDDEN 1 BYTE ( SIZE ) - CreateByteField (DBUF, 0x02, DVAL) // Packet value, 1 BYTES Device Status - CreateField (DBUF, 0x18, 0xA0, DEID)// Device ID, 20 BYTES(160 Bits) - - // Sets all sleep states to D3 - 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_.NFCD.PGID */ - If (\_SB.ABD.AVBL) - { - \_SB.PEP0.FLD0 = DBUF /* \_SB_.NFCD.DBUF */ - } - } - - Method (_PS3, 0, NotSerialized) // _PS3: Power State 3 - { - DEID = Buffer (ESNL) {} - DVAL = 0x03 - DEID = PGID /* \_SB_.NFCD.PGID */ - If (\_SB.ABD.AVBL) - { - \_SB.PEP0.FLD0 = DBUF /* \_SB_.NFCD.DBUF */ - } - } -} \ No newline at end of file + Method(_PS3, 0x0, NotSerialized) + { + Store(Buffer(ESNL){}, DEID) + Store(3, DVAL) + Store(PGID, DEID) + If(\_SB.ABD.AVBL) + { + Store(DBUF, \_SB.PEP0.FLD0) + } + } +}