From patchwork Mon Sep 23 18:59:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13809928 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012041.outbound.protection.outlook.com [52.101.66.41]) (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 ACA731A01BD; Mon, 23 Sep 2024 19:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118018; cv=fail; b=L95nZ/hnjqFF+L4jo8Nt4hwXIRcSCAPkVnsn4ySmQF3kiz4ZLvQmPq9SfzdsqHExRa7G54YKi7JttBvw6Nk6kAqxNANMFN4+zGzXQ8oPUp8fMpztwCUVGsLDIPIsHphQPrLeywCgcF/wtAqhejy4+wkB6n3XlCftUGj7/bM1VgI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118018; c=relaxed/simple; bh=UA8d+sBLH56yo6wbs19BhoTsblTm17oh+2btuJvmpbk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=DVRfvLXHZXKcYbx4vwHPa065C+Ye6ZP0Dk3gSy2ILMYdHBu6r42mxYRJqSN2UwVCRLdlf8WlnlM+KfH+xVE4MAfLhH174DpIHK3kRjuCOo8DyAwtErOl4HS0EOTwGEBQsYBkPo08yZ+b98UjIhJXi1l0VN+N5noycZ+I35ZLr/Q= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=PlAIqhYi; arc=fail smtp.client-ip=52.101.66.41 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="PlAIqhYi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uGcWf3gVh/Wp19NEGOYxatlsQwD6oTeuJGTzP7qNRsqkn+aNaoUIBsVZb+jZoeXlv3nBzldUy+S0fQwcdg2xNxHSimuOTIY7dTYf5mv3PoYup/1oceutROh3OZvtl9IRSEbxW7/p1tA7RZPoNGOZP8T0H64vaI3zzdMJccdprcmygUtwuRdkDanOu4pgo6feNjP3MOd3iNbn+JgdlSKBZ/sQnY+6CQNYVIQI0lOw7oJuUpSvDN2nmq1gSXSSgmsYkOqcCGTgdOWczHUwUvIEyf64zpvYTHaycSMecz+TR5zWvvrJwCGZqBmvv7a8VsS3MQ9Klzvc71BXdv6ECkbprA== 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=rrUk9YwMPnne01ifz2s05Q5PhJgj0l8sUAQNIs7aG8g=; b=jB3mYGIc4Ue7mjcvlCOUQdxoZYspNmWqzrTv2oufa2QZskQVwf0TL7Z2clBwpw/UqvnYbt7+eq5wDRlrHJVjwM0km5j9uqj9+/E4uVOATkVuSdBULZkvnXh8Tox5ZOXgR77bOX1XEL8UP7U2Oki/WoVP+Zpzh8CM2kWcfGdGzMWyx27bt0T68oiH0p2d0q63u/BxLH8oM3PC2V/dzMRP7azVRRCtrQj0kOc0ui6RMLXJSCLGxjtW0A5U+Vmnw6e0+p1w8Yw6KtdXeqhgSnM00A4SQzXIpHsyc7N38I1GDLl7ZcxADdtPDaXTxPYgnmYHrDSxs+h38i05NyB3yByIfg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rrUk9YwMPnne01ifz2s05Q5PhJgj0l8sUAQNIs7aG8g=; b=PlAIqhYizFjiB+nMpgYChosSqMRQaRFHQkpDTyg1Lyrp1y5NtfcmjqpEPQWL9LvLpyFP6sI+IgnvWvh8eelyvtkQvMn/MqsLbeOJ8m8mOWYnjtKf4Ej3FJZ8jFx8+2gNMLQrSvZ9GV+VACH2TtTHwSiGc3aPo6qWBifRXz2Eh51ceqV82By8qvW3O+Dy/w7aBwc09CPr/urN3T57YBk7++txnBflSCrhxhEG4E+Oh0Bze4NjU5L4TSQwRqt2oRMBhTk677aXq9j5q4/dB0EOAkLJIhTDhFYoBDNlODFwga94qtc+Qe3BaBabDdFBdq6XAd4MWkgir9NDDZKWzKYodQ== 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 DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 19:00:08 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7982.022; Mon, 23 Sep 2024 19:00:08 +0000 From: Frank Li Date: Mon, 23 Sep 2024 14:59:19 -0400 Subject: [PATCH v2 1/4] PCI: dwc: ep: Add bus_addr_base for outbound window Message-Id: <20240923-pcie_ep_range-v2-1-78d2ea434d9f@nxp.com> References: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> In-Reply-To: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1727117997; l=5222; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=UA8d+sBLH56yo6wbs19BhoTsblTm17oh+2btuJvmpbk=; b=AbThf7zokd+Nv7jvltfFUDJ986D5PciTOKU6Rru46M6BXfAO9/TFa5BhSXmyWj6AkTYAat3sx kpbS9UXXIybAAVH0+5QuOnwyc6VwfvPW2alKUtk39Ua+RunUs0qU5/z X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9562:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b9668bc-bd6e-4f4f-6159-08dcdc01f1a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8nsN2l8bCnWIebSLkKIG5kxHacGXuKA?= =?utf-8?q?FGiO/lItBFoYj2zd7dXthJoA9fjzKXhiIneRu5NVJMRiLZUj43uQP/ZL8GgXTVz9Z?= =?utf-8?q?753E/DEBQug6p4GqfDlYTxh96IJ2MM6ISQtQlltdtXUVtxdt9WZqU7S5/RuxbgkwU?= =?utf-8?q?8dlVLXbUXoTwnlqxMqiPvWyfFwgSKVUi88j/gM3khv1qiVf+DQbECzeS7/2cIKjVP?= =?utf-8?q?u3yYcKjmUVrXRrgQv1lA7oEDJfCnW280ft0SN/KwPI8KZT1KwbpJ5hKlwzCBklWKU?= =?utf-8?q?N8fXnzn57XizEj3wnQ26wUR+XyME2qPWdgoHzk8I3vGS+BF3k83dTyuyvKKPFhiOn?= =?utf-8?q?T5ikoLPUIeRzE8moq0bWbCPihBWeQMufAzEXfm7OiNSWAWaC7tK2FilMJwfePmM/L?= =?utf-8?q?+i7wYxLkuZoAHh89VCcQrKLdtW/nriKlXk+z5HDRLJ91qnuSdVDJnJQ6a5fQDhHyw?= =?utf-8?q?XIV1p6Qth6+B935wkBJh8BeRxWTLp9NxYHJkCJH4JSSX/t7E5pMlReZMzwi9OIKCH?= =?utf-8?q?mcBpcvxtGMaLYtaqQfedMWdKm/cfcRXc7/Uprbv/X59xG++4DTEY+yAgEtFmeUGPK?= =?utf-8?q?D1DdJ6AHtaIHJsvGEBjs6T9TYwbBiXy/VxcF/hz2lAvjtLDnyiRw/2sb2Y8VISAU0?= =?utf-8?q?vHkcmOfEhjrJ9eVyzMk0X4m8/Lp/7shOhUXLcyR59MA4zYa5lB++6dozPHWi7ohtr?= =?utf-8?q?QA682VEarStENZ5QKui6PhksmcdjyXNPdTDpY/w8ZqbnLTR2Gmaz0j1r3jVY4gvt/?= =?utf-8?q?fyDbb8A6VgScTqeTyO44CbR/VW7Ovadbvv8W3R45OawLtQgSgNCPWWJEBfFGsHhp3?= =?utf-8?q?5/uW/WyDVyK5YLLLv91PuevtylJnMLNGSKvUp9WY67AuzERelt208iWMoO4HS5Ubh?= =?utf-8?q?7A/RaJAsypTI8LsIUgwTGXzOE+Mhu1BdcBGeOWABqA9/+VsJ1ejwhPAyzUL+3jCKi?= =?utf-8?q?mj4X1e/43LDuHVdkUYVGVGh0/pmlpoyYbx21XDiCVzy7BeAHO1nlGkOuCtZsLyZ/Q?= =?utf-8?q?gxMZB+hs6DJSKN30gUvPkWtZ7jRXn29gRWx1fPMLO+E4eEg+EL4x8fzHZ3ThRhoht?= =?utf-8?q?HiRcQjQTjvyi1IqxHddPd4nkBSmvGlwIWijwErRvmiN+GQExt7vLSxb4XNBB/dp4k?= =?utf-8?q?AeDs5dzT48UlZ3/ucORqGVJfCmcI+TSmn7iDKUFQna+RnGNnlwOWjH65tjNavFXLA?= =?utf-8?q?fv8zBCzNT2p68gydpwnQD20YdquXeSK3HLELM4U2JGdBRAW616Vzzm27myvVbszK0?= =?utf-8?q?hCHL/e2weRL0Wie89++uBvM4vAIDkKFP81HYGMqE/ucxJPrzNd/+srINJuqCbDHK1?= =?utf-8?q?ZKqzH0tvwpj00LpMOUiX98NaTViLT8ejQdZEliPqlvHWu9KO+EUyxuQ=3D?= 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:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Chunk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q?IptgOqOlkrTDW1EFRSK+JNcgJ2+4ZxuDFylGclVrsQqrZWMScDoj+foeBTKq8Zrxp?= =?utf-8?q?1rnJTpCEu6nlJh8YMVhAfGnfZI5omUrinm4AYv+ciojn8hKkSA1tVj+cMOcKMYWF8?= =?utf-8?q?yZkG4PPBH7Zq1h8OI1ZadYzTIGhPbp/69aeowuPGH/dOmH7F5li44gO9Cyz8XX/0d?= =?utf-8?q?XmSKV6yd/7OdKwTNSb0KA6DQArev1BkYAB9fiI+EhGxG2ZKVLH8ZgrdORR/4wsZal?= =?utf-8?q?QC4pf882NsstvvdWTgbDMuIszD78kCQcdyjmfZwYR/u3kSxbcss5tZ+2CstNHX/D1?= =?utf-8?q?83rvfPknCnP70lEPkrjFjVzk6PGcIjeT4VBK3r3K0jrDFky7/RX85l6gQcm4exJr7?= =?utf-8?q?hMnF8J5a+m5UNRqx3OYX0fjORmv+s5lgIn5yzEDEv8YgPNjmj4yQ+rTojN193wTME?= =?utf-8?q?APRjpp3L30Fb67zo0zfykCBxZQGCAZpFDvkFk5bry69+KF5jKgDNpGoLfosKaO/cl?= =?utf-8?q?amFLee/VrCe7bAcNxHRqv320NHdcYzBJ3A9znujKfMwx/L+ZtXgYi+m8akWuGmzh9?= =?utf-8?q?cQt98GkkXBPMny4xL91L70hUdNS+jCcOnJSEWtA1VgueQ1qqubdLCHydairM/7Nef?= =?utf-8?q?6bdGbpGa6mQtYHKKVPB1URT6QWfjsGWch3AtcMO8qcudYjF1Z7ewGSoQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b9668bc-bd6e-4f4f-6159-08dcdc01f1a8 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 19:00:08.8174 (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: c23GZINQrMYjkDJ2D5qEi2AU2FlJMAcnjjXeKVR4AMmh2CKa4gFhTQDD0bR+YmnDTM1Uw6BmVkNBNw68+ThBwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9562 Endpoint Root complex ┌───────┐ ┌─────────┐ ┌─────┐ │ EP │ │ │ ┌─────┐ │ │ │ Ctrl │ │ │ │ CPU │ │ DDR │ │ │ │ ┌────┐ │ └──┬──┘ │ │◄──────┼─ATU ◄─┼────────┼─┤BarN│◄─┼─────────┘ │ │ │ │ │ └────┘ │ Outbound Transfer └─────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Inbound Transfer │ │ │ │ ┌──▼──┐ ┌───────┐ │ │ │ ┌───────┼─────►│DDR │ │ │ outbound Transfer* │ │ │ └─────┘ ┌─────┐ │ Bus ┼─────►│ ATU ─┬────────┼─┘ │ │ │ │ Fabric│Bus │ │ PCI Addr │ │ CPU ├───►│ │Addr │ │ 0xA000_0000 │ │ │CPU │ │0x8000_0000 │ │ │ └─────┘Addr└───────┘ │ │ │ │ 0x7000_0000 └───────┘ └─────────┘ Add `bus_addr_base` to configure the outbound window address for CPU write. The bus fabric generally passes the same address to the PCIe EP controller, but some bus fabrics convert the address before sending it to the PCIe EP controller. Above diagram, CPU write data to outbound windows address 0x7000_0000, Bus fabric convert it to 0x8000_0000. ATU should use bus address 0x8000_0000 as input address and convert to PCI address 0xA000_0000. Previously, `cpu_addr_fixup()` was used to handle address conversion. Now, the device tree provides this information, preferring a common method. bus@5f000000 { compatible = "simple-bus"; ranges = <0x5f000000 0x0 0x5f000000 0x21000000>, <0x80000000 0x0 0x70000000 0x10000000>; pcie-ep@5f010000 { reg = <0x5f010000 0x00010000>, <0x80000000 0x10000000>; reg-names = "dbi", "addr_space"; ... }; ... }; 'ranges' in bus@5f000000 descript how address convert from CPU address to bus address. Use `of_property_read_reg()` to obtain the bus address and set it to the ATU correctly, eliminating the need for vendor-specific cpu_addr_fixup(). Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pcie-designware-ep.c | 12 +++++++++++- drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 43ba5c6738df1..51eefdcb1b293 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcie-designware.h" @@ -294,7 +295,7 @@ static int dw_pcie_ep_map_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, atu.func_no = func_no; atu.type = PCIE_ATU_TYPE_MEM; - atu.cpu_addr = addr; + atu.cpu_addr = addr - ep->phys_base + ep->bus_addr_base; atu.pci_addr = pci_addr; atu.size = size; ret = dw_pcie_ep_outbound_atu(ep, &atu); @@ -861,6 +862,7 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) struct device *dev = pci->dev; struct platform_device *pdev = to_platform_device(dev); struct device_node *np = dev->of_node; + int index; INIT_LIST_HEAD(&ep->func_list); @@ -873,6 +875,14 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) return -EINVAL; ep->phys_base = res->start; + ep->bus_addr_base = ep->phys_base; + + index = of_property_match_string(np, "reg-names", "addr_space"); + if (index < 0) + return -EINVAL; + + of_property_read_reg(np, index, &ep->bus_addr_base, NULL); + ep->addr_size = resource_size(res); if (ep->ops->pre_init) diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 347ab74ac35aa..c189781524fb8 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -410,6 +410,7 @@ struct dw_pcie_ep { struct list_head func_list; const struct dw_pcie_ep_ops *ops; phys_addr_t phys_base; + phys_addr_t bus_addr_base; size_t addr_size; size_t page_size; u8 bar_to_atu[PCI_STD_NUM_BARS]; From patchwork Mon Sep 23 18:59:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13809929 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012034.outbound.protection.outlook.com [52.101.66.34]) (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 C79161A0BDE; Mon, 23 Sep 2024 19:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.34 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118023; cv=fail; b=TkkXSIP5K/tZbHPs1q7vpj1xUC5ewcZvPSR/l/62mqd21M2wX3VwjmfpGrUAN/UKTP+U1UE4jgewYVj2kDgCWdYpDhZS9lXJAL208NORTd0P6dG684m1dEGJKySJj3KQry4QFwrKaP8ruxH2eXndgSkUMZKMOqzd+jYK8CE8Xds= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118023; c=relaxed/simple; bh=xBMVKn21RPS80T4SAkqfwyKN2vEMUSzyklVzf6tRkTo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=AUtEIl6vkipI+WM976Fw8V2PQIygGV9XV9iM9RnFsyNSQduNbz0t1oToCA6jnw8QV/nXmVixrb0RUbruZrcL72BAF6yZl+vwKjdc2+GnkT37S/GRnQv7w/oPkiQfoLb7X+25dGaE/xh7ezwwYKkyfrtZ0/ytmQC8B5OHUMvgdTU= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=XdpthIi+; arc=fail smtp.client-ip=52.101.66.34 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="XdpthIi+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dxK+wRI19KHGNCtazkBgAU3d0PjlxkLl79qnhZnfoleck2v4120Y+NDQ7PmqV/vfKfdmIVvG3Wejd8h7Nz3I66c+J+NEuCyujeHCQMBqDwQtOnP3l0tsNEMLuI+cW0maZNInyYcwCzbF5iDg4WpTI5Ki4MeYx7BHCFngjFLmve7nGus3+WbcFLZfZ7lYukuYhTUKs9fqz9NMhNKrDnXaVxU/8Ac4ec6kP/r9dJruWvzwgVl+OqMfgXLIwFHqWDruJsayEvQFy3Byu8JbZ6UExurt9C8iFTREeDNgp4meZrzqemNIUnpoV2i6s/dBOUK/hH7t7oFBLDG8FSVxNsezbQ== 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=jzUSrlm+zJ/50bZADmWnNagaGfKuzqI28+YUGF5rjhw=; b=OpWQK5zweH3hRrFT4wFRaFgvwEsADcpz0t0SKU8BHAxOvfiKJQH0bidraKejG45eVR5V0Gjb+Y51o6WXrW7XNDhZad0JxesTLleq3su0AI/NFBjjYEBrZMvs25opOlqYL88/qWw7sUtdwXACRmM3qLR8rmeifY4JZ0fk9/q54Zeg8rOI02EWHkXi6pE8qbOVGTD8A3ajZNu4JJMPPdE2EncFuov9hir8W/P76jzrBBQYaeRkZFKzaIHm2rbw+LDTvy/Y3+a8pUG0XiRNxNNY8Wl4Pdj197gUCP1FofoKauOglwtFohczfqABtFMNhtN9Nbf/7lF9mxjYgGfV9gqw8g== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jzUSrlm+zJ/50bZADmWnNagaGfKuzqI28+YUGF5rjhw=; b=XdpthIi+KdM2mjIggtuwin976qtPf6jdmVMDvJEFSUtOtXIBi0eS86i3FbE7xno5TPEpdbfsKO3wn4yVUdUGZTovpser9wkKMgqrw1hPYKyZKsilU9c1uCT6k8ZYZC+LCPi4T0EpdNZ8t0AIOoPVnk4J06z/xc81JwwwCpgVAyKE7k8SBlmBoTqHt8eas0wvVaYvum0xNpiIXPq2Vzmk578Y+UjfW8XfAeq0f41QnpZOXm/ex7KnqA2AQnpr9QgiRxRZS5VXL47NiIW+PVv5NPM+/nrQO9DDcFADsQUKcFZ8JJIkMkDEwiEr76Kok1UuOsvy83G8JUO6FWr+7ywOQQ== 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 DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 19:00:15 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7982.022; Mon, 23 Sep 2024 19:00:15 +0000 From: Frank Li Date: Mon, 23 Sep 2024 14:59:20 -0400 Subject: [PATCH v2 2/4] dt-bindings: PCI: fsl,imx6q-pcie-ep: Add compatible string fsl,imx8q-pcie-ep Message-Id: <20240923-pcie_ep_range-v2-2-78d2ea434d9f@nxp.com> References: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> In-Reply-To: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1727117997; l=2111; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=xBMVKn21RPS80T4SAkqfwyKN2vEMUSzyklVzf6tRkTo=; b=FR05rrpUQQO86aIYr2NrF1V1AbdgBT9zKqDtShSLI5OhRFLw3ZX6PSX83c/OvQ7qlx/yFG487 A0TlTWIhH0uA90R2FfJvWNWpe5z8VlFDdOBx0sA6GDvM0i1JJ6tt/7M X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9562:EE_ X-MS-Office365-Filtering-Correlation-Id: a2f8eaf8-6797-41ab-c2d4-08dcdc01f55a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?c/cDCvinujFcIXMkH8783ZyWS1rHTpS?= =?utf-8?q?id/dpulEAzwvko6R2Hq0O5DveMcgQq+u2f76ge7EKtbwPLYbjd+IJX9kRK9hmRmjQ?= =?utf-8?q?FoOajmhYYkEDgSOI5cSwU663sKmwtvVvEpeO/KZHs7pQtdakerNCM1s/+y5y8BGKI?= =?utf-8?q?C3JXNMj2MEmXwkXZ7P7PgtIsdm3A/ZAlb+r5Bb5pgHMtaL0abttr8ng8qj0D3UNT+?= =?utf-8?q?ykGXxOfE/RGdmpHXg/B5eThOhpKYbyS93UX/SF/OCMap5k9nMN1H5K0Y3boiCA8pe?= =?utf-8?q?IZ8TQR0juLQz8y7FVMOlE/frbtrWXYtr+jxIg2IbMwcs3bp44Wi0746s2mdeOyYJ3?= =?utf-8?q?5LEwrLbbzORWVwitlJiG+HYABz5z6PPWxNXMKveGiIjSmWl32LmKiPZ+xUa1QVL+p?= =?utf-8?q?wriks0QpnEflX6ViZHB5Kfnbja5D48WOLZw8UGqblh4oVXZ98hvhvKNqgWnaMZ0wd?= =?utf-8?q?XRuM5KBRV5vumKsU46LaVzYL9I5YlAhy9B+MaUdCw6/rgK0BCAcfL7XYdszv8pyCH?= =?utf-8?q?G163aM5qDml+FtDDtrE+AnkdWOUMJwsiRayAQ+EefpkKTiyH185er9eFmVxJKF/H4?= =?utf-8?q?Z861SXsMA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outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8D7AQgaHr3D7S9riKAOyOIjRpZjX?= =?utf-8?q?Nt9mUHYP06UOBj/0q+hN+r057MIeQXClcVEQR12+p9BBJzgltJjVJpYPCmXum7wI+?= =?utf-8?q?MRVEyooi84cL8NLWQ804mAbSSHXHAPneeUx/lwcW4Oe81B0DWrZCwpN1LySdPEqmv?= =?utf-8?q?QfhOCDQEAnGFrtnJMRjuaUcpBNgPSF/htqAQapmw+0zg/H8//1iuyvgTJ1P3Np94H?= =?utf-8?q?QVDuKN+udB9hX2ynh7kZrnsAzmT/tZL3NHj55dnQvBKnbuaYuOqko7lDgPYaSpMKx?= =?utf-8?q?77D0l5lAyY3yQA176XnOYwuwn3A8IGS5TvE73HCbVQCQ219eUqAfZYmSE88FHqp2b?= =?utf-8?q?AFrDZJn8rq7jbDFd+8yx7sEnW3BKvGuxjIfzRY3rGN0DOaCslXhP+UzROoBTOmM8h?= =?utf-8?q?ESFN7mI0vRJMBNl7JkH51/8+lSdJEp5LzhOXVbuOuaC+W0Atev4Mpu/cruW68J9KQ?= =?utf-8?q?Jw/K+1c+6Cnkdr6vscTBYhx7WjgUkPTGKYn3G0Ud8tinlvRuUDi1IuvDxh834FyZQ?= =?utf-8?q?xhdnnARcXu/HxA3XBeP4ayVkrt4vnZzWyn2jddax2JNCosELIcdG1qdQIG2HY1EFW?= =?utf-8?q?Y0aRGrZs2u0aGSAOOmh0z2C+bjLcVeAUIyk03Vhy90lFPJVqJ3prr1LNkVW/PpdyK?= =?utf-8?q?JedA2RZ4CT5UOkkokx6RM765P6ij5769HgORNjQzCBLg2rPYri0BL/skbYhuU+WOP?= =?utf-8?q?HuR2RTrGouMmzLA3Ropp/8yHozGW/8xSAz8buTy9d481PSWNPEVqDLltJh6jCSG8X?= =?utf-8?q?WtorRrKFwkt47punXJiBekGi2a+W3tel1SpzXkziR7NX1PPK4T3IbpzzgTMuZxfXl?= =?utf-8?q?cQOa6ngcNbLfJQ6JJ4o+wBcwq7uJhm91RzpJ+Aw3leXVrYI454KnCIDBWC366qtbQ?= =?utf-8?q?a0BxyAGD1jjBxsx4VZ4QvU4kfUq4pU7DDwpIh9tXqNDqQOnFS1Eg77dwJit/O/IbD?= =?utf-8?q?Hv70zHbRfnrJqmUDKeq2v9vLkGLZcefCJCtMWvezaatoGcYhGXeSFB4Tptmp3yr7z?= =?utf-8?q?JdxKbFjgutxjdgpjoGX5zZTSdH40BtvyCHMrmls0F8wGCOgxLaKEpW5jCsjpKReOA?= =?utf-8?q?y5jcprgx/D1qDj91AnmOdeoHlzne8Y9LfR9cC8grvT+vd3hlxi9BpIZA/cde0SFWv?= =?utf-8?q?SBxV456eOekMhAWSaAyNLcNOIjvjlHyZVMkox6OYgcP6VicwUl5p5v6ct8rTjYCp1?= =?utf-8?q?WBinYU25/9PRCq6pq1x5d3WueHfZgjlshQE4GeEExJR9kE97MDUuWxnLQT4A7T3WR?= =?utf-8?q?zETiYFYHtQBvWaWX6rKpppZRnpDI0SU5k4vYqHEU1kdrmaFw8t9aGssz7WxF9cnxj?= =?utf-8?q?AEN6E3dDg0peXnIoThW8CiPRe8lNa0xCrZpWxhRJQXrJSF/8WXUQJraPGJcVCqNgs?= =?utf-8?q?ftw38oBik7SQUZiwRMFGS/VebGKDpOdSVmJFCToVAjM2cORqG1EFn7DbDK7YinSAM?= =?utf-8?q?FDokdU9XH4Xo9inFXL6XT/n0GUKWUI9/E85IgCOhg0eiBjp5w6edm9Tc=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2f8eaf8-6797-41ab-c2d4-08dcdc01f55a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 19:00:15.0036 (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: ob/c7yUZwsGVS/HV9ppGjEUeM/7CepG+PwSNOYRW0SEmDNnH+/c7KG8e3eOeRTMqFG3EBkcOglvulWVh3sHOrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9562 Add new compatible string fsl,imx8q-pcie-ep for iMX8Q. reg-names only needs 'dbi' and 'addr_space' because the others are located at default offset. The clock-names align Root Complex (RC)'s naming. Signed-off-by: Frank Li Acked-by: Conor Dooley --- .../devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml index 84ca12e8b25be..7bd00faa1f2c3 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml @@ -22,6 +22,7 @@ properties: - fsl,imx8mm-pcie-ep - fsl,imx8mq-pcie-ep - fsl,imx8mp-pcie-ep + - fsl,imx8q-pcie-ep - fsl,imx95-pcie-ep clocks: @@ -74,6 +75,20 @@ allOf: - const: dbi2 - const: atu + - if: + properties: + compatible: + enum: + - fsl,imx8q-pcie-ep + then: + properties: + reg: + maxItems: 2 + reg-names: + items: + - const: dbi + - const: addr_space + - if: properties: compatible: @@ -109,7 +124,14 @@ allOf: - const: pcie_bus - const: pcie_phy - const: pcie_aux - else: + + - if: + properties: + compatible: + enum: + - fsl,imx8mm-pcie-ep + - fsl,imx8mp-pcie-ep + then: properties: clocks: maxItems: 3 @@ -119,6 +141,20 @@ allOf: - const: pcie_bus - const: pcie_aux + - if: + properties: + compatible: + enum: + - fsl,imxq-pcie-ep + then: + properties: + clocks: + maxItems: 3 + clock-names: + items: + - const: dbi + - const: mstr + - const: slv unevaluatedProperties: false From patchwork Mon Sep 23 18:59:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13809930 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013008.outbound.protection.outlook.com [52.101.67.8]) (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 C8F601A2543; Mon, 23 Sep 2024 19:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118029; cv=fail; b=QdqPVmcHRLOm4lW91JnjXseGLVOmBluTnAQTsYTpkYMUSbOpT9l03wf4aMtoc17rkhNw7o0iEL4JCjOpA4W3TOB1pphRMI+WIcNSPplnxQkz+1BvFXhnu+yakEzGczWDGKYYxdXnHAuv+mijBcVL3BOQRpKkUsKHf2xByQSVf6o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118029; c=relaxed/simple; bh=dDCIqEiGeYvyy7IOr9TuFKqg1ZZuhKUnDbXG/Msug68=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=UbM3mXuq96kR1gLVy3OpHPzMA2VDyzlxV9H7oLxuOxWZMownWmOPCDXzAUIAarNumDGuxzjSObJcC3gVynB34lZX7SauG4f7H+Ksi7yz5VwhVfVrR9jn726aANLebVPgvw28qu2eHnOSvQWVB3SFhnJt24CA84qXfB9hQN1rvtk= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=gT9hV9x9; arc=fail smtp.client-ip=52.101.67.8 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="gT9hV9x9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wXiCGVkznm3koyteshdKsNTaQg5KJAlmhenxd+h9wxuUlSRx7jRTXijw4YJgSMT7DGG+1DfDViK8qrqMIUrbZcZaH5wYnbAl/VaTDnybMysxc1CDqutp2skQyQRTWUauiD2sBEDL2lH6EN2h3xq3MBNuI6komeY0iINN6L8l+73W4gIPnsZQmMLRtEUeLdnHvOD3zN2X7gme49o1bJPM/UxLxHNoeR2slTUKOXv7/XB5klDV2M3IdHHRguNoFtDYNZcLnCsV3QSG3yj/tm+noVRcyrXMDLRpNKfJUnvf+788d4X+uNSOLLL42FCdhgEc/9kb8TkaF5+PSP1QBITwgA== 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=wuX1Jv44F0T7Lrz9ExIWNFVs/gpRUetjCUAmSbU5G+M=; b=KRsLFmUcmHcnDyAe6td8YVICb9ZZA/XF3mFqrrpt6BZ6JIZhxzJVWI3FwOvoqmqon4JiygP8q2OwWObdYEBDHWdR53Dt7PbVKUEqeeusWPcxlVxjchKche70UDm3UqyKxGk1BpqCNzt1DId8XYTaf4t6Qmz7If/XEqdMYEO13gzo/3ahwRijAY/o9j0NPrHIri5BbZ3anhijHTkA2u727wsK+HkexUZE9WuXGW+coziQGVnffPAnaBGRjRWYF6PaUNFf9fTr5JuKbQemHeKn0bmSaMozhpS5UqGIH46PuvQ42Sc5+NiY9ItevzwQ2RUVlIhSFIb5AENTl3KRA88eFA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wuX1Jv44F0T7Lrz9ExIWNFVs/gpRUetjCUAmSbU5G+M=; b=gT9hV9x9aSH4d+7eMpQD8Jlg/n0b2XU1t8VHZa3u8G/K4aDGobr00EANWrzaJ080DRbwo3j/+YtYf3EEB5VoFh5nkqZeYoyUeCx8H1qV6gw+Go8/wffYB4IbiEMpQ0N2IehVSSkU6bzR0BvF4grOCyIYuq6WDTeq85CoBopeZaSO/uJpELvsfcfLkiW0WN8pe2Tg8lGbvPZM82antPsOMN3vJjhcQYvAkWUmINCFuqlLAmsFNpWJEh4zZaXQcET7y/4wnFTeTM5gh3QmZlSFSXz1TQWxdfXKVodpK62SlfZ/y/LqUh3k3+rvMRyes0ULZJReOn22yhtzhON4Z6/uZA== 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 DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 19:00:21 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7982.022; Mon, 23 Sep 2024 19:00:21 +0000 From: Frank Li Date: Mon, 23 Sep 2024 14:59:21 -0400 Subject: [PATCH v2 3/4] PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext() Message-Id: <20240923-pcie_ep_range-v2-3-78d2ea434d9f@nxp.com> References: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> In-Reply-To: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1727117997; l=1068; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=dDCIqEiGeYvyy7IOr9TuFKqg1ZZuhKUnDbXG/Msug68=; b=/Y9KjyUCvxV19RYudfpxSe7Hy+SWQwkyz4riQ6BB9QVAcN0+WiLQTEdcLDjHshODM9yMe8tKv 24Mw1YdnHwZBg0+nrYAeHh/mg0h6WGrl2puyXge7st+dOMS9gPZcMRK X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9562:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ca9e344-a40f-4e6c-5768-08dcdc01f8ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?LHA0foh57XpHMNpOdusJRrdlZ8zqI13?= =?utf-8?q?xF/+g/kDldbove8KqApSIhsbM5XMRRUuZ9QggT/NB+Xl/TVMbr6We32VPsfun+pgV?= =?utf-8?q?9DHF0PXNoX1TpwDWRQh4w3nEGBuiCrIFDuCC1Nc9/ciaxsQKJicjWHJRMyH710ttw?= =?utf-8?q?cf2w1OFkqBtXvw+DLG+cFCKm8INwJkVKCpPqIkPWrivhrhv5YtWwC4Ebr74Q2QGpF?= =?utf-8?q?9Rsz5192hX+uV8GCEDAnOAxUOxyBEZnkJv/xmEFkKaeFRD30vwoXJrEzUq0ondOwN?= =?utf-8?q?RxxYmU1ybUkAOidKCcTsdc9F3xMQNtEjBiS0IA6GEM+JpracnpG2myc7tb6GYRZUS?= =?utf-8?q?7AWhvW+swD2G1CMP1SVhwHe0Q5KPKcJ+GXuKmo3Rq87rjJGrOPc1NoA2ylOBhewoT?= =?utf-8?q?K8mUnw3wWEQTTzgWK5ljD3qlPAX4hT/IwIux4HyHxomvh4FWuatOZnGxGnXciQFCv?= =?utf-8?q?j8NV8YqW0kniKM2cs/o46i14tjWMSeM79rpFA2wkLuJ65ZswGDXAmuIhW5uo+oDQP?= =?utf-8?q?Qu+/Xl0vJTqgUWMWU1Ev7EtgWcuvDXHE1nhTZ7qaqvL97YhKLECfUW6t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;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SiKkYfkv/x15TEKyZbYmZOuzkNa7?= =?utf-8?q?0SnKXe2tmwK5R6k8nZVlO7jWEYu73tAIsW599jVFeX1GNmr+auVDFQYVqeDuFyw/e?= =?utf-8?q?Y/Lsd5QufT9YoWahnzjcdPJWQ6c3B9Fwwxp3uzk9JLW+xcQyNvbG92J4T/cCAhHYQ?= =?utf-8?q?GtrwTKNx8MmJElpQJHHci2UKCpYyQy8/74vML0Fpu6COavWwIYu3YYzXFV/aIAXfH?= =?utf-8?q?ljzVsYv1OUYYCpkcRq3zFiGzdfS8w3Ie3Ywb8C/j5ODjRrdNp17d7ZVwzfqz4zOOy?= =?utf-8?q?dgJ93CzZllZb4NhpVe/6Gr5aeeZaI+fK9zBEQwzCcQwGvwTzqeDOYDi4HcChAfCDr?= =?utf-8?q?MeH1USzs4Ik1Z7lVZWBEGMdgmeW2K2u5MmANL8pNMf4VDrp6MnReLhO26yR/Q/RYQ?= =?utf-8?q?t4cTxrLXOl5PVno36k/PkDJR2GbUXpviXb33ni0Y8d3BijiEnADxwmR9LBsTqi0H6?= =?utf-8?q?2NQ2YaK4x1gAsxjqh0kJZ6epWk4l8iPkAOj5FicaU7rgb53jtK8nM8orldLfN0HTb?= =?utf-8?q?Ws567LJ0zWd2Hao2E1rWF/bLMK0BcNQSLQ3VhMa5sjEaA1+oaymlybN5efVU0v4mW?= =?utf-8?q?euSuV13/CL0c09nk94c0gBjewvVt2GZRawJ+PCHPGWmmQBpUaLYL/Qm9Mm3eAb8hq?= =?utf-8?q?5xSh4bVHIF8xXYY4jIfhq6bln3T1pn8oTO6XIzzeAIbA/dPuan7fVD5TWsP0SCuPW?= =?utf-8?q?dDUYFGTPCqIOg2rM0IOZiskEbzAu2+xiRWpZb2NrYAFJMlnV21pjMyblefLtwBTlS?= =?utf-8?q?oOBJNMFACaBbLaf4NEPvaP+l6/1yo1xcA1B+eyGsrQovYXgZiwCkETERsTqKI0OiG?= =?utf-8?q?IP+QBCCVG0OhmLzQY90wdmzWq4bdewWFKj6IvViliRbYUdq5faFo2Lak0Dfw3JJTN?= =?utf-8?q?QqlF3xez+tS9pCqRZAmgmj0j5JZ1q5fYafQfiEwaWd8jrhXgTxGsYg0WHcRIE5+Oq?= =?utf-8?q?zKJ1mnm3LSWwYgGIoRnkPqDRu9S9wjmNxEiU35+fP5avDlEt6XJ5T2KWnLivWyP/m?= =?utf-8?q?4G81ykiWIeqn2I1T6D+8mXAGwkMpuRc/8Yj54hbLqMGYnFdJbReUsGYAb02ZoYGeF?= =?utf-8?q?vvE04aadq1bvVmDQx8VQAHDGAhVYMin0LfjwqVgQ1S3jv6trynMVZhohzVR7Kqxy8?= =?utf-8?q?hj1KrpE5idKKKGhahLGjPxWGJj43HcTzbjOOARa8ErhXtUPlyxdRcZ32tGdIapKSl?= =?utf-8?q?XPMV7e0zntfg0Iq2aMsPZahikgnmqPmRlDHqOU1cZHq2uR4qJ8iza1qWI/fQj9dIu?= =?utf-8?q?PCRdk379r2vsnqTc/3/Myg6twzUntpTagwdzjlFnlD+aHCXFa387Pz0C4Vp/Riud7?= =?utf-8?q?bIV4BposjRc0HsJA0LW/2FE/JYuQbyvU3KyMMe5yaBbRlwVze/nZis+LST6QBtXHW?= =?utf-8?q?5pp8ywkHd3C0bN/59T5XtlCOYTTYlaAeZSRf7mHPNvzKaB3uMOMT6BnT8szGdAsIF?= =?utf-8?q?jpeFe2c0WaXWcb71iVxrfV7Fj9DhB1qQPkVFe+zLBXeZhJfUF8SEWBug=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ca9e344-a40f-4e6c-5768-08dcdc01f8ea X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 19:00:20.9919 (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: X+GvNtdACe2V3hUdxNdTTWolJTcyCMq5t/UfM/WasXXDbIWv1tVit9XuKHd8k0y6zqtNWqumu4LvE5BaW0qUKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9562 Fix hardcoding to Root Complex (RC) mode by adding a drvdata mode check. Pass PHY_MODE_PCIE_EP if the PCI controller operates in Endpoint (EP) mode. Fixes: 8026f2d8e8a9 ("PCI: imx6: Call common PHY API to set mode, speed, and submode") Signed-off-by: Frank Li Reviewed-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-imx6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 808d1f1054173..bdc2b372e6c13 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -961,7 +961,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) goto err_clk_disable; } - ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); + ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, + imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE ? + PHY_MODE_PCIE_EP : PHY_MODE_PCIE_RC); if (ret) { dev_err(dev, "unable to set PCIe PHY mode\n"); goto err_phy_exit; From patchwork Mon Sep 23 18:59:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13809931 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011037.outbound.protection.outlook.com [52.101.70.37]) (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 9D2E41A2632; Mon, 23 Sep 2024 19:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118036; cv=fail; b=Zs/fDmrN+jY/w0DCRME/xqXqnvccnqbYLmeWZjLV0dqj8A3lSrRSXz1HHdwwzRil4Il8RaSDPc1xzSd8AFxVZ2gnITg8VrbC5bnCrhJpxuQSklVUqr1HIVJx2C2C6fcbF26tc+eVLA1bXKywhHqJXxw+e8Imm47l4fu154/h8nc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118036; c=relaxed/simple; bh=HmHQZfq9L8UmM2u5lYQ3fG7uWgmbd7LJLFR4sCzXQBI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=lYk4sjucUnjddfmtPxXSJXirFAanXYQgs9SUDzMykDX2X7PWgnrtsMkdDrcqCCbSnKEplkwHU/EuAcrpWaZFd0UF5WXr5vxcROtI2E4jSisajM8YNXcU3lrnawQt91dZcr3E2HCzaisaM6mHK48HwHP/rGdLCys2RXkMU0XrhL8= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=dpSd2L0y; arc=fail smtp.client-ip=52.101.70.37 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="dpSd2L0y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b/Mts+X+dQr8EZUMqbHFQu+/w5HxZMSXUfneDd88j0NmR5lV3sHoxJDPOgIaWTYgqvpMkiZ2GjNC1Zn+T8YxhoHHegx+d8Y4WGgc20WQAnTnXtfEs+7tdDu8EJSqeBrKpFTbad5xMCS2mfKeV0yK/WmL3FzTo7V32oiL9cLs1y1Qp2QbaQ3GR0uKYvlZMtEXtWO7Ah51mHmmsnk58+G/OAf+IXgx2M+QS8rU5G0isHOYnk6mirqqDNWZr8gw0Y7nVx3A5REptR3TYvaQT+E6v6VSgHoD2Nxg9I567aaiidX8zoinlTCJrWiawyphSN/rmKoGLJYdv7nF+ojbKpGa4Q== 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=hNBQub/0c6XKxnoL1eJNqowuPC2/Be9FImQcc7+deUA=; b=huP+5l5392pzN7qkZYicB06bufmn10JtrStOlHir0hCcL2E+jJELPbwBHhkSlDe5RPQcazAaRGv799eEL5ceQXCmVgQ3qSWlegGhOxefHiQ7/L4tuiJAJttbHoLpFMnJnaO9wO7KCf9zIVYuoU5n9TBxeg8E6FKQkQQXOVCD/AQGB3pFTDTdDhQJ5ivr5czOHM3FV6ty7ZbydWbaDLuPEjJ8+rIqevaW16ngNdg5Rzcgr1yKjdCkrnFYwCL9dX6JKSSdPHzxRLQ5q9+DF+TtyDqVcp1PArlXl8dGS4x5IqRyQ0RS4xZvnDrNJ/xn1zJ5S3EAuBXFaFWOow7raGpewg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hNBQub/0c6XKxnoL1eJNqowuPC2/Be9FImQcc7+deUA=; b=dpSd2L0yLSH65GCbN1mlNDMmrDgdVUA5DIZIZCTWxRx9uUds2UF4IdfTtvu2ZYWxVt3qOLyLMBR/roLhJpTQGm7gE5PEG7WMHIgGfFs7Q5I2DRMLxiEXRio3xGQ1apXC3Ohf8og9FCBWMxjN3Claqr7ZD7tWLuQatXPkjH7E/iHzK0zeMSfdIkULkti68MBpxtHeW4Z1A3bNLn5sfAgBAM9BPDql2lrW5UIEiPkP4pi/SIsuYaAqTmQzWGNaB3teqk56U0owcQHMVkZoDtfaZdukPwlfJFw53GudVNZxOcOLqbWwYf2ECX3O0yrcBjS/ldJmNkaOjkvbFKsm4m3fJg== 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 DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 19:00:26 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7982.022; Mon, 23 Sep 2024 19:00:26 +0000 From: Frank Li Date: Mon, 23 Sep 2024 14:59:22 -0400 Subject: [PATCH v2 4/4] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20240923-pcie_ep_range-v2-4-78d2ea434d9f@nxp.com> References: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> In-Reply-To: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1727117997; l=2309; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=HmHQZfq9L8UmM2u5lYQ3fG7uWgmbd7LJLFR4sCzXQBI=; b=BnflfNkgIwTmbgTStGai5DnLd9Tn+4c6USz+hjoFnoHbBCh+KqffAKh8tYUR0tLthX125iwHb /OQBnkp/KYCABs4BCn7J4f4MmG7hE4HRXGCGidZkQ687nj4j5Uq8X28 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9562:EE_ X-MS-Office365-Filtering-Correlation-Id: fa589a06-aada-41d2-a397-08dcdc01fc68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?6nSC/zLbum1z8Mz6UFb2V93d1kgkwAO?= =?utf-8?q?TiwOxthF2WkpqA8tw7UC19bFU5rdLfAHxCB3QkkT9MKv3CCxOvQgG7hx1W5QUqzIb?= =?utf-8?q?GXVKaqNbPwAx9ekVxd9QvGjdh84SH06Em8he+xys9/MtyuWPVOc8HbAaLIvbXPdqI?= =?utf-8?q?684f7PDgmK1tHu4z0R4TzJYat6gj+4nG4CIjFAF3pe8C8f+5MoznbAn1cewHV4/ly?= =?utf-8?q?n3UxD2xUFIhg4FZ8vkz7ZC+4Is7tv4u7xTjpl6Omfk/kitiXavQFz8t23y5V3Z4/8?= =?utf-8?q?hW8p+BcQnwwEcHBfwVQX2hmDwHGfh61h2b2+I3INzDjw/e0TIZBDPmHIkkRysSQt3?= =?utf-8?q?KXBdz1noEbGBiptLBcgdarUhvu+QFScCiDZo3L6CNfMsHUVJI2wgox5ltaBfnvBgD?= =?utf-8?q?+wenSlSw1tDddndWS/KbukeY2lkNscNCCylzfRP9ysq140vO5xvlE9tPmwLW5MRX9?= =?utf-8?q?a6FQq5hZHX4H79KGgNbWMlw0ltviOdRegHGiNq8NG22GwTimpFmvHDq7JgQ2Zy2X/?= =?utf-8?q?5eO7Hf/lbjr0OM1HdYHYLK5UzUk2b1EmIiJcOj1i7isLXiTi0SLgIfMoMRRccOK5p?= =?utf-8?q?9iLTW4bgyQeMlEUmRKHJB38p+bYUeI1wjQie4zkRGRgOiOLcJX6ZoQEp68Pj6jter?= =?utf-8?q?pL6e0tFL7B07AoLZ/YTOvVGyX4Xl5sQSKpwAX7u+nRlyrxtLBezJz4Q1htpEkDU6f?= =?utf-8?q?ED5rAySN55qakWPgbweqGmvJ2YXcvnny5KgsUEpAEaCAtZZYEJ86hmMpC0ZYOTk+q?= =?utf-8?q?2wi+Ry5l01fBsOVdKVyIHl+0OdLAPO7QzD3Gp9RRBqWr4bgxXBtPhR+te/9/Wr33L?= =?utf-8?q?lAPxKV/42q+0AKvU/DLYNkgWJMbkDgR1JUEUgJBNVr4dlt+mg498B2njSg47IYx73?= =?utf-8?q?tqO6a9S1YdY4EF+q04gY2FoSPDnGQiKyNMyewquHzhRx4I20J8YFNZ5/RrtdURXvN?= =?utf-8?q?V/6RMJCdYxC8v0L87YNuCpaLKWGMOvQHAnvai0GJO+gMR4tMwGP4omLtmPV17AvQC?= =?utf-8?q?UVpXqwyF1Oq1JOBYsrgRyDW1HrRD/8AiQXvR/2LqOzuSbr+PiCyJGYvkp09c8YvL7?= =?utf-8?q?GgDscVz84xoohbLuEZZrUdwbJyHLTsvMNcPqMwtDM4a+SWo3zL0qOHrPruqD4fEbI?= =?utf-8?q?P36MLMK9aoDv4NKjxA4YENuxxvFl8rSCSdcj/xHxxtkdNm1/z0dFkOFSYH0Y6S93d?= =?utf-8?q?M1ym14W9KpMHxewrQPJouUo3rtThijBMisUrhLFcBGJrsrXIxGk+7iu1kdaeL0LuP?= =?utf-8?q?aBNFGGvBt2Qhp3b3f9e0MSmuNfZegIWcUO5fKxfQ3ezZRZdwq/KcnlQ7bpIG1IUM6?= =?utf-8?q?s6vWEMod9ErWKS85aE9hMYl14c6/exPstLc3a3A9zcRTLNa44dlyFdo=3D?= 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:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xtEjB2T2s7GwPMUlIQ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utf-8?q?KCoQE3xJdjF53uAVFUaTFri4LAKrh7bpfT5vwLqJHVqxdZrZCZzo/5crzO4BbBmxX?= =?utf-8?q?pCe6G3c2Ikwj9JRVtAhSfaaN1l+MRm2so9Cwuega7wleBLUuDyXgmGa5bPS0KoflX?= =?utf-8?q?DGc/Ru4Vve0ZAfyyXkxF1w0fCQq/sk9bSXKPLo400ZtbjQws6G5fHKx473RlOoC8U?= =?utf-8?q?rbY0XyYRhPKI7lW4QYOaRqAPAi2sPP3QGH1xtseEhM9O50j1v7kwky4lSZryaWTVY?= =?utf-8?q?IjKbgik9GGEoxI1o1RwlYO10UMOaWawGqAs+rwqqt6xbrbS56PvC6HLNDmwGAfdEm?= =?utf-8?q?AxxmTpDEelHDiSx8C83+6gSg4nd5l9jneKcz61L7pmr9uDgm3jUOGXf8QdRGRtjgq?= =?utf-8?q?aPqaCfWf7Yf/6Dz6/6uf5tHIWZdSIBQsoefsxGCmX0Qm6CoUAixjPUXmpHxpr+HfQ?= =?utf-8?q?LgE8Nny4LRR7ldQm2kxlyFqJf9oUkjl2EFQqrC0zaN38HiPrR6YsPUmBrdfZhSQbL?= =?utf-8?q?2hwT2pz7K9hTDkf/AszR1RwTFDs/msdWlOBwz4ecug7ZpvdsJwC3AluiwccJ7iJVJ?= =?utf-8?q?XUXgXKJr/avMMCOkuqB00BtmGoxvGtiID2D8kg9GqzWn5CEGR5Uuj2HQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa589a06-aada-41d2-a397-08dcdc01fc68 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 19:00:26.8393 (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: xg211o7gQLBjfzD0oLvSh51d9Le4VxCq4rZIir2pN+NzkxjgGdVE4e5IXesf5ikg3Ym0zETFN4YKjKE/bpGb3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9562 Add support for i.MX8Q series (i.MX8QM, i.MX8QXP, and i.MX8DXL) PCIe Endpoint (EP). On i.MX8Q platforms, the PCI bus addresses differ from the CPU addresses. The DesignWare (DWC) driver already handles this in the common code. Signed-off-by: Frank Li Reviewed-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-imx6.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index bdc2b372e6c13..1e58c24137e7f 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -70,6 +70,7 @@ enum imx_pcie_variants { IMX8MQ_EP, IMX8MM_EP, IMX8MP_EP, + IMX8Q_EP, IMX95_EP, }; @@ -1079,6 +1080,16 @@ static const struct pci_epc_features imx8m_pcie_epc_features = { .align = SZ_64K, }; +static const struct pci_epc_features imx8q_pcie_epc_features = { + .linkup_notifier = false, + .msi_capable = true, + .msix_capable = false, + .bar[BAR_1] = { .type = BAR_RESERVED, }, + .bar[BAR_3] = { .type = BAR_RESERVED, }, + .bar[BAR_5] = { .type = BAR_RESERVED, }, + .align = SZ_64K, +}; + /* * BAR# | Default BAR enable | Default BAR Type | Default BAR Size | BAR Sizing Scheme * ================================================================================================ @@ -1645,6 +1656,14 @@ static const struct imx_pcie_drvdata drvdata[] = { .epc_features = &imx8m_pcie_epc_features, .enable_ref_clk = imx8mm_pcie_enable_ref_clk, }, + [IMX8Q_EP] = { + .variant = IMX8Q_EP, + .flags = IMX_PCIE_FLAG_HAS_PHYDRV, + .mode = DW_PCIE_EP_TYPE, + .epc_features = &imx8q_pcie_epc_features, + .clk_names = imx8q_clks, + .clks_cnt = ARRAY_SIZE(imx8q_clks), + }, [IMX95_EP] = { .variant = IMX95_EP, .flags = IMX_PCIE_FLAG_HAS_SERDES | @@ -1674,6 +1693,7 @@ static const struct of_device_id imx_pcie_of_match[] = { { .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], }, { .compatible = "fsl,imx8mm-pcie-ep", .data = &drvdata[IMX8MM_EP], }, { .compatible = "fsl,imx8mp-pcie-ep", .data = &drvdata[IMX8MP_EP], }, + { .compatible = "fsl,imx8q-pcie-ep", .data = &drvdata[IMX8Q_EP], }, { .compatible = "fsl,imx95-pcie-ep", .data = &drvdata[IMX95_EP], }, {}, };