From patchwork Sun Dec 8 04:39:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13898481 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061.outbound.protection.outlook.com [40.107.220.61]) (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 3CE9745005; Sun, 8 Dec 2024 04:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733632799; cv=fail; b=sjnv87+6Yyng6MM1A+levN7n35t0fuMdV/YfJagnNp/KG874TNewbhBrGIWb7tuIpF41zuxjL+xEPu+nI/OFmbfipv61lpLz6PKkPii28BRUGrpkbomtr2jyNnM/w1K1Z4a5pWJIxtyEv1RXc/5v1UORLVY0ncSITfuCQmWQVUU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733632799; c=relaxed/simple; bh=LUkd46oYVoghRXDPs2DqCXwa+H6TZuOmbobrY9Vm1mk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H2LiEtsyxHwkOqrXoOw0z0pCVvmasPbzlQpr1L/oQv8onZeK5RT2vdO++9GNt9rJcfGIMvVFUfTG/Ql2OMDzgXINbOuPmMTxnwdO1+hOc8ZzQczRy69TT/TR0NlLGDRV7Xj5vL2zZYOGcq1fJ2hmpX21itmJuHkB7lNAuoHUmZo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=b9zsVOFs; arc=fail smtp.client-ip=40.107.220.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="b9zsVOFs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A1QPrAQyQ361jv6+Qmxx3Y8j7pY9Ejr4BReVzkW0FzO+zXELRSSaezx6DvH9sPz1lu15MyStH1oAjDLwxyaxdJk+CLuBnx4B71bMTqBhFbzsnZT3QwtuynJdRYX/7R3XUZY7v72O5UGZWEhJnSRCaY7LFlVrelj+9BZrlQmoHvf7Eks2MiYtA2d7PKkSy7iBiDSqB1LoRnjQAt7FzTkLqM1uWHawaXfu4uOI+905DrLQLvlmuN1/G7/AMoQGRq7raA9KKg12zks0ytINlVGu59lJm9bLr1mOrKwjTd28xHc/7EaqGaoGfx9Nolkt+AkH1CNjsepa7/iKgfuMKhe6kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=FTxvKM27TnnFZsfdDmKzFnnw3NjvXD91BO8p/poI5Tw=; b=Ah0V91g89OUCWOvUz5coB+ivVg57HU7aiLCeBx8UMmv92/gj3sPV6YOiNv7fSLDlv3N9ykhyEjAEYWmVEROsOHPLhtPTqa5iVFbSbAM8NWx6/CCmw4Kz13LG9C89Yk3x085XNwJDVY9AXatozxG+AjD6z1Y2Zh9sxPUe10TjI7ZTJvF94VKHjdCWdMOEjBs0WmGM6AlF8CWSE6Wm/OcngVZqMsOufqdsdZCwl5BuGeL9io45HIj7Kc0srpdMfxzHdhIqGlwiOuxCm+u9OY78/XyvzZOy2X77dF32TkblRZCf9g7o5Y2Q6N94tufCE3+qi13SggqdtS6qBWLpGzquCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FTxvKM27TnnFZsfdDmKzFnnw3NjvXD91BO8p/poI5Tw=; b=b9zsVOFs4vhb5rYcxNSpVMde2cQdlJgxe1TBUBrRtJjAbj+4luc57ma2suAlfRzSEDw6snxDhqOQt1C/W9rRbj2+/H2LvcNAPcQ8PvyGSphrhjoqbrmzTKYhzSWOm0Ur+NKMrVtIza9oiO0DkAXZRcge2oxsvVUi988lym288p0= Received: from MW4PR03CA0245.namprd03.prod.outlook.com (2603:10b6:303:b4::10) by MW6PR12MB8834.namprd12.prod.outlook.com (2603:10b6:303:23c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.12; Sun, 8 Dec 2024 04:39:55 +0000 Received: from SJ5PEPF000001CB.namprd05.prod.outlook.com (2603:10b6:303:b4:cafe::a3) by MW4PR03CA0245.outlook.office365.com (2603:10b6:303:b4::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sun, 8 Dec 2024 04:39:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001CB.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Sun, 8 Dec 2024 04:39:54 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 7 Dec 2024 22:39:53 -0600 Received: from xhdthippesw40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Sat, 7 Dec 2024 22:39:50 -0600 From: Thippeswamy Havalige To: , , , , , , CC: , , , , , , Thippeswamy Havalige Subject: [PATCH v5 1/3] dt-bindings: PCI: dwc: Add AMD Versal2 mdb slcr support Date: Sun, 8 Dec 2024 10:09:26 +0530 Message-ID: <20241208043928.3287585-2-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241208043928.3287585-1-thippeswamy.havalige@amd.com> References: <20241208043928.3287585-1-thippeswamy.havalige@amd.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: thippeswamy.havalige@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CB:EE_|MW6PR12MB8834:EE_ X-MS-Office365-Filtering-Correlation-Id: a97aa39e-f6f4-44e4-2320-08dd17425ccf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: yvMwXkKPNfp5Mmkm3gNhyrMYzblX290dMHfkelN9qHCV9P7cHIvScypVOdfyFzQFSET4MW+PlDFAfM9sv0MMgQUeSFZGZF8pD0rXyRKFkpfVFtFyIoQX5Ozwj0LLGzlJ1uLGAwX+e/RFLtNC8Hb3j5liCVi64loOW5Syt5dQOzfarx+0fge15i8ACiAgyysZrA5LOVmHXgsuAtBAlWxpeZeazJaksaN3zeIxaqMYtPBvCOmL3IZEWgR6gz+o5ZIMta+0MZ78akKfdmEYgJ2Ttqux2igZa09Vyw6WMsPYtySXYNGaAJ2x0+3wqLRxaMU1Ya8Y4BhLHxe5pCu2ZmVGZzKINhqTi4FE8xHSLcr8uV4za4Osc96AbuCKs659WMl02sFMa+0w8XJ00cojkZykGldfW+jO/tO69UR2jX0g0tStmjVv8aOFirjPrSoar//q0+qRixpwM+hVposui+D5KG07hqvKIvDu7jJoA5qVD/GZw5LSDItZ5vFOPY7cou7KoNi2bsjqX71khQJPgR6o6cwtDCx+PYmUcvvNDpkP5oEm6dyrUYdNo9ed49vBDLMIDhsEgvWfbZS+Wi6QGzREtEDBrs8/FDqYA9k0oaOHiPIqYkV/4t4v3ROBFP7pIaR/zIDuOYM6qVjNkrGvWingTH6RSEHh91Z5FdWNQPy4t8zpFv8dav6wnWCxSNC6vE4DFZff1wkicdD1CwVMcsqaBKizy+jcDaUbVhr/OfrfQlzzPkvskOuN97SJCSQ6TTYkHmIsCO+zEFaNCzAJpCXdC1hKWoXllU4G6SkaYxNQx3eDxcgo00sUr2V5+3m0azbbcnr5wrFd/vI16b63AZVMwqK7cN61SnDXGlCnfSefvTXwPw0AfWqNvglaiLLIrlAn1fhIeUKc7EINZc0T2Aabd/rkceHhj2dk634GuWZEncQjSCNjLdft/RxvtMRysMa903iXLp9XaZpH5bU6m4NC1G3wzFRnTBIqj6jAAU9OEI0Tu43mfdS4gpUy/XiZ1vhRm97LG9d3rbftrEjckjzLg3tg/VmSbzXq7/IOAmSQmW4W3hUtC6jEoYNlcxXpb4woZeQSAVtQJcDyoMZeBH7CAdhAB+w9VtLcBpo6xAlNnxfaYlqPgris8/ifVcxX02hbUT5gRE2KKGk83sb5h8alnKCuTFUpNijOwUtxtHPRh2Y4LTL1o430PmbhhDqfWLFCrv0OzJ2hHIBmRSOetGJBwWIN1dZUBW2QEKbCybpe7P4PIVcHMfg1TOXedjTpkeJiHQzhA6QndwPPl5R0k847fCO2/kfnBzu0ue1qix6rkYjaRYlvZbGn2DwjcPmykkR6vKKrjM6sBIGvm2xLCLKegNkrpkoSjlTcXw6IJx5i/yBMGwQ7ya3xrgpwSUao9tAIVbfkNEVntNXePIGEqjl9y33grXTh3X9fAPjp9QJnWxNLqCcvfsKsGE63O/mLEN+l X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2024 04:39:54.7275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a97aa39e-f6f4-44e4-2320-08dd17425ccf X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8834 Add support for mdb slcr aperture that is only supported for AMD Versal2 devices. Signed-off-by: Thippeswamy Havalige --- Changes in v3: ------------- - Introduced below changes in dwc yaml schema. Changes in v5: ------------- - Modify mdb_pcie_slcr as constant. --- Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml index 548f59d76ef2..696568e81cfc 100644 --- a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml @@ -113,6 +113,8 @@ properties: enum: [ smu, mpu ] - description: Tegra234 aperture enum: [ ecam ] + - description: AMD MDB PCIe slcr region + const: mdb_pcie_slcr allOf: - contains: const: dbi From patchwork Sun Dec 8 04:39:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13898482 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2066.outbound.protection.outlook.com [40.107.236.66]) (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 818E07F7FC; Sun, 8 Dec 2024 04:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733632806; cv=fail; b=Rt3yBNk1l9vultOhZtwJ1uW05U9wdxyU718ZnbBBCf7NV5CnzdNH86jqUZrKt/hvB/JzWWzx51YE8T2zmm4xpUfZPLPXrGoKSwFpH8kMDamxBHYagjg/tCatxhJm6QsdWdxjG4Ip1C3q3PJdPkTRB1W9w5Gl1oprtZiG9xUaRtI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733632806; c=relaxed/simple; bh=0ZqiC1MqTrTRS5U+wB23Sp+b55bII8//HKniubEbMDY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lkhnWNS+1Qd0T7V4EcIA1t8oFaqBRxXxm1EhM5JsjhdwsaZtO+AJiRCrBUu+1G4iTq6k4BKNUfmi7gPvDVmPniGSF8twNalp8uzTQ5kWbBg/RgliNuCiPOcOF4pSIzfxWK6NE31bnkX6zsTAFkUf1qHuT97SwmIWLDTUnPxGorg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=x/YFgy7C; arc=fail smtp.client-ip=40.107.236.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="x/YFgy7C" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vLV+UHtKFdYa95y4rLJ92A/8Gw+BmtCAE2xNsDSY8hMngOi3BOmILOOBftnC7G46hpZKVUEhXuiLJ8vGpqWk+sgWoIpp4+W+0qFl0zqzLtLjUBUTiiQPWYxNm0s3LlLSqtOsJHAv9+FHsg7bvAEoGDiqiCT2xSvehyfpFuqXjr2TnwIg54NU+xAiWqF/rSVk5jHBw/7j3jSACpzMk8jLqS2RB2q4KVqoptJCJD01QRxB4RDPbBowcAPyyI7hZVTQQ95OJUW5GPY8b9mMtYNFsqwDijYsbw4s1B2Wsqhyo4XfZ+Yywbst1TgepJF2s/emrmaicezAXEwR+sRMYIh7SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UgRrxelI38fLt2v+YFWrDVbRcWYbxwjaQ+Yvlysu8dw=; b=TFdWkZU20HDVJDbXPEnob885H6lyLtYEGQWE7cT/f4lWGIq9G7+FHUkA2aNsfOym/+ARdpsu8Qk6Tb8V46B9Eq7OFSRVaC2K754sg7s9qDhsSjogXCcVsOwQkK7gsxI6pfPifCQY8He6p8x3SCPmhVVySzfIc3Sgbnb0PXVkG+Zww6FPSdFgNdychuHyRylGTED5G3h7BXE6KZukCPFFMpJ1MrGapNdDcFixFxPuwK4+9yzXWIH+AcDk9+dPVRjBTjSxQ80/DrnHSeDPEnc5C2fbWHdbQ7kFW2wTPfbYOWkZLHRyTxBGsNXWNr06OT25NMMHaWrBz2pEhg1a9BOcYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UgRrxelI38fLt2v+YFWrDVbRcWYbxwjaQ+Yvlysu8dw=; b=x/YFgy7CC8adEOYx5HR6phZ03w5fW/qOrcoGfkg7RA2Fhmhps2t18uhlsTA7OOmYJKF+KEblZIpUOUIOLSAs9MIzP+pHnYrq4Iurfu8HAWIFtKxNE7g8voqgwId+1SOshsXwIBQQ9fXzszOtb+K/eYL6gZpETB93K0O1jqWSNW0= Received: from BYAPR01CA0048.prod.exchangelabs.com (2603:10b6:a03:94::25) by PH7PR12MB5997.namprd12.prod.outlook.com (2603:10b6:510:1d9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.12; Sun, 8 Dec 2024 04:39:58 +0000 Received: from SJ5PEPF000001CC.namprd05.prod.outlook.com (2603:10b6:a03:94:cafe::b7) by BYAPR01CA0048.outlook.office365.com (2603:10b6:a03:94::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.15 via Frontend Transport; Sun, 8 Dec 2024 04:39:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001CC.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Sun, 8 Dec 2024 04:39:58 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 7 Dec 2024 22:39:57 -0600 Received: from xhdthippesw40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Sat, 7 Dec 2024 22:39:54 -0600 From: Thippeswamy Havalige To: , , , , , , CC: , , , , , , Thippeswamy Havalige Subject: [PATCH v5 2/3] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge Date: Sun, 8 Dec 2024 10:09:27 +0530 Message-ID: <20241208043928.3287585-3-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241208043928.3287585-1-thippeswamy.havalige@amd.com> References: <20241208043928.3287585-1-thippeswamy.havalige@amd.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: thippeswamy.havalige@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CC:EE_|PH7PR12MB5997:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e0b269b-dcb3-4914-4c86-08dd17425f1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013|7416014; X-Microsoft-Antispam-Message-Info: D2G0W5Xa/KgJR8Pa+ZNPriQh4LNzU53PuD+8CtFyLWT3n0o0BtjXRXmpBACwqFT5xIm3ZXzfAGVA02ZKICUDoGnzjx9qWcltVjwdb+GHbWxh+RU35JrifBq6gj7It8Js7jpbEE5fbkHpvGlO/M96/7fAPq8YjwUi5Td7jnwunPQLeKC1ztSkp/a8qHRiaMTy00qqZjZqYFcfHdPY+eusMAZ9Yq2TX8FBGgXgc6gyd35EfcjCRsh8y/BLZkXGTLcETZgCUhTDgYCylt6DZbtRy1l8K6u84Ix+VvVNU81pKmn6sKxuW6QBsGkv5e1Z8mxltHghIW2FB8wsFkN5PImEL+ynpxpaCZ8oWsbO+QiUNUKEgobappbCYBzoLofuVih9qb6lZglu8QJYc2JXzAAeuoxuuk2HbNerAwk+Qw93gTkriYnDPNMNIUOONLbsdX9HNJNCo68o5xUfXu7r6I3MaP838ywwtY0YeRYAJGbiMZEkRZFJTfTyf9s5aMOrksovXid3ajcGSFvny7fUG9pGKzv9QxUDbREBdQgOjIrQUK1bZUnmRzqdaH0gu6IesoAVsMhq43wdsTFnemvFzSl1mYeoVBfbAobnKbffhNmJRn8gtBIfl7yJaNsHkKkELOjo9ZqIn9I4FfZvJ01A8Y1o6OYL6IagSOifJwc75NXBA2y51ThSJDHp2zga0sRgftyERKG+LM+ZMMk/YLPrixw8TR3SLs2BJ8nLtWLDHSRowMYNFLPBOWhEz7aNKA+4JjikqwFakys3zE7ucAJrl8kLuSZgnai6Ikh98wrldbPQ68KoWf46M9r8poD73kVJZWTUyLYc2erYVX6toTEINI4Nlic7lJP3u4jxyV37Zg1LO1LCE0J/QKugnd9SE7yL8N+sO0fD+lJQ1LiGQ+aBhPqprx+HZXDtp/ENnxSL25U4L55Q82rSlsAtYyTULiebGPvFkfWTLXPg/SnVl/6C7UzuoIJBXdoRNJLkXkWvtWFCndsvDgtSgSfjcj/BW65+IVUwBjwvayW8YYw58Ae4ks+ecQ6c8vmxrtW0JnJ6Y+qurEgQlcWMsbeAzouz6ibOFxm/Poij5FS+9PwIOymbuM6PtXkkkBrveia6baN2U96tO1ncq2QkHotbn5qdUGa+A9lBDYV4z3NYFCeimQQpZXQE9VBhn2gJaRc9KskdL63ExMS/WOoB5D/SNKpIB3PmEv968Uycoci9RnD+aNXT1X/h3VnokDX/O3LCdkcOeDrpDbXqRneoKzFhZnxU57kHQOE/e+12aPfYvhm/vWjbjBiCAWgSTGKxowmvlJSe1gX6t/ZS2TE5QLrMDZ4hzSX5HIPAjAAiQInlrZ3B2h6MOHdAiGOte97jXzjptjuGj9MEorPOxWR0J+lwjIu/cFleWxQQyeebE1tpREqM/WVFbNlkJg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2024 04:39:58.6083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e0b269b-dcb3-4914-4c86-08dd17425f1f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5997 Add AMD Versal2 MDB (Multimedia DMA Bridge) PCIe Root Port Bridge. Signed-off-by: Thippeswamy Havalige --- Changes in v2: ------------- - Modify patch subject. - Add pcie host bridge reference. - Modify filename as per compatible string. - Remove standard PCI properties. - Modify interrupt controller description. - Indentation Changes in v3: ------------- - Modified SLCR to lower case. - Add dwc schemas. - Remove common properties. - Move additionalProperties below properties. - Remove ranges property from required properties. - Drop blank line. - Modify pci@ to pcie@ Changes in v4: ------------- - None. Changes in v5: ------------- - None. --- .../bindings/pci/amd,versal2-mdb-host.yaml | 121 ++++++++++++++++++ --- .../bindings/pci/amd,versal2-mdb-host.yaml | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml diff --git a/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml b/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file mode 100644 index 000000000000..c319adeeee66 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml @@ -0,0 +1,121 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/amd,versal2-mdb-host.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AMD Versal2 MDB(Multimedia DMA Bridge) Host Controller + +maintainers: + - Thippeswamy Havalige + +allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + - $ref: /schemas/pci/snps,dw-pcie.yaml# + +properties: + compatible: + const: amd,versal2-mdb-host + + reg: + items: + - description: MDB PCIe controller 0 slcr + - description: configuration region + - description: data bus interface + - description: address translation unit register + + reg-names: + items: + - const: mdb_pcie_slcr + - const: config + - const: dbi + - const: atu + + ranges: + maxItems: 2 + + msi-map: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-map-mask: + items: + - const: 0 + - const: 0 + - const: 0 + - const: 7 + + interrupt-map: + maxItems: 4 + + "#interrupt-cells": + const: 1 + + interrupt-controller: + description: identifies the node as an interrupt controller + type: object + additionalProperties: false + properties: + interrupt-controller: true + + "#address-cells": + const: 0 + + "#interrupt-cells": + const: 1 + + required: + - interrupt-controller + - "#address-cells" + - "#interrupt-cells" + +required: + - reg + - reg-names + - interrupts + - interrupt-map + - interrupt-map-mask + - msi-map + - "#interrupt-cells" + - interrupt-controller + +unevaluatedProperties: false + +examples: + - | + #include + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + pcie@ed931000 { + compatible = "amd,versal2-mdb-host"; + reg = <0x0 0xed931000 0x0 0x2000>, + <0x1000 0x100000 0x0 0xff00000>, + <0x1000 0x0 0x0 0x100000>, + <0x0 0xed860000 0x0 0x2000>; + reg-names = "mdb_pcie_slcr", "config", "dbi", "atu"; + ranges = <0x2000000 0x00 0xa8000000 0x00 0xa8000000 0x00 0x10000000>, + <0x43000000 0x1100 0x00 0x1100 0x00 0x00 0x1000000>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc_0 0>, + <0 0 0 2 &pcie_intc_0 1>, + <0 0 0 3 &pcie_intc_0 2>, + <0 0 0 4 &pcie_intc_0 3>; + msi-map = <0x0 &gic_its 0x00 0x10000>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + device_type = "pci"; + pcie_intc_0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + }; From patchwork Sun Dec 8 04:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13898483 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2059.outbound.protection.outlook.com [40.107.96.59]) (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 EFF9520B22; Sun, 8 Dec 2024 04:40:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733632852; cv=fail; b=YwnU03Ew7aTv9UJH6rH2swGSKpcE5AgJmAMFsEvaxoR/HPkgT2DeslENP5aFxD4zfm//q6JJJmbzMqRnj4FDCi0wieruSD1jVSxvEpcXmgaThphsdEzGAVCNRvFARV/GkezdK4CWwwmW8ekOvVsKK+7Et03SOEx/OFmOqCaGkQg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733632852; c=relaxed/simple; bh=b+2qEidAe5L3HVjPNEwYossrBSWZzBji5mz1gm61FcI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HVh+B+XRuPlQwxLfbLxdk9brl//OPESSRtYrCNKIY0Cp1VRosqBzWozFnLdEewyEqBFG4KMhLM8eyCmyIdhcYy0tgJpCjBZheACzp2QupOBxp4IsNQx4+DK1S8n9BolIW4a6hw4VYy2YxRcNIK0Xby1+5qIDhm+88BfiZGwaoNg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=gNzZO/Qc; arc=fail smtp.client-ip=40.107.96.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="gNzZO/Qc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PMvASbSZTn56JGFAmasVrYeG9fnHqBEIdx2itzWgCqOcHjbwbhEcWwhNR1CQx8f40G86E++JhUzb1FX0UJS/gV3FhbqnA32ejNEHxEmvSmteLhcqAWvDHI2ZXZfFhwDRfrbfTESR3+EyMQ1g3SZH4HKM3CyJbRd0jT/7//CtA0T/uG5JKKzKktTeCxBeqpxPJYoh7ZDfYjAbEGelM8SjroaYer7ZPP89MnzsdptZ/1voy6YpEh1bPD4kWOQOh7BjteHVr63eL8cNkb++AMtzvHHtByW2zueu8TZJXhF2+mWrM31ZnKKgt6xuSg3Zr+MqoG7yHZMDgPLXm2/F2iEztw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ea3kf0QHSnX1UDW1DDJiuhwiFQqnkl2lGSAeUJtepLk=; b=fPB+D1RUYP6joPNTf+/YzuGxZIW72CyrLPYV0ubObZxCAZ0PojbGuTUGcp86x41/p+2lgeEn1OleOjE0W25SeAGUwEK5wpVIexD8fILOJSuZYLZ8It0ammyCeGjc61MiMSGXIuvVZwxpy2DS8RXS2F+tHMsmso/M3EIzmtDiXXL4QZ/6ztwiaiJdkJiupyQxkI9e7Ia5biLQE0uMO4TpIVA+lj/YqAV3F0VmekiG4C2oasn+4oKle8hNdP9t2Arzhji8uuCva2/WAgIgfyU+p74zfUbnya23N4+cYAU8NkeiAiAJIP2Xr3S8o0g6FEazEOUs2cD7yGtYB7YGEUGnNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ea3kf0QHSnX1UDW1DDJiuhwiFQqnkl2lGSAeUJtepLk=; b=gNzZO/QcIJRoLRZQWzRe7QICa2BPmokWqO8+WjcVUSPNT3K1jI4M5hcQqOh3rjETwAjKjUfE4+M+G8v2pBKFx/lrvcpleLsduE7cqD4xORmueOZTYsl7bY4NskNa6qv4s1HSZ5hDP8Ho4spy0TEiEfqtGz3R1mNBdmzOPCYALzI= Received: from BN6PR17CA0039.namprd17.prod.outlook.com (2603:10b6:405:75::28) by PH7PR12MB6417.namprd12.prod.outlook.com (2603:10b6:510:1ff::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Sun, 8 Dec 2024 04:40:43 +0000 Received: from BN2PEPF000044A1.namprd02.prod.outlook.com (2603:10b6:405:75:cafe::d1) by BN6PR17CA0039.outlook.office365.com (2603:10b6:405:75::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.10 via Frontend Transport; Sun, 8 Dec 2024 04:40:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN2PEPF000044A1.mail.protection.outlook.com (10.167.243.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Sun, 8 Dec 2024 04:40:42 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 7 Dec 2024 22:40:41 -0600 Received: from xhdthippesw40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Sat, 7 Dec 2024 22:40:38 -0600 From: Thippeswamy Havalige To: , , , , , , CC: , , , , , , Thippeswamy Havalige Subject: [PATCH v5 3/3] PCI: amd-mdb: Add AMD MDB Root Port driver Date: Sun, 8 Dec 2024 10:09:28 +0530 Message-ID: <20241208043928.3287585-4-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241208043928.3287585-1-thippeswamy.havalige@amd.com> References: <20241208043928.3287585-1-thippeswamy.havalige@amd.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: thippeswamy.havalige@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A1:EE_|PH7PR12MB6417:EE_ X-MS-Office365-Filtering-Correlation-Id: 188f0848-46bd-461e-275e-08dd17427950 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: wPq6JoD9uY0B6Aya/tkTwFlI/FbreRgXD762DzmfEGoc3TZSxNNqvmkLDIB3s254IoSNqEudJKvdrlu38O07KfbsKVBu7LoeS/Z/Q9adBXSwcVmvNFokpmKLv8EzSKHHDibbrx84qaeKsrUfIAp0Fm8zozGLlrAWOU4HsSnRpYYNhJfBOVomeEKL1rAVtb6Ji+am7owFyA8rjz3yYxzSivPhK8XDztsm2XLDLB/wwUwzIXIcwQasbZT+iaTbU5FlhrBFwNceCXRt8LQg/5O7e/+FIvt7Fukdz99RZU9UoiphDxG2Qhfw/MaX1+KH2ySQS2lT9XVogeun71CDTLyJmjmzbROZPAdbQ+U/CrlKsXKLgzuwDcTmlmV2eptbRezWqUHe3W+dk0DZPzCrTNP9OKTCpBeXrsrBkhV1UFrkQh70yuZByN9qkTFVBWqYL6/Zv76GR9osHiuXbj0gTVYWMiznTNjPuisWHyHfXRhK6ELxXgbBnBpPWtdQZtQmsku1FI04wf+SIHl2WKTU6Ebv1AtDO4DqORzbvPyz/6UsxLawhqZV/dG50q8EOcZffcu/2YB90s6LejC0JaRSRKu41eLVm2kxKURNe9jB7k2x/5Di1Gg8Pvs3pv9rV1TRX3DWihXsBLvYqniGdHQwTLh5ejG+DhX59TmmiEZ6iqps+ii7fdBv0jYzzT+l30QAb6A/T5HjHHluKZNNH6yrapAE15B9TaAF15CQf5kHOu+kT2EuzL0Tvrg3yGhIzen5nr3RRRiZEyYeKTMsPgZBloKmt6+oSUblzP6mxnF3mC9Ve3+Z8hce2ZkHmuxveOayc1yKffpLJs6eDyayO2R6lHYQ/8JY339RcG6kSnv8Rzj0XOFzLxE4kF5+zDu8CzH/B5AKrxcrYGK61jbxUIWZjuc6jjNMKbJqPtTeLY8EII3rTZYwHJafM/OHS/vjlMRCsR2l1eBenHX5snPpr3E9iDHElOTwNIHr2YVoeElKAP+kMffHsILXUacxHipe+ghLU3U5ONjGyIBoXKrTvNdZiZzifG34UuNBsI2JerIAwrs93SL6pti9BtO9IiMSEhmQ1cKDKaR4PnyCksvoSvWc65Aey1dcawRjzkly6hNihcTNp+tARRoP2hBnFOinBzQDG1cPdHUacvjQcMoah6D5PxMxTEkwFsendCFSvghsX0vwjBKrABfrdie8/h3Z39v4KRLD0RIODRlvNAcaAyKQSJytFjmKf5UryTrrRqswh4JBC1FkVlhB330vme3Kpqd/UsJxfj8EjRbY751zpRJbP/Hu+E4Ph5A6Q7edsCcv1piVvW898PoBM6V00OBKqlZHjkSMkMrjiNKdgo7b8Hps44GM6fyCpjM5b8waBhzrZnUun7AEW6mlRYVbbaqS8L5960DfkBOUEAviUkjPFp0FmjZ0IR3AglSnYhJX+uDso1qv8FaCLRK2OJJLNcqdu9/A7vog X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2024 04:40:42.6117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 188f0848-46bd-461e-275e-08dd17427950 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A1.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6417 Add support for AMD MDB(Multimedia DMA Bridge) IP core as Root Port. The Versal2 devices include MDB Module. The integrated block for MDB along with the integrated bridge can function as PCIe Root Port controller at Gen5 32-Gb/s operation per lane. Bridge supports error and legacy interrupts and are handled using platform specific interrupt line in Versal2. Signed-off-by: Thippeswamy Havalige --- changes in v2: ------------- - Update Gen5 speed in the patch description. - Modify Kconfig file. - Update string _leg_ to intx. - Get platform structure through automic variables. - Remove _rp_ in function. Changes in v3: -------------- -None. Changes in v4: -------------- -None. Changes in v5: -------------- -None. --- drivers/pci/controller/dwc/Kconfig | 10 + drivers/pci/controller/dwc/Makefile | 1 + drivers/pci/controller/dwc/pcie-amd-mdb.c | 439 ++++++++++++++++++++++ 3 files changed, 450 insertions(+) create mode 100644 drivers/pci/controller/dwc/pcie-amd-mdb.c diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig index b6d6778b0698..30d0a3eadf1d 100644 --- a/drivers/pci/controller/dwc/Kconfig +++ b/drivers/pci/controller/dwc/Kconfig @@ -27,6 +27,16 @@ config PCIE_AL required only for DT-based platforms. ACPI platforms with the Annapurna Labs PCIe controller don't need to enable this. +config PCIE_AMD_MDB + bool "AMD PCIe controller (host mode)" + depends on OF || COMPILE_TEST + depends on PCI && PCI_MSI + select PCIE_DW_HOST + help + Say Y here to enable PCIe controller support on AMD SoCs. The + PCIe controller is based on DesignWare Hardware and uses AMD + hardware wrappers. + config PCI_MESON tristate "Amlogic Meson PCIe controller" default m if ARCH_MESON diff --git a/drivers/pci/controller/dwc/Makefile b/drivers/pci/controller/dwc/Makefile index a8308d9ea986..ae27eda6ec5e 100644 --- a/drivers/pci/controller/dwc/Makefile +++ b/drivers/pci/controller/dwc/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_PCIE_DW) += pcie-designware.o obj-$(CONFIG_PCIE_DW_HOST) += pcie-designware-host.o obj-$(CONFIG_PCIE_DW_EP) += pcie-designware-ep.o obj-$(CONFIG_PCIE_DW_PLAT) += pcie-designware-plat.o +obj-$(CONFIG_PCIE_AMD_MDB) += pcie-amd-mdb.o obj-$(CONFIG_PCIE_BT1) += pcie-bt1.o obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o diff --git a/drivers/pci/controller/dwc/pcie-amd-mdb.c b/drivers/pci/controller/dwc/pcie-amd-mdb.c new file mode 100644 index 000000000000..3947aad13ea0 --- /dev/null +++ b/drivers/pci/controller/dwc/pcie-amd-mdb.c @@ -0,0 +1,439 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * PCIe host controller driver for AMD MDB PCIe Bridge + * + * Copyright (C) 2024-2025, Advanced Micro Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcie-designware.h" + +#define AMD_MDB_TLP_IR_STATUS_MISC 0x4C0 +#define AMD_MDB_TLP_IR_MASK_MISC 0x4C4 +#define AMD_MDB_TLP_IR_ENABLE_MISC 0x4C8 + +#define AMD_MDB_PCIE_IDRN_SHIFT 16 + +/* Interrupt registers definitions */ +#define AMD_MDB_PCIE_INTR_CMPL_TIMEOUT 15 +#define AMD_MDB_PCIE_INTR_PM_PME_RCVD 24 +#define AMD_MDB_PCIE_INTR_PME_TO_ACK_RCVD 25 +#define AMD_MDB_PCIE_INTR_MISC_CORRECTABLE 26 +#define AMD_MDB_PCIE_INTR_NONFATAL 27 +#define AMD_MDB_PCIE_INTR_FATAL 28 + +#define IMR(x) BIT(AMD_MDB_PCIE_INTR_ ##x) +#define AMD_MDB_PCIE_IMR_ALL_MASK \ + ( \ + IMR(CMPL_TIMEOUT) | \ + IMR(PM_PME_RCVD) | \ + IMR(PME_TO_ACK_RCVD) | \ + IMR(MISC_CORRECTABLE) | \ + IMR(NONFATAL) | \ + IMR(FATAL) \ + ) + +/** + * struct amd_mdb_pcie - PCIe port information + * @pci: DesignWare PCIe controller structure + * @mdb_base: MDB System Level Control and Status Register(SLCR) Base + * @intx_domain: Legacy IRQ domain pointer + * @mdb_domain: MDB IRQ domain pointer + */ +struct amd_mdb_pcie { + struct dw_pcie pci; + void __iomem *mdb_base; + struct irq_domain *intx_domain; + struct irq_domain *mdb_domain; +}; + +static const struct dw_pcie_host_ops amd_mdb_pcie_host_ops = { +}; + +static inline u32 pcie_read(struct amd_mdb_pcie *pcie, u32 reg) +{ + return readl_relaxed(pcie->mdb_base + reg); +} + +static inline void pcie_write(struct amd_mdb_pcie *pcie, + u32 val, u32 reg) +{ + writel_relaxed(val, pcie->mdb_base + reg); +} + +static void amd_mdb_mask_intx_irq(struct irq_data *data) +{ + struct amd_mdb_pcie *pcie = irq_data_get_irq_chip_data(data); + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *port = &pci->pp; + unsigned long flags; + u32 mask, val; + + mask = BIT(data->hwirq + AMD_MDB_PCIE_IDRN_SHIFT); + raw_spin_lock_irqsave(&port->lock, flags); + + val = pcie_read(pcie, AMD_MDB_TLP_IR_STATUS_MISC); + pcie_write(pcie, (val & (~mask)), AMD_MDB_TLP_IR_STATUS_MISC); + + raw_spin_unlock_irqrestore(&port->lock, flags); +} + +static void amd_mdb_unmask_intx_irq(struct irq_data *data) +{ + struct amd_mdb_pcie *pcie = irq_data_get_irq_chip_data(data); + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *port = &pci->pp; + unsigned long flags; + u32 mask; + u32 val; + + mask = BIT(data->hwirq + AMD_MDB_PCIE_IDRN_SHIFT); + raw_spin_lock_irqsave(&port->lock, flags); + + val = pcie_read(pcie, AMD_MDB_TLP_IR_STATUS_MISC); + pcie_write(pcie, (val | mask), AMD_MDB_TLP_IR_STATUS_MISC); + + raw_spin_unlock_irqrestore(&port->lock, flags); +} + +static struct irq_chip amd_mdb_intx_irq_chip = { + .name = "INTx", + .irq_mask = amd_mdb_mask_intx_irq, + .irq_unmask = amd_mdb_unmask_intx_irq, +}; + +/** + * amd_mdb_pcie_intx_map - Set the handler for the INTx and mark IRQ + * as valid + * @domain: IRQ domain + * @irq: Virtual IRQ number + * @hwirq: HW interrupt number + * + * Return: Always returns 0. + */ +static int amd_mdb_pcie_intx_map(struct irq_domain *domain, + unsigned int irq, irq_hw_number_t hwirq) +{ + irq_set_chip_and_handler(irq, &amd_mdb_intx_irq_chip, + handle_level_irq); + irq_set_chip_data(irq, domain->host_data); + irq_set_status_flags(irq, IRQ_LEVEL); + + return 0; +} + +/* INTx IRQ Domain operations */ +static const struct irq_domain_ops amd_intx_domain_ops = { + .map = amd_mdb_pcie_intx_map, +}; + +/** + * amd_mdb_pcie_init_port - Initialize hardware + * @pcie: PCIe port information + * @pdev: platform device + */ +static int amd_mdb_pcie_init_port(struct amd_mdb_pcie *pcie, + struct platform_device *pdev) +{ + int val; + + /* Disable all TLP Interrupts */ + pcie_write(pcie, pcie_read(pcie, AMD_MDB_TLP_IR_ENABLE_MISC) & + ~AMD_MDB_PCIE_IMR_ALL_MASK, + AMD_MDB_TLP_IR_ENABLE_MISC); + + /* Clear pending TLP interrupts */ + pcie_write(pcie, pcie_read(pcie, AMD_MDB_TLP_IR_STATUS_MISC) & + AMD_MDB_PCIE_IMR_ALL_MASK, + AMD_MDB_TLP_IR_STATUS_MISC); + + /* Enable all TLP Interrupts */ + val = pcie_read(pcie, AMD_MDB_TLP_IR_ENABLE_MISC); + pcie_write(pcie, (val | AMD_MDB_PCIE_IMR_ALL_MASK), + AMD_MDB_TLP_IR_ENABLE_MISC); + + return 0; +} + +static irqreturn_t amd_mdb_pcie_event_flow(int irq, void *args) +{ + struct amd_mdb_pcie *pcie = args; + unsigned long val; + int i; + + val = pcie_read(pcie, AMD_MDB_TLP_IR_STATUS_MISC); + val &= ~pcie_read(pcie, AMD_MDB_TLP_IR_MASK_MISC); + for_each_set_bit(i, &val, 32) + generic_handle_domain_irq(pcie->mdb_domain, i); + pcie_write(pcie, val, AMD_MDB_TLP_IR_STATUS_MISC); + + return IRQ_HANDLED; +} + +#define _IC(x, s)[AMD_MDB_PCIE_INTR_ ## x] = { __stringify(x), s } + +static const struct { + const char *sym; + const char *str; +} intr_cause[32] = { + _IC(CMPL_TIMEOUT, "completion timeout"), + _IC(PM_PME_RCVD, "PM_PME message received"), + _IC(PME_TO_ACK_RCVD, "PME_TO_ACK message received"), + _IC(MISC_CORRECTABLE, "Correctable error message"), + _IC(NONFATAL, "Non fatal error message"), + _IC(FATAL, "Fatal error message"), +}; + +static void amd_mdb_mask_event_irq(struct irq_data *d) +{ + struct amd_mdb_pcie *pcie = irq_data_get_irq_chip_data(d); + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *port = &pci->pp; + u32 val; + + raw_spin_lock(&port->lock); + val = pcie_read(pcie, AMD_MDB_TLP_IR_STATUS_MISC); + val &= ~BIT(d->hwirq); + pcie_write(pcie, val, AMD_MDB_TLP_IR_STATUS_MISC); + raw_spin_unlock(&port->lock); +} + +static void amd_mdb_unmask_event_irq(struct irq_data *d) +{ + struct amd_mdb_pcie *pcie = irq_data_get_irq_chip_data(d); + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *port = &pci->pp; + u32 val; + + raw_spin_lock(&port->lock); + val = pcie_read(pcie, AMD_MDB_TLP_IR_STATUS_MISC); + val |= BIT(d->hwirq); + pcie_write(pcie, val, AMD_MDB_TLP_IR_STATUS_MISC); + raw_spin_unlock(&port->lock); +} + +static struct irq_chip amd_mdb_event_irq_chip = { + .name = "RC-Event", + .irq_mask = amd_mdb_mask_event_irq, + .irq_unmask = amd_mdb_unmask_event_irq, +}; + +static int amd_mdb_pcie_event_map(struct irq_domain *domain, + unsigned int irq, irq_hw_number_t hwirq) +{ + irq_set_chip_and_handler(irq, &amd_mdb_event_irq_chip, + handle_level_irq); + irq_set_chip_data(irq, domain->host_data); + irq_set_status_flags(irq, IRQ_LEVEL); + return 0; +} + +static const struct irq_domain_ops event_domain_ops = { + .map = amd_mdb_pcie_event_map, +}; + +static void amd_mdb_pcie_free_irq_domains(struct amd_mdb_pcie *pcie) +{ + if (pcie->intx_domain) { + irq_domain_remove(pcie->intx_domain); + pcie->intx_domain = NULL; + } + + if (pcie->mdb_domain) { + irq_domain_remove(pcie->mdb_domain); + pcie->mdb_domain = NULL; + } +} + +/** + * amd_mdb_pcie_init_irq_domains - Initialize IRQ domain + * @pcie: PCIe port information + * @pdev: platform device + * Return: '0' on success and error value on failure + */ +static int amd_mdb_pcie_init_irq_domains(struct amd_mdb_pcie *pcie, + struct platform_device *pdev) +{ + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *pp = &pci->pp; + struct device *dev = &pdev->dev; + struct device_node *node = dev->of_node; + struct device_node *pcie_intc_node; + + /* Setup INTx */ + pcie_intc_node = of_get_next_child(node, NULL); + if (!pcie_intc_node) { + dev_err(dev, "No PCIe Intc node found\n"); + return -EINVAL; + } + + pcie->mdb_domain = irq_domain_add_linear(pcie_intc_node, 32, + &event_domain_ops, + pcie); + if (!pcie->mdb_domain) + goto out; + + irq_domain_update_bus_token(pcie->mdb_domain, DOMAIN_BUS_NEXUS); + + pcie->intx_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, + &amd_intx_domain_ops, pcie); + if (!pcie->intx_domain) + goto mdb_out; + + irq_domain_update_bus_token(pcie->intx_domain, DOMAIN_BUS_WIRED); + + of_node_put(pcie_intc_node); + raw_spin_lock_init(&pp->lock); + + return 0; +mdb_out: + amd_mdb_pcie_free_irq_domains(pcie); +out: + of_node_put(pcie_intc_node); + dev_err(dev, "Failed to allocate IRQ domains\n"); + + return -ENOMEM; +} + +static irqreturn_t amd_mdb_pcie_intr_handler(int irq, void *args) +{ + struct amd_mdb_pcie *pcie = args; + struct device *dev; + struct irq_data *d; + + dev = pcie->pci.dev; + + d = irq_domain_get_irq_data(pcie->mdb_domain, irq); + if (intr_cause[d->hwirq].str) + dev_warn(dev, "%s\n", intr_cause[d->hwirq].str); + else + dev_warn(dev, "Unknown IRQ %ld\n", d->hwirq); + + return IRQ_HANDLED; +} + +static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie, + struct platform_device *pdev) +{ + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *pp = &pci->pp; + struct device *dev = &pdev->dev; + int i, irq, err; + + pp->irq = platform_get_irq(pdev, 0); + if (pp->irq < 0) + return pp->irq; + + for (i = 0; i < ARRAY_SIZE(intr_cause); i++) { + if (!intr_cause[i].str) + continue; + irq = irq_create_mapping(pcie->mdb_domain, i); + if (!irq) { + dev_err(dev, "Failed to map mdb domain interrupt\n"); + return -ENXIO; + } + err = devm_request_irq(dev, irq, amd_mdb_pcie_intr_handler, + IRQF_SHARED | IRQF_NO_THREAD, + intr_cause[i].sym, pcie); + if (err) { + dev_err(dev, "Failed to request IRQ %d\n", irq); + return err; + } + } + + /* Plug the main event chained handler */ + err = devm_request_irq(dev, pp->irq, amd_mdb_pcie_event_flow, + IRQF_SHARED | IRQF_NO_THREAD, "pcie_irq", pcie); + if (err) { + dev_err(dev, "Failed to request event IRQ %d\n", pp->irq); + return err; + } + + return 0; +} + +static int amd_mdb_add_pcie_port(struct amd_mdb_pcie *pcie, + struct platform_device *pdev) +{ + struct dw_pcie *pci = &pcie->pci; + struct dw_pcie_rp *pp = &pci->pp; + struct device *dev = &pdev->dev; + int ret; + + pcie->mdb_base = devm_platform_ioremap_resource_byname(pdev, "mdb_pcie_slcr"); + if (IS_ERR(pcie->mdb_base)) + return PTR_ERR(pcie->mdb_base); + + ret = amd_mdb_pcie_init_irq_domains(pcie, pdev); + if (ret) + return ret; + + amd_mdb_pcie_init_port(pcie, pdev); + + ret = amd_mdb_setup_irq(pcie, pdev); + if (ret) { + dev_err(dev, "Failed to set up interrupts\n"); + goto out; + } + + pp->ops = &amd_mdb_pcie_host_ops; + + ret = dw_pcie_host_init(pp); + if (ret) { + dev_err(dev, "Failed to initialize host\n"); + goto out; + } + + return 0; + +out: + amd_mdb_pcie_free_irq_domains(pcie); + return ret; +} + +static int amd_mdb_pcie_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct amd_mdb_pcie *pcie; + struct dw_pcie *pci; + + pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); + if (!pcie) + return -ENOMEM; + + pci = &pcie->pci; + pci->dev = dev; + + platform_set_drvdata(pdev, pcie); + + return amd_mdb_add_pcie_port(pcie, pdev); +} + +static const struct of_device_id amd_mdb_pcie_of_match[] = { + { + .compatible = "amd,versal2-mdb-host", + }, + {}, +}; + +static struct platform_driver amd_mdb_pcie_driver = { + .driver = { + .name = "amd-mdb-pcie", + .of_match_table = amd_mdb_pcie_of_match, + .suppress_bind_attrs = true, + }, + .probe = amd_mdb_pcie_probe, +}; +builtin_platform_driver(amd_mdb_pcie_driver);