From patchwork Tue Dec 14 04:40:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilkka Koskinen X-Patchwork-Id: 12675465 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 56B5FC433EF for ; Tue, 14 Dec 2021 04:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229554AbhLNElB (ORCPT ); Mon, 13 Dec 2021 23:41:01 -0500 Received: from mail-mw2nam12on2092.outbound.protection.outlook.com ([40.107.244.92]:30816 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229477AbhLNElA (ORCPT ); Mon, 13 Dec 2021 23:41:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GxzsQhV8qi8aK3m9JHs62muzEbNm/Dv9fL9Q8w2yuL3qF32Q0kqfq7q8cJ+BZyHL42dAKHSU0z/YKSOZ0E8yKuXd8czCx4deWaeFJEUa7VrMZUSF3d3lL9kyrssnSgw4Vx0bEJ8ln5hj0ouvcJ+KRuD+PdyW4tbq5bZ2wR0gbMohudGuoznJQCFVrO3NgEgR1ltNBtElhVCH2UlWzvjcpflujyat6O2Z7AZwETOCJ5lGBb4UDvhpNOCrDGzZ1tQ7zj7NEDE6cd2U38ZXvgnQPHgPDo1Z+E3FiCN7yspanwC6NCA/PGILVMFAUOFnifwSYuaXPdRDhATV9eeMbx+gzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tcs+w7TDYoeziTSR9MVk297dLxHWSNCreHdbz/t3U5U=; b=mkXePeMROMg5KYTBX2/mYoFgX6JpQnS74eTNDc0DwsEFbClSFm5Bq2Dbn37qjpCKf/2GxKCDJhszhFpzQZv5LAgQhNHaoxlMnJ7Q7YvMzVx53ovTKpPfdbErLNWJODeypOvy8MgNlGw4oN/nF+oxseheLISfnJMg2/7Nk16l9eR4D3EAIxU+8osO+tunZMOJvhtn0W+gJPQt2oEu1/bKmcxLKNJnDoo9kVbYRP6RDwyWkaqrldQGgRHj5Hz2bNZkZnjN2pcbvDs3uifNAt/2DjyqqRYyVlzWhk+OW3XKReL8yDuntE9N9LYbzZlg2F5BlnrAkCQutHFJFbCA6cDYHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tcs+w7TDYoeziTSR9MVk297dLxHWSNCreHdbz/t3U5U=; b=ExpgEieQeL8siuunBzv0p7t1itWVmOPFY+xr0FTLi3ZBCFgs9YM3KmH3Jj+ZNFQDn4zte3jgNIRXJe3tM7eqhTMF/On2dcIx25jNHNnT/7PT734vQAaLgjbTV83zhIvRY7hUud9ecULfxIBHQ+cSMZf6Oofv1Ze4vOod957vwvg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) by DM6PR01MB4153.prod.exchangelabs.com (2603:10b6:5:22::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Tue, 14 Dec 2021 04:40:57 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::38e1:cab:501d:6b96]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::38e1:cab:501d:6b96%4]) with mapi id 15.20.4778.017; Tue, 14 Dec 2021 04:40:57 +0000 From: Ilkka Koskinen To: lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, linux@armlinux.org.uk Cc: rafael@kernel.org, lenb@kernel.org, robert.moore@intel.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devel@acpica.org, patches@amperecomputing.com, scott@os.amperecomputing.com, darren@os.amperecomputing.com Subject: [PATCH v2 1/2] ACPI: AGDI: Add AGDI tables to drivers/acpi Date: Mon, 13 Dec 2021 20:40:35 -0800 Message-Id: <20211214044036.48245-2-ilkka@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211214044036.48245-1-ilkka@os.amperecomputing.com> References: <20211214044036.48245-1-ilkka@os.amperecomputing.com> X-ClientProxiedBy: CH0PR03CA0063.namprd03.prod.outlook.com (2603:10b6:610:cc::8) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 477d4d2f-ccda-4706-a078-08d9bebbeba9 X-MS-TrafficTypeDiagnostic: DM6PR01MB4153:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C1gW1K8oiFCFPXSsrqJ5TzpdybT/Mt+G/OC05MsP6OGWum2khNf+8dtEo6y+6UWyFNa/xoAU+gHZNzcVL1MboAaDfoQL/Hkxa5aP20a5VoVEu5EzVOZs0y3GyTTxhKT3X1v4gYcuRWEw2PtWlOvuaCQMJI1BF2zS+gV0g3wtLSCBKWbgoHByfBiLYcOTUF2gcnTHOBw3stftkXr6Y+6cOel7E4arYud4VPMVAipxNKPd3XZUR0NEjWWo+sjAvMFP/euuUynw0YGvrBtfsVoxgt/JpgTMFdtAwuLrZBNkSUEXmR5oeDluar+t1lz4J9hiD/IhE4Vr+EBPPiGVAeBvZ7RPkbr4+v14cWprk1ga78bMqWBobCRu/grYkYmRBeHDcCyj0qj5uDBSUU4WJOK5HfapwFF3WHucYPwGENCTiIxpmR15Vf6lxkTmvmuxHubMlvIlZAD/LdahKyT6gtJNuIzkqEozvqvrpr4cs+oDUqyDRx7M2wn3oZHx0asFriviPH0Jg+W7VK5GP8jpU/OwUPuqOXDUy4Qn4xbA55pmTIN0BnuJTf2mxFifR2dCBcYlkAjRzt8PyUIs8u3fmR6zW1dMBlnAV3Sd/A8u0rCfXV4o52gTZiXHxd1NnHQPlDEyaXabmyyR3VxaYlrR+7MV8DFqVIzPlz65bQsADng+RyyNHQ0v/RekXZ8y5DJYaTwHGh9mWot6496odIqNEHwJgR+WWY8+IeTfNzehRPf5WrzW41krtaxa+qWaNEg7GTtpF9XetOlGmPwRsJenwzGvBeVf7s8cp+26J8zeL9nTKgo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3590.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(8936002)(966005)(316002)(6512007)(66476007)(66556008)(66946007)(52116002)(7416002)(5660300002)(1076003)(508600001)(6506007)(107886003)(2616005)(8676002)(4326008)(6666004)(186003)(86362001)(83380400001)(26005)(6486002)(38100700002)(38350700002)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n8YSk0FUu4ZjOkbu4fUFoBs+n21uwOCTwzoS6j/cXlwfmb33prM5xIA2SptriUxUC1opzhshj4QjquVOCm1gScY2a8FqdyhePwIapDmiI+rvosSOBueo35AiJXl6A6FCoqNvGde8vRGwILs9ImRKmAJl156aMvEz8PJCI03w/0LhGxhwBzghBuuZx/bjx7n3itC6CE5krDZ2+I12UzXo9NgN8+Hnw4r9oT5uSjM8WJS4bLe2Ht5oaFX6tlQcFwyBaOJfgiWPxHAGcUG9BrRmOaHc6aLKmIulsGnxbLkZFrNajwI5nGOQo/UMz9WAKLSOxgIA5IZ+edLuBuDQZJbaL5IW64yQuybtsd7izuJekapao91p0GBsXfJoagaDlnEPlS1vmm7UmH7kBZiYnpza7kbUarhZl9IW+XZnJjM+q0goTIDlUXE/48oJdOk+25JKlF2KF+QbKbVI+dZKUuXDxIVa8j1CFsytBT93IyN4qibs9FvIA+Mllc/Smr+BJYfZlqFas7BJlWfYVbnEot7S31kleRNjjaAd8w6cAVjQQluTqv/dGhhGZ+3xjUhJ6tEW18OsY+eYWlXXCgO9IGcKcUJZJVEm6H1vYF+0kp7dmk9k1v4XXsZDhziU1Y9ALtV+bhJOflARQHVojT/xZ+EeqPM7eCVjWYuLooD/MAthplUKQ0wFHusblYgY5UiRWA0UP88zBQW9usgqCtkz3ac3MMN4vfFn61ne4ycMAmU/zXOu55Ks8vgBU6TWwvxAfJXwxpWEaSIe9uh8IMx9Gh5eXRPyPSszd5mxh/sp5/fLDRXyERcJovnbqG/2d31En6ans6kCyVNx9fLCNDuADdjjd/MawLBGPOU5SRYD0XKf/uNh7olbLbF/K9PEthk2n90qn6mrhWlhasEboql0YlelKotDmGGmO+fPcO1E3h4tx/zz7gmyWVLVz6rpHXC8bBsGIr05kpLNZIyAr20XDgfKeodtMj12joIDcMCqa26LYlm5UNr6uvNuCyCyP+q5LnNxIjDwUr8LH256pSXPDZ5JhRF5syc21R+jYn0rIieqdwP9c9Xy8o0hD2hDyACddraKTEqYG/ErqC7RvDpqG0unKVdpo1+QcemcaHK7RJ1OBuh0cUWzgA3Nl0SEGqKoF3mMQ0CsEcjpIak3+2pV//wY7NoIO2iMS2uFbjp1Gwr485wlr4JcTiwMgbn9HrL/vj1idOYJBnKcIWJ4ajYqiXTSETuBjKJ6awNms8eqOVnBvHkXTfFWtQatDFi76uFDXFW5bkUbD+CX/1Nhlz4TH6Rw97kbJ82IaNYdyyV+2EBgJqdMX0WMip+yZaFKtFDrVFEJpLt4GVdB0fnjyy8ZBr4+hVnBC/jRvs0BbbstKVThMBTeotf/UXcCUMWi/VnpMhS4GjLvIcUtUoCCYtrrKJwTnU9nb/uZBXA0ieTA+srOEUbXDOwDrV2Jwqn1MSpuU2ipk+rg0Sbi20QAJ7qKJ3vJE+HXHszVN2x91wpvn39L7opeM3+7fJqOKU2Gnh61R4JZKQXqrG/g9EoaBt20d0YHSpggw/CPwSeg1xnf03AlaUzD8rqHtv32FLQEeNBPKBkHYl2xyI12B+13yVafzH/7Vnr178Uelof/vA1RoaSsY6iUqHnILzMGZPFbumy/D/wxkPp58O8Kdq7RAD3unHzzriyMhXnsIIdAZjyqQ4G2ufGziqLuKBK8VoRJu472ppE7Co3eKx1siKWjT5N/6XhfVw== X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 477d4d2f-ccda-4706-a078-08d9bebbeba9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2021 04:40:57.4372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KTofUIvkHs1YIIjbskCvn4Jmq+N/FzAYEOGgdH1M/IKoC0NukoJ9aVP/RCGbXjxgdwzAnKNc3U3AuOI3+uWlNt5pwiAxqTwhHXo+v9A7pkS+tVOfQxzM7ZlLxExq+11y X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB4153 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ACPI for Arm Components 1.1 Platform Design Document v1.1 [0] specifices Arm Generic Diagnostic Device Interface (AGDI). It allows an admin to issue diagnostic dump and reset via an SDEI event or an interrupt. This patch adds support to ACPI/AGDI tables. [0] https://developer.arm.com/documentation/den0093/latest/ Signed-off-by: Ilkka Koskinen --- drivers/acpi/tables.c | 2 +- include/acpi/actbl2.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 71419eb16e09..5e3169bcb9fb 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -500,7 +500,7 @@ static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst = { ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT, - ACPI_SIG_NHLT }; + ACPI_SIG_NHLT, ACPI_SIG_AGDI }; #define ACPI_HEADER_SIZE sizeof(struct acpi_table_header) diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 71ca090fd61b..66ca85b9f5fe 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -24,6 +24,7 @@ * file. Useful because they make it more difficult to inadvertently type in * the wrong signature. */ +#define ACPI_SIG_AGDI "AGDI" /* ARM Generic Diagnostic Dump and Reset Device Interface */ #define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */ #define ACPI_SIG_IORT "IORT" /* IO Remapping Table */ #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ @@ -237,6 +238,25 @@ typedef struct acpi_aest_node_interrupt { #define ACPI_AEST_NODE_ERROR_RECOVERY 1 #define ACPI_AEST_XRUPT_RESERVED 2 /* 2 and above are reserved */ +/******************************************************************************* + * AGDI - Generic Diagnostic Dump and Reset Device Interface + * + * Document number: ARM DEN0093 + * + *******************************************************************************/ + +struct acpi_table_agdi { + struct acpi_table_header header; + u8 flags; + u8 reserved[3]; + u32 sdei_event; + u32 gsiv; +}; + +/* Masks for Flags field above for AGDI table */ + +#define ACPI_AGDI_SIGNALING_MODE (1) + /******************************************************************************* * * BDAT - BIOS Data ACPI Table From patchwork Tue Dec 14 04:40:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilkka Koskinen X-Patchwork-Id: 12675463 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 159F7C433F5 for ; Tue, 14 Dec 2021 04:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbhLNElD (ORCPT ); Mon, 13 Dec 2021 23:41:03 -0500 Received: from mail-bn8nam12on2135.outbound.protection.outlook.com ([40.107.237.135]:49601 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229449AbhLNElA (ORCPT ); Mon, 13 Dec 2021 23:41:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JH85nqoXgmvq+jWen+B+RRmCsCWt+GGVAVa5mM6jyxyfH7w9+ywnV840g9XG1/YqFzalnb4D3K0ZeB33gzanb4y7QGHVzwmbW4hNjWAP1hOnTgwZLOa6+YC7V3foSySQgAGTtoI4kcH5/DAvIXsOHK7wkAge6WQVhSuUWxagfc/FiBJGJ3F/ZcJ/arNDQM+C0TSLl5fYMs7cn5UMdWYF7el0MPV/3rzboM+4WPcUGjY9rKsijmIe0IhiQj8nM99MGGJ4JjUhfBJPYGDHrL77AQ7gb6bE5QUc0c63RSuEunBvWEoF6qGGsY7vMpKiItNhNUetyEXtICzDZ9v4+RWu7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KbAkhrQB8e00n7Lfgi9b6VumYWZ7vNWCYET9PxfwR7o=; b=VHmlYs4riZ/lu8JWurWXD8CdflFWGLGKQzCFMntnCdod3USziHJJDRJ3c/9e74zKM4GoHkbVsPNWpoHNMmBycN58R3pRTByqkNR3TAXngKrsygpvP39c3G/wRbFLyESK1wByLjP7R9kv04lcJY6TEoEbdDxotpbOatZA+I6/H9G/hZpaCMsWXZwaY4m11mBy8XBQE+Higj611DJo53qBLkp0FQA4Oy1Dp0VxXSUl6jsYW6ATmg2k9Zgne+KVE1DGXeQh176YG5qQIEV9PTRIis2uXOF9T3M90HPgkXk9IBQ/JDL0dUZInEtHjGEBDyNUS14+d50nSO2yvW34g/PDXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KbAkhrQB8e00n7Lfgi9b6VumYWZ7vNWCYET9PxfwR7o=; b=eG2NAsywWPkW0mKlx9aN9WP/PAzIcRCsEzq9njQJ5L/9CYXrr+HCg5UqUx68/Fpn3bpFWqAIY3A7BPP+MYnvqJ8M/Tr81UhEJVGa6ktd7o+Lb+/5r69SpPusYqz9MU011toVr6+Vjmfa601hohaZZ52Y9XM7MUxgdZnySViZZug= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) by DM6PR01MB4826.prod.exchangelabs.com (2603:10b6:5:64::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.18; Tue, 14 Dec 2021 04:40:58 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::38e1:cab:501d:6b96]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::38e1:cab:501d:6b96%4]) with mapi id 15.20.4778.017; Tue, 14 Dec 2021 04:40:58 +0000 From: Ilkka Koskinen To: lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, linux@armlinux.org.uk Cc: rafael@kernel.org, lenb@kernel.org, robert.moore@intel.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devel@acpica.org, patches@amperecomputing.com, scott@os.amperecomputing.com, darren@os.amperecomputing.com Subject: [PATCH v2 2/2] ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device Date: Mon, 13 Dec 2021 20:40:36 -0800 Message-Id: <20211214044036.48245-3-ilkka@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211214044036.48245-1-ilkka@os.amperecomputing.com> References: <20211214044036.48245-1-ilkka@os.amperecomputing.com> X-ClientProxiedBy: CH0PR03CA0063.namprd03.prod.outlook.com (2603:10b6:610:cc::8) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2b255f8-55b4-4039-30c1-08d9bebbec80 X-MS-TrafficTypeDiagnostic: DM6PR01MB4826:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fKh8f8JTI1An9G4dURfNLnp+KTVF56ShkKtGL2IukRRKf1lIR65RDd5GEO4TWSWDk361/g7SYeoLIKAehmpf8SqoXFwjBHwOt861ARGvy2GaGUKuOxko8fq4QqjdgEaKfs55o2EBkUvtHRY6oTqlq+Wafi62O9Tdx263WqDWUj6sZk5INSzXhe8lEd8Tvs8t2uFPmRPu3YBBUCq+GhfAv5LEo+H4B0e2OfICM8vHQF27aEz9yYS1kJgckN4FCRJou9ysWeyiqvx3sdTHtWbzDO7+iD/gAEoW8/Lxlh9rmKaMPWjwiW3en6S6ufjUHpzb6yAEZmFkjcV5EHwTl6nTpgs3Sp/610j0dIcEAJ9NNjBdjPJdxR0rWRadGksMwXBVsOIoJkrFt0LdpOFQ/dX2nVjnAObBC+AsVWOiUKFgDoybzcdmr3JPZrptqFEXUPQaVbN4YhgGniolMekC6AVW1GTbxZ+0QZjiztIUbw5xBGohrfX5T2294VfZ7WkPfVJ3X5+boVBiRqQ+fZttn7LQxLGJW404DK4Zwj1myqze+dILHkOL9a611oM9D/r5/mQfZK8JMmtvF+Gqz1ZNKHHI0r7EPA4y5ugc8hqrxXDszGmFwLfiX+1MPP+qXBt5BD0tFr1jjucpUDz218jCheMWTU+hBvjluVW78o5t10EYw1qjnTKmzu8foUFkZqhMZTHN9XP4Z90lZOWV3s+SmKdaodSyiJGw3hWEEz/FZjFkQI9aoxEMQ8LVfIUnhmfZ0+Fmxh6d6mShrh43Er6wveoBoN3vEGfEl84YCognllRvlziKhnebYVsT5386bN0Rsinb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3590.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(107886003)(2616005)(66946007)(66476007)(66556008)(186003)(26005)(1076003)(316002)(6666004)(4326008)(6506007)(86362001)(52116002)(8936002)(2906002)(7416002)(6512007)(5660300002)(38100700002)(38350700002)(6486002)(8676002)(508600001)(83380400001)(966005)(41533002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zIdFMrxNubwvvcviH1GCMHOQz2mONyKynoxLi4Q+zr6MXHgR/4+rS03rI2nRtu0RTvs4zTce4ay39nheHfoTECrW2nR/mCYPsdwNS1n73WxkHagoPZYOHmCuBIXie7lCGzWpvuUokFmFxBSgo1DKf+JYH96vcZXNSI4M9aBiAlcUzSb9CsM0w/pK9k74OB9z+2GSvVHN/0YS+rtz2v57OCA0Xqm6pHQQN2Z8l+RjeAU0OfpfbQzlVQTUM/BZMDkU/keCvUL3Z2sJhsg4DlGEchAU8YRiRFbhRNUZnWt18d5fISxd1H6FftPLw6wOBGnu+myJvTFm98xQ6B2Zb69jWMTMSyPwO0NJOoCV3csmVwcT0vrz8+vGFR9+q7GJ/T5225890MqGeO9YiBCPD7Abk2Dtt5aZ+6WAwYH2RBp+/tdiWxyYfsfgifGoMDzVbgBcT/8sVgM29+gHjnR1/dZZmDiV2rYQYuLyb7Y3T+IPvW6YFgnT/o1iSR+U6SxKkNeeSeBokINBgjF40dOry3bLo0qB9IkWgxvpOfkSvRxzt4qtRy2FgFyMJ8H5ytYaJ3QRGtPK/szzj6LO1PaA58pEF/2yiKEKihV7nKrUzIh8D78Nr5AYKpqigwXmSxbRukensNR5d3UdQkydf/vfeBonjAOME5AstTHP3LiZOmwk+OdOuyfNB5vYiMhcFBJcBst4pIxnev4suI7sJV/QyiCR+q40fAUd5uIxtDiZcSuEbK7cNhOHVvVcbfQhMVITlhJ9Rz5QhEvleHaboFzH0o8RY///+VQcSBZTwp1yS/ExMCCvzSxL7clDIEMgnHo5euTGK5QlFllTeoMbP/8DYh1X5ddvgL/+GlohGn3W4544uxqBXyIkNtv8JU0zee2jQIjADO6YFmC+yL1/h70hJDeivs7LEUL3m6TU3jJKUGYaib14aZ2xBUVsjZdyiOZMY49/dVWMcB6xHZzHivBadky4kce+L2fZeTH/xRw0aPudhL6lKdgua+19klk/BdabZ/EROIPlVxWV+3NABbbMzoIj6cg6BUqKeLkiS1Pi9RUWv3BxLUP0oHjqvvW2aS/vgCnahvxCNCE3MYGC9ScFY+E5HtXyUmLRKlhMo7devr9zq/hsJXMj3jMkkgal4Bn4jtPRvK5PdRyCYn+5gqaPrqxaCr8EHvoz3uYWsPOI3xCAMvQ+hAVVBnhdzkmqpkBpy/mSQUrTU0g9kjdEE7wyIb9Rd4mxgS3cozuoXi+OYnAKZIuLXGt4F6nuMe9Tn8P09+FNfA8WM7F6dxuMcOsWSSjyb2rHex1CNOB8BffC+CldSpkNzqPZWUGQPZrOf9DeTe296/WwYo5NwtvKYJx6bbmxMknqOrdaTE9P/YHcwHFyjORhGqph4K+jwedfhV22yyswbUdpVF9k6PTsQsXpkuC0kfP4cFG6tVhMb9pHNUesfNShEvNLdsIvoT9oBAHpTFGS33TJQ1KIgCz8pYq9Mt41j+/ZcBDmEVzUOWJvw69IjW9xMhHNL3YQRWd9qqczNfmjiQfZpb0y3qgBL1AkfODFzSJnOdkV1jJciDkqDq5h3sncCt+C4OdMvzKSSKrnZJNJ2FsREDyiWGo8VldDQEUQFZJWNd5isuYL4ob8u1B3LXJty1Z7qZuQ7hUXE/FSXVnuvSduQ4VWnUT5DMFCbX13Cemu5Ta45kZ8llbCu3SJ2C68R4doCxHnzJqvBRu6JDSoI4PYmnRoh9mrc4IsEsLLPA== X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2b255f8-55b4-4039-30c1-08d9bebbec80 X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2021 04:40:58.8746 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VuoEDoMm+A24KnMrgBZzf/9heBRpvQoKOYdPtjbvDBt4sbozR0ksAgYWKRWHXPPKWUdGQ7mFRcRQUOokj026Wl0m9GTVNjDJYkN6gfVrGIBIjEuLx6lv111kdQCF2fSx X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB4826 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ACPI for Arm Components 1.1 Platform Design Document v1.1 [0] specifices Arm Generic Diagnostic Device Interface (AGDI). It allows an admin to issue diagnostic dump and reset via an SDEI event or an interrupt. This patch implements SDEI path. [0] https://developer.arm.com/documentation/den0093/latest/ Signed-off-by: Ilkka Koskinen --- drivers/acpi/arm64/Kconfig | 8 +++ drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/agdi.c | 125 ++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 drivers/acpi/arm64/agdi.c diff --git a/drivers/acpi/arm64/Kconfig b/drivers/acpi/arm64/Kconfig index 6dba187f4f2e..24869ba5b365 100644 --- a/drivers/acpi/arm64/Kconfig +++ b/drivers/acpi/arm64/Kconfig @@ -8,3 +8,11 @@ config ACPI_IORT config ACPI_GTDT bool + +config ACPI_AGDI + bool "Arm Generic Diagnostic Dump and Reset Device Interface" + depends on ARM_SDE_INTERFACE + help + Arm Generic Diagnostic Dump and Reset Device Interface (AGDI) is + a standard that enables issuing a non-maskable diagnostic dump and + reset command. diff --git a/drivers/acpi/arm64/Makefile b/drivers/acpi/arm64/Makefile index 66acbe77f46e..7b9e4045659d 100644 --- a/drivers/acpi/arm64/Makefile +++ b/drivers/acpi/arm64/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_ACPI_AGDI) += agdi.o obj-$(CONFIG_ACPI_IORT) += iort.o obj-$(CONFIG_ACPI_GTDT) += gtdt.o obj-y += dma.o diff --git a/drivers/acpi/arm64/agdi.c b/drivers/acpi/arm64/agdi.c new file mode 100644 index 000000000000..6525ccbae5c1 --- /dev/null +++ b/drivers/acpi/arm64/agdi.c @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * This file implements handling of + * Arm Generic Diagnostic Dump and Reset Interface table (AGDI) + * + * Copyright (c) 2021, Ampere Computing LLC + */ + +#define pr_fmt(fmt) "ACPI: AGDI: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include + +struct agdi_data { + int sdei_event; +}; + +static int agdi_sdei_handler(u32 sdei_event, struct pt_regs *regs, void *arg) +{ + nmi_panic(regs, "Arm Generic Diagnostic Dump and Reset SDEI event issued"); + return 0; +} + +static int agdi_sdei_probe(struct platform_device *pdev, + struct agdi_data *adata) +{ + int err; + + err = sdei_event_register(adata->sdei_event, agdi_sdei_handler, pdev); + if (err) { + dev_err(&pdev->dev, "Failed to register for SDEI event %d", + adata->sdei_event); + return err; + } + + err = sdei_event_enable(adata->sdei_event); + if (err) { + sdei_event_unregister(adata->sdei_event); + dev_err(&pdev->dev, "Failed to enable event %d\n", + adata->sdei_event); + return err; + } + + return 0; +} + +static int agdi_probe(struct platform_device *pdev) +{ + struct agdi_data *adata; + + adata = dev_get_platdata(&pdev->dev); + if (!adata) + return -EINVAL; + + return agdi_sdei_probe(pdev, adata); +} + +static int agdi_remove(struct platform_device *pdev) +{ + struct agdi_data *adata = platform_get_drvdata(pdev); + + sdei_event_disable(adata->sdei_event); + sdei_event_unregister(adata->sdei_event); + + return 0; +} + +static struct platform_driver agdi_driver = { + .driver = { + .name = "agdi", + }, + .probe = agdi_probe, + .remove = agdi_remove, +}; + +static int __init agdi_init(void) +{ + int ret; + acpi_status status; + struct acpi_table_agdi *agdi_table; + struct agdi_data pdata; + struct platform_device *pdev; + + if (acpi_disabled) + return 0; + + status = acpi_get_table(ACPI_SIG_AGDI, 0, + (struct acpi_table_header **) &agdi_table); + if (ACPI_FAILURE(status)) + return -ENODEV; + + if (agdi_table->flags & ACPI_AGDI_SIGNALING_MODE) { + pr_warn("Interrupt signaling is not supported"); + ret = -ENODEV; + goto err_put_table; + } + + pdata.sdei_event = agdi_table->sdei_event; + + pdev = platform_device_register_data(NULL, "agdi", 0, &pdata, sizeof(pdata)); + if (IS_ERR(pdev)) { + ret = PTR_ERR(pdev); + goto err_put_table; + } + + ret = platform_driver_register(&agdi_driver); + if (ret) + goto err_device_unregister; + + acpi_put_table((struct acpi_table_header *)agdi_table); + return 0; + +err_device_unregister: + platform_device_unregister(pdev); +err_put_table: + acpi_put_table((struct acpi_table_header *)agdi_table); + return ret; +} +device_initcall(agdi_init);