From patchwork Thu Feb 15 11:14:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13558147 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1638C48BEB for ; Thu, 15 Feb 2024 11:15:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D90B78D001B; Thu, 15 Feb 2024 06:15:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C50418D0023; Thu, 15 Feb 2024 06:15:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87F308D001B; Thu, 15 Feb 2024 06:15:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5F97A8D0021 for ; Thu, 15 Feb 2024 06:15:18 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 405A2120FC9 for ; Thu, 15 Feb 2024 11:15:18 +0000 (UTC) X-FDA: 81793781916.27.C879BE2 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf15.hostedemail.com (Postfix) with ESMTP id 6EB03A000C for ; Thu, 15 Feb 2024 11:15:16 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707995716; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jJVzC6a93d5/6WQpeOW8zNL+NBICeCZmUTpqDceX8bs=; b=bJesP6DVbaJPMbSnOnbw2uLFQVsoOs/ohHVPOeIhzXDsCUfWAHViwFzz/phOfKs7dbPuk8 sa9juTGxQVRWnoJLpRAis2DHLSviY09hXPwwgqTEck9kuIEd+GJZ+oSXBGsS/kx4e5HvqF JJ16vrot60JHV6bTPzbTHq0Y5P0A73o= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707995716; a=rsa-sha256; cv=none; b=iZ1BBnlq5NQMz9zOXnNHB1BVgfBLfs9YjKAY6JcFOZKUvYF9XQCkvRey4D1/e4ffyMv822 nFOmL0v/LCRYpCg93X8GjetvZPHMJgN5ZJkXVSfTDt3Gy44LNK7BPb3yI548w84B/Wds+1 7VctBDVJAfwyawhGjxp3j5/DjcVjHeE= Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TbC764WFDz67SFp; Thu, 15 Feb 2024 19:11:30 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id 83A86141CB9; Thu, 15 Feb 2024 19:15:14 +0800 (CST) Received: from SecurePC30232.china.huawei.com (10.122.247.234) by lhrpeml500006.china.huawei.com (7.191.161.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 15 Feb 2024 11:15:13 +0000 From: To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH v6 10/12] ACPICA: ACPI 6.5: Add support for RAS2 table Date: Thu, 15 Feb 2024 19:14:52 +0800 Message-ID: <20240215111455.1462-11-shiju.jose@huawei.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20240215111455.1462-1-shiju.jose@huawei.com> References: <20240215111455.1462-1-shiju.jose@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.122.247.234] X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Rspamd-Queue-Id: 6EB03A000C X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 3x6dq9ih1xo5bjngnofugej8quhaxbxw X-HE-Tag: 1707995716-728951 X-HE-Meta: U2FsdGVkX1/Yhz0vZzy+hmM0KEpkvOIwPvSKk+POoI/YEEVwQlPeAGmpppk6wiwSi0sOx0p4xqkkkpAmGGKSJNks8nDypNav0iX1BTat1Rz1JUpCqyw7+FvV3MiNbDR+WkUPFysJHSBhS3osR5Fise5RLFMDi19l/4GX86lsZIcR+3lFL1pj/moySPTtd6zBEdQYMJy/HFn0qR72Dl5smAWGa++EHkXdqaLXKmnOPl7zxFbnzwtykUU7pmdemUzyE48kciBz3kPo/QrjS1o7ZSX9NLTeqDBlPFIgHPusFGevBLiQDJJUJ3nuNCyq3JBV3dt6KYcib8iWnTlH4EYMtLzfpGAecM8DLVSFzlqEoPhza5uBlqAWA4zXDLYJ1I9OXALKHUheXysxdW2KBkTXzV/6NyAAysnhK99iAMqShDFldq2Pe2hD0l/F2fSKGE9UHq9kI963lNlKSY7u1njlWxoEVyvo7aVdhVXOlL3xs42lsDX0OeS9wqOPv66tUDbCSVRXJ11KEnGpRyg8vMf3CzIZRlJP5BBojlVx7AMKeccASIczGLTaifBIKht3gU2H8KYHBKGCT7gH8OU+zWY/3MFIZJeK73DtppfTG3MFT37r2iGLidG/kSysEZ+5DiJmDlkKt9MPJ9E1SFrfEu6tKeNhtNS9utF6h6+BOfOEKKuzzKJ98IPiDA88JNGsTVt+M97EqiKbgI12HJNVIx4aooP+NBdrgzUnwgIywSsPmA561C3dVwIBt/84cGvfGtSd/9SoY+KjPaYrF1AFCxxyzpMP8cKma7wiULB7/M5vXM79SK8bUEgcNKKQ0I1HjSNYfCWBXKdWzFx/rdsyn+qVOw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Shiju Jose Add support for ACPI RAS2 feature table(RAS2) defined in the ACPI 6.5 Specification & upwards revision, section 5.2.21. The RAS2 table provides interfaces for platform RAS features. RAS2 offers the same services as RASF, but is more scalable than the latter. RAS2 supports independent RAS controls and capabilities for a given RAS feature for multiple instances of the same component in a given system. The platform can support either RAS2 or RASF but not both. Link: https://github.com/acpica/acpica/pull/899 Signed-off-by: Shiju Jose --- include/acpi/actbl2.h | 137 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 9775384d61c6..15c271657f9f 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -47,6 +47,7 @@ #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */ #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ +#define ACPI_SIG_RAS2 "RAS2" /* RAS2 Feature table */ #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */ #define ACPI_SIG_RHCT "RHCT" /* RISC-V Hart Capabilities Table */ #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ @@ -2751,6 +2752,142 @@ enum acpi_rasf_status { #define ACPI_RASF_ERROR (1<<2) #define ACPI_RASF_STATUS (0x1F<<3) +/******************************************************************************* + * + * RAS2 - RAS2 Feature Table (ACPI 6.5) + * Version 2 + * + * + ******************************************************************************/ + +struct acpi_table_ras2 { + struct acpi_table_header header; /* Common ACPI table header */ + u16 reserved; + u16 num_pcc_descs; +}; + +/* + * RAS2 Platform Communication Channel Descriptor + */ + +struct acpi_ras2_pcc_desc { + u8 channel_id; + u16 reserved; + u8 feature_type; + u32 instance; +}; + +/* + * RAS2 Platform Communication Channel Shared Memory Region + */ + +struct acpi_ras2_shared_memory { + u32 signature; + u16 command; + u16 status; + u16 version; + u8 features[16]; + u8 set_capabilities[16]; + u16 num_parameter_blocks; + u32 set_capabilities_status; +}; + +/* RAS2 Parameter Block Structure Header */ + +struct acpi_ras2_parameter_block { + u16 type; + u16 version; + u16 length; +}; + +/* + * RAS2 Parameter Block Structure for PATROL_SCRUB + */ + +struct acpi_ras2_patrol_scrub_parameter { + struct acpi_ras2_parameter_block header; + u16 patrol_scrub_command; + u64 requested_address_range[2]; + u64 actual_address_range[2]; + u32 flags; + u32 scrub_params_out; + u32 scrub_params_in; +}; + +/* Masks for Flags field above */ + +#define ACPI_RAS2_SCRUBBER_RUNNING 1 + +/* + * RAS2 Parameter Block Structure for LA2PA_TRANSLATION + */ + +struct acpi_ras2_la2pa_translation_parameter { + struct acpi_ras2_parameter_block header; + u16 addr_translation_command; + u64 sub_instance_id; + u64 logical_address; + u64 physical_address; + u32 status; +}; + +/* Channel Commands */ + +enum acpi_ras2_commands { + ACPI_RAS2_EXECUTE_RAS2_COMMAND = 1 +}; + +/* Platform RAS2 Features */ + +enum acpi_ras2_features { + ACPI_RAS2_PATROL_SCRUB_SUPPORTED = 0, + ACPI_RAS2_LA2PA_TRANSLATION = 1 +}; + +/* RAS2 Patrol Scrub Commands */ + +enum acpi_ras2_patrol_scrub_commands { + ACPI_RAS2_GET_PATROL_PARAMETERS = 1, + ACPI_RAS2_START_PATROL_SCRUBBER = 2, + ACPI_RAS2_STOP_PATROL_SCRUBBER = 3 +}; + +/* RAS2 LA2PA Translation Commands */ + +enum acpi_ras2_la2pa_translation_commands { + ACPI_RAS2_GET_LA2PA_TRANSLATION = 1 +}; + +/* RAS2 LA2PA Translation Status values */ + +enum acpi_ras2_la2pa_translation_status { + ACPI_RAS2_LA2PA_TRANSLATION_SUCCESS = 0, + ACPI_RAS2_LA2PA_TRANSLATION_FAIL = 1 +}; + +/* Channel Command flags */ + +#define ACPI_RAS2_GENERATE_SCI (1<<15) + +/* Status values */ + +enum acpi_ras2_status { + ACPI_RAS2_SUCCESS = 0, + ACPI_RAS2_NOT_VALID = 1, + ACPI_RAS2_NOT_SUPPORTED = 2, + ACPI_RAS2_BUSY = 3, + ACPI_RAS2_FAILED = 4, + ACPI_RAS2_ABORTED = 5, + ACPI_RAS2_INVALID_DATA = 6 +}; + +/* Status flags */ + +#define ACPI_RAS2_COMMAND_COMPLETE (1) +#define ACPI_RAS2_SCI_DOORBELL (1<<1) +#define ACPI_RAS2_ERROR (1<<2) +#define ACPI_RAS2_STATUS (0x1F<<3) + /******************************************************************************* * * RGRT - Regulatory Graphics Resource Table