From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C5E3C43334 for ; Sat, 16 Jul 2022 18:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229937AbiGPSLE (ORCPT ); Sat, 16 Jul 2022 14:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiGPSLC (ORCPT ); Sat, 16 Jul 2022 14:11:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14241167E2 for ; Sat, 16 Jul 2022 11:11:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A14F561209 for ; Sat, 16 Jul 2022 18:11:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A5B4C34114; Sat, 16 Jul 2022 18:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657995060; bh=gBnoGjN0G2M3wuIEOqdffVmvK+3Ru/WwEXuGSgw7XWE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MPAC2ug0aAFUvVw7HL1ewqEaqcmGiGJVlu8ZMHPgSyK6UvmZB4/CV7h/KxqeFHtRb 5tTuNL83X1hBwdGqgCK4AnBrt8lL/J2ZRvxQJp3aa/nP8a0TLkGQBU4BDXGoSQYwir 8mTfBzM4cmjHt7HTuH+clsf9ri7zYc2e08s0AKtxZTBr7OaHt9qKot6iduPEvuTBUQ 8aecykEXiU8YXtIIVeIU8yc9VjaiMf/3OBt97UgsJXO04P633xFsZFuF0xuo9tlb/U gJ+mgHGTYUylEX3Pau9aEDE5fNYmqzZvAsuXySK8ie91fHyUVKxuqub5M3ZW8i+vFp 5+e7IOtTJZH7g== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oCmFl-007u8X-Lp; Sat, 16 Jul 2022 19:10:57 +0100 Date: Sat, 16 Jul 2022 19:10:52 +0100 Message-ID: <87mtd93p3n.wl-maz@kernel.org> From: Marc Zyngier To: Jianmin Lv , Robert Moore Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Hanjun Guo , Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen Subject: Re: [PATCH V15 01/15] ACPICA: MADT: Add LoongArch APICs support In-Reply-To: <1657868751-30444-2-git-send-email-lvjianmin@loongson.cn> References: <1657868751-30444-1-git-send-email-lvjianmin@loongson.cn> <1657868751-30444-2-git-send-email-lvjianmin@loongson.cn> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: lvjianmin@loongson.cn, robert.moore@intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, guohanjun@huawei.com, lorenzo.pieralisi@arm.com, jiaxun.yang@flygoat.com, chenhuacai@loongson.cn X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+ Robert Moore] On Fri, 15 Jul 2022 08:05:37 +0100, Jianmin Lv wrote: >=20 > From: Huacai Chen >=20 > 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. >=20 > ACPI changes of LoongArch-specific interrupt controllers have already > been approved in the ECRs, and will be public in the next revision of > ACPI Specification. >=20 > Reference: https://mantis.uefi.org/mantis/view.php?id=3D2203 > Reference: https://mantis.uefi.org/mantis/view.php?id=3D2313 >=20 > Above links needs login(available for ASWG), so the following link( > the ECR file for adding LoongArch APICs into ACPI spec) is provided > for public: >=20 > https://github.com/lvjianmin-loongson/acpica/blob/master/Add%20APIC%20Str= uctures%20for%20Loongarch%20in%20MADT-rev3.pdf >=20 > Signed-off-by: Jianmin Lv > Signed-off-by: Huacai Chen Since the ACPI maintainers are unwilling to take this patch (for undisclosed reasons), we need something to unblock this sorry situation, as I don't think it is fair on the LoongArch folks to be blocked for another cycle on this ground only. I'm proposing to replace this patch with the following, which will allow the patches to be merged without breaking anything. Once the ACPI support is updated, we'll be able to simply revert this patch. Thanks, M. =46rom 43ec25d2dbde3c422cce430c9d5ec32fbe7b255c Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Sat, 16 Jul 2022 18:56:10 +0100 Subject: [PATCH] LoongArch: Provisionally add ACPICA data structures The LoongArch architecture is using ACPI, but the spec containing the required updates still is in an unreleased state. Instead of preventing the inclusion of the IRQ support into the kernel, add the missing bits to the arch-specific parts of the ACPICA support. Once the ACPICA bits are updated to the version that supports LoongArch, these bits can eventually be removed. Signed-off-by: Marc Zyngier --- arch/loongarch/include/asm/acpi.h | 138 ++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/arch/loongarch/include/asm/acpi.h b/arch/loongarch/include/asm= /acpi.h index 62044cd5b7bc..6155e46098af 100644 --- a/arch/loongarch/include/asm/acpi.h +++ b/arch/loongarch/include/asm/acpi.h @@ -31,6 +31,144 @@ static inline bool acpi_has_cpu_in_madt(void) =20 extern struct list_head acpi_wakeup_device_list; =20 +/* + * Temporary definitions until the core ACPICA code gets updated (see + * 1656837932-18257-1-git-send-email-lvjianmin@loongson.cn and its + * follow-ups for the "rationale"). + * + * Once the "legal reasons" are cleared and that the code is merged, + * this can be dropped entierely. + */ +#if (ACPI_CA_VERSION =3D=3D 0x20220331 && !defined(LOONGARCH_ACPICA_EXT)) + +#define LOONGARCH_ACPICA_EXT 1 + +#define ACPI_MADT_TYPE_CORE_PIC 17 +#define ACPI_MADT_TYPE_LIO_PIC 18 +#define ACPI_MADT_TYPE_HT_PIC 19 +#define ACPI_MADT_TYPE_EIO_PIC 20 +#define ACPI_MADT_TYPE_MSI_PIC 21 +#define ACPI_MADT_TYPE_BIO_PIC 22 +#define ACPI_MADT_TYPE_LPC_PIC 23 + +/* Values for Version field above */ + +enum acpi_madt_core_pic_version { + ACPI_MADT_CORE_PIC_VERSION_NONE =3D 0, + ACPI_MADT_CORE_PIC_VERSION_V1 =3D 1, + ACPI_MADT_CORE_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +enum acpi_madt_lio_pic_version { + ACPI_MADT_LIO_PIC_VERSION_NONE =3D 0, + ACPI_MADT_LIO_PIC_VERSION_V1 =3D 1, + ACPI_MADT_LIO_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +enum acpi_madt_eio_pic_version { + ACPI_MADT_EIO_PIC_VERSION_NONE =3D 0, + ACPI_MADT_EIO_PIC_VERSION_V1 =3D 1, + ACPI_MADT_EIO_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +enum acpi_madt_ht_pic_version { + ACPI_MADT_HT_PIC_VERSION_NONE =3D 0, + ACPI_MADT_HT_PIC_VERSION_V1 =3D 1, + ACPI_MADT_HT_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +enum acpi_madt_bio_pic_version { + ACPI_MADT_BIO_PIC_VERSION_NONE =3D 0, + ACPI_MADT_BIO_PIC_VERSION_V1 =3D 1, + ACPI_MADT_BIO_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +enum acpi_madt_msi_pic_version { + ACPI_MADT_MSI_PIC_VERSION_NONE =3D 0, + ACPI_MADT_MSI_PIC_VERSION_V1 =3D 1, + ACPI_MADT_MSI_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +enum acpi_madt_lpc_pic_version { + ACPI_MADT_LPC_PIC_VERSION_NONE =3D 0, + ACPI_MADT_LPC_PIC_VERSION_V1 =3D 1, + ACPI_MADT_LPC_PIC_VERSION_RESERVED =3D 2 /* 2 and greater are reserved */ +}; + +/* Core Interrupt Controller */ + +struct acpi_madt_core_pic { + struct acpi_subtable_header header; + u8 version; + u32 processor_id; + u32 core_id; + u32 flags; +}; + +/* Legacy I/O Interrupt Controller */ + +struct acpi_madt_lio_pic { + struct acpi_subtable_header header; + u8 version; + u64 address; + u16 size; + u8 cascade[2]; + u32 cascade_map[2]; +}; + +/* Extend I/O Interrupt Controller */ + +struct acpi_madt_eio_pic { + struct acpi_subtable_header header; + u8 version; + u8 cascade; + u8 node; + u64 node_map; +}; + +/* HT Interrupt Controller */ + +struct acpi_madt_ht_pic { + struct acpi_subtable_header header; + u8 version; + u64 address; + u16 size; + u8 cascade[8]; +}; + +/* Bridge I/O Interrupt Controller */ + +struct acpi_madt_bio_pic { + struct acpi_subtable_header header; + u8 version; + u64 address; + u16 size; + u16 id; + u16 gsi_base; +}; + +/* MSI Interrupt Controller */ + +struct acpi_madt_msi_pic { + struct acpi_subtable_header header; + u8 version; + u64 msg_address; + u32 start; + u32 count; +}; + +/* LPC Interrupt Controller */ + +struct acpi_madt_lpc_pic { + struct acpi_subtable_header header; + u8 version; + u64 address; + u16 size; + u8 cascade; +}; + +#endif + #endif /* !CONFIG_ACPI */ =20 #define ACPI_TABLE_UPGRADE_MAX_PHYS ARCH_LOW_ADDRESS_LIMIT --=20 2.34.1 --=20 Without deviation from the norm, progress is not possible.