From patchwork Tue Oct 29 16:36:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13855296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7C63D3A67C for ; Tue, 29 Oct 2024 18:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: Content-Transfer-Encoding:Content-Type:Message-Id:Date:Subject:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=I7E6ctQ873OCWFw0wgYbKh8cLoRdOiMAZxFvYh0tbBQ=; b=JrzqNE7cAvgzECFLZqQgTbcBHn T2lbfnuXlR3IBRn6hW9rVGzVc9b/9bNw+LcIe8OXyc5ISdbN6lYRF2R3lIXRMO8U6vW6CQ/VIMAUb qiOP7M1lEsCtZoXt6QK1MspyXOQgvtnk64VUpdjlB5e0/X4c3kSPt0e5Di2FrTagO/+wXiXA0PBeF uwvBYVd8KPPRd7yVJYmgvh9GvkVsIbl3bU4RIttojXMLhTJ2BjVwBoR7/ZJ+pcBl8HECoGDsVxQ4M X6k8/P3e4zgDFr1+X53gMdBbF8gSkudbB9YARRDEvppYIYBA8uZYYhvAVFYCx2D8b+A78H5EBaKrR KeG8ZJog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5rEY-0000000FXQc-3D3o; Tue, 29 Oct 2024 18:46:26 +0000 Received: from mail-am6eur05on20622.outbound.protection.outlook.com ([2a01:111:f403:2612::622] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5pDE-0000000F8In-22F1 for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2024 16:37:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wAAR1b3k8qzKeouo7APZSFLZ6bGK5EJ0GRkaATAn0dEGORmkp7Rvma0tgK+FN8fD1fVioCB8M+eyKIf3rKST3e4AiHlmjw9P2+QaH+v8m4bcD1L4ip/JV29QQJaJonIoRqiUW8zHAi/jr/gn+OP1wm00BFwyO8Zf8MjCBCHIoTi7IgDAma3XYrtiAuL5pcaUly7G5N72i9lZ+wFz00ZDyrFMYZZmQ9vs8uTGX4jYvUpMJR76/L1Ea3qNLICrIbUM13bPZox9e65VklLZsJN4XPnFjYjyfOQiuIpbLzM82VJ5L94ml/9PFU/bozRbK2sbemiZvW2y9gxI/2Jt346o0w== 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=I7E6ctQ873OCWFw0wgYbKh8cLoRdOiMAZxFvYh0tbBQ=; b=GJApU2HqAWjTiOrmd2lycFRdPF88tJDf9yiPxd1+CPsVcfgJreyd0vGy+keFKd9f/GJ/pIcfj0qtoVc9GkRZgWLhZbmlzGm5u3Yllyg8Zyn/c/4yEgb58xGCAPbuqseP84hEm4Sjc8l0IAjd9KR4t9sQQiwNugrKxvH5hlE1D0zQSiLJDKsOpLqfaT4uyBWGcD5dsiuNDmpuuLpjbWrda30E7J/tSnr/k+STSpfxrejdSf77yAtKc/9LI2pz7D9liMze2tenY14j0rKmXFtD+UQjqv6K9MoKtM+V1vS96DguNRT94nGzOTiASrHwr0k/kBZOAnbrPArqCDyB/HmwyA== 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=I7E6ctQ873OCWFw0wgYbKh8cLoRdOiMAZxFvYh0tbBQ=; b=laTtBPUt1R8oX/MISDjRus4Xvt69l3Xlo31yADvaeD7NyUD37A2DgUxgjUyO0LEoObdEAj6e3pRRARNxWhrB8hCUKXleFGdKhSeuhWT5RohRiqjx+ChDOkqC0NKuJ/0tAjJLX+a2RXAfw9YEgTx+Oz8EAIjQaioEubPd1RHYqFjaRDmGzbZCJkFTelKKrHgwGUwgZ03s4JTicu18re457WZCLVFrFHzm3gU8i57SWBuEdhEVGcGpJBbpS3KXAgO3CWMBqN9UBgnuI1JzlkSWjA/RTBhMFVx4QDithYpKn/QBg2ZZyWjnfP8Uo5p/Nwt78uDNDoYMflqL4Cdd9ZiEBw== 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 DB9PR04MB8431.eurprd04.prod.outlook.com (2603:10a6:10:24e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.24; Tue, 29 Oct 2024 16:36:48 +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.8093.027; Tue, 29 Oct 2024 16:36:48 +0000 From: Frank Li Subject: [PATCH v7 0/7] PCI: dwc: opitimaze RC Host/EP pci_fixup_addr() Date: Tue, 29 Oct 2024 12:36:33 -0400 Message-Id: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@nxp.com> X-B4-Tracking: v=1; b=H4sIABEPIWcC/3XQwW6DMAwG4Fepch6TY+wk7LT3qKqKJM6awwDBh jpVvPtCDxMI7fg7+n4rfqhJxiyTejs91ChznnLflWBfTirc2u5DqhxLVghI0CBVQ8jXlO/fw7W Ncaxax8alxntfkypoGKW8PgvPl5Jvefrqx59n/6zX6b9Vs66gYhs1tY2WQOm9uw+vof9Ua9GMW 2wOGAsWYiQmLTHRHtcbXMMB1wU7ELFQM6Zg95j+sAZwB0wFIwsjgGHrwx7zBms+YC44SGQ2wTF a2GOzwXjcbNY/e/EhuhQpbQ62LMsvcY1NitsBAAA= To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li , Conor Dooley X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1730219803; l=7902; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=yZdqmrqbTLbF4+nrhojHvjEl9Y6WyPHs/n0NCAnME+M=; b=+OFkwkhACdx/He9EyjzZV7VNbZBuIot0Z0g0eR+JK3vF5RYPx9NADu9E21DVaPNdoELdh7lip AmLaeYDuiTHCreVwo1mYaELWbXyq84p5beGNJTTmyHmeazgO78GGKQ8 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY5PR13CA0035.namprd13.prod.outlook.com (2603:10b6:a03:180::48) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DB9PR04MB8431:EE_ X-MS-Office365-Filtering-Correlation-Id: bb15ec40-6b1b-4a3e-0abd-08dcf837e224 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?f6kFOvvfZ7nwtddERZ3pBgqD0JBEBZ6?= =?utf-8?q?IRlYe4d/RsBnxeTYmV/3SxtkRpaGF+snTl8rUK06+T5IbMPp0rvg9Vck491rj0KLq?= =?utf-8?q?AbmvY9QF4F+A77J1NyLKSj+BQyRW9V+KRmsTFu04s4qUQInE9ZYkss5BHhz0+TSBM?= =?utf-8?q?Plif7IePB9rK5EVpV3r/zA5DZ/w1hc1maYF6fVkBL6exxizxvZtEY66mrTkOUtXjI?= =?utf-8?q?mFxEjX6KvsLi3x1PLiNQzGk2BIX/a8UN6zpD7K13Z3ItBYtHOqIGOnJ50cDKm3+Fw?= =?utf-8?q?igKNCSCvpfudr5sgUmOyizj3oHKUlKvEcOO0ftcld6SDi1ZYy8WZ9Jm8ZZThpG5v2?= =?utf-8?q?xm4qIMbflCNc83ZSkzFupjV4Q3+k9nJ+2dj+KursK01YtLFH1Ug5Lo4sB4GRHjfv9?= =?utf-8?q?K0PZHyF/WL71gwcsnmc+IYxSVEUONFLwLBnJOmLzHMudU550Xx749EmM7CHV5/+bI?= =?utf-8?q?0NT9VmsCVltj3TStj37eevflKf6DgyGn2uvS8prxXtmDMkyGFThO+Z/oA5zO173gC?= =?utf-8?q?YB8LjAdY56XnfE4yw3NCUPUmL3IT/BSfKXOYY3Cg1PwhWDQ80BG7smS7ti0BnZeF3?= =?utf-8?q?7blQkx7dEqiigtluwzksIXSyAIQBJaJQNuLPIM0PiGJDRDU1i3m0tv3BGvOmgUFyS?= =?utf-8?q?XI2l74YMhIn9Z2CfBgNonOsqTjGif2QLyVpHFdXcvtdCS2w7/j5k5lGkVNNNaTp1f?= =?utf-8?q?f0+RDvM2xUD6RnMhHyF5E9iGd7YXN9d5xr3t0dzilht9yAM0Jk896aR/C4iRD/SPe?= =?utf-8?q?sfVz+GfjPolKoZLdJflnl/g/evYTHajzTVFMchjw/LgdbcBIC9espDDdlFuSrb8FS?= =?utf-8?q?ciWYS7a0oiGv0Ag7WyW5jq5uIvt80UOkI0YswKQ7PhCa2g2iToXRfnrhApGHDiXg/?= =?utf-8?q?PUP6weNgBkFwsA75R73U7TVos9j/NXJ82t88TJ2CTBKkDFnq93Uwe3521qae20+fx?= =?utf-8?q?FxGNiaC/W6+ge0bGd2bkA1Ce4w6y4hN3/BOCyrexVytkyL+QrADM4bTXICr3eCd3v?= =?utf-8?q?HV6PxvDFrMo7c8qNLnNuRKvpSDhJB5H1+tQ4fB9NrXhpeTUANyjrPSadVSCIL7+Xh?= =?utf-8?q?X89cRAewnK+xl223zs+ja9mJvdhX8QiBPeUfYlujsJbq+w15lbWGT0LK5rruFOMvL?= =?utf-8?q?JP8U716dhBhzQJgxdhNb9662/0fwU953sxp9FjO51i1yvJIF/B06ZySamsLWlBPYd?= =?utf-8?q?OrTtGX5wnk3Mxs4FARuQfFbRaOX5A4cM2kDzAQ1lwINlSNf2HLyRBUVlAU1hphmdt?= =?utf-8?q?g+kaRbx/JmFaUJ+2aiFWVRc0ZoP5kbS3taovsoC+mvpuc2cEjaVrX4vh4NQVT/J/1?= =?utf-8?q?Sh3ZayrDEcj/?= 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)(366016)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0cW/SUtCrrnnM5d2koQUkV4xd9BV?= =?utf-8?q?Pg6oqEZQly6N7pIEDSiz6F8XyQv9duvLEC4N/nBRYLrBTS3TMIFi7LupY5lA+rH56?= =?utf-8?q?oXkCyOJQpTRLnagRfy/YlpQqRiFcZtjMn5u3S935Jq+sDGDvT4C/EcBKkjLQ9fIor?= =?utf-8?q?jmkMQlsAxMtLHo26ZZEN4E629qp8GTqDacxkA/M+OER47rjIQX0CI8+MgdnO1UB0C?= =?utf-8?q?snYAnmBBJeGZPVGsn3cBPW22Zwa10gIOr8zXqCgMBvsOStpRai++TZ7XHbvip4YIx?= =?utf-8?q?SuhkQiyFjlV5quyZM724CcxwkCkIUT8VkqTfznukzfbl+TKz25UK+rsIJ7aza90hV?= =?utf-8?q?kdyKstiSY5ebRAsTo4H5O742phEoPxUaEUZ5aXmtJALHoNFg6xLWLsw4kjWG4MA29?= =?utf-8?q?dlbLMO/TS+Q4mJlGnjMcaGByipxrvmzqzer8L9cuhT8PPoHw3Lcj+Nt4RiWZm3hbS?= =?utf-8?q?bkntujFKmn5H7kSpmle89zBe4TK6ekcX0pZLFWgDXuaSy+/DOHsbGTq2cpMEbSoLc?= =?utf-8?q?Dzj8/WCZKKLU+EVZYNkPMS+y385ToBvGpWmMMx+E/FZhJYQMF/a55yHWP81/bErku?= =?utf-8?q?OcNWBCpb8MjXtaukWkWAn6d7w00VO0zH+FqvH0W09k4AwEcNgq/W46NlpKAmhm/3O?= =?utf-8?q?9UaLkhm3eryNPbyFNvC8gxh8rpEJQSJGxxPPhVMwjHGeJuuyhQdgk8dM364198Wlf?= =?utf-8?q?qjYVhgESpb/zP3XtOVKyGKF2yza8cxnoqYXr17Bo7qYXZSRkpxQn2OIhJ/m+m3KH/?= =?utf-8?q?qcGXkWoGniZtT47zwrmhrvVO0ttZDRTA6GNJmFgnZzZkto7LInPYdnOnn9Ux+yMD8?= =?utf-8?q?L99IGxY+mW2XUv+gwWiY9SyyazqtVri5iAjbH3Gk3hPSJUA095qEpz82rMI0XA2jN?= =?utf-8?q?rTAgXkEF0/pHPA/Xy1Vy4y2yrNmMGEPvNp54P8QnZ6uPDdc6+JnX4LhouN1nqzJej?= =?utf-8?q?UC+pe0riRhyQRRVSxvQCPYulx/VK5CDNAQmTtulDIRuJkrwD8AjJAOWkFyJbWRCto?= =?utf-8?q?LqN3yv1a0Fl6qCjmI7OmxzUkuItnrabNsaa1WD2kWVyIOGm87ZWDVaUoGXst2ZpJh?= =?utf-8?q?oXdWCn7LYrP+k1cTl8MJYNvZnHqtW3Wjlld1eZuGxngtoeK92EHBILFp77aRa0oGf?= =?utf-8?q?v/7mwFGgPrteaug5w3/Od+KgTEmSPN4Q2M0WjIDfk6h6NqiJxKLojHufw7FuELVd6?= =?utf-8?q?D3qW88KCiG2vE83sUVDgDFvjochygeLV6fAxIAAd4dNlJj2W2MFaOcPWaJtNuruQO?= =?utf-8?q?eAzZN/ED/WkWHBd4yTDa5uW+0XiYjtrEgRp54h17RQRq5UgoUzwqCG57BDG9c8uIE?= =?utf-8?q?XHN0eWVzUQqO5PaAU9vap90iu9rYh3DcmTSoqiPQMjXbJYhWrg4/o7Qe6k8J9EchQ?= =?utf-8?q?dpU7S/pnY5e085tVAvRno9Uw2RBraqUTSZA+AIsNtNpRzO+W1r05nqWErWJrNUZr3?= =?utf-8?q?n15lMcrA2kI6s2zEv5qDo0aKY3jaL88Gw6onvJmgII1S29rW6Ljjx3bcxSmY+CLkT?= =?utf-8?q?exEvSSeYMhck?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb15ec40-6b1b-4a3e-0abd-08dcf837e224 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 16:36:48.4812 (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: 0P9zYhWTBqg6Q40WMSn1INCRir4vsL0SDDBCUqp7rYGlB1/Yd+GlNRL7qHhIERbAiYtCtbe09wT/O4RzLJ0Eug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8431 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_093657_170214_18C386F3 X-CRM114-Status: UNSURE ( 6.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org == RC side: ┌─────────┐ ┌────────────┐ ┌─────┐ │ │ IA: 0x8ff8_0000 │ │ │ CPU ├───►│ ┌────►├─────────────────┐ │ PCI │ └─────┘ │ │ │ IA: 0x8ff0_0000 │ │ │ CPU Addr │ │ ┌─►├─────────────┐ │ │ Controller │ 0x7ff8_0000─┼───┘ │ │ │ │ │ │ │ │ │ │ │ │ │ PCI Addr 0x7ff0_0000─┼──────┘ │ │ └──► IOSpace ─┼────────────► │ │ │ │ │ 0 0x7000_0000─┼────────►├─────────┐ │ │ │ └─────────┘ │ └──────► CfgSpace ─┼────────────► BUS Fabric │ │ │ 0 │ │ │ └──────────► MemSpace ─┼────────────► IA: 0x8000_0000 │ │ 0x8000_0000 └────────────┘ Current dwc implimemnt, pci_fixup_addr() call back is needed when bus fabric convert cpu address before send to PCIe controller. bus@5f000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; ranges = <0x80000000 0x0 0x70000000 0x10000000>; pcie@5f010000 { compatible = "fsl,imx8q-pcie"; reg = <0x5f010000 0x10000>, <0x8ff00000 0x80000>; reg-names = "dbi", "config"; #address-cells = <3>; #size-cells = <2>; device_type = "pci"; bus-range = <0x00 0xff>; ranges = <0x81000000 0 0x00000000 0x8ff80000 0 0x00010000>, <0x82000000 0 0x80000000 0x80000000 0 0x0ff00000>; ... }; }; Device tree already can descript all address translate. Some hardware driver implement fixup function by mask some bits of cpu address. Last pci-imx6.c are little bit better by fetch memory resource's offset to do fixup. static u64 imx_pcie_cpu_addr_fixup(struct dw_pcie *pcie, u64 cpu_addr) { ... entry = resource_list_first_type(&pp->bridge->windows, IORESOURCE_MEM); return cpu_addr - entry->offset; } But it is not good by using IORESOURCE_MEM to fix up io/cfg address map although address translate is the same as IORESOURCE_MEM. This patches to fetch untranslate range information for PCIe controller (pcie@5f010000: ranges). So current config ATU without cpu_fixup_addr(). == EP side: Endpoint ┌───────────────────────────────────────────────┐ │ pcie-ep@5f010000 │ │ ┌────────────────┐│ │ │ Endpoint ││ │ │ PCIe ││ │ │ Controller ││ │ bus@5f000000 │ ││ │ ┌──────────┐ │ ││ │ │ │ Outbound Transfer ││ │┌─────┐ │ Bus ┼─────►│ ATU ──────────┬┬─────► ││ │ │ Fabric │Bus │ ││PCI Addr ││ CPU ├───►│ │Addr │ ││0xA000_0000 ││ │CPU │ │0x8000_0000 ││ │└─────┘Addr└──────────┘ │ ││ │ 0x7000_0000 └────────────────┘│ └───────────────────────────────────────────────┘ bus@5f000000 { compatible = "simple-bus"; ranges = <0x80000000 0x0 0x70000000 0x10000000>; pcie-ep@5f010000 { reg = <0x5f010000 0x00010000>, <0x80000000 0x10000000>; reg-names = "dbi", "addr_space"; ... ^^^^ }; ... }; 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. The both pave the road to eliminate ugle cpu_fixup_addr() callback function. Signed-off-by: Frank Li --- Changes in v7: - fix | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202410291546.kvgEWJv7-lkp@intel.com/ - Link to v6: https://lore.kernel.org/r/20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com Changes in v6: - merge RC and EP to one thread! - Link to v5: https://lore.kernel.org/r/20241015-pci_fixup_addr-v5-0-ced556c85270@nxp.com Changes in v5: - update address order in diagram patches. - remove confused 0x5f00_0000 range - update patch1's commit message. - Link to v4: https://lore.kernel.org/r/20241008-pci_fixup_addr-v4-0-25e5200657bc@nxp.com Changes in v4: - Improve commit message by add driver source code path. - Link to v3: https://lore.kernel.org/r/20240930-pci_fixup_addr-v3-0-80ee70352fc7@nxp.com Changes in v3: - see each patch - Link to v2: https://lore.kernel.org/r/20240926-pci_fixup_addr-v2-0-e4524541edf4@nxp.com Changes in v2: - see each patch - Link to v1: https://lore.kernel.org/r/20240924-pci_fixup_addr-v1-0-57d14a91ec4f@nxp.com --- Frank Li (7): of: address: Add parent_bus_addr to struct of_pci_range PCI: dwc: Using parent_bus_addr in of_range to eliminate cpu_addr_fixup() PCI: dwc: ep: Add bus_addr_base for outbound window PCI: imx6: Remove cpu_addr_fixup() dt-bindings: PCI: fsl,imx6q-pcie-ep: Add compatible string fsl,imx8q-pcie-ep PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext() PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support .../devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 38 ++++++++++++++- drivers/of/address.c | 2 + drivers/pci/controller/dwc/pci-imx6.c | 46 +++++++++--------- drivers/pci/controller/dwc/pcie-designware-ep.c | 21 ++++++++- drivers/pci/controller/dwc/pcie-designware-host.c | 55 +++++++++++++++++++++- drivers/pci/controller/dwc/pcie-designware.h | 9 ++++ include/linux/of_address.h | 1 + 7 files changed, 148 insertions(+), 24 deletions(-) --- base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc change-id: 20240924-pci_fixup_addr-a8568f9bbb34 Best regards, --- Frank Li