From patchwork Tue Oct 15 19:17:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13836995 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2058.outbound.protection.outlook.com [40.107.105.58]) (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 10B9D1B6CE1; Tue, 15 Oct 2024 19:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019879; cv=fail; b=o9xuspSOB/VKwz0WAxYO7uyBabrPJi0w+7ldpR6CR4s7LxHdjvqOFgm9EyF7+3JeUOPMr0Ygwp/9bh4XpxXv9H6BbEwQYNT6PpIehyl1p3ceq5iJgwdWvzocxYRAkoq9xMVRnVGwiHEcRw7Gi7jrMhM+DCHQ4IkNe6gRCch/D1g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019879; c=relaxed/simple; bh=Xur3w88Prm2U9ti80meGJLxIu6InmfTZAzjgILmrVU0=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=RYp1LTQ2ARjOhQUgWCgkvJhtNbzWdYb4irhVZI8g01PMCwr/kPNanqeDGMGeKrGm9O4ouRCPHxS6XwowbeZfxhJp6L/MMpM/d6t8Y63RSqEQUGOZd0sMuO7qHFDej7ShQ0qnqsxMJXGaXaFvUQbhQpjJRLUTitMXqytB2FJ01f0= 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=Ig9KZhvo; arc=fail smtp.client-ip=40.107.105.58 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="Ig9KZhvo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PjKX9s4C8O+HNEZVFwkQz/zBdXvgt/lmg0b+rWZ+gvgubkNFw4BcvB+Y0h0B72rJSPBG4wCOFNAedvvVj3CZF7C5b7Qo0D3HJ/oQDBN7ffeW7gAYFWaXJvLSBsDTZiJFgDreXUJDUNFc4vWrKrdINpiIB1VYC0SLwEQJBfhYzyLAHpv+66qiRXeP7NJjOshrHQNKecwCBa1DJZnrpvHvtd6XLNWXBkW4gdeKeyAPDdBSwinMrKict7BjVD6vGLf5AD889RESxfTWKKSgm25SPkCOxKeA+bbEJ+jgVdSmMMeekJW1r+LrlsX1q5cc1YgyMq5dnRYh3TVEkeYUodnSTw== 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=kFdkiX44EjkJj3LAqVwNHMJG8BXqkLT7bhkwcmGyI8Y=; b=Tjsz/dFsnwJ6eqZisRBYthZLvWzz9PphxCzlap/ISEM6oMroMgikkS69nWWuTmHKa0irkoZCIhG3OUSd0OXRt/HlotBprRhRXbXF8I7nLLMunauXgraSTSJoyiFlme7QKHoKltS+7xOeEfG1LP6QjfKscYpXEsoeRRa783WCSzPREkHiojMt344Fsdhz5Q3DDqhgCVGkbMMWg9JZiqQqBG4QzJq09jKLXbl1UXAL5GwTYER3JtqOp7xB+mmqx41E2zTW8soe8Baj6FdAInZ/AH7A98UaNmo6GO7F52FUnZ+l3g2lnxrAbJG/L37VzasNVMmw1vJHJeyAHxvI+pXdRQ== 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=kFdkiX44EjkJj3LAqVwNHMJG8BXqkLT7bhkwcmGyI8Y=; b=Ig9KZhvoxxBtKwaq9W6Dpl2i3KHO+TmXIVq0gKGEiG5iw+LXqO1yl0fOj8MYsqEsW9UI4VciRGnVR5UZUHl+ZQskiw0oqe+hqSj4DGYZPy7P1su4+Tw02Rw/6lupquhIqMAEJ0ljYHJcHmi+Z5wQWPN/94RWPRnq65LQLvRUs3APdpRL2zMETojAHdTqYvURd5mCVjE2i5g1Nywv6/g0yRUsxxEZNdPIK9Z1onWUjShZ6luYj75oiAhQQ4K9mJldjLB7BXo9t5dy2KvCgE4Tf8afg+5BIxk32uI2q04weMm9r47mz1YE3IsE6fIdFRM0idnaaEd32QWoLb/CP3cLkg== 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 AM9PR04MB8826.eurprd04.prod.outlook.com (2603:10a6:20b:409::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Tue, 15 Oct 2024 19:17:54 +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.8069.016; Tue, 15 Oct 2024 19:17:54 +0000 From: Frank Li Date: Tue, 15 Oct 2024 15:17:19 -0400 Subject: [PATCH v5 3/3] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20241015-pci_fixup_addr-v5-3-ced556c85270@nxp.com> References: <20241015-pci_fixup_addr-v5-0-ced556c85270@nxp.com> In-Reply-To: <20241015-pci_fixup_addr-v5-0-ced556c85270@nxp.com> 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 X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1729019855; l=2455; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Xur3w88Prm2U9ti80meGJLxIu6InmfTZAzjgILmrVU0=; b=CfiwpnLOP6TFyvQ9YuQRyjLyR4VWCIAxMb01L2DT4ROCDyrMXEuNW+7QF1uF9bn8Yoc5jn3/o McSsd5Uo+9mAC590Kk5w+kk6T1xmuiHJ+h7yGdod53WsPHxri9YwBXv X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0117.namprd05.prod.outlook.com (2603:10b6:a03:334::32) 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_|AM9PR04MB8826:EE_ X-MS-Office365-Filtering-Correlation-Id: 5232c217-a128-4570-3cee-08dced4e11aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?9nUDTJI526gKveFuN3d1ocBGJJ77apv?= =?utf-8?q?IWuEnwK7zrSmxGrWzSXkfYsoqQhwwqbPboh7R0Tk3Ay/VnVqWrX8ixIv8hxynatKc?= =?utf-8?q?hjVkFqbGpBavIOLhMrbajXx70y3Mb4bnFEqFFyOXr3XiJ2ztcy2rL+ePiu3yTKRm0?= =?utf-8?q?PYiNAWWvpjOj3sU8lg5AXuFgI8YeQEyRqTq7r1TiultKOQFIg4eG0EpJgca07dsXu?= =?utf-8?q?zZ2vcGpfZTgSfuZMzFeRDJkayTkz6+Tx7Ft5EzdvuSwnXpmw3SrNMCbkDSDozyll1?= =?utf-8?q?84yjsqNRJsq7r7KWLVgP+vXBKfdYDtI9VDy8B/mW+21NXmqpIcMDTvMyml5AgJQhA?= =?utf-8?q?tc3DnooUGnRwumhCX9bs3gaw7VZaC6dg2ZirVaOxEyyZCjHN8HPCIAi7W6cH0z+Tf?= =?utf-8?q?LsYCfop+xuVW/t9qVJSnemyRzqK3+QDkiAdBAADyss9q/+KzeGZ4zw6Z2nLqGYYxG?= =?utf-8?q?TObAJARY5CyXaZbj225qQxRY3JPCLZiHv5fnNiliahKaM8YvVT12c9b0IHT9jnyqM?= =?utf-8?q?/Cam+b3LOPVEDq1X7rG6+vC9vABjrfIEd/khAQbi4gh79mf9vz8euG6Lu4YQs1q89?= =?utf-8?q?lEos7tcCbYXkkZJJHTk0ydsYP20+bEfjsP/hBo2fgXusAdYHVvs33berjThbNb1iQ?= =?utf-8?q?4CupM1MDHC77xkhWedvWOL7NLo/yJhdvWVduTzNP61myiYCtruKRmRFeMxWsHvffT?= =?utf-8?q?2+PzNNmXwi113ROwr9ekgS22mwNW8MPEi4SqRVzP1cduc1uyxcVNK0xJ63aD0ljR3?= =?utf-8?q?2p5M9Az2nIoKFFsFZh7BHon/b3VywD2g/9x1hB3ZwL3JDZn3BGx+hDofaxl48BU5u?= =?utf-8?q?8Zx3lKTORHsQcyD6przHTijbaaee0zLxURx8YUeBJGLmxy9563KWbkg4/0U0oKB2f?= =?utf-8?q?LO7rsVwMhXiwg911CHwtw4n8vfFxmDM5k10a9ijKuOhRjACvdAcL4vcUTjzwG4bId?= =?utf-8?q?pwrnja99YI5yyyZ7aPFx8YlD0u2hX/Bz3/AuMw6l0wCGQGm0utAhDEkfhnSRbkH01?= =?utf-8?q?Y8Olv6mZKHxIYr3x4/YlxsAX2OWogtgo4+eTXgaw3BsS7AxwOYpBgCSGJDCe7f77F?= =?utf-8?q?c5W/t+AltH0vc/a34ZQj/70d3qA+HaRZ/Rmc792EyafkOwJl0DDg53fBQm2aara4F?= =?utf-8?q?M1PkD9/5OP+Kmu3V/v0WNrgv3KWaAeYwmJRGIAYSFSl8l7LmpxWej74MlncoIRlrn?= =?utf-8?q?SQ+aBVriZcQmch0ymg2+swY6P0U0OAaP5qpj6Q5Xy87d5+9aTs7h8FqZRZGUYsXz5?= =?utf-8?q?1T0k7BH7I7LSD9nkPoeyX7c5eFa+DZ1M7X7C2STt6slcpLOKG65fKRQ0=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)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?eA+RIcCihjiLxeaTJoeNn/JBIV1G?= =?utf-8?q?p7IM2F2h26muTTR9UZBZeW43UIBp6Px09xxyQNAsV4ac665jVapyDpHAv47rDtLqo?= =?utf-8?q?0HHeNpjHUEvEHN1Zgqkm7uE7gkAcvaNrgKXAgOyFWB0Tm2YxnuzUFtQLgvjF4AZxR?= =?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?Ai8ttt1VA/qVNPZplhrhEYO5G0J6jxLccKWYCq3ry2u7N+s9jxSV1tAnk8KiK8xrP?= =?utf-8?q?sPS5sAY9P3mraBSFjEwqT4r7rZ+vy01gf+Zw9dnFCw7rgRM8l7PAsXFQg5ZM2ShNm?= =?utf-8?q?P86BiwyFTa357K7CdAOkf364lVn7yIE9HDLqWe2eqlUAIQGFr8gr73UOskRIWoJeT?= =?utf-8?q?+4DnbQ7wt8IqrVVOOs98RV/PYTZ1uVAd7rBRVGpDa0w720E51b4JVrVKsBD7kmRaP?= =?utf-8?q?u94BuJ8pVk4WK/WT0cZOT/P2fgkEJKVQz8l3XdboiopC8ggbZBKB9Z9Qo/VjJWlmp?= =?utf-8?q?2thYjGiGWwJQ1L4IxAol20jla0Ap0Gz35rDcWx6MnF58VOsJHL5Vh4eTBTNS11+CF?= =?utf-8?q?VZc+ggxegVh6hd3bJJN+QuEZv63uKuO7WrYEzLtfwvzwlSVCNVhON6oONAxL7H5xm?= =?utf-8?q?xDzrMlWsxcB1GhdXBN5YBYgBBhUOrIPVMbuMLksmHgn3bLYTwsAsMs3Y=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5232c217-a128-4570-3cee-08dced4e11aa X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 19:17:54.0391 (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: LwDgHXVUwOZ8uwmSt3jy8jYtO8nSQVFA4wzLJa7wepfIW2708qFbtqR5ICUT5v65zVkaAZ9Z05GUVJYxqqO2uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8826 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li --- Change from v2 to v5 - none Change from v1 to v2 - set using_dtbus_info true --- drivers/pci/controller/dwc/pci-imx6.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 808d1f1054173..533905b3942a1 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -81,7 +81,6 @@ enum imx_pcie_variants { #define IMX_PCIE_FLAG_HAS_PHY_RESET BIT(5) #define IMX_PCIE_FLAG_HAS_SERDES BIT(6) #define IMX_PCIE_FLAG_SUPPORT_64BIT BIT(7) -#define IMX_PCIE_FLAG_CPU_ADDR_FIXUP BIT(8) #define imx_check_flag(pci, val) (pci->drvdata->flags & val) @@ -1012,22 +1011,6 @@ static void imx_pcie_host_exit(struct dw_pcie_rp *pp) regulator_disable(imx_pcie->vpcie); } -static u64 imx_pcie_cpu_addr_fixup(struct dw_pcie *pcie, u64 cpu_addr) -{ - struct imx_pcie *imx_pcie = to_imx_pcie(pcie); - struct dw_pcie_rp *pp = &pcie->pp; - struct resource_entry *entry; - - if (!(imx_pcie->drvdata->flags & IMX_PCIE_FLAG_CPU_ADDR_FIXUP)) - return cpu_addr; - - entry = resource_list_first_type(&pp->bridge->windows, IORESOURCE_MEM); - if (!entry) - return cpu_addr; - - return cpu_addr - entry->offset; -} - static const struct dw_pcie_host_ops imx_pcie_host_ops = { .init = imx_pcie_host_init, .deinit = imx_pcie_host_exit, @@ -1036,7 +1019,6 @@ static const struct dw_pcie_host_ops imx_pcie_host_ops = { static const struct dw_pcie_ops dw_pcie_ops = { .start_link = imx_pcie_start_link, .stop_link = imx_pcie_stop_link, - .cpu_addr_fixup = imx_pcie_cpu_addr_fixup, }; static void imx_pcie_ep_init(struct dw_pcie_ep *ep) @@ -1446,6 +1428,7 @@ static int imx_pcie_probe(struct platform_device *pdev) if (ret) return ret; + pci->using_dtbus_info = true; if (imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE) { ret = imx_add_pcie_ep(imx_pcie, pdev); if (ret < 0) @@ -1585,8 +1568,7 @@ static const struct imx_pcie_drvdata drvdata[] = { }, [IMX8Q] = { .variant = IMX8Q, - .flags = IMX_PCIE_FLAG_HAS_PHYDRV | - IMX_PCIE_FLAG_CPU_ADDR_FIXUP, + .flags = IMX_PCIE_FLAG_HAS_PHYDRV, .clk_names = imx8q_clks, .clks_cnt = ARRAY_SIZE(imx8q_clks), },