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: 13880497 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 B3C44D6C287 for ; Tue, 19 Nov 2024 19:49:42 +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=5MDrE0QkVGaSwDsZhJXehBvAhAGHitWF51NhOtmt0vo=; b=qkCas2nUmSoiqBJj/juNFbFJxc Kq5VMTDZY67kgmtjO6e7KjZGXunj7t0U1O/KFvaMtRO19a1l3LEAYR/w3lQjKwpPbLeHdqLIrtlgk 08hOhfhONyI6x+fDuie1JxP0Zwoz8VXcFgAMhPDII4oUCsJJOS4lEVvAUVYjvBraWPYwEBPeegkd9 Ha+tppcFD6/mHW8qNtoSh0F4ZukW4U7LiEBL+2R5abxarzqcdo616pMYL61jyrXxWvEzMuoecLScq nXyd1tBoCUjQzZVPIuqG0SLXsQ53I0ZLpvqbSJujvnRpaAXmBo+TrOYaH/9bEIsn7W4Le3W2sd/dk pGbPscqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDUE6-0000000Daa4-1JSR; Tue, 19 Nov 2024 19:49:30 +0000 Received: from mail-am6eur05on20604.outbound.protection.outlook.com ([2a01:111:f403:2612::604] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDU9i-0000000DZUQ-2LnU for linux-arm-kernel@lists.infradead.org; Tue, 19 Nov 2024 19:44:59 +0000 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) 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/I29VgFiLSXGN24HLSYOIUkOnzHhCs8a62R1QQ3zsF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?SQF5EqkqgU2FUF1vnvsnHeNQ9w7Gf/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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_114458_605361_3137B454 X-CRM114-Status: GOOD ( 15.31 ) 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. 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), },