public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Bob Moore <robert.moore@intel.com>,
	Saket Dumbre <saket.dumbre@intel.com>
Subject: [PATCH 12/14] ACPICA: MADT: Add RISC-V external interrupt controllers
Date: Mon, 10 Jul 2023 19:21:57 +0200	[thread overview]
Message-ID: <8291255.NyiUUSuA9g@kreacher> (raw)
In-Reply-To: <5698695.DvuYhMxLoT@kreacher>

From: Sunil V L <sunilvl@ventanamicro.com>

ACPICA commit 8c048cee4ea7b9ded8db3e1b3b9c14e21e084a2c

This adds 3 different external interrupt controller
definitions in MADT for RISC-V.

 1) RISC-V PLIC is a platform interrupt controller for
    handling wired interrupt in a RISC-V systems.

 2) RISC-V IMSIC is MSI interrupt controller to
    support MSI interrupts.

 3) RISC-V APLIC has dual functionality. First it can
    act like PLIC and direct all wired interrupts to
    the CPU which doesn't have MSI controller. Second,
    when the CPU has MSI controller (IMSIC), it will
    act as a converter from wired interrupts to MSI.

Update the existing RINTC structure also to support
these external interrupt controllers.

This codefirst ECR is approved by UEFI forum and will
be part of next ACPI spec version.

Link: https://github.com/acpica/acpica/commit/8c048cee
Signed-off-by: Haibo, Xu <haibo1.xu@intel.com>
Co-developed-by: Haibo, Xu <haibo1.xu@intel.com>
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 include/acpi/actbl2.h | 50 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 0029336775a9..280ab4c7f77a 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -893,7 +893,10 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_BIO_PIC = 22,
 	ACPI_MADT_TYPE_LPC_PIC = 23,
 	ACPI_MADT_TYPE_RINTC = 24,
-	ACPI_MADT_TYPE_RESERVED = 25,	/* 25 to 0x7F are reserved */
+	ACPI_MADT_TYPE_IMSIC = 25,
+	ACPI_MADT_TYPE_APLIC = 26,
+	ACPI_MADT_TYPE_PLIC = 27,
+	ACPI_MADT_TYPE_RESERVED = 28,	/* 28 to 0x7F are reserved */
 	ACPI_MADT_TYPE_OEM_RESERVED = 0x80	/* 0x80 to 0xFF are reserved for OEM use */
 };
 
@@ -1261,6 +1264,9 @@ struct acpi_madt_rintc {
 	u32 flags;
 	u64 hart_id;
 	u32 uid;		/* ACPI processor UID */
+	u32 ext_intc_id;	/* External INTC Id */
+	u64 imsic_addr;		/* IMSIC base address */
+	u32 imsic_size;		/* IMSIC size */
 };
 
 /* Values for RISC-V INTC Version field above */
@@ -1271,6 +1277,48 @@ enum acpi_madt_rintc_version {
 	ACPI_MADT_RINTC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
 };
 
+/* 25: RISC-V IMSIC */
+struct acpi_madt_imsic {
+	struct acpi_subtable_header header;
+	u8 version;
+	u8 reserved;
+	u32 flags;
+	u16 num_ids;
+	u16 num_guest_ids;
+	u8 guest_index_bits;
+	u8 hart_index_bits;
+	u8 group_index_bits;
+	u8 group_index_shift;
+};
+
+/* 26: RISC-V APLIC */
+struct acpi_madt_aplic {
+	struct acpi_subtable_header header;
+	u8 version;
+	u8 id;
+	u32 flags;
+	u8 hw_id[8];
+	u16 num_idcs;
+	u16 num_sources;
+	u32 gsi_base;
+	u64 base_addr;
+	u32 size;
+};
+
+/* 27: RISC-V PLIC */
+struct acpi_madt_plic {
+	struct acpi_subtable_header header;
+	u8 version;
+	u8 id;
+	u8 hw_id[8];
+	u16 num_irqs;
+	u16 max_prio;
+	u32 flags;
+	u32 size;
+	u64 base_addr;
+	u32 gsi_base;
+};
+
 /* 80: OEM data */
 
 struct acpi_madt_oem_data {
-- 
2.35.3





  parent reply	other threads:[~2023-07-10 17:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 17:10 [PATCH 00/14] ACPICA 20230628 Rafael J. Wysocki
2023-07-10 17:11 ` [PATCH 01/14] ACPICA: Fix GCC 12 dangling-pointer warning Rafael J. Wysocki
2023-07-10 17:12 ` [PATCH 02/14] ACPICA: Modify ACPI_STATE_COMMON Rafael J. Wysocki
2023-07-10 17:13 ` [PATCH 03/14] ACPICA: exserial.c: replace ternary operator with ACPI_MIN() Rafael J. Wysocki
2023-07-10 17:13 ` [PATCH 04/14] ACPICA: Add support for _DSC as per ACPI 6.5 Rafael J. Wysocki
2023-07-10 17:14 ` [PATCH 05/14] ACPICA: fix for conflict macro definition on zephyr interface Rafael J. Wysocki
2023-07-10 17:15 ` [PATCH 06/14] ACPICA: Detect GED device and keep track of _EVT Rafael J. Wysocki
2023-07-10 17:16 ` [PATCH 07/14] ACPICA: Add interrupt command to acpiexec Rafael J. Wysocki
2023-07-10 17:17 ` [PATCH 08/14] ACPICA: Fix misspelled CDAT DSMAS define Rafael J. Wysocki
2023-07-10 17:18 ` [PATCH 09/14] ACPICA: Slightly simplify an error message in acpi_ds_result_push() Rafael J. Wysocki
2023-07-10 17:20 ` [PATCH 10/14] ACPICA: Add a define for size of struct acpi_srat_generic_affinity device_handle Rafael J. Wysocki
2023-07-10 17:21 ` [PATCH 11/14] ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer Rafael J. Wysocki
2023-07-10 17:21 ` Rafael J. Wysocki [this message]
2023-07-10 17:22 ` [PATCH 13/14] ACPICA: RHCT: Add flags, CMO and MMU nodes Rafael J. Wysocki
2023-07-10 17:23 ` [PATCH 14/14] ACPICA: Update version to 20230628 Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8291255.NyiUUSuA9g@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.moore@intel.com \
    --cc=saket.dumbre@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox