Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp846818lfv; Tue, 12 Apr 2022 06:57:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEceUhF4XLTLk7KLh8UpQyA8MNe+EU35BooGdgP8p2PhJPRyI48cv0dCMwqxdDoe2Zew6x X-Received: by 2002:a17:907:2d8d:b0:6e8:886e:fd1e with SMTP id gt13-20020a1709072d8d00b006e8886efd1emr11189915ejc.139.1649771831017; Tue, 12 Apr 2022 06:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649771831; cv=none; d=google.com; s=arc-20160816; b=MBxGjQyRC/yoKFFnTZi85pp8GLOSccWMn0v3aWlncxBM7qpn6QNPQkJjhQbZtJ/Quz xWU2k8Q1lJyrGZeFDCMdizx+qKgKaSQHKkm097PWQQ2CDgO/73fjoVyRvO6HxkWOyy7A g+k8XQ5NISmiX+Tv/gSyJ65pxKXgsCfcCYXFuQhryETj+UMu6O5GD7GyFI+aNIJmKBxY ZJWPihRTNeT3lmiNLjlsk3gXNgFu80I+pPye/wvtlCDCnHKJMmRbUKKaLtpoFbILBt5h 7YmmSoWz1OC7voS03FEFTdLgD7faZtZamNCvjOWg4e7BPmwYZLLIINEZpe/xXpM9dBhO 6YvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZMwn5NdYABsrEFmywEN+FVw+gcLDvA3FbY5m8tVe57U=; b=xEw57JVTsmK3o3/IAq+wJIIVkG3sVLeNONoa9RmAIRV9VsAkty4GuS8b/eZ0MU1F1Y eg/BxRcxTy5mEG4Dz0CJNqCpQ40ESuA0XBbpCpmpv03QJVDOH2PnID8hfs9WWlZS3CK+ 4sjIMCxBbSTpc2VVSUeP5v1jEZd88jk/kz3f/m3oOJ77jV0iLxsvGxsaqgLr4CFsuE1P vEKWg+0fUSXviPELFh9JW8QwbhJYOa5EwvFOhG5GJcEa5sOjkFyJY/6/qSXOcrwOF27d jbD7TOWGila0Xrv5sQ6Z+5f7Nd7gKgm2QH+wg9rx4Hdkaw0RXo8YRpiDgeWI3ZNT4a0Y fwGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a170906721300b006df76385e96si9319207ejk.822.2022.04.12.06.56.45; Tue, 12 Apr 2022 06:57:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349460AbiDKTHP (ORCPT + 99 others); Mon, 11 Apr 2022 15:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349370AbiDKTGz (ORCPT ); Mon, 11 Apr 2022 15:06:55 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F73627B19; Mon, 11 Apr 2022 12:04:27 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id c82cba2810d760f0; Mon, 11 Apr 2022 21:04:25 +0200 Received: from kreacher.localnet (unknown [213.134.175.113]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 116F066BDFD; Mon, 11 Apr 2022 21:04:25 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Bob Moore Subject: [PATCH 13/20] ACPICA: Add support for ARM Performance Monitoring Unit Table. Date: Mon, 11 Apr 2022 20:58:04 +0200 Message-ID: <3370028.QJadu78ljV@kreacher> In-Reply-To: <5578328.DvuYhMxLoT@kreacher> References: <5578328.DvuYhMxLoT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.175.113 X-CLIENT-HOSTNAME: 213.134.175.113 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudekiedgudefgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepgfektdehueehteffueelleehhfffgfejtdehvddtfeetjeffveetheehvdejgfdunecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepvddufedrudefgedrudejhedruddufeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddujeehrdduudefpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeefpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosggvrhhtrdhmohhorhgvsehinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Besar Wicaksono ACPICA commit 002165ecc0a3dc703bb24c789aaa02fdada01675 The specification of this table is described in "ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document" ARM DEN0117. This patch adds the necessary types and support for compiling/disassembling APMT. Link: https://github.com/acpica/acpica/commit/002165ec Signed-off-by: Besar Wicaksono Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- actbl2.h | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff -Nurp linux.before_name/include/acpi/actbl2.h linux.after_name/include/acpi/actbl2.h --- linux.before_name/include/acpi/actbl2.h 2022-04-01 18:26:31.909335052 +0200 +++ linux.after_name/include/acpi/actbl2.h 2022-04-01 18:26:28.746374585 +0200 @@ -25,6 +25,7 @@ * the wrong signature. */ #define ACPI_SIG_AGDI "AGDI" /* Arm Generic Diagnostic Dump and Reset Device Interface */ +#define ACPI_SIG_APMT "APMT" /* Arm Performance Monitoring Unit table */ #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 */ @@ -260,6 +261,85 @@ struct acpi_table_agdi { /******************************************************************************* * + * APMT - ARM Performance Monitoring Unit Table + * + * Conforms to: + * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document + * ARM DEN0117 v1.0 November 25, 2021 + * + ******************************************************************************/ + +struct acpi_table_apmt { + struct acpi_table_header header; /* Common ACPI table header */ +}; + +#define ACPI_APMT_NODE_ID_LENGTH 4 + +/* + * APMT subtables + */ +struct acpi_apmt_node { + u16 length; + u8 flags; + u8 type; + u32 id; + u64 inst_primary; + u32 inst_secondary; + u64 base_address0; + u64 base_address1; + u32 ovflw_irq; + u32 reserved; + u32 ovflw_irq_flags; + u32 proc_affinity; + u32 impl_id; +}; + +/* Masks for Flags field above */ + +#define ACPI_APMT_FLAGS_DUAL_PAGE (1<<0) +#define ACPI_APMT_FLAGS_AFFINITY (1<<1) +#define ACPI_APMT_FLAGS_ATOMIC (1<<2) + +/* Values for Flags dual page field above */ + +#define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP (0<<0) +#define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP (1<<0) + +/* Values for Flags processor affinity field above */ +#define ACPI_APMT_FLAGS_AFFINITY_PROC (0<<1) +#define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1) + +/* Values for Flags 64-bit atomic field above */ +#define ACPI_APMT_FLAGS_ATOMIC_NSUPP (0<<2) +#define ACPI_APMT_FLAGS_ATOMIC_SUPP (1<<2) + +/* Values for Type field above */ + +enum acpi_apmt_node_type { + ACPI_APMT_NODE_TYPE_MC = 0x00, + ACPI_APMT_NODE_TYPE_SMMU = 0x01, + ACPI_APMT_NODE_TYPE_PCIE_ROOT = 0x02, + ACPI_APMT_NODE_TYPE_ACPI = 0x03, + ACPI_APMT_NODE_TYPE_CACHE = 0x04, + ACPI_APMT_NODE_TYPE_COUNT +}; + +/* Masks for ovflw_irq_flags field above */ + +#define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE (1<<0) +#define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE (1<<1) + +/* Values for ovflw_irq_flags mode field above */ + +#define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL (0<<0) +#define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE (1<<0) + +/* Values for ovflw_irq_flags type field above */ + +#define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED (0<<1) + +/******************************************************************************* + * * BDAT - BIOS Data ACPI Table * * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5