summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2022-04-01 13:47:27 -0700
committerGitHub <noreply@github.com>2022-04-01 13:47:27 -0700
commita49f7d01b3de5369d99cefd90c6109f52dd07a6b (patch)
treebd00a244061691c735d2299757dbaf6d6176ac74
parent0690b2bcc03202f20ab28397de77a0b8a1f517e9 (diff)
parent32d875705c8ee8f99fd8b78dbed48633486a7640 (diff)
downloadacpica-a49f7d01b3de5369d99cefd90c6109f52dd07a6b.tar.gz
Merge pull request #757 from chenhuacai/master
ACPI: Add LoongArch-related definitions
-rw-r--r--source/common/dmtable.c7
-rw-r--r--source/components/events/evevent.c11
-rw-r--r--source/components/hardware/hwsleep.c10
-rw-r--r--source/components/utilities/utglobal.c1
-rw-r--r--source/include/actbl2.h139
-rw-r--r--source/include/actypes.h3
6 files changed, 166 insertions, 5 deletions
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 440c5fb40..b67848cfd 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -403,6 +403,13 @@ static const char *AcpiDmMadtSubnames[] =
"Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
"Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */
"Mutiprocessor Wakeup", /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */
+ "CPU Core Interrupt Controller", /* ACPI_MADT_TYPE_CORE_PIC */
+ "Legacy I/O Interrupt Controller", /* ACPI_MADT_TYPE_LIO_PIC */
+ "HT Interrupt Controller", /* ACPI_MADT_TYPE_HT_PIC */
+ "Extend I/O Interrupt Controller", /* ACPI_MADT_TYPE_EIO_PIC */
+ "MSI Interrupt Controller", /* ACPI_MADT_TYPE_MSI_PIC */
+ "Bridge I/O Interrupt Controller", /* ACPI_MADT_TYPE_BIO_PIC */
+ "LPC Interrupt Controller", /* ACPI_MADT_TYPE_LPC_PIC */
"Unknown Subtable Type", /* Reserved */
"Types 80-FF are used for OEM data" /* Reserved for OEM data */
};
diff --git a/source/components/events/evevent.c b/source/components/events/evevent.c
index 8b08338a2..5754140ec 100644
--- a/source/components/events/evevent.c
+++ b/source/components/events/evevent.c
@@ -312,7 +312,8 @@ AcpiEvFixedEventInitialize (
{
Status = AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[i].EnableRegisterId,
- ACPI_DISABLE_EVENT);
+ (i == ACPI_EVENT_PCIE_WAKE) ?
+ ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -361,6 +362,11 @@ AcpiEvFixedEventDetect (
return (IntStatus);
}
+ if (FixedEnable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE)
+ FixedEnable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+ else
+ FixedEnable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"Fixed Event Block: Enable %08X Status %08X\n",
FixedEnable, FixedStatus));
@@ -431,7 +437,8 @@ AcpiEvFixedEventDispatch (
{
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
- ACPI_DISABLE_EVENT);
+ (Event == ACPI_EVENT_PCIE_WAKE) ?
+ ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT);
ACPI_ERROR ((AE_INFO,
"No installed handler for fixed event - %s (%u), disabling",
diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c
index 45ff336a1..6667c27ec 100644
--- a/source/components/hardware/hwsleep.c
+++ b/source/components/hardware/hwsleep.c
@@ -475,6 +475,16 @@ AcpiHwLegacyWake (
AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].StatusRegisterId,
ACPI_CLEAR_STATUS);
+ /* Enable pcie wake event if support */
+ if ((AcpiGbl_FADT.Flags & ACPI_FADT_PCI_EXPRESS_WAKE)) {
+ (void) AcpiWriteBitRegister (
+ AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].EnableRegisterId,
+ ACPI_DISABLE_EVENT);
+ (void) AcpiWriteBitRegister (
+ AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].StatusRegisterId,
+ ACPI_CLEAR_STATUS);
+ }
+
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
return_ACPI_STATUS (Status);
}
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index 7de4a9c31..43de5c0a7 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -287,6 +287,7 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
/* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE},
/* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
/* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE},
+ /* ACPI_EVENT_PCIE_WAKE */ {ACPI_BITREG_PCIEXP_WAKE_STATUS, ACPI_BITREG_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
};
#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/source/include/actbl2.h b/source/include/actbl2.h
index 3032c5e25..1460d3d01 100644
--- a/source/include/actbl2.h
+++ b/source/include/actbl2.h
@@ -1107,7 +1107,14 @@ enum AcpiMadtType
ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
- ACPI_MADT_TYPE_RESERVED = 17, /* 17 to 0x7F are reserved */
+ ACPI_MADT_TYPE_CORE_PIC = 17,
+ ACPI_MADT_TYPE_LIO_PIC = 18,
+ ACPI_MADT_TYPE_HT_PIC = 19,
+ ACPI_MADT_TYPE_EIO_PIC = 20,
+ ACPI_MADT_TYPE_MSI_PIC = 21,
+ ACPI_MADT_TYPE_BIO_PIC = 22,
+ ACPI_MADT_TYPE_LPC_PIC = 23,
+ ACPI_MADT_TYPE_RESERVED = 24, /* 24 to 0x7F are reserved */
ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */
};
@@ -1391,7 +1398,135 @@ typedef struct acpi_madt_multiproc_wakeup_mailbox
#define ACPI_MP_WAKE_COMMAND_WAKEUP 1
-/* 17: OEM data */
+/* 17: CPU Core Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_core_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT32 ProcessorId;
+ UINT32 CoreId;
+ UINT32 Flags;
+} ACPI_MADT_CORE_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtCorePicVersion {
+ ACPI_MADT_CORE_PIC_VERSION_NONE = 0,
+ ACPI_MADT_CORE_PIC_VERSION_V1 = 1,
+ ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 18: Legacy I/O Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_lio_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT64 Address;
+ UINT16 Size;
+ UINT8 Cascade[2];
+ UINT32 CascadeMap[2];
+} ACPI_MADT_LIO_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtLioPicVersion {
+ ACPI_MADT_LIO_PIC_VERSION_NONE = 0,
+ ACPI_MADT_LIO_PIC_VERSION_V1 = 1,
+ ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 19: HT Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_ht_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT64 Address;
+ UINT16 Size;
+ UINT8 Cascade[8];
+} ACPI_MADT_HT_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtHtPicVersion {
+ ACPI_MADT_HT_PIC_VERSION_NONE = 0,
+ ACPI_MADT_HT_PIC_VERSION_V1 = 1,
+ ACPI_MADT_HT_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 20: Extend I/O Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_eio_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT8 Cascade;
+ UINT8 Node;
+ UINT64 NodeMap;
+} ACPI_MADT_EIO_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtEioPicVersion {
+ ACPI_MADT_EIO_PIC_VERSION_NONE = 0,
+ ACPI_MADT_EIO_PIC_VERSION_V1 = 1,
+ ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 21: MSI Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_msi_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT64 MsgAddress;
+ UINT32 Start;
+ UINT32 Count;
+} ACPI_MADT_MSI_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtMsiPicVersion {
+ ACPI_MADT_MSI_PIC_VERSION_NONE = 0,
+ ACPI_MADT_MSI_PIC_VERSION_V1 = 1,
+ ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 22: Bridge I/O Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_bio_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT64 Address;
+ UINT16 Size;
+ UINT16 Id;
+ UINT16 GsiBase;
+} ACPI_MADT_BIO_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtBioPicVersion {
+ ACPI_MADT_BIO_PIC_VERSION_NONE = 0,
+ ACPI_MADT_BIO_PIC_VERSION_V1 = 1,
+ ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 23: LPC Interrupt Controller (ACPI 6.5) */
+
+typedef struct acpi_madt_lpc_pic {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Version;
+ UINT64 Address;
+ UINT16 Size;
+ UINT8 Cascade;
+} ACPI_MADT_LPC_PIC;
+
+/* Values for Version field above */
+
+enum AcpiMadtLpcPicVersion {
+ ACPI_MADT_LPC_PIC_VERSION_NONE = 0,
+ ACPI_MADT_LPC_PIC_VERSION_V1 = 1,
+ ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+/* 80: OEM data */
typedef struct acpi_madt_oem_data
{
diff --git a/source/include/actypes.h b/source/include/actypes.h
index 99588f671..fff6c1659 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -873,7 +873,8 @@ typedef UINT32 ACPI_EVENT_TYPE;
#define ACPI_EVENT_POWER_BUTTON 2
#define ACPI_EVENT_SLEEP_BUTTON 3
#define ACPI_EVENT_RTC 4
-#define ACPI_EVENT_MAX 4
+#define ACPI_EVENT_PCIE_WAKE 5
+#define ACPI_EVENT_MAX 5
#define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1
/*