From: Vu Nguyen <vungu...@os.amperecomputing.com> This adds necessary changes of ACPI tables and defines the memory region between OS and Trusted Firmware-A for supporting Hot Plug of Ampere Altra Max.
Signed-off-by: Minh Nguyen <minhnguy...@os.amperecomputing.com> --- Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi | 24 + Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl | 511 ++++++++++ Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi | 92 ++ Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi | 545 ++++++++++ Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi | 1072 ++++++++++++++++++++ 5 files changed, 2244 insertions(+) diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi b/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi index 17ecd52a553f..73804cab81b5 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi @@ -174,7 +174,16 @@ Device(GED0) { } Name(_CRS, ResourceTemplate () { Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 84 } // GHES + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 44 } // PCIe Hot Plug Doorbell Insertion & Ejection (DBNS4 -> GIC-IRQS44) }) + + // @DBN4 agent base address for HP PCIe insertion/ejection event: 0x1000.0054.4000 + OperationRegion(DBN4, SystemMemory, 0x100000544010, 20) + Field (DBN4, DWordAcc, NoLock, Preserve) { + DOUT, 32, // event and PCIe port information at offset 0x10 + offset (0x10), + STA4, 32, // interrupt status at offset 0x20 + } } // Shutdown button using GED. @@ -511,3 +520,18 @@ Device(NVDR) { } } } + +// +// LED Device +Device(LED) { + Name(_HID, "AMPC0008") + Name(_CCA, ONE) + Name(_STR, Unicode("Altra LED Device")) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "uuid", Package (4) { 0x5598273c, 0xa49611ea, 0xbb370242, 0xac130002 }}, + } + }) +} diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl b/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl index ce12272f961d..f2977d4e58a8 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl @@ -12,8 +12,519 @@ DefinitionBlock("Dsdt.aml", "DSDT", 0x02, "Ampere", "Jade", 1) { Name(\BDMD, "Altra Max Jade Board") Name(AERF, 0) // PCIe AER Firmware-First + Include ("MHPP.asi") + Scope(\_SB) { + Include ("CommonDevices.asi") + + Scope(\_SB.GED0) { + Method(_EVT, 1, Serialized) { + Switch (ToInteger(Arg0)) { + Case (84) { // GHES interrupt + Notify (HED0, 0x80) + } + + Case (44) { // doorbell notification (Insertion/ejection) + local0 = DOUT & 0x00FF0000 + if (local0 == 0x00010000) { + local0 = STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 = A050 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 = A051 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P2, 1) // insertion action + } + local0 = A052 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 = A053 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P4, 1) // insertion action + } + local0 = A040 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 = A041 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P2, 1) // insertion action + } + local0 = A042 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 = A043 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P4, 1) // insertion action + } + local0 = A160 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 = A161 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P2, 1) // insertion action + } + local0 = A162 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 = A163 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P4, 1) // insertion action + } + + local0 = A170 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 = A171 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P2, 1) // insertion action + } + local0 = A172 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 = A173 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P4, 1) // insertion action + } + + local0 = A150 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 = A151 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P2, 1) // insertion action + } + local0 = A152 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 = A153 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P4, 1) // insertion action + } + + + local0 = A120 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 = A121 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 = A122 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 = A123 & 0xFF000000 + if ((local0 == 0x01000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + } + elseif (local0 == 0x00000000) { + local0 = STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 = A050 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI5.P2P1, 1) // ejection action + A050 = 0x10000500 // inprogress remove + } + local0 = A051 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI5.P2P2, 1) // ejection action + A051 = 0x10010500 // inprogress remove + } + local0 = A052 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI5.P2P3, 1) // ejection action + A052 = 0x10020500 // inprogress remove + } + local0 = A053 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI5.P2P4, 1) // ejection action + A053 = 0x10030500 // inprogress remove + } + local0 = A040 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI4.P2P1, 1) // ejection action + A040 = 0x10000400 // inprogress remove + } + local0 = A041 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI4.P2P2, 1) // ejection action + A041 = 0x10010400 // inprogress remove + } + local0 = A042 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI4.P2P3, 1) // ejection action + A042 = 0x10020400 // inprogress remove + } + local0 = A043 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCI4.P2P4, 1) // ejection action + A043 = 0x10030400 // inprogress remove + } + local0 = A160 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIE.P2P1, 1) // ejection action + A160 = 0x10000601 // inprogress remove + } + local0 = A161 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIE.P2P2, 1) // ejection action + A161 = 0x10010601 // inprogress remove + } + local0 = A162 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIE.P2P3, 1) // ejection action + A162 = 0x10020601 // inprogress remove + } + local0 = A163 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIE.P2P4, 1) // ejection action + A163 = 0x10030601 // inprogress remove + } + + local0 = A170 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIF.P2P1, 1) // ejection action + A170 = 0x10000701 // inprogress remove + } + local0 = A171 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIF.P2P2, 1) // ejection action + A171 = 0x10010701 // inprogress remove + } + local0 = A172 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIF.P2P3, 1) // ejection action + A172 = 0x10020701 // inprogress remove + } + local0 = A173 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIF.P2P4, 1) // ejection action + A173 = 0x10030701 // inprogress remove + } + + local0 = A150 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCID.P2P1, 1) // ejection action + A150 = 0x10000501 // inprogress remove + } + local0 = A151 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCID.P2P2, 1) // ejection action + A151 = 0x10010501 // inprogress remove + } + local0 = A152 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCID.P2P3, 1) // ejection action + A152 = 0x10020501 // inprogress remove + } + local0 = A153 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCID.P2P4, 1) // ejection action + A153 = 0x10030501 // inprogress remove + } + + local0 = A120 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIA.P2P1, 1) // ejection action + A120 = 0x10000201 // inprogress remove + } + local0 = A121 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIA.P2P2, 1) // ejection action + A121 = 0x10010201 // inprogress remove + } + local0 = A122 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIA.P2P3, 1) // ejection action + A122 = 0x10020201 // inprogress remove + } + local0 = A123 & 0xFF000000 + if (local0 == 0x00000000) { + Notify (\_SB.PCIA.P2P4, 1) // ejection action + A123 = 0x10030201 // inprogress remove + } + } + elseif (local0 == 0x00020000) { // is either unstable link or too fast insertion? + local0 = STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 = A050 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P1, 3) // force remove bridge port and port itself + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 = A051 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P2, 3) // force remove bridge port and port itself + Notify (\_SB.PCI5.P2P2, 1) // insertion action + } + local0 = A052 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P3, 3) // force remove bridge port and port itself + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 = A053 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P4, 3) // force remove bridge port and port itself + Notify (\_SB.PCI5.P2P4, 1) // insertion action + } + local0 = A040 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P1, 3) // force remove bridge port and port itself + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 = A041 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P2, 3) // force remove bridge port and port itself + Notify (\_SB.PCI4.P2P2, 1) // insertion action + } + local0 = A042 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P3, 3) // force remove bridge port and port itself + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 = A043 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P4, 3) // force remove bridge port and port itself + Notify (\_SB.PCI4.P2P4, 1) // insertion action + } + local0 = A160 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P1, 3) // force remove bridge port and port itself + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 = A161 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P2, 3) // force remove bridge port and port itself + Notify (\_SB.PCIE.P2P2, 1) // insertion action + } + local0 = A162 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P3, 3) // force remove bridge port and port itself + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 = A163 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P4, 3) // force remove bridge port and port itself + Notify (\_SB.PCIE.P2P4, 1) // insertion action + } + + local0 = A170 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P1, 3) // force remove bridge port and port itself + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 = A171 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P2, 3) // force remove bridge port and port itself + Notify (\_SB.PCIF.P2P2, 1) // insertion action + } + local0 = A172 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P3, 3) // force remove bridge port and port itself + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 = A173 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P4, 3) // force remove bridge port and port itself + Notify (\_SB.PCIF.P2P4, 1) // insertion action + } + + local0 = A150 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P1, 3) // force remove bridge port and port itself + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 = A151 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P2, 3) // force remove bridge port and port itself + Notify (\_SB.PCID.P2P2, 1) // insertion action + } + local0 = A152 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P3, 3) // force remove bridge port and port itself + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 = A153 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P4, 3) // force remove bridge port and port itself + Notify (\_SB.PCID.P2P4, 1) // insertion action + } + + local0 = A120 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P1, 3) // force remove bridge port and port itself + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 = A121 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P2, 3) // force remove bridge port and port itself + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 = A122 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P3, 3) // force remove bridge port and port itself + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 = A123 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P4, 3) // force remove bridge port and port itself + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + } + elseif (local0 == 0x00030000) { // got incomplete remove before? + local0 = STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 = A050 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 = A051 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P2, 1) // insertion action + } + local0 = A052 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 = A053 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI5.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P4, 1) // insertion action + } + local0 = A040 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 = A041 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P2, 1) // insertion action + } + local0 = A042 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 = A043 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCI4.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P4, 1) // insertion action + } + local0 = A160 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 = A161 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P2, 1) // insertion action + } + local0 = A162 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 = A163 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIE.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P4, 1) // insertion action + } + + local0 = A170 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 = A171 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P2, 1) // insertion action + } + local0 = A172 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 = A173 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIF.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P4, 1) // insertion action + } + + local0 = A150 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 = A151 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P2, 1) // insertion action + } + local0 = A152 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 = A153 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCID.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P4, 1) // insertion action + } + + local0 = A120 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 = A121 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 = A122 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 = A123 & 0xFF000000 + if ((local0 == 0x0E000000) || (local0 == 0x0F000000)) { + Notify (\_SB.PCIA.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + } + } + } + } + } + Include ("PCI-S0.Rca01.asi") Include ("PCI-S0.asi") Include ("PCI-S1.asi") diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi b/Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi new file mode 100644 index 000000000000..ae166fd33a92 --- /dev/null +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi @@ -0,0 +1,92 @@ +/** @file + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR> + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +// @DRAM base address 0x88970000 +// Regarding updating the status of hotplug PCIe ports, a shared DRAM +// memory region between Arm Trusted Firmware and UEFI is used to indicate +// PCIe hotplug event action. An item of MHPP table is used to reflect hotplug +// event of each PCIe port. There is a maximum of 48 PCIe hotplug ports in Altra +// Family processor, the definition in this table should be aligned with hotplug +// port map of a specific platform. For example, in Ampere Mt. Jade platform, +// there are 36 PCIe hotplug ports. Hence, this table defines 40 entries corresponding +// to Ampere Mt. Jade PCIe hotplug port map. +OperationRegion(MHPP, SystemMemory, 0x88970000, 960) +Field (MHPP, DWordAcc, NoLock, Preserve) { + A050, 32, // 0. S0 RCA5.0 + A00I, 8, // incomplete remove + offset (24), + A051, 32, // 1. S0 RCA5.1 + A01I, 8, // incomplete remove + offset (48), + A052, 32, // 2. S0 RCA5.2 + A02I, 8, // incomplete remove + offset (72), + A053, 32, // 3. S0 RCA5.3 + A03I, 8, // incomplete remove + offset (96), + A040, 32, // 4. S0 RCA4.0 + A04I, 8, // incomplete remove + offset (120), + A041, 32, // 5. S0 RCA4.1 + A05I, 8, // incomplete remove + offset (144), + A042, 32, // 6. S0 RCA4.0 + A06I, 8, // incomplete remove + offset (168), + A043, 32, // 7. S0 RCA4.1 + A07I, 8, // incomplete remove + offset (192), + A163, 32, // 8. S1 RCA6.3 + A08I, 8, // incomplete remove + offset (216), + A162, 32, // 9 S1 RCA6.2 + A09I, 8, // incomplete remove + offset (240), + A161, 32, // 10. S1 RCA6.1 + A10I, 8, // incomplete remove + offset (264), + A160, 32, // 11. S1 RCA6.0 + A11I, 8, // incomplete remove + offset (288), + A173, 32, // 12. S1 RCA7.3 + A12I, 8, // incomplete remove + offset (312), + A172, 32, // 13. S1 RCA7.2 + A13I, 8, // incomplete remove + offset (336), + A171, 32, // 14. S1 RCA7.1 + A14I, 8, // incomplete remove + offset (360), + A170, 32, // 15. S1 RCA7.0 + A15I, 8, // incomplete remove + offset (384), + A150, 32, // 16. S1 RCA5.0 + A16I, 8, // incomplete remove + offset (408), + A151, 32, // 17. S1 RCA5.1 + A17I, 8, // incomplete remove + offset (432), + A152, 32, // 18. S1 RCA5.2 + A18I, 8, // incomplete remove + offset (456), + A153, 32, // 19. S1 RCA5.3 + A19I, 8, // incomplete remove + offset (480), + A120, 32, // 20. S1 RCA2.0 + A20I, 8, // incomplete remove + offset (504), + A121, 32, // 21 S1 RCA2.1 + A21I, 8, // incomplete remove + offset (528), + A122, 32, // 22. S1 RCA2.2 + A22I, 8, // incomplete remove + offset (552), + A123, 32, // 23. S1 RCA2.3 + A23I, 8, // incomplete remove + offset (576) + } diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi b/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi index b6cf18fb2218..e57a2a9ffd63 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi @@ -6,6 +6,15 @@ **/ +Include ("MHPP.asi") + +// @DoorBellNS1 0x1000.0054.1000. Out-Offset: 0x10 +OperationRegion(DNS1, SystemMemory, 0x100000541010 , 8) +Field (DNS1, DWordAcc, NoLock, Preserve) { + OUTV, 32, + DIN0, 32, +} + // PCI2 RCA2 Device (PCI2) { // @@ -997,6 +1006,274 @@ Device (PCI4) { Name (_ADR, 0x00000000) } + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 [01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A040 == 0xF0000400) { // SW ejected ? + Store(0x02000400, A040) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000212, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000212 to DBNS1_10 + Return(0xF) + } + elseif (A040 == 0x10000400) { // ejected complete ? + Store(0x02000400, A040) // clear action value + Return(0x0) + } + elseif ((A040 == 0x01000400) || (A040 == 0x0F000400)) { // inserted? + if (A04I == 0x00) { + Store(0x02000400, A040) // clear action value + } + Return(0xF) + } + elseif ((A040 == 0x0E000400) || (A040 == 0x0F000400)) { // inprogress inserted? + if (A04I == 0x00) { + Store(0x02000400, A040) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A040 == 0x02000400) { // really sw ejection call? + Store(0xF0000400, A040) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000212, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000212 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A041 == 0xF0010400) { // SW ejected ? + Store(0x02010400, A041) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000222, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000222 to DBNS1_10 + Return(0xF) + } + elseif (A041 == 0x10010400) { // ejected complete ? + Store(0x02010400, A041) // clear action value + Return(0x0) + } + elseif ((A041 == 0x01010400) || (A041 == 0x0F010400)) { // inserted? + if (A04I == 0x00) { + Store(0x02010400, A041) // clear action value + } + Return(0xF) + } + elseif ((A041 == 0x0E010400) || (A041 == 0x0F010400)) { // inprogress inserted? + if (A04I == 0x00) { + Store(0x02010400, A041) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A041 == 0x02010400) { // really sw ejection call? + Store(0xF0010400, A041) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000222, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000222 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A042 == 0xF0020400) { // SW ejected ? + Store(0x02020400, A042) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000232, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000232 to DBNS1_10 + Return(0xF) + } + elseif (A042 == 0x10020400) { // ejected complete ? + Store(0x02020400, A042) // clear action value + Return(0x0) + } + elseif ((A042 == 0x01020400) || (A042 == 0x0F020400)) { // inserted? + if (A06I == 0x00) { + Store(0x02020400, A042) // clear action value + } + Return(0xF) + } + elseif ((A042 == 0x0E020400) || (A042 == 0x0F020400)) { // inprogress inserted? + if (A06I == 0x00) { + Store(0x02020400, A042) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A042 == 0x02020400) { // really sw ejection call? + Store(0xF0020400, A042) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000232, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000232 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A043 == 0xF0030400) { // SW ejected ? + Store(0x02030400, A043) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000242, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000242 to DBNS1_10 + Return(0xF) + } + elseif(A043 == 0x10030400) { // ejected complete ? + Store(0x02030400, A043) // clear action value + Return(0x0) + } + elseif((A043 == 0x01030400) || (A043 == 0x0F030400)) { // inserted ? + if (A07I == 0x00) { + Store(0x02030400, A043) // clear action value + } + Return(0xF) + } + elseif((A043 == 0x0E030400) || (A043 == 0x0F030400)) { // inprogress inserted ? + if (A07I == 0x00) { + Store(0x02030400, A043) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A043 == 0x02030400) { // really sw ejection call? + Store(0xF0030400, A043) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000242, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000242 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1341,6 +1618,274 @@ Device (PCI5) { Name (_ADR, 0x00000000) } + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 [01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A050 == 0xF0000500) { // SW ejected ? + Store(0x02000500, A050) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000213, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000213 to DBNS1_10 + Return(0xF) + } + elseif (A050 == 0x10000500) { // ejected complete ? + Store(0x02000500, A050) // clear action value + Return(0x0) + } + elseif ((A050 == 0x01000500) || (A050 == 0x0F000500)) { // inserted? + if (A00I == 0x00) { + Store(0x02000500, A050) // clear action value + } + Return(0xF) + } + elseif ((A050 == 0x0E000500) || (A050 == 0x0F000500)) { // inprogress inserted? + if (A00I == 0x00) { + Store(0x02000500, A050) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A050 == 0x02000500) { // really sw ejection call? + Store(0xF0000500, A050) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000213, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000213 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A051 == 0xF0010500) { // SW ejected ? + Store(0x02010500, A051) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000223, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000223 to DBNS1_10 + Return(0xF) + } + elseif (A051 == 0x10010500) { // ejected complete ? + Store(0x02010500, A051) // clear action value + Return(0x0) + } + elseif ((A051 == 0x01010500) || (A051 == 0x0F010500)) { // inserted? + if (A01I == 0x00) { + Store(0x02010500, A051) // clear action value + } + Return(0xF) + } + elseif ((A051 == 0x0E010500) || (A051 == 0x0F010500)) { // inprogress inserted? + if (A01I == 0x00) { + Store(0x02010500, A051) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A051 == 0x02010500) { // really sw ejection call? + Store(0xF0010500, A051) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000223, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000223 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A052 == 0xF0020500) { // SW ejected ? + Store(0x02020500, A052) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000233, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000233 to DBNS1_10 + Return(0xF) + } + elseif (A052 == 0x10020500) { // ejected complete ? + Store(0x02020500, A052) // clear action value + Return(0x0) + } + elseif ((A052 == 0x01020500) || (A052 == 0x0F020500)) { // inserted? + if (A02I == 0x00) { + Store(0x02020500, A052) // clear action value + } + Return(0xF) + } + elseif ((A052 == 0x0E020500) || (A052 == 0x0F020500)) { // inprogress inserted? + if (A02I == 0x00) { + Store(0x02020500, A052) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A052 == 0x02020500) { // really sw ejection call? + Store(0xF0020500, A052) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000233, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000233 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A053 == 0xF0030500) { // SW ejected ? + Store(0x02030500, A053) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000243, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000243 to DBNS1_10 + Return(0xF) + } + elseif(A053 == 0x10030500) { // ejected complete ? + Store(0x02030500, A053) // clear action value + Return(0x0) + } + elseif((A053 == 0x01030500) || (A053 == 0x0F030500)) { // inserted ? + if (A03I == 0x00) { + Store(0x02030500, A053) // clear action value + } + Return(0xF) + } + elseif((A053 == 0x0E030500) || (A053 == 0x0F030500)) { // inprogress inserted ? + if (A03I == 0x00) { + Store(0x02030500, A053) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A053 == 0x02030500) { // really sw ejection call? + Store(0xF0030500, A053) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000243, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000243 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi b/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi index cb03247895a6..72548fc8030a 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi @@ -330,6 +330,274 @@ Device (PCIA) { Name (_ADR, 0x00000000) } + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A120 == 0xF0000201) { // SW ejected before ? + Store(0x02000201, A120) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000216, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000216 to DBNS1_10 + Return (0xF) + } + elseif (A120 == 0x10000201) { // ejected completed ? + Store(0x02000201, A120) // clear action value + Return (0x0) + } + elseif ((A120 == 0x01000201) || (A120 == 0x0F000201)) { // inserted ? + if (A20I == 0x00) { + Store(0x02000201, A120) // clear action value + } + Return (0xF) + } + elseif ((A120 == 0x0E000201) || (A120 == 0x0F000201)) { // inprogress inserted ? + if (A20I == 0x00) { + Store(0x02000201, A120) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A120 == 0x02000201) { // is sw ejection? + Store(0xF0000201, A120) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000216, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000216 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 ([02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A121 == 0xF0010201) { // SW ejected before ? + Store(0x02010201, A121) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000226, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000226 to DBNS1_10 + Return(0xF) + } + elseif (A121 == 0x10010201) { // ejected completed ? + Store(0x02010201, A121) // clear action value + Return(0x0) + } + elseif ((A121 == 0x01010201) || (A121 == 0x0F010201)) { // inserted ? + if (A21I == 0x00) { + Store(0x02010201, A121) // clear action value + } + Return(0xF) + } + elseif ((A121 == 0x0E010201) || (A121 == 0x0F010201)) { // inprogress inserted ? + if (A21I == 0x00) { + Store(0x02010201, A121) // clear action value + } + Return(0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A121 == 0x02010201) { // is sw ejection? + Store(0xF0010201, A121) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000226, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000226 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A122 == 0xF0020201) { // SW ejected before ? + Store(0x02020201, A122) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000236, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000236 to DBNS1_10 + Return(0xF) + } + elseif (A122 == 0x10020201) { // ejected complete ? + Store(0x02020201, A122) // clear action value + Return (0x0) + } + elseif ((A122 == 0x01020201) || (A122 == 0x0F020201)) { // inserted ? + if (A22I == 0x00) { + Store(0x02020201, A122) // clear action value + } + Return (0xF) + } + elseif ((A122 == 0x0E020201) || (A122 == 0x0F020201)) { // inprogess inserted ? + if (A22I == 0x00) { + Store(0x02020201, A122) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A122 == 0x02020201) { // is sw ejection? + Store(0xF0020201, A122) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000236, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000236 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 [04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A123 == 0xF0030201) { // SW ejected before ? + Store(0x02030201, A123) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000246, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000246 to DBNS1_10 + Return(0xF) + } + elseif (A123 == 0x10030201) { // ejected complete ? + Store(0x02030201, A123) // clear action value + Return (0x0) + } + elseif ((A123 == 0x01030201) || (A123 == 0x0F030201)) { // inserted ? + if (A23I == 0x00) { + Store(0x02030201, A123) // clear action value + } + Return (0xF) + } + elseif ((A123 == 0x0E030201) || (A123 == 0x0F030201)) { // inprogress inserted ? + if (A23I == 0x00) { + Store(0x02030201, A123) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A123 == 0x02030201) { // is sw ejection? + Store(0xF0030201, A123) // set ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000246, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000246 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1350,6 +1618,274 @@ Device (PCID) { Name (_ADR, 0x00000000) } + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 [01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A150 == 0xF0000501) { // SW ejected ? + Store(0x02000501, A150) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000219, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000219 to DBNS1_10 + Return(0xF) + } + elseif (A150 == 0x10000501) { // ejected complete ? + Store(0x02000501, A150) // clear action value + Return(0x0) + } + elseif ((A150 == 0x01000501) || (A150 == 0x0F000501)) { // inserted? + if (A16I == 0x00) { + Store(0x02000501, A150) // clear action value + } + Return(0xF) + } + elseif ((A150 == 0x0E000501) || (A150 == 0x0F000501)) { // inprogress inserted? + if (A16I == 0x00) { + Store(0x02000501, A150) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A150 == 0x02000501) { // really sw ejection call? + Store(0xF0000501, A150) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000219, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000219 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A151 == 0xF0010501) { // SW ejected ? + Store(0x02010501, A151) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000229, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000229 to DBNS1_10 + Return(0xF) + } + elseif (A151 == 0x10010501) { // ejected complete ? + Store(0x02010501, A151) // clear action value + Return(0x0) + } + elseif ((A151 == 0x01010501) || (A151 == 0x0F010501)) { // inserted? + if (A17I == 0x00) { + Store(0x02010501, A151) // clear action value + } + Return(0xF) + } + elseif ((A151 == 0x0E010501) || (A151 == 0x0F010501)) { // inprogress inserted? + if (A17I == 0x00) { + Store(0x02010501, A151) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A151 == 0x02010501) { // really sw ejection call? + Store(0xF0010501, A151) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000229, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000229 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A152 == 0xF0020501) { // SW ejected ? + Store(0x02020501, A152) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000239, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000239 to DBNS1_10 + Return(0xF) + } + elseif (A152 == 0x10020501) { // ejected complete ? + Store(0x02020501, A152) // clear action value + Return(0x0) + } + elseif ((A152 == 0x01020501) || (A152 == 0x0F020501)) { // inserted? + if (A18I == 0x00) { + Store(0x02020501, A152) // clear action value + } + Return(0xF) + } + elseif ((A152 == 0x0E020501) || (A152 == 0x0F020501)) { // inprogress inserted? + if (A18I == 0x00) { + Store(0x02020501, A152) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A152 == 0x02020501) { // really sw ejection call? + Store(0xF0020501, A152) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000239, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000239 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A153 == 0xF0030501) { // SW ejected ? + Store(0x02030501, A153) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000249, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000249 to DBNS1_10 + Return(0xF) + } + elseif(A153 == 0x10030501) { // ejected complete ? + Store(0x02030501, A153) // clear action value + Return(0x0) + } + elseif((A153 == 0x01030501) || (A153 == 0x0F030501)) { // inserted ? + if (A19I == 0x00) { + Store(0x02030501, A153) // clear action value + } + Return(0xF) + } + elseif((A153 == 0x0E030501) || (A153 == 0x0F030501)) { // inprogress inserted ? + if (A19I == 0x00) { + Store(0x02030501, A153) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A153 == 0x02030501) { // really sw ejection call? + Store(0xF0030501, A153) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x68000249, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x68000249 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1697,6 +2233,274 @@ Device (PCIE) { Name (_ADR, 0x00000000) } + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A160 == 0xF0000601) { // SW ejected before ? + Store(0x02000601, A160) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800021A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800021A to DBNS1_10 + Return(0xF) + } + elseif (A160 == 0x10000601) { // ejected complete ? + Store(0x02000601, A160) // clear action value + Return (0x0) + } + elseif ((A160 == 0x01000601) || (A160 == 0x0F000601)){ // inserted ? + if (A11I == 0x00) { + Store(0x02000601, A160) // clear action value + } + Return (0xF) + } + elseif ((A160 == 0x0E000601) || (A160 == 0x0F000601)) { // inprogress inserted ? + if (A11I == 0x00) { + Store(0x02000601, A160) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A160 == 0x02000601) { // is sw ejection? + Store(0xF0000601, A160) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800021A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800021A to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A161 == 0xF0010601) { // SW ejected before ? + Store(0x02010601, A161) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800022A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800022A to DBNS1_10 + Return(0xF) + } + elseif (A161 == 0x10010601) { // ejected completed ? + Store(0x02010601, A161) // clear action value + Return (0x0) + } + elseif ((A161 == 0x01010601) || (A161 == 0x0F010601)){ // inserted ? + if (A10I == 0x00) { + Store(0x02010601, A161) // clear action value + } + Return (0xF) + } + elseif ((A161 == 0x0E010601) || (A161 == 0x0F010601)) { // inprogress inserted ? + if (A10I == 0x00) { + Store(0x02010601, A161) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A161 == 0x02010601) { // is sw ejection? + Store(0xF0010601, A161) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800022A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800022A to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A162 == 0xF0020601) { // SW ejected before ? + Store(0x02020601, A162) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800023A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800023A to DBNS1_10 + Return(0xF) + } + elseif (A162 == 0x10020601) { // ejected complete ? + Store(0x02020601, A162) // clear action value + Return (0x0) + } + elseif ((A162 == 0x01020601) || (A162 == 0x0F020601)) { // inserted ? + if (A09I == 0x00) { + Store(0x02020601, A162) // clear action value + } + Return (0xF) + } + elseif ((A162 == 0x0E020601) || (A162 == 0x0F020601)) { // inprogress inserted ? + if (A09I == 0x00) { + Store(0x02020601, A162) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A162 == 0x02020601) { // is sw ejection? + Store(0xF0020601, A162) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800023A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800023A to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A163 == 0xF0030601) { // SW ejected before ? + Store(0x02030601, A163) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800024A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800024A to DBNS1_10 + Return(0xF) + } + elseif (A163 == 0x10030601) { // ejected complete ? + Store(0x02030601, A163) // clear action value + Return (0x0) + } + elseif ((A163 == 0x01030601) || (A163 == 0x0F030601)) { // inserted ? + if (A08I == 0x00) { + Store(0x02030601, A163) // clear action value + } + Return (0xF) + } + elseif ((A163 == 0x0E030601) || (A163 == 0x0F030601)) { // inprogress inserted ? + if (A08I == 0x00) { + Store(0x02030601, A163) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A163 == 0x02030601) { // is sw ejection? + Store(0xF0030601, A163) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800024A, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800024A to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -2044,6 +2848,274 @@ Device (PCIF) { Name (_ADR, 0x00000000) } + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A170 == 0xF0000701) { // SW ejected before ? + Store(0x02000701, A170) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800021B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800021B to DBNS1_10 + Return(0xF) + } + elseif (A170 == 0x10000701) { // ejected complete ? + Store(0x02000701, A170) // clear action value + Return (0x0) + } + elseif ((A170 == 0x01000701) || (A170 == 0x0F000701)){ // inserted ? + if (A15I == 0x00) { + Store(0x02000701, A170) // clear action value + } + Return (0xF) + } + elseif ((A170 == 0x0E000701) || (A170 == 0x0F000701)) { // inprogress inserted ? + if (A15I == 0x00) { + Store(0x02000701, A170) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A170 == 0x02000701) { // is sw ejection? + Store(0xF0000701, A170) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800021B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800021B to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A171 == 0xF0010701) { // SW ejected before ? + Store(0x02010701, A171) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800022B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800022B to DBNS1_10 + Return(0xF) + } + elseif (A171 == 0x10010701) { // ejected completed ? + Store(0x02010701, A171) // clear action value + Return (0x0) + } + elseif ((A171 == 0x01010701) || (A171 == 0x0F010701)){ // inserted ? + if (A14I == 0x00) { + Store(0x02010701, A171) // clear action value + } + Return (0xF) + } + elseif ((A171 == 0x0E010701) || (A171 == 0x0F010701)) { // inprogress inserted ? + if (A14I == 0x00) { + Store(0x02010701, A171) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A171 == 0x02010701) { // is sw ejection? + Store(0xF0010701, A171) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800022B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800022B to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A172 == 0xF0020701) { // SW ejected before ? + Store(0x02020701, A172) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800023B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800023B to DBNS1_10 + Return(0xF) + } + elseif (A172 == 0x10020701) { // ejected complete ? + Store(0x02020701, A172) // clear action value + Return (0x0) + } + elseif ((A172 == 0x01020701) || (A172 == 0x0F020701)) { // inserted ? + if (A13I == 0x00) { + Store(0x02020701, A172) // clear action value + } + Return (0xF) + } + elseif ((A172 == 0x0E020701) || (A172 == 0x0F020701)) { // inprogress inserted ? + if (A13I == 0x00) { + Store(0x02020701, A172) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A172 == 0x02020701) { // is sw ejection? + Store(0xF0020701, A172) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800023B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800023B to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A173 == 0xF0030701) { // SW ejected before ? + Store(0x02030701, A173) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800024B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800024B to DBNS1_10 + Return(0xF) + } + elseif (A173 == 0x10030701) { // ejected complete ? + Store(0x02030701, A173) // clear action value + Return (0x0) + } + elseif ((A173 == 0x01030701) || (A173 == 0x0F030701)) { // inserted ? + if (A12I == 0x00) { + Store(0x02030701, A173) // clear action value + } + Return (0xF) + } + elseif ((A173 == 0x0E030701) || (A173 == 0x0F030701)) { // inprogress inserted ? + if (A12I == 0x00) { + Store(0x02030701, A173) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A173 == 0x02030701) { // is sw ejection? + Store(0xF0030701, A173) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // <Led:6-7.Led_action:4-5.Ampere_HP_CMD:0-3> + // Ampere_HP_CMD: LED_CMD = 4, HP_CHG_CMD = 3 + Store(0x6800024B, OUTV) // <MsgType(0x6)-Hdlr(0x8).Resv.action.dev.segment> + // action: Insert = 1 & Remove = 2 + // 0x6800024B to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) -- 2.39.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104719): https://edk2.groups.io/g/devel/message/104719 Mute This Topic: https://groups.io/mt/98831773/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-