From patchwork Mon Sep 30 18:44:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13816861 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011047.outbound.protection.outlook.com [52.101.65.47]) (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 64089199FAB; Mon, 30 Sep 2024 18:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727721934; cv=fail; b=Fx2hpSzT9pyhDUbM01RI4SYAO5hxuwidHwexg921GTl0pJERzdddCiDiuHj4QkN520QAx5+0v1WadAAStpWJHZ9EezgvPpwB681J3RozI0dpO/XD843+ybK2VCURz0w4rNqxlSOfATbC6M8WsAprymp4llNCwH+kkdgAmZfP1yU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727721934; c=relaxed/simple; bh=+dGq6PoUYPMOCSby2xfGUtVL0PAj0jtC7NzcyMHa4wQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=NkE2N3MesfJfa+ZVXWkgM4+k0k58D9cORvCbG6NdoLZMyVP+S5XuHI9My/D3yy5FjEs/2pwg2epmv420Gkj+90qLCuBI6H5SBzQrMvsCBj2ko3UaaoRJaXgS1lRmVByCvlb5bJIE2Xc0/9EcBzvRxhmSXOhZstchfHVVsq7eDLU= 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=VQuAH77V; arc=fail smtp.client-ip=52.101.65.47 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="VQuAH77V" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AXbvaF+4Uh63JSCNYi3KmComFDi7E6KvkX3LTc6Y5O5tWvtddnCbirGFXDKKIqj7VLXd9tpmh5LlK0UUKInjcl9tlL1b6RqNFoAu0miM0t0fiG+L3b3mZOV6PBO1jZIixNKKEnA4L77NGwvRVu7tEKFwOhEhotgKeI8BZNH/TYSWVwAoft8MUcE6/2IBN6nhgn1ME9FLrlgc27NAiAtXFXx1d55ipNrC0HKeShb0NpibamyXUpivssxxpbeEsqvKqSCTtdbEf0ngl5/Art02Q+S5log+3rAzBwTwnTmblJLz8TmhEMyqdrMCk+UDALkMDeakESZcmscKqQN+RB039A== 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=jMQxrTJTrKyb9jA1AVXWB4dHgbjb8wTaLWpeKSZmB9M=; b=pLR6etYQxczZ5C0FOR78gTlCknLjTL7LrJXhWXz2HCUO3PadACLtX08t9dLn4IItW7UzBqXo5QqobfE8k41dUjorRjtg6/giSE6f/5tSL7SV1I44OozUCcc8rwCuGrDGtBTIzPv2vV2UNTwA9Iizto74xdY45eumI25upUmvCPkTZENfIecGRN1OkOk5mimlDPQ1CiGXA6IcyhXwGemejzJP6l90DO2oD6sLdCcctxCEhjGU/DZmA9LkJqEi08sy7y7qGpznFrt5fRzb0oxPNe26YQVn9TWx0xdxK9sxT78xcejJPS6yOrjfOeDgATAGwpVJbKI8kHcJWNJn06HXeA== 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=jMQxrTJTrKyb9jA1AVXWB4dHgbjb8wTaLWpeKSZmB9M=; b=VQuAH77Vo8P8JNQesLmz9qAOf0MQR3r7ODICFcODfCEu9SfrIohb9z3OD5QSRKq0AzXdoaTW2/IgpeskEqjMSJST5xSBYhWGXFZBRAQ2gQISquIAa+kHywAEFvhvgFUhRglnOFtukYkuf4C9E3L4E0W1z6hwlSlxJ7Jpb+/ZBWY6rj37xgGtrtayweVF8kGuIU+fHG+PSeIbs0qz9WU7fTYx2Q0e8NhURCedtIh+Dr4jluNcoHSxkekrzUyKCDCYq89KASx8kVK1TjfqT9RW/G8iOk19bmxTy28ZzGjCDPVAihhiV2fH60lLIRd0dej4oukXwI1ltM4yawrJHpvqcw== 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 VI1PR04MB9884.eurprd04.prod.outlook.com (2603:10a6:800:1d0::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 18:45:28 +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.8005.024; Mon, 30 Sep 2024 18:45:28 +0000 From: Frank Li Date: Mon, 30 Sep 2024 14:44:55 -0400 Subject: [PATCH v3 3/3] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20240930-pci_fixup_addr-v3-3-80ee70352fc7@nxp.com> References: <20240930-pci_fixup_addr-v3-0-80ee70352fc7@nxp.com> In-Reply-To: <20240930-pci_fixup_addr-v3-0-80ee70352fc7@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=1727721910; l=2455; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=+dGq6PoUYPMOCSby2xfGUtVL0PAj0jtC7NzcyMHa4wQ=; b=pUws7vapk2FukVNjbBvFBoUpU21J6bsa+N8lQC1LnWs4Ds9ggp/MqO9ouRJKR7h27+1Xr8eg3 6Uhk0S7Q8znCS/w1ZYfnc53aVjsgoOcFEtGBr5ozJrIvafMeNpT9UCz X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0P220CA0020.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::26) 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_|VI1PR04MB9884:EE_ X-MS-Office365-Filtering-Correlation-Id: 3dca980b-2c80-4fb9-6761-08dce1800ded X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?AfeskvDf5HhbvenqtZmE88caxg6Y9wQ?= =?utf-8?q?GtWFfU+zt0GYn4QJzTj3o8fCzwt8Z+kHLYpOAoX115Ypeyj8xWflCGmxCEV0H9AvH?= =?utf-8?q?nQ2bo9I4NNj6ODeSV3v0IUv7khMVK4JLUNUpJmLb1TtXyUR3AZ4evMprmJzlRYOQA?= =?utf-8?q?nKbFeQJRtZHEb8na/TbIZDLXfNJZUSa8z7bIV+lmfATb/mzogfaaVCKf4EyKEpbu5?= =?utf-8?q?rT8LW537ZMMb0yXx+RYFfrpsRytNsie7VXEM2dDw430TmVeLvHgGEUw9rnOS0myc/?= =?utf-8?q?jtnMoXY6p/2mda9Npl2VIEdWmlU4sMCkxpCajqI7xl27mt/cKhMvpra6I7N7ftvrS?= =?utf-8?q?mkx6B6QKdN0ZkKK70n+x6jbo4ds+rrJaLwFgafNQcFhcksH8FFkikodqqI1cneA1X?= =?utf-8?q?2HSXPCsT+a4vM23YEJM+WahoTiAh6kJRKveA68ZnLJhXcz59qYZU4LuWsWDJ0tRKr?= =?utf-8?q?nEj3z+gS8YeOsib7M6sAveyPYDI19AXfX6hsx7JcMu63aXOPLP1tzlMwTkwTscIy1?= =?utf-8?q?5nw8one9+nLOod5zpfEO2k26eeKVozDRsQ2feYrYGwowG7GlytpenKIN8roL9v4BT?= =?utf-8?q?gDlWikrdLcJmtPjRiDdKmFKkfuTs61Bu4OZn4QV4YKxN8Ja/L+4LA0lBATfIZ+uhk?= =?utf-8?q?qeMR6OMd/XQ05TVBCWlhTVEqWK3/ibWUQc7d5yCOdJSdID9yFLbbUufXu2xVXISqw?= =?utf-8?q?rK+IeN+8+khLQ+MK/GViKTwJtbpfgRlFi0d1osgyRtHoPdf9kFoW4a0yh133moX4D?= =?utf-8?q?aKurtM95k3PMbffjkd3jOdjeio/bVH+cl43McQRpOvQEzrX0eQTB91lH2e9QOi/pD?= =?utf-8?q?kaMh0ZdB6ObgAGBZYx20HoW2Vlw3d67664AXcYAq3wSc+x+SbiigvbRpU1Yvn+cHV?= =?utf-8?q?FUJ3Vi+hW9FSeuWcV0WaviCp9eEdp8QuoVmgJLxHREOZmuvZA49v494LlaeopTTf5?= =?utf-8?q?hnRclYXjwSsa8jwCz2xWiJdnxp9jYcM8JiMmZepz4SEvaIDCDCbZU3cG0yFp5N2Ml?= =?utf-8?q?z0yU0cGHM3OBCAsYtjoVMiTnT3QUx2h26b2O84JO9YLRCZMmvn1iavyTJHPSDV+au?= =?utf-8?q?z6tz0NGZA78Z6eOYfy15FyGxN7qCH1GwjkYRvTVkJDY3NeF30YbehJNS4cwOcuXav?= =?utf-8?q?izs+tLX+fwyazPV3ZloT11TjjyoPRqaKf4t6Y0hJ8k0tTiSSqPR6gS7UJk25T7KoL?= =?utf-8?q?mORX14O5Tzv5xFXUt6hdQjBh7cvX7xo1mU8FJSG182WZI4uyNZSZMX1+O5zNWMtpW?= =?utf-8?q?BvAGaELuVxb/IP0mlt/vNcvkAZBHzcclh0vyghsf+kWgULxtMLNKwfVZgILlMDFyX?= =?utf-8?q?KS4dGL3ILp3C4jeBXgcY6tDl/Ix0WTv5ap+3zj/FfJuOGDwxbjrtAwU=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)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?48xDhlowfFOZ5bnPJDUJx4sDJAuF?= =?utf-8?q?SiEf1fW3Ah0VBvXf+xRh5D09wE1jsRZtvTpANm4xYivlFJp3fw3NxqVz8z3T1at5N?= =?utf-8?q?Cytksb9PilASHcKl3jW9rkvMAPG4vt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xsv0yubHZSgtemHuxFocWhCOC8n?= =?utf-8?q?RvavogG5U+4le9ta0o4kT89gsbOPttU/YL5UqYyihl1bTEuWuxhKGvqm8hMmH6RZG?= =?utf-8?q?NlRM1wanQgdLnyQqQDbYI+RtUdPrnisgVISEit86imNjsExHiz/gwL7NDU3oAlLXM?= =?utf-8?q?wKcbbNIU306n3jefJv5V3DN9jExNn6EeQRpz9hjAglg0AHz5NIOWnIpRAnu1WIw+v?= =?utf-8?q?M2qB8hHKzP+t7AF6E9S/eOS27POiAa5KsZCd0uhIUq57lIQWR6eqxH1R+6UJTuANt?= =?utf-8?q?nzwBNv890N5r5JyKHTZrfMHTq90ueq8XVtAMDuPiZc383ykphrTXy7nyVnhvzbFII?= =?utf-8?q?JGC7+hTeDN0gg0yQ93z+VDCy+T7B60EoKEvGXL1y2VqDcWOc33al5KeWQIXv04SX8?= =?utf-8?q?YKSw46OiidouIM4EIKpJZiqtim+a7oCNMNpPi/NWtL2v31fS8KyanZz9SNpk8cdY1?= =?utf-8?q?Yx1J4rNPrfyi1IVzDfa2V2fo6+CD2zFBKIY+0iCcvfKwK4R+I+EuxfFc=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dca980b-2c80-4fb9-6761-08dce1800ded X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 18:45:28.6513 (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: l7mbLDPhPTHcjMWaS0Mosh37Uj0kCbVR3Wy9o4htAuUgwKz2rifkgXLELDmYlZGDIbF80FbuUOELuvZWaZwPqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9884 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li --- Change from v2 to v3 - 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 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), },