All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ACPI: Add LoongArch-related definitions
@ 2021-07-05 12:42 Huacai Chen
  2021-07-05 12:42 ` [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA Huacai Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Huacai Chen @ 2021-07-05 12:42 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Robert Moore, Erik Kaneda
  Cc: linux-acpi, devel, Xuefeng Li, Jiaxun Yang, Huacai Chen, Jianmin Lv

LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V.
LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit
version (LA32S) and a 64-bit version (LA64). LoongArch use ACPI as its
boot protocol LoongArch-specific interrupt controllers (similar to APIC)
are already added in the next revision of ACPI Specification (current
revision is 6.4).

This patchset are preparing to add LoongArch support in mainline kernel,
we can see a snapshot here:
https://github.com/loongson/linux/tree/loongarch-next

Cross-compile tool chain to build kernel:
https://github.com/loongson/build-tools/releases

Loongson and LoongArch documentations:
https://github.com/loongson/LoongArch-Documentation

Huacai Chen and Jianmin Lv(3):
 ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA.
 ACPICA: MADT: Add LoongArch APICs support.
 ACPICA: Events: Support fixed pcie wake event.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> 
---
 drivers/acpi/Kconfig           |   4 +-
 drivers/acpi/acpica/evevent.c  |  17 ++++--
 drivers/acpi/acpica/hwsleep.c  |  12 ++++
 drivers/acpi/acpica/utglobal.c |   4 ++
 drivers/acpi/numa/Kconfig      |   2 +-
 drivers/acpi/numa/srat.c       |   2 +-
 drivers/acpi/tables.c          |  10 ++++
 include/acpi/actbl2.h          | 123 ++++++++++++++++++++++++++++++++++++++++-
 include/acpi/actypes.h         |   3 +-
 include/linux/acpi.h           |   2 +-
 10 files changed, 166 insertions(+), 13 deletions(-)
--
2.27.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
  2021-07-05 12:42 [PATCH 0/3] ACPI: Add LoongArch-related definitions Huacai Chen
@ 2021-07-05 12:42 ` Huacai Chen
  2021-07-14 12:30     ` [Devel] " Rafael J. Wysocki
  2021-07-05 12:42 ` [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support Huacai Chen
  2021-07-05 13:05 ` [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event Huacai Chen
  2 siblings, 1 reply; 14+ messages in thread
From: Huacai Chen @ 2021-07-05 12:42 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Robert Moore, Erik Kaneda
  Cc: linux-acpi, devel, Xuefeng Li, Jiaxun Yang, Huacai Chen

We are preparing to add new Loongson (based on LoongArch, not MIPS)
support. LoongArch use ACPI other than DT as its boot protocol, so
add its support for ACPI_PROCESSOR/ACPI_NUMA.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/acpi/Kconfig      | 4 ++--
 drivers/acpi/numa/Kconfig | 2 +-
 drivers/acpi/numa/srat.c  | 2 +-
 include/linux/acpi.h      | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index fe0bb6277e4d..90afa44efcba 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
 
 config ACPI_PROCESSOR
 	tristate "Processor"
-	depends on X86 || IA64 || ARM64
+	depends on X86 || IA64 || ARM64 || LOONGARCH
 	select ACPI_PROCESSOR_IDLE
-	select ACPI_CPU_FREQ_PSS if X86 || IA64
+	select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
 	default y
 	help
 	  This driver adds support for the ACPI Processor package. It is required
diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig
index fcf2e556d69d..39b1f34c21df 100644
--- a/drivers/acpi/numa/Kconfig
+++ b/drivers/acpi/numa/Kconfig
@@ -2,7 +2,7 @@
 config ACPI_NUMA
 	bool "NUMA support"
 	depends on NUMA
-	depends on (X86 || IA64 || ARM64)
+	depends on (X86 || IA64 || ARM64 || LOONGARCH)
 	default y if IA64 || ARM64
 
 config ACPI_HMAT
diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
index 6021a1013442..b8795fc49097 100644
--- a/drivers/acpi/numa/srat.c
+++ b/drivers/acpi/numa/srat.c
@@ -206,7 +206,7 @@ int __init srat_disabled(void)
 	return acpi_numa < 0;
 }
 
-#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
+#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
 /*
  * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
  * I/O localities since SRAT does not list them.  I/O localities are
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 6bb36fd6ba31..3ba8511cbede 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -249,7 +249,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
 /* the following numa functions are architecture-dependent */
 void acpi_numa_slit_init (struct acpi_table_slit *slit);
 
-#if defined(CONFIG_X86) || defined(CONFIG_IA64)
+#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
 void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
 #else
 static inline void
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support
  2021-07-05 12:42 [PATCH 0/3] ACPI: Add LoongArch-related definitions Huacai Chen
  2021-07-05 12:42 ` [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA Huacai Chen
@ 2021-07-05 12:42 ` Huacai Chen
  2021-07-08 21:35     ` [Devel] " Moore, Robert
  2021-07-05 13:05 ` [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event Huacai Chen
  2 siblings, 1 reply; 14+ messages in thread
From: Huacai Chen @ 2021-07-05 12:42 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Robert Moore, Erik Kaneda
  Cc: linux-acpi, devel, Xuefeng Li, Jiaxun Yang, Huacai Chen, Jianmin Lv

LoongArch-specific interrupt controllers (similar to APIC) are added
in the next revision of ACPI Specification (current revision is 6.4),
which including CORE_PIC (CPUINTC), LIO_PIC (LIOINTC), EIO_PIC (EIOINTC),
HT_PIC (HTVECINTC), BIO_PIC (PCHINTC), LPC_PIC (PCHLPC) and MSI_PIC
(PCHMSI). This patch add their definition and handlings.

Reference: https://mantis.uefi.org/mantis/view.php?id=2203
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/acpi/tables.c |  10 ++++
 include/acpi/actbl2.h | 123 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 132 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index a37a1532a575..5943ae4f76bb 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -208,6 +208,16 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 		}
 		break;
 
+	case ACPI_MADT_TYPE_CORE_PIC:
+		{
+			struct acpi_madt_core_pic *p =
+			    (struct acpi_madt_core_pic *)header;
+			pr_debug("CORE PIC (processor_id[0x%02x] core_id[0x%02x] %s)\n",
+				 p->processor_id, p->core_id,
+				 (p->flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
+		}
+		break;
+
 	default:
 		pr_warn("Found unsupported MADT entry (type = 0x%x)\n",
 			header->type);
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 2069ac38a4e2..fd6d0b440c4b 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -571,7 +571,14 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
 	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
 	ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
-	ACPI_MADT_TYPE_RESERVED = 17	/* 17 and greater 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 and greater are reserved */
 };
 
 /*
@@ -801,6 +808,120 @@ struct acpi_madt_multiproc_wakeup_mailbox {
 
 #define ACPI_MP_WAKE_COMMAND_WAKEUP    1
 
+/* Values for Version field above */
+
+enum acpi_madt_core_pic_version {
+	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 */
+};
+
+enum acpi_madt_lio_pic_version {
+	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 */
+};
+
+enum acpi_madt_eio_pic_version {
+	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 */
+};
+
+enum acpi_madt_ht_pic_version {
+	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 */
+};
+
+enum acpi_madt_bio_pic_version {
+	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 */
+};
+
+enum acpi_madt_msi_pic_version {
+	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 */
+};
+
+enum acpi_madt_lpc_pic_version {
+	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 */
+};
+
+/* Core Interrupt Controller */
+
+struct acpi_madt_core_pic {
+	struct acpi_subtable_header header;
+	u32 processor_id;
+	u32 core_id;
+	u32 flags;
+	u8 version;
+};
+
+/* Legacy I/O Interrupt Controller */
+
+struct acpi_madt_lio_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade[2];
+	u32 cascade_map[2];
+	u8 version;
+};
+
+/* Extend I/O Interrupt Controller */
+
+struct acpi_madt_eio_pic {
+	struct acpi_subtable_header header;
+	u8 cascade;
+	u8 version;
+};
+
+/* HT Interrupt Controller */
+
+struct acpi_madt_ht_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade[8];
+	u8 version;
+};
+
+/* Bridge I/O Interrupt Controller */
+
+struct acpi_madt_bio_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u16 id;
+	u16 gsi_base;
+	u8 version;
+};
+
+/* MSI Interrupt Controller */
+
+struct acpi_madt_msi_pic {
+	struct acpi_subtable_header header;
+	u64 msg_address;
+	u32 start;
+	u32 count;
+	u8 version;
+};
+
+/* LPC Interrupt Controller */
+
+struct acpi_madt_lpc_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade;
+	u8 version;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event
  2021-07-05 12:42 [PATCH 0/3] ACPI: Add LoongArch-related definitions Huacai Chen
  2021-07-05 12:42 ` [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA Huacai Chen
  2021-07-05 12:42 ` [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support Huacai Chen
@ 2021-07-05 13:05 ` Huacai Chen
  2021-07-14 14:51     ` [Devel] " Moore, Robert
  2 siblings, 1 reply; 14+ messages in thread
From: Huacai Chen @ 2021-07-05 13:05 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Robert Moore, Erik Kaneda
  Cc: linux-acpi, devel, Xuefeng Li, Jiaxun Yang, Huacai Chen, Jianmin Lv

Some chipsets (such as Loongson's LS7A) support fixed pcie wake event
which is defined in the PM1 block(related description can be found in
4.8.4.1.1 PM1 Status Registers, 4.8.4.2.1 PM1 Control Registers and
5.2.9 Fixed ACPI Description Table (FADT)), so we add code to handle it.

ACPI Spec 6.4 link:
https://uefi.org/specifications/ACPI/6.4/

Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/acpi/acpica/evevent.c  | 17 +++++++++++------
 drivers/acpi/acpica/hwsleep.c  | 12 ++++++++++++
 drivers/acpi/acpica/utglobal.c |  4 ++++
 include/acpi/actypes.h         |  3 ++-
 4 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c
index 35385148fedb..2340986de37b 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -140,9 +140,9 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
 
 		if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) {
 			status =
-			    acpi_write_bit_register(acpi_gbl_fixed_event_info
-						    [i].enable_register_id,
-						    ACPI_DISABLE_EVENT);
+			    acpi_write_bit_register(acpi_gbl_fixed_event_info[i].enable_register_id,
+						    (i == ACPI_EVENT_PCIE_WAKE) ?
+						    ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT);
 			if (ACPI_FAILURE(status)) {
 				return (status);
 			}
@@ -185,6 +185,11 @@ u32 acpi_ev_fixed_event_detect(void)
 		return (int_status);
 	}
 
+	if (fixed_enable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE)
+		fixed_enable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+	else
+		fixed_enable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+
 	ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
 			  "Fixed Event Block: Enable %08X Status %08X\n",
 			  fixed_enable, fixed_status));
@@ -248,9 +253,9 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
 	 * and disable the event to prevent further interrupts.
 	 */
 	if (!acpi_gbl_fixed_event_handlers[event].handler) {
-		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
-					      enable_register_id,
-					      ACPI_DISABLE_EVENT);
+		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].enable_register_id,
+					      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/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 14baa13bf848..7e7ea4c2e914 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -312,6 +312,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
 				    [ACPI_EVENT_SLEEP_BUTTON].
 				    status_register_id, ACPI_CLEAR_STATUS);
 
+	/* Enable pcie wake event if support */
+	if ((acpi_gbl_FADT.flags & ACPI_FADT_PCI_EXPRESS_WAKE)) {
+		(void)
+		acpi_write_bit_register(acpi_gbl_fixed_event_info
+				[ACPI_EVENT_PCIE_WAKE].
+				enable_register_id, ACPI_DISABLE_EVENT);
+		(void)
+		acpi_write_bit_register(acpi_gbl_fixed_event_info
+				[ACPI_EVENT_PCIE_WAKE].
+				status_register_id, ACPI_CLEAR_STATUS);
+	}
+
 	acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 59a48371a7bc..16f7a206fc6d 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -186,6 +186,10 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
 					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/include/acpi/actypes.h b/include/acpi/actypes.h
index 92c71dfce0d5..0b6c72033487 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -714,7 +714,8 @@ typedef u32 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
 
 /*
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support
@ 2021-07-08 21:35     ` Moore, Robert
  0 siblings, 0 replies; 14+ messages in thread
From: Moore, Robert @ 2021-07-08 21:35 UTC (permalink / raw)
  To: Huacai Chen, Rafael J . Wysocki, Len Brown, Erik Kaneda
  Cc: linux-acpi, devel, Xuefeng Li, Jiaxun Yang, Jianmin Lv

For legal reasons, we can't pre-release any upcoming ACPI spec changes in ACPICA.

-----Original Message-----
From: Huacai Chen <chenhuacai@loongson.cn> 
Sent: Monday, July 05, 2021 5:42 AM
To: Rafael J . Wysocki <rjw@rjwysocki.net>; Len Brown <lenb@kernel.org>; Moore, Robert <robert.moore@intel.com>; Erik Kaneda <erik.kaneda@intel.com>
Cc: linux-acpi@vger.kernel.org; devel@acpica.org; Xuefeng Li <lixuefeng@loongson.cn>; Jiaxun Yang <jiaxun.yang@flygoat.com>; Huacai Chen <chenhuacai@loongson.cn>; Jianmin Lv <lvjianmin@loongson.cn>
Subject: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support

LoongArch-specific interrupt controllers (similar to APIC) are added in the next revision of ACPI Specification (current revision is 6.4), which including CORE_PIC (CPUINTC), LIO_PIC (LIOINTC), EIO_PIC (EIOINTC), HT_PIC (HTVECINTC), BIO_PIC (PCHINTC), LPC_PIC (PCHLPC) and MSI_PIC (PCHMSI). This patch add their definition and handlings.

Reference: https://mantis.uefi.org/mantis/view.php?id=2203
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/acpi/tables.c |  10 ++++
 include/acpi/actbl2.h | 123 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 132 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index a37a1532a575..5943ae4f76bb 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -208,6 +208,16 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 		}
 		break;
 
+	case ACPI_MADT_TYPE_CORE_PIC:
+		{
+			struct acpi_madt_core_pic *p =
+			    (struct acpi_madt_core_pic *)header;
+			pr_debug("CORE PIC (processor_id[0x%02x] core_id[0x%02x] %s)\n",
+				 p->processor_id, p->core_id,
+				 (p->flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
+		}
+		break;
+
 	default:
 		pr_warn("Found unsupported MADT entry (type = 0x%x)\n",
 			header->type);
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 2069ac38a4e2..fd6d0b440c4b 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -571,7 +571,14 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
 	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
 	ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
-	ACPI_MADT_TYPE_RESERVED = 17	/* 17 and greater 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 and greater are reserved */
 };
 
 /*
@@ -801,6 +808,120 @@ struct acpi_madt_multiproc_wakeup_mailbox {
 
 #define ACPI_MP_WAKE_COMMAND_WAKEUP    1
 
+/* Values for Version field above */
+
+enum acpi_madt_core_pic_version {
+	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 */
+};
+
+enum acpi_madt_lio_pic_version {
+	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 */
+};
+
+enum acpi_madt_eio_pic_version {
+	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 */
+};
+
+enum acpi_madt_ht_pic_version {
+	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 */
+};
+
+enum acpi_madt_bio_pic_version {
+	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 */
+};
+
+enum acpi_madt_msi_pic_version {
+	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 */
+};
+
+enum acpi_madt_lpc_pic_version {
+	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 */
+};
+
+/* Core Interrupt Controller */
+
+struct acpi_madt_core_pic {
+	struct acpi_subtable_header header;
+	u32 processor_id;
+	u32 core_id;
+	u32 flags;
+	u8 version;
+};
+
+/* Legacy I/O Interrupt Controller */
+
+struct acpi_madt_lio_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade[2];
+	u32 cascade_map[2];
+	u8 version;
+};
+
+/* Extend I/O Interrupt Controller */
+
+struct acpi_madt_eio_pic {
+	struct acpi_subtable_header header;
+	u8 cascade;
+	u8 version;
+};
+
+/* HT Interrupt Controller */
+
+struct acpi_madt_ht_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade[8];
+	u8 version;
+};
+
+/* Bridge I/O Interrupt Controller */
+
+struct acpi_madt_bio_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u16 id;
+	u16 gsi_base;
+	u8 version;
+};
+
+/* MSI Interrupt Controller */
+
+struct acpi_madt_msi_pic {
+	struct acpi_subtable_header header;
+	u64 msg_address;
+	u32 start;
+	u32 count;
+	u8 version;
+};
+
+/* LPC Interrupt Controller */
+
+struct acpi_madt_lpc_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade;
+	u8 version;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
--
2.27.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Devel] Re: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support
@ 2021-07-08 21:35     ` Moore, Robert
  0 siblings, 0 replies; 14+ messages in thread
From: Moore, Robert @ 2021-07-08 21:35 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 5508 bytes --]

For legal reasons, we can't pre-release any upcoming ACPI spec changes in ACPICA.

-----Original Message-----
From: Huacai Chen <chenhuacai(a)loongson.cn> 
Sent: Monday, July 05, 2021 5:42 AM
To: Rafael J . Wysocki <rjw(a)rjwysocki.net>; Len Brown <lenb(a)kernel.org>; Moore, Robert <robert.moore(a)intel.com>; Erik Kaneda <erik.kaneda(a)intel.com>
Cc: linux-acpi(a)vger.kernel.org; devel(a)acpica.org; Xuefeng Li <lixuefeng(a)loongson.cn>; Jiaxun Yang <jiaxun.yang(a)flygoat.com>; Huacai Chen <chenhuacai(a)loongson.cn>; Jianmin Lv <lvjianmin(a)loongson.cn>
Subject: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support

LoongArch-specific interrupt controllers (similar to APIC) are added in the next revision of ACPI Specification (current revision is 6.4), which including CORE_PIC (CPUINTC), LIO_PIC (LIOINTC), EIO_PIC (EIOINTC), HT_PIC (HTVECINTC), BIO_PIC (PCHINTC), LPC_PIC (PCHLPC) and MSI_PIC (PCHMSI). This patch add their definition and handlings.

Reference: https://mantis.uefi.org/mantis/view.php?id=2203
Signed-off-by: Jianmin Lv <lvjianmin(a)loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai(a)loongson.cn>
---
 drivers/acpi/tables.c |  10 ++++
 include/acpi/actbl2.h | 123 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 132 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index a37a1532a575..5943ae4f76bb 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -208,6 +208,16 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 		}
 		break;
 
+	case ACPI_MADT_TYPE_CORE_PIC:
+		{
+			struct acpi_madt_core_pic *p =
+			    (struct acpi_madt_core_pic *)header;
+			pr_debug("CORE PIC (processor_id[0x%02x] core_id[0x%02x] %s)\n",
+				 p->processor_id, p->core_id,
+				 (p->flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
+		}
+		break;
+
 	default:
 		pr_warn("Found unsupported MADT entry (type = 0x%x)\n",
 			header->type);
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 2069ac38a4e2..fd6d0b440c4b 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -571,7 +571,14 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
 	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
 	ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
-	ACPI_MADT_TYPE_RESERVED = 17	/* 17 and greater 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 and greater are reserved */
 };
 
 /*
@@ -801,6 +808,120 @@ struct acpi_madt_multiproc_wakeup_mailbox {
 
 #define ACPI_MP_WAKE_COMMAND_WAKEUP    1
 
+/* Values for Version field above */
+
+enum acpi_madt_core_pic_version {
+	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 */
+};
+
+enum acpi_madt_lio_pic_version {
+	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 */
+};
+
+enum acpi_madt_eio_pic_version {
+	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 */
+};
+
+enum acpi_madt_ht_pic_version {
+	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 */
+};
+
+enum acpi_madt_bio_pic_version {
+	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 */
+};
+
+enum acpi_madt_msi_pic_version {
+	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 */
+};
+
+enum acpi_madt_lpc_pic_version {
+	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 */
+};
+
+/* Core Interrupt Controller */
+
+struct acpi_madt_core_pic {
+	struct acpi_subtable_header header;
+	u32 processor_id;
+	u32 core_id;
+	u32 flags;
+	u8 version;
+};
+
+/* Legacy I/O Interrupt Controller */
+
+struct acpi_madt_lio_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade[2];
+	u32 cascade_map[2];
+	u8 version;
+};
+
+/* Extend I/O Interrupt Controller */
+
+struct acpi_madt_eio_pic {
+	struct acpi_subtable_header header;
+	u8 cascade;
+	u8 version;
+};
+
+/* HT Interrupt Controller */
+
+struct acpi_madt_ht_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade[8];
+	u8 version;
+};
+
+/* Bridge I/O Interrupt Controller */
+
+struct acpi_madt_bio_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u16 id;
+	u16 gsi_base;
+	u8 version;
+};
+
+/* MSI Interrupt Controller */
+
+struct acpi_madt_msi_pic {
+	struct acpi_subtable_header header;
+	u64 msg_address;
+	u32 start;
+	u32 count;
+	u8 version;
+};
+
+/* LPC Interrupt Controller */
+
+struct acpi_madt_lpc_pic {
+	struct acpi_subtable_header header;
+	u64 address;
+	u16 size;
+	u8 cascade;
+	u8 version;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
--
2.27.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: RE: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support
  2021-07-08 21:35     ` [Devel] " Moore, Robert
  (?)
@ 2021-07-09  3:08     ` 陈华才
  -1 siblings, 0 replies; 14+ messages in thread
From: 陈华才 @ 2021-07-09  3:08 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Rafael J . Wysocki, Len Brown, Erik Kaneda, linux-acpi, devel,
	Xuefeng Li, Jiaxun Yang, Jianmin Lv, chenhuacai

Hi, Moore,

&gt; -----原始邮件-----
&gt; 发件人: "Moore, Robert" <robert.moore@intel.com>
&gt; 发送时间: 2021-07-09 05:35:28 (星期五)
&gt; 收件人: "Huacai Chen" <chenhuacai@loongson.cn>, "Rafael J . Wysocki" <rjw@rjwysocki.net>, "Len Brown" <lenb@kernel.org>, "Erik Kaneda" <erik.kaneda@intel.com>
&gt; 抄送: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>, "devel@acpica.org" <devel@acpica.org>, "Xuefeng Li" <lixuefeng@loongson.cn>, "Jiaxun Yang" <jiaxun.yang@flygoat.com>, "Jianmin Lv" <lvjianmin@loongson.cn>
&gt; 主题: RE: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support
&gt; 
&gt; For legal reasons, we can't pre-release any upcoming ACPI spec changes in ACPICA.
That's OK, we can wait.

Huacai
&gt; 
&gt; -----Original Message-----
&gt; From: Huacai Chen <chenhuacai@loongson.cn> 
&gt; Sent: Monday, July 05, 2021 5:42 AM
&gt; To: Rafael J . Wysocki <rjw@rjwysocki.net>; Len Brown <lenb@kernel.org>; Moore, Robert <robert.moore@intel.com>; Erik Kaneda <erik.kaneda@intel.com>
&gt; Cc: linux-acpi@vger.kernel.org; devel@acpica.org; Xuefeng Li <lixuefeng@loongson.cn>; Jiaxun Yang <jiaxun.yang@flygoat.com>; Huacai Chen <chenhuacai@loongson.cn>; Jianmin Lv <lvjianmin@loongson.cn>
&gt; Subject: [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support
&gt; 
&gt; LoongArch-specific interrupt controllers (similar to APIC) are added in the next revision of ACPI Specification (current revision is 6.4), which including CORE_PIC (CPUINTC), LIO_PIC (LIOINTC), EIO_PIC (EIOINTC), HT_PIC (HTVECINTC), BIO_PIC (PCHINTC), LPC_PIC (PCHLPC) and MSI_PIC (PCHMSI). This patch add their definition and handlings.
&gt; 
&gt; Reference: https://mantis.uefi.org/mantis/view.php?id=2203
&gt; Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
&gt; Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
&gt; ---
&gt;  drivers/acpi/tables.c |  10 ++++
&gt;  include/acpi/actbl2.h | 123 +++++++++++++++++++++++++++++++++++++++++-
&gt;  2 files changed, 132 insertions(+), 1 deletion(-)
&gt; 
&gt; diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index a37a1532a575..5943ae4f76bb 100644
&gt; --- a/drivers/acpi/tables.c
&gt; +++ b/drivers/acpi/tables.c
&gt; @@ -208,6 +208,16 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
&gt;  		}
&gt;  		break;
&gt;  
&gt; +	case ACPI_MADT_TYPE_CORE_PIC:
&gt; +		{
&gt; +			struct acpi_madt_core_pic *p =
&gt; +			    (struct acpi_madt_core_pic *)header;
&gt; +			pr_debug("CORE PIC (processor_id[0x%02x] core_id[0x%02x] %s)\n",
&gt; +				 p-&gt;processor_id, p-&gt;core_id,
&gt; +				 (p-&gt;flags &amp; ACPI_MADT_ENABLED) ? "enabled" : "disabled");
&gt; +		}
&gt; +		break;
&gt; +
&gt;  	default:
&gt;  		pr_warn("Found unsupported MADT entry (type = 0x%x)\n",
&gt;  			header-&gt;type);
&gt; diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 2069ac38a4e2..fd6d0b440c4b 100644
&gt; --- a/include/acpi/actbl2.h
&gt; +++ b/include/acpi/actbl2.h
&gt; @@ -571,7 +571,14 @@ enum acpi_madt_type {
&gt;  	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
&gt;  	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
&gt;  	ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
&gt; -	ACPI_MADT_TYPE_RESERVED = 17	/* 17 and greater are reserved */
&gt; +	ACPI_MADT_TYPE_CORE_PIC = 17,
&gt; +	ACPI_MADT_TYPE_LIO_PIC = 18,
&gt; +	ACPI_MADT_TYPE_HT_PIC = 19,
&gt; +	ACPI_MADT_TYPE_EIO_PIC = 20,
&gt; +	ACPI_MADT_TYPE_MSI_PIC = 21,
&gt; +	ACPI_MADT_TYPE_BIO_PIC = 22,
&gt; +	ACPI_MADT_TYPE_LPC_PIC = 23,
&gt; +	ACPI_MADT_TYPE_RESERVED = 24	/* 24 and greater are reserved */
&gt;  };
&gt;  
&gt;  /*
&gt; @@ -801,6 +808,120 @@ struct acpi_madt_multiproc_wakeup_mailbox {
&gt;  
&gt;  #define ACPI_MP_WAKE_COMMAND_WAKEUP    1
&gt;  
&gt; +/* Values for Version field above */
&gt; +
&gt; +enum acpi_madt_core_pic_version {
&gt; +	ACPI_MADT_CORE_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_CORE_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +enum acpi_madt_lio_pic_version {
&gt; +	ACPI_MADT_LIO_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_LIO_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +enum acpi_madt_eio_pic_version {
&gt; +	ACPI_MADT_EIO_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_EIO_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +enum acpi_madt_ht_pic_version {
&gt; +	ACPI_MADT_HT_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_HT_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_HT_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +enum acpi_madt_bio_pic_version {
&gt; +	ACPI_MADT_BIO_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_BIO_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +enum acpi_madt_msi_pic_version {
&gt; +	ACPI_MADT_MSI_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_MSI_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +enum acpi_madt_lpc_pic_version {
&gt; +	ACPI_MADT_LPC_PIC_VERSION_NONE = 0,
&gt; +	ACPI_MADT_LPC_PIC_VERSION_V1 = 1,
&gt; +	ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
&gt; +};
&gt; +
&gt; +/* Core Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_core_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u32 processor_id;
&gt; +	u32 core_id;
&gt; +	u32 flags;
&gt; +	u8 version;
&gt; +};
&gt; +
&gt; +/* Legacy I/O Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_lio_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u64 address;
&gt; +	u16 size;
&gt; +	u8 cascade[2];
&gt; +	u32 cascade_map[2];
&gt; +	u8 version;
&gt; +};
&gt; +
&gt; +/* Extend I/O Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_eio_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u8 cascade;
&gt; +	u8 version;
&gt; +};
&gt; +
&gt; +/* HT Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_ht_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u64 address;
&gt; +	u16 size;
&gt; +	u8 cascade[8];
&gt; +	u8 version;
&gt; +};
&gt; +
&gt; +/* Bridge I/O Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_bio_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u64 address;
&gt; +	u16 size;
&gt; +	u16 id;
&gt; +	u16 gsi_base;
&gt; +	u8 version;
&gt; +};
&gt; +
&gt; +/* MSI Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_msi_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u64 msg_address;
&gt; +	u32 start;
&gt; +	u32 count;
&gt; +	u8 version;
&gt; +};
&gt; +
&gt; +/* LPC Interrupt Controller */
&gt; +
&gt; +struct acpi_madt_lpc_pic {
&gt; +	struct acpi_subtable_header header;
&gt; +	u64 address;
&gt; +	u16 size;
&gt; +	u8 cascade;
&gt; +	u8 version;
&gt; +};
&gt; +
&gt;  /*
&gt;   * Common flags fields for MADT subtables
&gt;   */
&gt; --
&gt; 2.27.0
</chenhuacai@loongson.cn></lvjianmin@loongson.cn></lvjianmin@loongson.cn></chenhuacai@loongson.cn></jiaxun.yang@flygoat.com></lixuefeng@loongson.cn></erik.kaneda@intel.com></robert.moore@intel.com></lenb@kernel.org></rjw@rjwysocki.net></chenhuacai@loongson.cn></lvjianmin@loongson.cn></jiaxun.yang@flygoat.com></lixuefeng@loongson.cn></devel@acpica.org></linux-acpi@vger.kernel.org></erik.kaneda@intel.com></lenb@kernel.org></rjw@rjwysocki.net></chenhuacai@loongson.cn></robert.moore@intel.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
@ 2021-07-14 12:30     ` Rafael J. Wysocki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2021-07-14 12:30 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Rafael J . Wysocki, Len Brown, Robert Moore, Erik Kaneda,
	ACPI Devel Maling List,
	open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
	Xuefeng Li, Jiaxun Yang

On Mon, Jul 5, 2021 at 2:41 PM Huacai Chen <chenhuacai@loongson.cn> wrote:
>
> We are preparing to add new Loongson (based on LoongArch, not MIPS)
> support. LoongArch use ACPI other than DT as its boot protocol, so
> add its support for ACPI_PROCESSOR/ACPI_NUMA.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>  drivers/acpi/Kconfig      | 4 ++--
>  drivers/acpi/numa/Kconfig | 2 +-
>  drivers/acpi/numa/srat.c  | 2 +-
>  include/linux/acpi.h      | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index fe0bb6277e4d..90afa44efcba 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
>
>  config ACPI_PROCESSOR
>         tristate "Processor"
> -       depends on X86 || IA64 || ARM64
> +       depends on X86 || IA64 || ARM64 || LOONGARCH
>         select ACPI_PROCESSOR_IDLE
> -       select ACPI_CPU_FREQ_PSS if X86 || IA64
> +       select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
>         default y
>         help
>           This driver adds support for the ACPI Processor package. It is required
> diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig
> index fcf2e556d69d..39b1f34c21df 100644
> --- a/drivers/acpi/numa/Kconfig
> +++ b/drivers/acpi/numa/Kconfig
> @@ -2,7 +2,7 @@
>  config ACPI_NUMA
>         bool "NUMA support"
>         depends on NUMA
> -       depends on (X86 || IA64 || ARM64)
> +       depends on (X86 || IA64 || ARM64 || LOONGARCH)
>         default y if IA64 || ARM64
>
>  config ACPI_HMAT
> diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> index 6021a1013442..b8795fc49097 100644
> --- a/drivers/acpi/numa/srat.c
> +++ b/drivers/acpi/numa/srat.c
> @@ -206,7 +206,7 @@ int __init srat_disabled(void)
>         return acpi_numa < 0;
>  }
>
> -#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
> +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
>  /*
>   * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
>   * I/O localities since SRAT does not list them.  I/O localities are
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 6bb36fd6ba31..3ba8511cbede 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -249,7 +249,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
>  /* the following numa functions are architecture-dependent */
>  void acpi_numa_slit_init (struct acpi_table_slit *slit);
>
> -#if defined(CONFIG_X86) || defined(CONFIG_IA64)
> +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
>  void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
>  #else
>  static inline void
> --

Does this patch alone make sense without the other two in the series?
If so, I can queue it up for 5.15, so please let me know.

Thanks!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Devel] Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
@ 2021-07-14 12:30     ` Rafael J. Wysocki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2021-07-14 12:30 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2975 bytes --]

On Mon, Jul 5, 2021 at 2:41 PM Huacai Chen <chenhuacai(a)loongson.cn> wrote:
>
> We are preparing to add new Loongson (based on LoongArch, not MIPS)
> support. LoongArch use ACPI other than DT as its boot protocol, so
> add its support for ACPI_PROCESSOR/ACPI_NUMA.
>
> Signed-off-by: Huacai Chen <chenhuacai(a)loongson.cn>
> ---
>  drivers/acpi/Kconfig      | 4 ++--
>  drivers/acpi/numa/Kconfig | 2 +-
>  drivers/acpi/numa/srat.c  | 2 +-
>  include/linux/acpi.h      | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index fe0bb6277e4d..90afa44efcba 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
>
>  config ACPI_PROCESSOR
>         tristate "Processor"
> -       depends on X86 || IA64 || ARM64
> +       depends on X86 || IA64 || ARM64 || LOONGARCH
>         select ACPI_PROCESSOR_IDLE
> -       select ACPI_CPU_FREQ_PSS if X86 || IA64
> +       select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
>         default y
>         help
>           This driver adds support for the ACPI Processor package. It is required
> diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig
> index fcf2e556d69d..39b1f34c21df 100644
> --- a/drivers/acpi/numa/Kconfig
> +++ b/drivers/acpi/numa/Kconfig
> @@ -2,7 +2,7 @@
>  config ACPI_NUMA
>         bool "NUMA support"
>         depends on NUMA
> -       depends on (X86 || IA64 || ARM64)
> +       depends on (X86 || IA64 || ARM64 || LOONGARCH)
>         default y if IA64 || ARM64
>
>  config ACPI_HMAT
> diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> index 6021a1013442..b8795fc49097 100644
> --- a/drivers/acpi/numa/srat.c
> +++ b/drivers/acpi/numa/srat.c
> @@ -206,7 +206,7 @@ int __init srat_disabled(void)
>         return acpi_numa < 0;
>  }
>
> -#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
> +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
>  /*
>   * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
>   * I/O localities since SRAT does not list them.  I/O localities are
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 6bb36fd6ba31..3ba8511cbede 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -249,7 +249,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
>  /* the following numa functions are architecture-dependent */
>  void acpi_numa_slit_init (struct acpi_table_slit *slit);
>
> -#if defined(CONFIG_X86) || defined(CONFIG_IA64)
> +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
>  void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
>  #else
>  static inline void
> --

Does this patch alone make sense without the other two in the series?
If so, I can queue it up for 5.15, so please let me know.

Thanks!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event
@ 2021-07-14 14:51     ` Moore, Robert
  0 siblings, 0 replies; 14+ messages in thread
From: Moore, Robert @ 2021-07-14 14:51 UTC (permalink / raw)
  To: Huacai Chen, Rafael J . Wysocki, Len Brown
  Cc: linux-acpi, devel, Xuefeng Li, Jiaxun Yang, Jianmin Lv

We'll probably take this patch.

Rafael, does this look OK?
thanks,
Bob


-----Original Message-----
From: Huacai Chen <chenhuacai@loongson.cn> 
Sent: Monday, July 05, 2021 6:06 AM
To: Rafael J . Wysocki <rjw@rjwysocki.net>; Len Brown <lenb@kernel.org>; Moore, Robert <robert.moore@intel.com>; Erik Kaneda <erik.kaneda@intel.com>
Cc: linux-acpi@vger.kernel.org; devel@acpica.org; Xuefeng Li <lixuefeng@loongson.cn>; Jiaxun Yang <jiaxun.yang@flygoat.com>; Huacai Chen <chenhuacai@loongson.cn>; Jianmin Lv <lvjianmin@loongson.cn>
Subject: [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event

Some chipsets (such as Loongson's LS7A) support fixed pcie wake event which is defined in the PM1 block(related description can be found in
4.8.4.1.1 PM1 Status Registers, 4.8.4.2.1 PM1 Control Registers and
5.2.9 Fixed ACPI Description Table (FADT)), so we add code to handle it.

ACPI Spec 6.4 link:
https://uefi.org/specifications/ACPI/6.4/

Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/acpi/acpica/evevent.c  | 17 +++++++++++------  drivers/acpi/acpica/hwsleep.c  | 12 ++++++++++++  drivers/acpi/acpica/utglobal.c |  4 ++++
 include/acpi/actypes.h         |  3 ++-
 4 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c index 35385148fedb..2340986de37b 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -140,9 +140,9 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
 
 		if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) {
 			status =
-			    acpi_write_bit_register(acpi_gbl_fixed_event_info
-						    [i].enable_register_id,
-						    ACPI_DISABLE_EVENT);
+			    acpi_write_bit_register(acpi_gbl_fixed_event_info[i].enable_register_id,
+						    (i == ACPI_EVENT_PCIE_WAKE) ?
+						    ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT);
 			if (ACPI_FAILURE(status)) {
 				return (status);
 			}
@@ -185,6 +185,11 @@ u32 acpi_ev_fixed_event_detect(void)
 		return (int_status);
 	}
 
+	if (fixed_enable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE)
+		fixed_enable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+	else
+		fixed_enable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+
 	ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
 			  "Fixed Event Block: Enable %08X Status %08X\n",
 			  fixed_enable, fixed_status));
@@ -248,9 +253,9 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
 	 * and disable the event to prevent further interrupts.
 	 */
 	if (!acpi_gbl_fixed_event_handlers[event].handler) {
-		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
-					      enable_register_id,
-					      ACPI_DISABLE_EVENT);
+		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].enable_register_id,
+					      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/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 14baa13bf848..7e7ea4c2e914 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -312,6 +312,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
 				    [ACPI_EVENT_SLEEP_BUTTON].
 				    status_register_id, ACPI_CLEAR_STATUS);
 
+	/* Enable pcie wake event if support */
+	if ((acpi_gbl_FADT.flags & ACPI_FADT_PCI_EXPRESS_WAKE)) {
+		(void)
+		acpi_write_bit_register(acpi_gbl_fixed_event_info
+				[ACPI_EVENT_PCIE_WAKE].
+				enable_register_id, ACPI_DISABLE_EVENT);
+		(void)
+		acpi_write_bit_register(acpi_gbl_fixed_event_info
+				[ACPI_EVENT_PCIE_WAKE].
+				status_register_id, ACPI_CLEAR_STATUS);
+	}
+
 	acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index 59a48371a7bc..16f7a206fc6d 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -186,6 +186,10 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
 					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/include/acpi/actypes.h b/include/acpi/actypes.h index 92c71dfce0d5..0b6c72033487 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -714,7 +714,8 @@ typedef u32 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
 
 /*
--
2.27.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Devel] Re: [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event
@ 2021-07-14 14:51     ` Moore, Robert
  0 siblings, 0 replies; 14+ messages in thread
From: Moore, Robert @ 2021-07-14 14:51 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 5128 bytes --]

We'll probably take this patch.

Rafael, does this look OK?
thanks,
Bob


-----Original Message-----
From: Huacai Chen <chenhuacai(a)loongson.cn> 
Sent: Monday, July 05, 2021 6:06 AM
To: Rafael J . Wysocki <rjw(a)rjwysocki.net>; Len Brown <lenb(a)kernel.org>; Moore, Robert <robert.moore(a)intel.com>; Erik Kaneda <erik.kaneda(a)intel.com>
Cc: linux-acpi(a)vger.kernel.org; devel(a)acpica.org; Xuefeng Li <lixuefeng(a)loongson.cn>; Jiaxun Yang <jiaxun.yang(a)flygoat.com>; Huacai Chen <chenhuacai(a)loongson.cn>; Jianmin Lv <lvjianmin(a)loongson.cn>
Subject: [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event

Some chipsets (such as Loongson's LS7A) support fixed pcie wake event which is defined in the PM1 block(related description can be found in
4.8.4.1.1 PM1 Status Registers, 4.8.4.2.1 PM1 Control Registers and
5.2.9 Fixed ACPI Description Table (FADT)), so we add code to handle it.

ACPI Spec 6.4 link:
https://uefi.org/specifications/ACPI/6.4/

Signed-off-by: Jianmin Lv <lvjianmin(a)loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai(a)loongson.cn>
---
 drivers/acpi/acpica/evevent.c  | 17 +++++++++++------  drivers/acpi/acpica/hwsleep.c  | 12 ++++++++++++  drivers/acpi/acpica/utglobal.c |  4 ++++
 include/acpi/actypes.h         |  3 ++-
 4 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c index 35385148fedb..2340986de37b 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -140,9 +140,9 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
 
 		if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) {
 			status =
-			    acpi_write_bit_register(acpi_gbl_fixed_event_info
-						    [i].enable_register_id,
-						    ACPI_DISABLE_EVENT);
+			    acpi_write_bit_register(acpi_gbl_fixed_event_info[i].enable_register_id,
+						    (i == ACPI_EVENT_PCIE_WAKE) ?
+						    ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT);
 			if (ACPI_FAILURE(status)) {
 				return (status);
 			}
@@ -185,6 +185,11 @@ u32 acpi_ev_fixed_event_detect(void)
 		return (int_status);
 	}
 
+	if (fixed_enable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE)
+		fixed_enable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+	else
+		fixed_enable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE;
+
 	ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
 			  "Fixed Event Block: Enable %08X Status %08X\n",
 			  fixed_enable, fixed_status));
@@ -248,9 +253,9 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
 	 * and disable the event to prevent further interrupts.
 	 */
 	if (!acpi_gbl_fixed_event_handlers[event].handler) {
-		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
-					      enable_register_id,
-					      ACPI_DISABLE_EVENT);
+		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].enable_register_id,
+					      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/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 14baa13bf848..7e7ea4c2e914 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -312,6 +312,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
 				    [ACPI_EVENT_SLEEP_BUTTON].
 				    status_register_id, ACPI_CLEAR_STATUS);
 
+	/* Enable pcie wake event if support */
+	if ((acpi_gbl_FADT.flags & ACPI_FADT_PCI_EXPRESS_WAKE)) {
+		(void)
+		acpi_write_bit_register(acpi_gbl_fixed_event_info
+				[ACPI_EVENT_PCIE_WAKE].
+				enable_register_id, ACPI_DISABLE_EVENT);
+		(void)
+		acpi_write_bit_register(acpi_gbl_fixed_event_info
+				[ACPI_EVENT_PCIE_WAKE].
+				status_register_id, ACPI_CLEAR_STATUS);
+	}
+
 	acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index 59a48371a7bc..16f7a206fc6d 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -186,6 +186,10 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
 					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/include/acpi/actypes.h b/include/acpi/actypes.h index 92c71dfce0d5..0b6c72033487 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -714,7 +714,8 @@ typedef u32 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
 
 /*
--
2.27.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
  2021-07-14 12:30     ` [Devel] " Rafael J. Wysocki
  (?)
@ 2021-07-15  4:49     ` 陈华才
  2021-07-16 17:11         ` [Devel] " Rafael J. Wysocki
  -1 siblings, 1 reply; 14+ messages in thread
From: 陈华才 @ 2021-07-15  4:49 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J . Wysocki, Len Brown, Robert Moore, Erik Kaneda,
	ACPI Devel Maling List,
	open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
	Xuefeng Li, Jiaxun Yang, chenhuacai

Hi, Rafael,


&gt; -----原始邮件-----
&gt; 发件人: "Rafael J. Wysocki" <rafael@kernel.org>
&gt; 发送时间: 2021-07-14 20:30:33 (星期三)
&gt; 收件人: "Huacai Chen" <chenhuacai@loongson.cn>
&gt; 抄送: "Rafael J . Wysocki" <rjw@rjwysocki.net>, "Len Brown" <lenb@kernel.org>, "Robert Moore" <robert.moore@intel.com>, "Erik Kaneda" <erik.kaneda@intel.com>, "ACPI Devel Maling List" <linux-acpi@vger.kernel.org>, "open list:ACPI COMPONENT ARCHITECTURE (ACPICA)" <devel@acpica.org>, "Xuefeng Li" <lixuefeng@loongson.cn>, "Jiaxun Yang" <jiaxun.yang@flygoat.com>
&gt; 主题: Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
&gt; 
&gt; On Mon, Jul 5, 2021 at 2:41 PM Huacai Chen <chenhuacai@loongson.cn> wrote:
&gt; &gt;
&gt; &gt; We are preparing to add new Loongson (based on LoongArch, not MIPS)
&gt; &gt; support. LoongArch use ACPI other than DT as its boot protocol, so
&gt; &gt; add its support for ACPI_PROCESSOR/ACPI_NUMA.
&gt; &gt;
&gt; &gt; Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
&gt; &gt; ---
&gt; &gt;  drivers/acpi/Kconfig      | 4 ++--
&gt; &gt;  drivers/acpi/numa/Kconfig | 2 +-
&gt; &gt;  drivers/acpi/numa/srat.c  | 2 +-
&gt; &gt;  include/linux/acpi.h      | 2 +-
&gt; &gt;  4 files changed, 5 insertions(+), 5 deletions(-)
&gt; &gt;
&gt; &gt; diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
&gt; &gt; index fe0bb6277e4d..90afa44efcba 100644
&gt; &gt; --- a/drivers/acpi/Kconfig
&gt; &gt; +++ b/drivers/acpi/Kconfig
&gt; &gt; @@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
&gt; &gt;
&gt; &gt;  config ACPI_PROCESSOR
&gt; &gt;         tristate "Processor"
&gt; &gt; -       depends on X86 || IA64 || ARM64
&gt; &gt; +       depends on X86 || IA64 || ARM64 || LOONGARCH
&gt; &gt;         select ACPI_PROCESSOR_IDLE
&gt; &gt; -       select ACPI_CPU_FREQ_PSS if X86 || IA64
&gt; &gt; +       select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
&gt; &gt;         default y
&gt; &gt;         help
&gt; &gt;           This driver adds support for the ACPI Processor package. It is required
&gt; &gt; diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig
&gt; &gt; index fcf2e556d69d..39b1f34c21df 100644
&gt; &gt; --- a/drivers/acpi/numa/Kconfig
&gt; &gt; +++ b/drivers/acpi/numa/Kconfig
&gt; &gt; @@ -2,7 +2,7 @@
&gt; &gt;  config ACPI_NUMA
&gt; &gt;         bool "NUMA support"
&gt; &gt;         depends on NUMA
&gt; &gt; -       depends on (X86 || IA64 || ARM64)
&gt; &gt; +       depends on (X86 || IA64 || ARM64 || LOONGARCH)
&gt; &gt;         default y if IA64 || ARM64
&gt; &gt;
&gt; &gt;  config ACPI_HMAT
&gt; &gt; diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
&gt; &gt; index 6021a1013442..b8795fc49097 100644
&gt; &gt; --- a/drivers/acpi/numa/srat.c
&gt; &gt; +++ b/drivers/acpi/numa/srat.c
&gt; &gt; @@ -206,7 +206,7 @@ int __init srat_disabled(void)
&gt; &gt;         return acpi_numa &lt; 0;
&gt; &gt;  }
&gt; &gt;
&gt; &gt; -#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
&gt; &gt; +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
&gt; &gt;  /*
&gt; &gt;   * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
&gt; &gt;   * I/O localities since SRAT does not list them.  I/O localities are
&gt; &gt; diff --git a/include/linux/acpi.h b/include/linux/acpi.h
&gt; &gt; index 6bb36fd6ba31..3ba8511cbede 100644
&gt; &gt; --- a/include/linux/acpi.h
&gt; &gt; +++ b/include/linux/acpi.h
&gt; &gt; @@ -249,7 +249,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
&gt; &gt;  /* the following numa functions are architecture-dependent */
&gt; &gt;  void acpi_numa_slit_init (struct acpi_table_slit *slit);
&gt; &gt;
&gt; &gt; -#if defined(CONFIG_X86) || defined(CONFIG_IA64)
&gt; &gt; +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
&gt; &gt;  void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
&gt; &gt;  #else
&gt; &gt;  static inline void
&gt; &gt; --
&gt; 
&gt; Does this patch alone make sense without the other two in the series?
&gt; If so, I can queue it up for 5.15, so please let me know.
Yes, this patch has no dependency with other two.

Huacai
&gt; 
&gt; Thanks!
</chenhuacai@loongson.cn></chenhuacai@loongson.cn></jiaxun.yang@flygoat.com></lixuefeng@loongson.cn></devel@acpica.org></linux-acpi@vger.kernel.org></erik.kaneda@intel.com></robert.moore@intel.com></lenb@kernel.org></rjw@rjwysocki.net></chenhuacai@loongson.cn></rafael@kernel.org>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
@ 2021-07-16 17:11         ` Rafael J. Wysocki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2021-07-16 17:11 UTC (permalink / raw)
  To: 陈华才
  Cc: Rafael J. Wysocki, Rafael J . Wysocki, Len Brown, Robert Moore,
	Erik Kaneda, ACPI Devel Maling List,
	open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
	Xuefeng Li, Jiaxun Yang, chenhuacai

On Thu, Jul 15, 2021 at 6:49 AM 陈华才 <chenhuacai@loongson.cn> wrote:
>
> Hi, Rafael,
>
>
> &gt; -----原始邮件-----
> &gt; 发件人: "Rafael J. Wysocki" <rafael@kernel.org>
> &gt; 发送时间: 2021-07-14 20:30:33 (星期三)
> &gt; 收件人: "Huacai Chen" <chenhuacai@loongson.cn>
> &gt; 抄送: "Rafael J . Wysocki" <rjw@rjwysocki.net>, "Len Brown" <lenb@kernel.org>, "Robert Moore" <robert.moore@intel.com>, "Erik Kaneda" <erik.kaneda@intel.com>, "ACPI Devel Maling List" <linux-acpi@vger.kernel.org>, "open list:ACPI COMPONENT ARCHITECTURE (ACPICA)" <devel@acpica.org>, "Xuefeng Li" <lixuefeng@loongson.cn>, "Jiaxun Yang" <jiaxun.yang@flygoat.com>
> &gt; 主题: Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
> &gt;
> &gt; On Mon, Jul 5, 2021 at 2:41 PM Huacai Chen <chenhuacai@loongson.cn> wrote:
> &gt; &gt;
> &gt; &gt; We are preparing to add new Loongson (based on LoongArch, not MIPS)
> &gt; &gt; support. LoongArch use ACPI other than DT as its boot protocol, so
> &gt; &gt; add its support for ACPI_PROCESSOR/ACPI_NUMA.
> &gt; &gt;
> &gt; &gt; Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> &gt; &gt; ---
> &gt; &gt;  drivers/acpi/Kconfig      | 4 ++--
> &gt; &gt;  drivers/acpi/numa/Kconfig | 2 +-
> &gt; &gt;  drivers/acpi/numa/srat.c  | 2 +-
> &gt; &gt;  include/linux/acpi.h      | 2 +-
> &gt; &gt;  4 files changed, 5 insertions(+), 5 deletions(-)
> &gt; &gt;
> &gt; &gt; diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> &gt; &gt; index fe0bb6277e4d..90afa44efcba 100644
> &gt; &gt; --- a/drivers/acpi/Kconfig
> &gt; &gt; +++ b/drivers/acpi/Kconfig
> &gt; &gt; @@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
> &gt; &gt;
> &gt; &gt;  config ACPI_PROCESSOR
> &gt; &gt;         tristate "Processor"
> &gt; &gt; -       depends on X86 || IA64 || ARM64
> &gt; &gt; +       depends on X86 || IA64 || ARM64 || LOONGARCH
> &gt; &gt;         select ACPI_PROCESSOR_IDLE
> &gt; &gt; -       select ACPI_CPU_FREQ_PSS if X86 || IA64
> &gt; &gt; +       select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
> &gt; &gt;         default y
> &gt; &gt;         help
> &gt; &gt;           This driver adds support for the ACPI Processor package. It is required
> &gt; &gt; diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig
> &gt; &gt; index fcf2e556d69d..39b1f34c21df 100644
> &gt; &gt; --- a/drivers/acpi/numa/Kconfig
> &gt; &gt; +++ b/drivers/acpi/numa/Kconfig
> &gt; &gt; @@ -2,7 +2,7 @@
> &gt; &gt;  config ACPI_NUMA
> &gt; &gt;         bool "NUMA support"
> &gt; &gt;         depends on NUMA
> &gt; &gt; -       depends on (X86 || IA64 || ARM64)
> &gt; &gt; +       depends on (X86 || IA64 || ARM64 || LOONGARCH)
> &gt; &gt;         default y if IA64 || ARM64
> &gt; &gt;
> &gt; &gt;  config ACPI_HMAT
> &gt; &gt; diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> &gt; &gt; index 6021a1013442..b8795fc49097 100644
> &gt; &gt; --- a/drivers/acpi/numa/srat.c
> &gt; &gt; +++ b/drivers/acpi/numa/srat.c
> &gt; &gt; @@ -206,7 +206,7 @@ int __init srat_disabled(void)
> &gt; &gt;         return acpi_numa &lt; 0;
> &gt; &gt;  }
> &gt; &gt;
> &gt; &gt; -#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
> &gt; &gt; +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
> &gt; &gt;  /*
> &gt; &gt;   * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
> &gt; &gt;   * I/O localities since SRAT does not list them.  I/O localities are
> &gt; &gt; diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> &gt; &gt; index 6bb36fd6ba31..3ba8511cbede 100644
> &gt; &gt; --- a/include/linux/acpi.h
> &gt; &gt; +++ b/include/linux/acpi.h
> &gt; &gt; @@ -249,7 +249,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
> &gt; &gt;  /* the following numa functions are architecture-dependent */
> &gt; &gt;  void acpi_numa_slit_init (struct acpi_table_slit *slit);
> &gt; &gt;
> &gt; &gt; -#if defined(CONFIG_X86) || defined(CONFIG_IA64)
> &gt; &gt; +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
> &gt; &gt;  void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
> &gt; &gt;  #else
> &gt; &gt;  static inline void
> &gt; &gt; --
> &gt;
> &gt; Does this patch alone make sense without the other two in the series?
> &gt; If so, I can queue it up for 5.15, so please let me know.
> Yes, this patch has no dependency with other two.

OK, applied as 5.15 material.

Thanks!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Devel] Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
@ 2021-07-16 17:11         ` Rafael J. Wysocki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2021-07-16 17:11 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 4572 bytes --]

On Thu, Jul 15, 2021 at 6:49 AM 陈华才 <chenhuacai(a)loongson.cn> wrote:
>
> Hi, Rafael,
>
>
> &gt; -----原始邮件-----
> &gt; 发件人: "Rafael J. Wysocki" <rafael(a)kernel.org>
> &gt; 发送时间: 2021-07-14 20:30:33 (星期三)
> &gt; 收件人: "Huacai Chen" <chenhuacai(a)loongson.cn>
> &gt; 抄送: "Rafael J . Wysocki" <rjw(a)rjwysocki.net>, "Len Brown" <lenb(a)kernel.org>, "Robert Moore" <robert.moore(a)intel.com>, "Erik Kaneda" <erik.kaneda(a)intel.com>, "ACPI Devel Maling List" <linux-acpi(a)vger.kernel.org>, "open list:ACPI COMPONENT ARCHITECTURE (ACPICA)" <devel(a)acpica.org>, "Xuefeng Li" <lixuefeng(a)loongson.cn>, "Jiaxun Yang" <jiaxun.yang(a)flygoat.com>
> &gt; 主题: Re: [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA
> &gt;
> &gt; On Mon, Jul 5, 2021 at 2:41 PM Huacai Chen <chenhuacai(a)loongson.cn> wrote:
> &gt; &gt;
> &gt; &gt; We are preparing to add new Loongson (based on LoongArch, not MIPS)
> &gt; &gt; support. LoongArch use ACPI other than DT as its boot protocol, so
> &gt; &gt; add its support for ACPI_PROCESSOR/ACPI_NUMA.
> &gt; &gt;
> &gt; &gt; Signed-off-by: Huacai Chen <chenhuacai(a)loongson.cn>
> &gt; &gt; ---
> &gt; &gt;  drivers/acpi/Kconfig      | 4 ++--
> &gt; &gt;  drivers/acpi/numa/Kconfig | 2 +-
> &gt; &gt;  drivers/acpi/numa/srat.c  | 2 +-
> &gt; &gt;  include/linux/acpi.h      | 2 +-
> &gt; &gt;  4 files changed, 5 insertions(+), 5 deletions(-)
> &gt; &gt;
> &gt; &gt; diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> &gt; &gt; index fe0bb6277e4d..90afa44efcba 100644
> &gt; &gt; --- a/drivers/acpi/Kconfig
> &gt; &gt; +++ b/drivers/acpi/Kconfig
> &gt; &gt; @@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
> &gt; &gt;
> &gt; &gt;  config ACPI_PROCESSOR
> &gt; &gt;         tristate "Processor"
> &gt; &gt; -       depends on X86 || IA64 || ARM64
> &gt; &gt; +       depends on X86 || IA64 || ARM64 || LOONGARCH
> &gt; &gt;         select ACPI_PROCESSOR_IDLE
> &gt; &gt; -       select ACPI_CPU_FREQ_PSS if X86 || IA64
> &gt; &gt; +       select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
> &gt; &gt;         default y
> &gt; &gt;         help
> &gt; &gt;           This driver adds support for the ACPI Processor package. It is required
> &gt; &gt; diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig
> &gt; &gt; index fcf2e556d69d..39b1f34c21df 100644
> &gt; &gt; --- a/drivers/acpi/numa/Kconfig
> &gt; &gt; +++ b/drivers/acpi/numa/Kconfig
> &gt; &gt; @@ -2,7 +2,7 @@
> &gt; &gt;  config ACPI_NUMA
> &gt; &gt;         bool "NUMA support"
> &gt; &gt;         depends on NUMA
> &gt; &gt; -       depends on (X86 || IA64 || ARM64)
> &gt; &gt; +       depends on (X86 || IA64 || ARM64 || LOONGARCH)
> &gt; &gt;         default y if IA64 || ARM64
> &gt; &gt;
> &gt; &gt;  config ACPI_HMAT
> &gt; &gt; diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> &gt; &gt; index 6021a1013442..b8795fc49097 100644
> &gt; &gt; --- a/drivers/acpi/numa/srat.c
> &gt; &gt; +++ b/drivers/acpi/numa/srat.c
> &gt; &gt; @@ -206,7 +206,7 @@ int __init srat_disabled(void)
> &gt; &gt;         return acpi_numa &lt; 0;
> &gt; &gt;  }
> &gt; &gt;
> &gt; &gt; -#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
> &gt; &gt; +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
> &gt; &gt;  /*
> &gt; &gt;   * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
> &gt; &gt;   * I/O localities since SRAT does not list them.  I/O localities are
> &gt; &gt; diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> &gt; &gt; index 6bb36fd6ba31..3ba8511cbede 100644
> &gt; &gt; --- a/include/linux/acpi.h
> &gt; &gt; +++ b/include/linux/acpi.h
> &gt; &gt; @@ -249,7 +249,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
> &gt; &gt;  /* the following numa functions are architecture-dependent */
> &gt; &gt;  void acpi_numa_slit_init (struct acpi_table_slit *slit);
> &gt; &gt;
> &gt; &gt; -#if defined(CONFIG_X86) || defined(CONFIG_IA64)
> &gt; &gt; +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
> &gt; &gt;  void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
> &gt; &gt;  #else
> &gt; &gt;  static inline void
> &gt; &gt; --
> &gt;
> &gt; Does this patch alone make sense without the other two in the series?
> &gt; If so, I can queue it up for 5.15, so please let me know.
> Yes, this patch has no dependency with other two.

OK, applied as 5.15 material.

Thanks!

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-07-16 17:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 12:42 [PATCH 0/3] ACPI: Add LoongArch-related definitions Huacai Chen
2021-07-05 12:42 ` [PATCH 1/3] ACPI: Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA Huacai Chen
2021-07-14 12:30   ` Rafael J. Wysocki
2021-07-14 12:30     ` [Devel] " Rafael J. Wysocki
2021-07-15  4:49     ` 陈华才
2021-07-16 17:11       ` Rafael J. Wysocki
2021-07-16 17:11         ` [Devel] " Rafael J. Wysocki
2021-07-05 12:42 ` [PATCH 2/3] ACPICA: MADT: Add LoongArch APICs support Huacai Chen
2021-07-08 21:35   ` Moore, Robert
2021-07-08 21:35     ` [Devel] " Moore, Robert
2021-07-09  3:08     ` 陈华才
2021-07-05 13:05 ` [PATCH 3/3] ACPICA: Events: Support fixed pcie wake event Huacai Chen
2021-07-14 14:51   ` Moore, Robert
2021-07-14 14:51     ` [Devel] " Moore, Robert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.