From patchwork Tue Oct 29 16:36:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13855300 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 05A3CD3A67C for ; Tue, 29 Oct 2024 18:47:06 +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: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CIjUKF1pCR2NnXoJoZT8XtU0SA8MMpxu73bnZDj5E6g=; b=erEeYEo9Da4qQxVQEfyEC63HVS C6A3Lb2NNxpp/qK/az6wSnzj8QoePTPBN67QmYI8fm+Qt1//l1YJJVSubMBECAanlu6jRNv5gFfPE OQ/o6iM7Fw7Eprcm2vsuEujCthPXdYrIUeZN2ZgnC0wqbwpeqXP3lHN4UFN/uUqSDzk4lc86KKEoj uzlR4UP8Q8xWjK97XFc6Wc/e2fUu52tHeOC7yqyBFKqumVYxrtA4E9mHxL1KSj2MdZDKh7Ly9ZH/4 VWoGhkHKs7BpEbUgGGe5UIBdBGxeETcBJoRSsQkUTM+eJ2Y+BY6CTTd6agn5+aCnSl90FKwuDUPuW wepq/YvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5rEx-0000000FXme-3MtL; Tue, 29 Oct 2024 18:46:51 +0000 Received: from mail-db8eur05on20620.outbound.protection.outlook.com ([2a01:111:f403:2614::620] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5pDS-0000000F8OH-2dNc for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2024 16:37:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LsW/o/rlbIiN99CIYiFjhAecK6heBjS5Cpsxkqc6uVRVC+sVqgm+CPVh7ubi3wucIMQaNPujJ5OvS+z/sicl9Fyr3FRR6KLdyWQx9JO0hkrNxhV3j0qieYcXhOujoAcduCMKGwtnIUXoO/mer2SELppel5PRmtVuB/qQ2fSi5705Td1WeTyHgLrzDDxXqWiYg9g7pSknm4TVLcmlTZY1cE9fpnkoGwtU8KQtEdHJeq63fY0Nz3ayQzSRyFhOY8B+JnDwQggs9f5k5BNxiUJlCMxbVpFrusvL7AdHJZOtsy8/Wx2mmpvfsSTu6l2zWhE/vuFYMLuNISDP1mRr5eJmtw== 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=CIjUKF1pCR2NnXoJoZT8XtU0SA8MMpxu73bnZDj5E6g=; b=DjbV04Tw27NNn0Jv+M3oLI4d1OqP/xxDb0G6iO7V+7g47KR0dooRNOspzmN62iQjQcBi20jSBaXEslVlPAsedTvwUGQLCWH7o0HKLTVsCBH+lnBhaxY2CdNFAUdjO2opUfg9bpmio8KqdselMZrwZCRhLP/eKp0LFfqv/epdgd10CslJ8kxRG7cwCB030V8pYv/N+LJZt5YedFQ1ZOQ6ZOXDuaaHKbkHjveiJaid4sQvFD37DRsA3/TFofGWLxYON3NOgGxdMHuEpj0B5RwZvvS4ldkoofEsPuonjkLVKdp6zQZpuiiTs+BsxMXzRw4eOJdDOQ2ijvf1B1V3jWMDFw== 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=CIjUKF1pCR2NnXoJoZT8XtU0SA8MMpxu73bnZDj5E6g=; b=Te2JhypPy3Z7re/gLb0TBIIhQh5DrKOFggl+BB6gnZ4AW2iQ7uX3QVuwh53HyCPGF3vaVn0z6gXtUhGz0yjMbXl5CU05il3W89gd9SvJ7JBZyVOPhpCb/lPFUq0LSBIAFMWh8diR4mAzVMPPCdXykkmFymEXr83KsplPnSzJiVfm2lXMof9p61nyC/JRllw04q+0IaB1ChsvW2mkXqdqNzjAfPSOaTG02jjQAkRAH8MdvVxVVGBChv0fb13Nf/h0hRXrOcZ6Pj1vwi4/jdUhJlB37qGxFQKKhnzrqEDiAuexu2zlL0ylS6ByEOzuEPuer1itxtDyupJKvkQMfOxslA== 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 DBBPR04MB7577.eurprd04.prod.outlook.com (2603:10a6:10:206::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 16:37:07 +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:37:07 +0000 From: Frank Li Date: Tue, 29 Oct 2024 12:36:37 -0400 Subject: [PATCH v7 4/7] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20241029-pci_fixup_addr-v7-4-8310dc24fb7c@nxp.com> References: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@nxp.com> In-Reply-To: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@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=1730219803; l=2455; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=QOgfKyodPSXGdn059Wbm5lzn0V1+zBWDoUWmg/pDYgY=; b=9wvE6bON6I4IaU2EIMPtWUKxcAjgPgF13XjSP41Is/Klje1XPIpcpF4IMwvSOP/eKvEdLjWjl qf7zFOo8ip0DMKi3N0DXP4rAX6Y8vfhiP9wtXPBMET2lg38tXC+fXeU 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_|DBBPR04MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e7d3cfd-5e2a-4d61-8be6-08dcf837ed57 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|52116014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?i9bRm3NPgRrmbEnpZzz2IK+XFZw9rrv?= =?utf-8?q?OnQh3dTTA15YPJoTNgEFcAaX8qoDUcqMccVq1DXz8UNsfZgpUqtk5NNnker1s+hYq?= =?utf-8?q?AQvU8lbDJWIkGRfBtN6xGd2l3PaHND+Xf1OoFzTAI1MsfnSji5zfok2xGavDG0+a7?= =?utf-8?q?VnjP1vDapRPucxC2lYPSoN4nInU9ld/NN/oKS6MTTQBClbGrNDb8W3nnqF5cW8MMH?= =?utf-8?q?jmw3T0NAtvG2fwJjipuOu3GzjWY0SK9fV75ETAB1xi9NJBomg3I4nrkD4ysW2qhxi?= =?utf-8?q?rR/ZKgOA34hL1zKm4yBQ+Oznja9Z53NpUZ3MwhKiYTCBbc+kielXzLpSKxFH+nuzP?= =?utf-8?q?iEu9VrIhwC7unW48EspH3imaX0+iE5CmM+V0P6wml/hbDSqnyadLswsbnQHsP5whm?= =?utf-8?q?YHtluqzv1cu0BSV6H+Ta6YQ9p09SX25qvCC9AoqyDIKLzSdecgF6wzFvrqRfw680S?= =?utf-8?q?F1xLzDgzRO6DcPiOCOy596UzCtq5CT9FwgBwV5oxV8ZtuvbMzgXeH8zZUtN5xd3gL?= =?utf-8?q?Cb7yfbaGGzs2PZcI3fsvv+J17vZbqpoF4WhSTvlzP5pPYUZ8NyltLv0MEPDisXJYC?= =?utf-8?q?xqgTZf+GS+p5Vx9QpDXh0+U0OLw5Z8gqpw4/iM9uhiNVcPb/IbGX+kV8/IMapqrtk?= =?utf-8?q?4GvmJBW1UynNlsWCLGLn7MQgWgYF/g8X0EBRh4yzel7sNEe7g78+EAhQJbhMiIf7I?= =?utf-8?q?JbOO8ZMKSqNMQGZNDyqhRIi/YVSbRNjZggRUh7IscVMfwWAwDk3uCjry2e5/zo+qe?= =?utf-8?q?UnYc51WaQX0qUHyI0kDI3kVeBeIisejqdTKZz/weZvr2HSo+oy+s8Sjv88BZGsC/s?= =?utf-8?q?uFGw5g9pjsLguQNDbpUzPLjN4epn/pR9IIVgVGvtv0yrHSZyBIPPpixVNTKDKIMKh?= =?utf-8?q?+HBOgV/iZugdB2O56IdX8p1btyyvxDKeCovUMBRaTlA8XqbEZjzj4x09a8YsvFZvg?= =?utf-8?q?ageEwgVUf9zVcyN1PrigtdGO2jslJH/IF6DIhr38dK+hAOX8tW8fd6XImIBomegdm?= =?utf-8?q?/aYP9Q7hIrmAv4FhKa4PlYl8T2g1BWh1uyFJv99ENZs7l3YC1cPrzF+IqouYHF5Ho?= =?utf-8?q?qpH2Qcdeo3kRm8iOEMBIH4HnLUHY/h72z++iX07bOWY3sQ2tpdMem/2AdI5rgzpJe?= =?utf-8?q?cdzR7CcHmhN1eC8+7ZQ7oa1QxE+ajx+mGjNJRssozGuPjv+jenLZVdyq8PrrItEUv?= =?utf-8?q?PQOLDnS1+Gv0qQmoW+mVYNN04VeCZkjtaA7BuVuF5ZJCp+5ttJ0udNTNd+kF1ww+J?= =?utf-8?q?9COzHFX4jLuuF/5EBDiDT6yo/THvBNuvQ7ujlNP4HWqZ4KsZwF6eQQZcYm1vvXWyN?= =?utf-8?q?Hx2qNF72MzgN?= 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)(1800799024)(366016)(7416014)(52116014)(376014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jvFbpmdlgajDnBiUVDWH3YfCc16g?= =?utf-8?q?VZsLPQ8GLYUYQxGui9mwctRh/mJPeK68ApeajWQ1QtwjOWHF0AwoY6/Rh1NIZa1bd?= =?utf-8?q?q0xzMUTy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O6KrRh+8CjzQgZT9H7gGB2NBmI4su84rxG49jYLsjDJ0gA+j49E?= =?utf-8?q?cmtjTZ9+CIJSpsqVGMZCdyR4mrz4VbS7ygjppJb3DdrvyRIlLTTikW6WkKpmth3Mq?= =?utf-8?q?hix6dWUdsFG78llKFkKCVGvLyGWaQi3UhqO52TRRvwMnEXZnvpNTQXg1CkwUA+3xP?= =?utf-8?q?OnGKTB0071jfjiv7DxnSLsfVdxRf9INc9BZ8puCci9lFGDSTX49Lc60ISDpFv2gJ+?= =?utf-8?q?ycV6kSJYMLfyJZw8DnjORIBHexUHniEn8nUfWbG1z7RI0jbN72/719pt/LRfDW4ny?= =?utf-8?q?d5RN940idset7QRPaXM3pk4r8Tclfp0UwRd7DEouzYvHpHGDiPYUr0Qg6bQbpQ9Lo?= =?utf-8?q?24eGZZkpY/YJnymysYwzr2EGCdXBU6Kupc3eZnaG/jySKX3rJ4laAL/ie8d7JYj72?= =?utf-8?q?IfXoykVqefvBC0LDk00ZvKVU0fGeW1LYdU4nFgK46WJqn6Oc3W71lreQ6S43XZPdk?= =?utf-8?q?LwK7HP8NEBB8YK7GZw29AvbIqTOrUAiJPlYsSWUssjDS4hZym23FrAY2u5N9lvuZb?= =?utf-8?q?OTZZ94k7gTPI?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e7d3cfd-5e2a-4d61-8be6-08dcf837ed57 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:37:07.2078 (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: qrYj5NA5uinB3/4fvDB1Rq3BogkWoXiBukYQ+G22MBnvEZLkmG4913KqEpHUIUW2fNvlfhxI4gbCe4jn85uymQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7577 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_093710_706715_292D5591 X-CRM114-Status: GOOD ( 14.51 ) 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 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li Acked-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam --- Change from v2 to v7 - 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), },