From patchwork Wed Apr 17 16:59:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13633648 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2081.outbound.protection.outlook.com [40.107.13.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CE5B171088 for ; Wed, 17 Apr 2024 17:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713373212; cv=fail; b=Q4X2YLD/dDC1tg8zUrxL0L6RJckPDjz2+GZkASpkP2uV28sgdOdyLZ2xkIrXtbhvyH6HhnmVlglg68QtmCH87jZ+87YHABL0ESR9V0Zq81wLt39NvdS6fWSedhmkoFcd0RwVZoTMa2e6ixrdgLnkrSF0cvAudUwP9X4Qv9IlV1M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713373212; c=relaxed/simple; bh=RGiIXYVRmfGJBV1HNXeAiH/lKJo/HvVSSGdFR93iLDE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=b29TMPEdZ90B3nYS+CC9thOlGtf0pZzmsil8poQQDs3hww+Kk8bCOmTTkNZ0zu3FDYitNZfSZ0rEmuanmd4kBZexaPHaMLPH/SWGoI95cKVVQBWcsknakYmmVAjtnUvpFuqwCjYm7mbroBfPvZnrMyiemKRBmI5JKT2Ezmougjk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=loQp+CCv; arc=fail smtp.client-ip=40.107.13.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="loQp+CCv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OjZ0sZ9FwD9R8C1XVgp4iYkdYejlcY464MTz24XLFqjcMCepvkLKSlQIY9XWXSS5R8kL1xZizgIxTva+jvNkWv/Suc+IG0pSMKF/bQH3Em2sEJnQ+vziurfk03xmkGFW75UPMdTuUf6kjf3nSza3CNMD8Eel5XWAClxA8XQRn3VWf4LNKHSLYMML9MvsWMoferopH1+Q9xOXHbkNIYCgI3oenWi8CSlg9SKl1oLVSgVxK/s2hehmCJAjr4vlwR2GZm/epV/013Rq7BmQuWKnUBn3k1BaVDzyiMUCzryl0gmdriOc8gU84I/0q+m+7/WGrbbwQblrwxoPCOz/Y8xD5Q== 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=7XJormfUbxmrv0piWzu3dWXoF2ecnIxqtssuoVKEuJU=; b=oCt/apZU3OiHuvKJ3frKjzkbo5hcEPnzLfGImWVGtFdHoKTKbjsxWVeyEuV+zGJHafWDIsgA1P8pJ/eKYo4/d9Vs9p1oRj8/P4OIyWeEKjgQb0KyW/otudjlbFXj7ocwmgKL5cY6tU7DtgI1LYE8t7ch9nFAu0I4ipbY1E3wlp4O8GNZCwWtQlMbEs8ZDB1c6U1LCXIik1oUi9YUJfTTn70WCX1+ul51jCYTEeqeZN3/4KOCUftYMIxpVSkitAeA2sxDTwL1St6fonvqIRhdbDys/6mtr3u6o3k25W7jcz3Avq5pz0IhTOB5eR+eINrtE7QeZZpeU/k/YPZkPfB61g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7XJormfUbxmrv0piWzu3dWXoF2ecnIxqtssuoVKEuJU=; b=loQp+CCvA7SdleZkSz7wmSn1H7aeifIqB5noDu32oVsic+/LlL24+YwOydT68kpCYcfcaOzE7uuUUmRQDfnd9H5le8R37V/XVsXN7obESZL1sYm2jfPgK4fGzNd5H3Fa3UUv1A6OTrvAfaukEVqDznMymt4ApbJQAlhtjSpGrM8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8080.eurprd04.prod.outlook.com (2603:10a6:102:1c9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.51; Wed, 17 Apr 2024 17:00:08 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58%7]) with mapi id 15.20.7452.049; Wed, 17 Apr 2024 17:00:08 +0000 From: Frank Li Date: Wed, 17 Apr 2024 12:59:39 -0400 Subject: [PATCH v7 1/5] PCI: Add INTx Mechanism Messages macros Message-Id: <20240417-pme_msg-v7-1-9c6208cda90f@nxp.com> References: <20240417-pme_msg-v7-0-9c6208cda90f@nxp.com> In-Reply-To: <20240417-pme_msg-v7-0-9c6208cda90f@nxp.com> To: Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , imx@lists.linux.dev Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Frank Li , Yoshihiro Shimoda , Serge Semin X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1713373200; l=1623; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=T7axIIwEU0hBwz5dW25mb2R9FYDj6emglE2AhxS6gq8=; b=QsAkgdc0M94P4kLwp1lMZ5Dj/5NWRiCC9kKaGAafSTD/ZJDnn3GxySi9x2PDlhfrodraChulz NHakwLBTjO2Aghxvjv9fn9zl/9UEC3OpadvC1dherDF5smYhyJDZiG7 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0012.namprd05.prod.outlook.com (2603:10b6:a03:33b::17) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8080:EE_ X-MS-Office365-Filtering-Correlation-Id: fde0befc-5c02-4aee-fe14-08dc5effd5f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bXWShc65dqa9BJ31BfhPcDTyFSCGTJkqZh8YKWgX1C4fyLwGhrpdaAd7BcMvd2o3sDJH03n++TbNkdRAfdNvC2XL1LPS082zr+IVFMDWAgTDBrgva2ALPrhSZjlj+2MKO3UJCceyLp9040dfx3JKZ7oNslajSpovQIq2kxlawRRfSGozNC9t1lzrw7VESmWvEetyfSB8DruyAB99oUpW1VcltstU3S3VP/MiUNI3eh4OcYZ8OADKps87BNx1jn5SrNeqKKGANuGkM0oQhvvVFBXZbRIDbAbLTITgYIsZSPORL99opAjtWNE4ZvfLZDGqhXVp99e2A2bO8QUOzREZKT9ncD8N5+h4pXVArfNkPGJlKBpATo5l6V0xuqfw590ssb1FbPsF4GeV0Axp87UdICLK2KeReDXy5NfIrM3yoMoTBZ19KX3P8l+MI8zKxc34R816HJzD0XbNi3O1HeyxLFiGZgHCb0QUuB4hPEN6Wo0s5pxeujownXw3Wn0qF9JduQ1CI17f8c4VTmcxDijW/57efkYXFDCtHZb86MMug1oQ2Ba+bEAvxAGwJqv3YJjESgsVA+/Th/tQ7uYG4WNv364uZtd/X74Z7jBuMpi/NDbiNCU0Pf5O5bWg8QL8zfeBIYfFHP8bQea9B6Ng8WPI1niDg4HYoGPXpiQUyX7DR1k9SIR09fTfOjQj4UhQ8nyHmLYr+i5TfZcrp73BwYW0y/6fVGWN3JDD7UoVYxzlNe4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(7416005)(376005)(52116005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?M5LwJ5r7ATx1LyWtuWUgA4bGjTH3?= =?utf-8?q?lmR2gjvhYCYNEp/ZQA/Zul/erevdUI29qBGEketP5t83AZNbB2EsFvL3hWE+ywffO?= =?utf-8?q?5Hpzyuj5lq+W6pD5PITvxlpz2hN2Gd6zwaTO8KsWsjOxKVswiYBIXMYoT081c+lFc?= =?utf-8?q?lx7fJ3NBb4916/hAOVy3IUUTDig8sT/0eUeQjrPlTPB/uulgPLStoxiKBCTlOK3qX?= =?utf-8?q?2PNP+JYEmfT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wOPYT5A/h8ekKIZWcc23TjdbjFpF33BLuIGRmnrY8tfCcYdSgO2hitmffpqr?= =?utf-8?q?5527CUhVSVJnuPNTcd/iElX9cZuEehqHuJ01/Y/o9v+Qy8RlAPgbuVbUuGtmng+w8?= =?utf-8?q?nDJdiBbEjt0nDdAuEo+7cBuGjNqFuGSgNQXZpF7YgcLkjVRky6svX5bI0Pr7xnGFz?= =?utf-8?q?TjIUqfrwRGaz5ehffyK9F+ZeBLzsFFuF4VkwBstp/ZaRNE7o8Mfmarq1UWSJkkBEi?= =?utf-8?q?N/FzSKC7vt1pMqZVROvmDY1X/WyHBA+tYAc/BnODVxNHY1R/rhxRz/WjUbEP64EYh?= =?utf-8?q?L3zD2E8fpBs3tNTOkFmycGfCFsLEoOspDCnRvasvmFpBi+Nah7xOXcqNuZRfZzYzb?= =?utf-8?q?i7q2XQQBDYebZSRnxo6tDC05N72/Ao6tTkpGU2vOpSBxCl2Shu3BmWw3nTMrDVlXg?= =?utf-8?q?vFj4AdmqjJS7?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fde0befc-5c02-4aee-fe14-08dc5effd5f8 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2024 17:00:08.0033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rNJbzGNIlRDWecGH1vNipDhfG8DPt1SD2mZjnAivHJkK10g1F6ERGVduKkhwD2qsBwL1bU8Yxr5G0zvlWZL1kA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8080 From: Yoshihiro Shimoda Add "Message Routing" and "INTx Mechanism Messages" macros to enable a PCIe driver to send messages for INTx Interrupt Signaling. The "Message Routing" is in the section 2.2.8, and the "INTx Mechanism Messages" is in the section 2.2.8.1 on the PCI Express Base Specification, Rev 6.1. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Acked-by: Bjorn Helgaas Signed-off-by: Frank Li --- drivers/pci/pci.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 17fed18468474..02f46875fe2d9 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -22,6 +22,24 @@ */ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* Message Routing (r[2:0]); PCIe r6.0, sec 2.2.8 */ +#define PCIE_MSG_TYPE_R_RC 0 +#define PCIE_MSG_TYPE_R_ADDR 1 +#define PCIE_MSG_TYPE_R_ID 2 +#define PCIE_MSG_TYPE_R_BC 3 +#define PCIE_MSG_TYPE_R_LOCAL 4 +#define PCIE_MSG_TYPE_R_GATHER 5 + +/* INTx Mechanism Messages; PCIe r6.0, sec 2.2.8.1 */ +#define PCIE_MSG_CODE_ASSERT_INTA 0x20 +#define PCIE_MSG_CODE_ASSERT_INTB 0x21 +#define PCIE_MSG_CODE_ASSERT_INTC 0x22 +#define PCIE_MSG_CODE_ASSERT_INTD 0x23 +#define PCIE_MSG_CODE_DEASSERT_INTA 0x24 +#define PCIE_MSG_CODE_DEASSERT_INTB 0x25 +#define PCIE_MSG_CODE_DEASSERT_INTC 0x26 +#define PCIE_MSG_CODE_DEASSERT_INTD 0x27 + extern const unsigned char pcie_link_speed[]; extern bool pci_early_dump;