From patchwork Mon Oct 28 19:05:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13853898 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.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 BF44E1E0DBE; Mon, 28 Oct 2024 19:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730142391; cv=fail; b=ajpNreGv2LKOGm9DSstRPE74uKA4IYESsNA+X8clrumE+yiA0blA5m3YOvJFYW63aXbC6YRhqDnmQb72QSN0qEhMZzmX5F8yHbIriF956+7wUnqmh+5ABBpoqoAw01mBxN4o7lXBAbNu4acKouOgzyN3cE5KtUvbCijo4p1Nah8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730142391; c=relaxed/simple; bh=Z1ygha9+xD7FlYOYS9zQvq9PhEUCSi65GmFlWznej58=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=RDnXiDhdYDsJUBl4mBG++wH6JOvYYeRnq9Ml2XFEl+5dNaINNRC1NTGHYfDG6ZYPHFoTa22FmmzNOuG3LpYFSDqX3kop+7/J+e6rxtvsWDcNgEZJQuNa/Cc73u3j7idzZZ3Li+KHKb1MAh9xcQ+MK8X64CK9CqzrPRDLDScJqkY= 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=HUxrZEDO; arc=fail smtp.client-ip=40.107.20.66 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="HUxrZEDO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=av9e+Kc2JrWaLyEWhPZYlXWiqCa6euMp5DW0RrxwtoxYDIzGF4pooHtlvgV4E8h/Bld2rDdQAOY0pcj58U6FJx8LisFkSxViziaQnkgqHP97YX8n3X5Y1z9MvDe/jFfiC9/RYx3IZqvBx7rAC3gJ45rC5wVaYFSY0vHK42+A+a9IY9o8hJShIC+qihaCAziLkkWrmBwhIrzwbaWOXcthaWQ6tclspvvaLXl2FnW1P/QjcADE1YaqlSvoARlxChH4yWMJ3bsF0K7//sOd8eog/FqRi8jY8H+840fnYz6pJYsXa90lcj1wJRZjDpWKmI1AbOG5L1kd+/tyC18iByXE0w== 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=JQeePKxiG6VD8uGDrodNnYj3a8VmNmBfPCLUrcwxvY0=; b=TlGh6s1La7ck1FxUs+0t9xuG7eQweL3/JTD75lHfhl1nzHVQeqYUT+dZuGKHHOhg8tKQ8EXghKlDEIMFlTsoG/e+TkWljTpD5LZIcKfSwanSEeJUG+pTG4/6a/RnoMVacEMg0o32dvmwmQxX8eN35r5UWR6A1nPdsl1t+nJnoGj+o4BDFVSKjr2LAgNWgntYQxa1Kl6+7MF9IH31gZiIIFr+ens+2RQIsLxZRqKc+oLezOcxOYVrSKrVQLLdmBKxvfmoq+BXzlkLDLni55i/h3sjOPmc3mkcE0qf3X1Cjexl6tgD0Jp9Ehp72nC/wlohX2yKpXeCkxlJ3x/Al8B7XA== 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=JQeePKxiG6VD8uGDrodNnYj3a8VmNmBfPCLUrcwxvY0=; b=HUxrZEDOhFypuVm7mu2ROiFs6IU2Xlsyt6imA9EMl3RXgR9r0vYWm0Ld03zEcLhkqlxACn2gNTgGb+VsT4cTiK+nmDcIl+JQwr0a1PCQ9WPkjVo47C50F8hEHq+rMslGVTaOim+xyswYDW7dbemp7mmzNoxHi+1NsiZ5mvnC3lUCFbOAvL/k/eLH7NUX19/ENEgK+MzKEnP2ipZALr1BiCCRv4ZRO0eVCzWSXDbcWYMWecLs2tnXfvqEZmfi4p24WnjFVO5Yhkg165SygSg80Y2uFrX0fCVshk/1W0DQhP1Zcj4UquIoYR80PbT9sjCP1HR33dJECMREeXJKv32RoA== 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 DBBPR04MB7946.eurprd04.prod.outlook.com (2603:10a6:10:1ec::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 19:06: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.8093.021; Mon, 28 Oct 2024 19:06:26 +0000 From: Frank Li Date: Mon, 28 Oct 2024 15:05:58 -0400 Subject: [PATCH v6 4/7] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20241028-pci_fixup_addr-v6-4-ebebcd8fd4ff@nxp.com> References: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com> In-Reply-To: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@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=1730142363; l=2455; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Z1ygha9+xD7FlYOYS9zQvq9PhEUCSi65GmFlWznej58=; b=3yp3+KMBu8iS9BIFCUUKquHWkCCIC92YBwOFNA3a2qFhTRSk6+IqYryloMK6W1SDbP64xj0I7 6YW3oTyxAU8D7qNmJaahKNlaWRnHHnM6Za1QPBZDnv+KmuNK70AJjCb X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR03CA0005.namprd03.prod.outlook.com (2603:10b6:a02:a8::18) 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_|DBBPR04MB7946:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d445dac-04b0-4180-36e5-08dcf7839f15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xgvSVIBWwie6by+PsmWeaNQ0FclRWz4?= =?utf-8?q?/MFKIktgp2PxbB9gaoaWMsNg9NNpzxWF7ZBvFgV+GrjWciaqzJhjpd207vnj63W5X?= =?utf-8?q?f9gcFsSoRwtQLnu05mMIAInkbzlxDXBP9n+8dRYFSRz+a6h76AQdrT5Nt9+knNMec?= =?utf-8?q?9EHcoMKVSyY9ClANJExrEzSrRiOErojk9HT1zchioTS6BBa7JhHuntvfwuMgkz75h?= =?utf-8?q?dABYHdqRCoNuj9Sv6JZZL0TUT6KXzhXjnDcCUPy8RqgrXU1cbHrZbfLdda0Sq55J2?= =?utf-8?q?q2fAhG0xglPB3hLH2Ia+DJNtOWJqf9tVvkfAiXqwcYaAu+1J8F10wrziiXv/V88+F?= =?utf-8?q?L03fmr46vVnJ0okHk9Kjl/a+dTBuY/Bj8CV/8UU9N0IjZMGf73rEzhwbY9D867OWB?= =?utf-8?q?96IFdstIXxdG2VuWWoMkhpRtN0UDuh3aLRclhOuSZlUL5bzIu4CTVy3S6RUsH8fYV?= =?utf-8?q?0iaWWUvTPtQseyiEMMgrOXnWnguTfI+qmBbWfmF3Zy4do1A/imqaWk+KxCfcGTu6U?= =?utf-8?q?fCgojEzjS+9nOTayZircIwN4i1PSyI4wNSZymUEEMrQo5dUvLIYlbRHcRw9qrb9bs?= =?utf-8?q?Bn4QC2+oEVB9qnwXBrP91zvjLVR1rEeRrwrHd6aPCcDk53lugH2pHwDeuSod6c/gX?= =?utf-8?q?NaQf5++R3KPDMOfeZSxkNjhN8+7trZGO3ok5Dn5414GZhiIJJVIbYofYVer5pvBBK?= =?utf-8?q?ULsNphKO3SQ6/acDnU1G+keU/5WfJTlHmLEdbtFL+0aTAPcEn2cIO1yTaDMyueYcV?= =?utf-8?q?R/SENi4SjaQUWQFlp9qNpv9yqSvyy1TuO/jX8cNozX8Dr9MKYUka0puxX4XvY8C/K?= =?utf-8?q?YHNJIVaU3wYe/WGvEs/v152Yvnvu3CrGrWZnk1m0qjYkbFMtLwxr3i210CWs3xZRU?= =?utf-8?q?XWQJsBh3dh+BO40sRq6KaRypLWwS3IG8BeyucbTHOMQKpzpQu6eag3NPGh38hfT0n?= =?utf-8?q?ZYXksyq+P5teStBPc0RmjzBBkkpzE5cvXAKqdSXde8wKxXpi1xoBuBAEkiL3VawYM?= =?utf-8?q?U4x6NNe6njEvr/0B1QnfqY6c7EYkahTw6zsuHhbz9HSOa7qqEUH7KO2N64FQxnVtn?= =?utf-8?q?CxietWOmLsE/6I4xQ4v1DfyGQTnj6v51J6D7zDfIi9dmVw2WC0B4WmT9aTi4LYDnD?= =?utf-8?q?8Urn0gI+1z34RW3cfrxcRA2nZiZYic8HOJHnwdvfEKB5UZRmwro8nBhw5CtmCu2Wd?= =?utf-8?q?bZK6E9rm7g7qt2R+sC1034eo6wfxNLzqMvHiUlnv8Qg5vS53HHr+zJKo7ZdVPGdyN?= =?utf-8?q?2Kpbw1pXnS1lEep4GyaNuZbLiEsjrLMHLMJCniG6Q5CGxOJpBhF1uHVfVuN4L4ZwD?= =?utf-8?q?lgwS4mBUqdgt?= 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)(52116014)(366016)(7416014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qLnOlseo1Bhs/ZiCFkVQjP2IQ4t7?= =?utf-8?q?RX4/cZiUO+d8zE3zJz5cm2fgsKV/966jx1NsKbcGuO8JHfEehdHIi8JcvXj6hpnKP?= =?utf-8?q?UiPDc4IwVX+vd6dHhRtI63GI/aM+HS7uF+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fPVadXsCyzq6RYXYrJmki?= =?utf-8?q?ZHxhqhIdd0mhkee05tyfPUhD7+LO7OccL5HVKqBm/xZLS49wkpfKaC8UzzxfhfNVY?= =?utf-8?q?Ytjpvr9n4hLPCuN9iRwst73eOXothXp6Xtw94qjs79xAfJLK3ugq87eXlTgvBVTgN?= =?utf-8?q?Eeq7wYTJrx+6zN2oUc7AMXnCkJNwVa/hisXZmJGGm0omIvKa30R2fcaRW0vYlMNFO?= =?utf-8?q?qSGwzmP/cHqM4ThUKjeOt+BrbG/OmHaj4EtzKQ5zAQjM79O46wKIyDf2iOlM583qE?= =?utf-8?q?bMha5ZluNIFemTc2gmvcITV+NV6a36DJrwGNvF5bhKhCr0N/GSPgVzQh10Zme7F27?= =?utf-8?q?Q6XB+5Zn5hT6rxTvKQvmQP/nNCbuuZk5rzigOsT3xh6RHOpqRe2tL+MrN1aaWogET?= =?utf-8?q?KP2CE4EQvqzzo2XV41rrpiejfMB1zg5bvtwtYbLgYcVbDSBqdubWR9aofJE3DOQtj?= =?utf-8?q?LFcYHTp7HdgFbFTfAAsjq38v+Cfku+q3Ok3WuTwAaC/y4L4etvjmr1B77KOSnBfri?= =?utf-8?q?zgpd8+3BCG88?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d445dac-04b0-4180-36e5-08dcf7839f15 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 19:06:26.2626 (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: PFUPx1u1bdEFlK3NSpIk4+6fAbdpxzV+nlXtPgXt9FKbCi6bh8YPT5EVnI2OZgMWcDqe6HUMZO9EXfcUSZ9xSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7946 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li --- Change from v2 to v6 - 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), },