From patchwork Tue Nov 19 19:44:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13880489 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2057.outbound.protection.outlook.com [40.107.22.57]) (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 EA2201D4171 for ; Tue, 19 Nov 2024 19:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045500; cv=fail; b=UBSJhkbbeoq1nUIacQsr1+5uXSlDDXii5FDJdlBBPs53odaMWIdsiGzGIG84u5ZkJz6u4lLVW0M6Hl++uuOs+7WHLfIJW5TZsgJvT/xoXc2g23/UiOXHjLkObMmeFXTaia6fllbCqLUtlW4xOHEZPAEZy/jRVPGRzHOT6Fi+JIM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045500; c=relaxed/simple; bh=I0aB8s9mgt7c/wPNl4Q9fV9Vkbql7lyhVemIzXKa6vk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=JQEF1QYI9cRqFfDH/spuHfboq7egfu5wbnvtVbVRv20yWJflvTzJm8TiBjqiSthd/nuDuflDwcogNcRxixPAv9VGDEFKS32hlRAjBhD3OOc7QWsApT6fqZrZZls33cA1vtiiFKylKKKvHN9JRxaqo8Kbb2FMfhYvlrdXEAcXm/s= 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=CYXh/0no; arc=fail smtp.client-ip=40.107.22.57 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="CYXh/0no" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yqNPfHA2sfXqtikoV1IoTrufKV92+7vw5jN3ER4N5WWsu/2s87KOuoriVeWxULP9b0w2YcgX6j+stfOqCsGqov5h2rTvhxraVpNcOMIlpT5ked3DycBsyZbjIo1KwV8ztGXOgG/l4IAnWvnJnm2JHqDF83n8v35iYUNoC65v8aOCILsAghZqhqzIlc6utXt2yvB/MmqQLget9MwIapW3yA+X/bzH0fGyuK74hRXUUhyRFTXEH4+bHh/jLa8dZaUIMVeWDpJvVGjm7aCcNFISUHmh31O3qb7Vep6czBX1/G4t5cZyIMCIixjinGJPTBO8kKWKjJCBjE0Q73f9yQHgfA== 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=5MDrE0QkVGaSwDsZhJXehBvAhAGHitWF51NhOtmt0vo=; b=otFdApvdLt9UTSHrmZfyNknEveFMuEALSy7YMN4c2mWy6lf6wHNh79GOLwgC9xycgtp770Kaoh65bT7Wn1tQ6QSP4iAFBq2GguEEGVSpKRiQBi5T5t7KmJyg2WyhJSWJo5PjIZXHNj8SNFBLVbDpS/ux+Fn6yyyrsna0nABUaG8d9Q2vm7SuCCET/C+x77uAfdiUSVj9t5qeLUWizKrGDXciwQ0DgeR8fcUL6zbq/pZPqmqMu9+hEjh2/HudzozzvZ0qQuoD0uw6KuoYqBauWn97GucQ4cVwz0Oya4V01szVJnWq/LPyg4msOJXSkCLkTCUktXHeRtXtpzHG72JoCw== 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=5MDrE0QkVGaSwDsZhJXehBvAhAGHitWF51NhOtmt0vo=; b=CYXh/0noeP6atpqILw20anNKjQVxkadudOmfMRT+cyyyyIgDAGwAA2ihbjE4pKwGaFBHuFQPJ62wQffJGTxWOWxmZ5QefRfbm/9MwUd+oqcMnmwg8RNm4jBdb4u8DxvzVilb0zz6+jiMvzGEHSaxAn7ue3qAj8BR1m973j7heODhcT/MhasosEODOSdCs9kIAsEdNHtt1BqlXLd57vWM7bbSxt2OruqECRgcD7qhZfj1ZCrz8rKcBO+GRUaWeorAnxYooGlPopVJfCRsmaerBBdwpTYyoSjpy17fVjagoPau/qOzNNtQORA4LeRhHkwPmmiIIeX6ziyHNXbuI8MRTw== 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 GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:44:55 +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.8158.021; Tue, 19 Nov 2024 19:44:55 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:22 -0500 Subject: [PATCH v8 4/7] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20241119-pci_fixup_addr-v8-4-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@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=1732045469; l=2679; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=I0aB8s9mgt7c/wPNl4Q9fV9Vkbql7lyhVemIzXKa6vk=; b=MATppPIs138QqC88p86N6l8VmPqKeOgbQxRpSnrquzgj6hwnWbc9VRRhTp6OLF4zpVzKW09Zq Yqe7zLnVjGwDjc9hjEsxIFWWIczSNm4brHolgj3ND93qUR2SBO6sH7V X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: cc96936f-c6ec-446b-4bf7-08dd08d2a441 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?El/AQPmzLLVOE2BudYQDUCqhcdQCnmv?= =?utf-8?q?eZwOp4ZctOWzCmQTQF0IHK/tdPHSP9PgMVXjD11Njr+7ho0DoY0VKifCqkCyXk97Y?= =?utf-8?q?NH9IYpQ53PecABKUSqQXS4YP7rsE0FvLVbTaE1Cqt88wdXGiZIo9UgulV3lt1gLrO?= =?utf-8?q?i7rQDGawXAD5wQYUY117Bfvk0W5G0DQGnydrcE+Y5oTZN7/FK3kKgbJAssH1HL2nG?= =?utf-8?q?6S+RuBQQNkZL/ZnFwxD4q6nN6X3xxBaCqcWuTwF5GAlEypOCuCTRErMZybsUKaUrT?= =?utf-8?q?aELarcxLSBIjwlhH/dhW54AvtrXIoVEXXwkDPM74AA6zDN7jIw3AubYd4QK8bDxNu?= =?utf-8?q?gGhsh18NcEfM5DSG7FXNZ4pBjhfv7VzIJrUMQP7SpfUZwjrvjnxXNXImqrk6+V3i8?= =?utf-8?q?YhPAvnSmHAmQeUuXmm/61M+N76EFCz4Fgw17Hu0I7Bb8wdIJEncyi4CHtH2MTV+EI?= =?utf-8?q?LSFnZVLmyMwj+5gczdttDQCvHkzKfwSYR+Hhf4zFcKxXuV4KKw5JH8rMVF5eX+cFB?= =?utf-8?q?c1KwYRz4UX1x4c0LY35DeqkYKVTp7SLmrbBOt+j9+KQsP4Nsi/LHD6tsZaVFqrJ7h?= =?utf-8?q?rI+K4mYTOFJZnG0rNNzlu5nTkqILpxSl1laS3Nj8vUaaHmA5fcT6MqMN9BagJ3anX?= =?utf-8?q?3Vz8AQWRSwczDnToCr6A9WSqBPo7d5lriysPIxrvooD7xLn4NWmd19pPBm2eODmI4?= =?utf-8?q?4nETNs66ePg+ITXOPJ/pAZaviqKVtvNukUxbpZO6GbC+Pb3R2Lhr2oXYlu0iKveOW?= =?utf-8?q?u120C5IK/SYBWQ3KYXLcApH5ETrY3pSzkWEPvGpSenHbTYC3rlHD6RD2yjF8t9qcC?= =?utf-8?q?ft8MUnYCQeVdTcRyY0+CWI/626qxOd4IFFtAMww1l0jiFdARoTiIqAWFJe6sv0B0y?= =?utf-8?q?sHJC1pzaVdiVIwyhRkMFJ/Vq0DVMmhRWFT9nEW2DgeUY7h6UNoZ+cWEXqlCsddvmM?= =?utf-8?q?UA20xmcOewTba3RAMibHnqAEkr+/LC5Wm0JXvriR6aZq8aSGwt7v2IUvqe6/a5YuP?= =?utf-8?q?/4obAcuzBL+aCoWKa73MPXAawzu1BNHYuAY41WYZnI0SVNhrgICT3GxqS05RsA1kG?= =?utf-8?q?QbrCkMD2UVpd+VUEBFkhCMvA2D4UbfntQEJWXFQ1zFPMe/kOVmv5uYRWpmFZ3dtCa?= =?utf-8?q?jhxPM9yPv5whOr2rPVIwGwoFi/obBImU35UDlOWwWHG+XmhPtOV+P+VbmszUs25IZ?= =?utf-8?q?J7oSVWo33zZF1Pogal97ot/ei4OcjIPxrE4hTar9SfbjdH5MHJ5e0JAhOs3HgFs1O?= =?utf-8?q?6fxPDrxyFjhiDs4nI2RUTj6W/EWjXJDpA5hqHVHFZmZENe1cfegndRW4hNiChNHCm?= =?utf-8?q?buEC0op+FN2C?= 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)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?iWB6HVVFHIAIcpeNbt4rNYRlPatQ?= =?utf-8?q?3dNC4Kg+/doLKsh3fss5RJ5ho1q9CsjwTC1zf5FMVv3XFcys+W+TO3Fzz12yS+muO?= =?utf-8?q?HNaSj2F+IUw/I29VgFiLSXGN24HLSYOIUkOnzHhCs8a62R1QQ3zsFQSCfv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EqkqgU2FUF1vnvsnHeNQ9w7Gf/pjJeQkB+BFFm1jv5z9QOTDMN2WZJJfAmt2Q?= =?utf-8?q?7whR7SLUikcRK0en8Ex8dHB87SBzQhdOgGWPi/4ac2MpKwLdbPFrlE8ao0gBaI+eR?= =?utf-8?q?CsqATzmiC2rguP1JZxEAzQQj/oj5vpmtYZxzhfK3xY4lZdSPaKiyXa1CgPhEcfSCF?= =?utf-8?q?Yvtr0s5pUHckyq8PIYrYAqO8FgOtzr6kdmShxeOnEmtnCO/WOCNb34bDNqqYLO97s?= =?utf-8?q?dlyZcvrTnUVYun+GyCQaF5R+cdTT/K3DjsGh3OccmLwxIYPvrXxvGotU+/mB0v4Bt?= =?utf-8?q?b8uMJ3271lxFLkpO0WGSK9Rnh3XX3zyJM8iRUoEzq+E0j09jJ3sAm5USpQwF4dWzS?= =?utf-8?q?+8dTF1SuUI/h0CL3jbJ2mD/JjWOm8yyUcram/fwnNRCuuqPhG9aDS5XH2DPZjlCM5?= =?utf-8?q?RqmuOD+Dn/o88+QPn4ucqRsnWIr2cIPOOCuxcoac77LP0vuGAfbZ8YXY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc96936f-c6ec-446b-4bf7-08dd08d2a441 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:44:54.9924 (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: URTiZVC12JfT8kPndQFN71YIC24KE1jRBWlYIn7JmtNLeZA2gB0h1kaXQEQeodQ8feeaLkCHL2aiUXKaSS2Y3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Acked-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Change from v7 to v8 - add mani and richard's review/ack tag - use varible 'use_parent_dt_ranges' 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..cf033e672dbde 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->use_parent_dt_ranges = 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), },