From patchwork Thu Sep 26 16:47:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13813516 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011026.outbound.protection.outlook.com [52.101.65.26]) (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 0531E15ECD5; Thu, 26 Sep 2024 16:47:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727369282; cv=fail; b=A+wAIe/Y0ZgfuEDARsT4o2ahWVvYYuLVrAfyn9OmKfGrE1qJNKltKFDJGinFi62Kt4BXYON7CAn30crXg7J0T1nq/yrVO0dweN/SF6Gni6RXXEyL6NKJhYo2eSvhr4itJy27cP9AF8A16qYJM0aF2xgNtDplPws+k6y/bqrlNSk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727369282; c=relaxed/simple; bh=4/d0yg3ZdSKNs2s1itIqRF0QpsFqrvue8dPnBf8tBgc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=X/ClUE5IT2MM7VUFKCx+r+Kfk0cSYz06ODq8uSfT3j/lDkxw+My8HlDj/OuHktk2Dg6dAI7+PmA2tlUZKc3wCQKFcKAh0baJqdagDBy54QmHdSE/RIIuufImODGZVoNovgwoxn8OkEYn5yyBsYpIDiqSD2QlyxiKbod8VFW/jkY= 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=Tl8R6/YS; arc=fail smtp.client-ip=52.101.65.26 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="Tl8R6/YS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tisRnGIQnMEjIuOaBsQ4+JC46vxaUkiB1lVQ4YD9Qgzf1KWCIWuwLO5VlgczObOsNOSDINBnc8rKHPxPws0gD7TgkVpUd01Q7kYmto60zN/QDlDL0hbOtEiHLXp7LxKcwhreBWW8Ta0hTJb/WSSWQUSdQik3/nlr+E4zJerhF/pImBVDIyBv/LsevLtzA0EIIrXls2JJ7jMOjsYdDO7hTeVgJOP/O/5W2R6hjiZOdqgR5XAOg+fpDOxqUhCYpLLs+RyBvlcv18JLj2vfNcIGsf8nHS3VUrc5WLVuU+I0v01lFZKYBajYd2On6OfucifOhSRw6kt2jPOH2jUjPzU9sQ== 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=Y3sjUEiO0k6XvVJ5cZBVFtq9FPmyCSr88/w4nn+7UwE=; b=mp1thGO84cQe6yeI7h0eZdRVkp03v+3j/LdISUCI9Lo6CHCNHOs5noREOoKLog71SJD5hK8JVYbzS/rYgsRdL6qqbmcAfBWIsrWkFiIRtkxI6NckuVyaHGXYu0fjJsnc/z5l9+Oi+2poAEOsIaNPHD8SsMxaqlJWSxWVWqb9lSfhL1ae11vX1szgx6zOXXB1+3nVCzGIQ3Yi1ee5kH2dDHxdACaJ6hD3fR5fnjDW+8hgLcXs6EC+zM5VDkbnnqRPJ5EHbaYtaRIzSgIeSESIn6Az+zH3dn+v06S0KXjwAofTgDmlcFbcsJXZsr0y2tbDXoYX0p8XCmJlC2tOn760mQ== 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=Y3sjUEiO0k6XvVJ5cZBVFtq9FPmyCSr88/w4nn+7UwE=; b=Tl8R6/YSGywfGQqBOcE8Fp5aDj6+EaO37PyJFxZn7wk2y7eCa5hEjJkzuu3UBxko84rAENnkiVO284/td18PLzqUsz333tfWrVWKwfeHLP0YeoAPHhLMS7DRrnvJD4uR1AqPMKYkklw6tsEHqSo4stzY4vAgWQYMRKsdQd52g1K3ipdKQCXv1ZCcOZ2LQFkxvpCtnkNywL5U+j78DSSu9dvZszQHKzYlKmozBC3yWYPFLxAXsX8GteC2U/9H3ObLXHV5em9ZOM+6/Xc406zwVAL21ZDWZK3DtCsViuJTxjxmwfNHLXSJi8WkaDhMxgWLq38xT4Y5UZpjXeCy4uhxJg== 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 AS8PR04MB7768.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Thu, 26 Sep 2024 16:47:52 +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; Thu, 26 Sep 2024 16:47:52 +0000 From: Frank Li Date: Thu, 26 Sep 2024 12:47:15 -0400 Subject: [PATCH v2 3/3] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20240926-pci_fixup_addr-v2-3-e4524541edf4@nxp.com> References: <20240926-pci_fixup_addr-v2-0-e4524541edf4@nxp.com> In-Reply-To: <20240926-pci_fixup_addr-v2-0-e4524541edf4@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=1727369253; l=2425; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=4/d0yg3ZdSKNs2s1itIqRF0QpsFqrvue8dPnBf8tBgc=; b=zZHDFYAhGGWKyUhoHuATdR5ysX824C1DL/YF7b+wIDIvCapIU/OuP7hI1gAbndbgQBS0rdr90 V/SaJACMKmYCkugvMdR/u5QABb252bjqTOojl5g9CgeAkBBmorFNoPx X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0091.namprd05.prod.outlook.com (2603:10b6:a03:334::6) 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_|AS8PR04MB7768:EE_ X-MS-Office365-Filtering-Correlation-Id: 68cfa33e-f0db-4847-665b-08dcde4af644 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?+w18hIaXw3jBAWN6JzFPg0h2i2xkjpa?= =?utf-8?q?/9stWKekvh9i1TBfnMdACcC4C3JURubjEAmVFsjX9ew7gMFw064b8dQPo3DNwVrw9?= =?utf-8?q?udYKcCsPmekI6igG77Y9lpebuBEUMrUJAKvLmAVkgJNaR/YdenRPw37Bc5hqWx2v2?= =?utf-8?q?iplQCtRXurz7KX3wNE4Pfb76PxPuCBnqt2h0u4y7U48Bl3phX3FHct3wpu1clp8ps?= =?utf-8?q?lKmEsK29ydK2j+XIcceGxIzR0rjMWnWs/eWhitVjpH3ymVN5dAvjIxW5WAbkUUION?= =?utf-8?q?MiO+LU7XoLcfeZFEBFE/yJaJ/anEzvkZSEPMe0KGyD6dRNj2WZIRWpon0qSgJqMl1?= =?utf-8?q?eJ6M3L7ybou1Si//8sAHxeSSyyzIrXq3Ziy2/S14u5YbRwslF2/XDfwY97Bj+hrpM?= =?utf-8?q?CExstoQGCJKFXW3zElZWaQSM81erQ06KZQqT4TOXMT7Kr4qHayy/Hg/a+QORjT1o5?= =?utf-8?q?zuGzKQQskyjgwu6+LcTobJ/m9LxUHWwwFNOs5vrrfw2nOTt6u/i1YsNNmhmFnh5AT?= =?utf-8?q?k8OcPGATtD9BXZ6vVmoNAFzUYoezestNmc+1oL32WIynxdsic/thnPSUnumhHoi5X?= =?utf-8?q?3ov5VdqfS9KNG90XwC5x3zeNTSjbltuexfKsIkg8yfSKTevSheDJv2Vcx7zQXREKn?= =?utf-8?q?7hW/Km9Zfs2a9Ukl4XTgqBpeYvNcaQKzr5zuYf8WYQEMzTB0kZDT3goGML9rH8a2v?= =?utf-8?q?Du7eUUmmQmnDE8JmMBMNFtQI7pydOrH/55F2F+zoA3t15iaQI9dNeArvPD+3X2Lek?= =?utf-8?q?34zc27zfMf3zBvtrgF7mkd0R9SHx9ijU8YVGgetbP+WyOYZfM8Wtl6Vkej63e3Grs?= =?utf-8?q?KYkNxvTfAjX4CFSOtUoQXLsflpOgxaOY07ICS4W+dvAoqwQJenHzoWizrzeheeEFq?= =?utf-8?q?e3APqojJoMWOFv6NfTzxubGvKecyGUguoCwNk8obcrzzZMiycHQ8+DcBqobHal+p1?= =?utf-8?q?Zf+58bd3nDfm7jYfG5L8EelYHA9+jN9dQEq/3rVuD/j6Ft7IJl2oTeC31ho0iOdXi?= =?utf-8?q?tVGtTWzJ3XFoKpt0Uh6LXtc6AnXHLpie/WA6qXk0wYB/cZ/8/xj+YsCY++DyDFJmE?= =?utf-8?q?DSDb3Ln0UJpDCw0LA2Mc+0sSUmrZIStttnq/mbRjKKcPerAMnmwykrGixQgHCiPLC?= =?utf-8?q?k95+lMUyIrlJbBxkM2byFmOwtmC3kOTShZJVy3xPyq1HPdD7cBArEpyljIvfWtTz3?= =?utf-8?q?GO+3wWUrmn57S9GsltFtoRhdhD6LAmMGrcgm9deMDXOiC5dexUNXzuUEzXegsJQNz?= =?utf-8?q?3qNL8GeNtud4n8+CUmxE1gvYdQKKB68HDIrhAc/fKJKihh36RpeIKEXHCGyW9sD1Y?= =?utf-8?q?xlCULfzrl86CIuNG2uI2zeXMJM6WILyI4pjPI9icxg5jP1VD0xdCgg4=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)(52116014)(7416014)(376014)(366016)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xyohMF/sTcGhWbfpLtuU8tV3LmZU?= =?utf-8?q?eiPI9uZDIw3DhhJMKeSeMKKyFRuSOrpoP5kZRI+gj+nwffQ0T3MzymlcDUDIwyeP1?= =?utf-8?q?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CYRge2CsECKmxhlVELEcrXH4ecb1XLT98g5pCqV1fHv/p?= =?utf-8?q?g0JYrXpxm3dd3rBwJpyhnOG/XkYJQpCazB0YXjIUTE+/qTCzbEq7dql7x5fxNaMcz?= =?utf-8?q?zEdLpFDCylIWTGT6Jeerq6CFhhLZ97kTcO4Nr6gaS6N/Ad8U8NLXh8bneMHqox6Ae?= =?utf-8?q?SrKjKx0cNxy2Q9HnUJMXFcM6nPeizp5Jib+E2XG9dZN7nYzQDgh8DNIPJWxewvKAr?= =?utf-8?q?AnfSTLK2BVu1ZtSvVOih+fUt/9B0/gB3z/wZM5SLr8k1jCJXg7p2W+ECx7efPI3sl?= =?utf-8?q?jup+Abwo/z/n7cCLZszgK/wF1u30M7zNO6MclJICFFh537KE6n3KsbItg+gmrqNUQ?= =?utf-8?q?gIyjThkB++/+Y4D6yfTdhEV+a3z8ythMrDxCGym/0lXb+7mmA8j+ScC2fJCstMScW?= =?utf-8?q?wcO1wgXgGWLdROApldfxLgTcJzWmVce3pEcRQC5cs93g4nPnVY63T4sNyvewLkJpx?= =?utf-8?q?pBqzHS5aj9vFw/e+n5IBCqkoOdhrMjIj6fyHvzp1J+FrWcrvGOPmARHmdmqNiAsiL?= =?utf-8?q?fyw4ZWF3iOJC?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68cfa33e-f0db-4847-665b-08dcde4af644 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2024 16:47:52.4273 (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: 1NUM92ugVr8PLu+XZZweApbySUOvqzuCCDKuYNpM3KH2dZR09ohflUTFB5+4rEFFsNk+oy60M5+EjAWU7vpiGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7768 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li --- 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 1e58c24137e7f..94f3411352bf0 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -82,7 +82,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) @@ -1015,22 +1014,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, @@ -1039,7 +1022,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) @@ -1459,6 +1441,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) @@ -1598,8 +1581,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), },