From patchwork Tue Oct 8 19:54:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13826894 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010061.outbound.protection.outlook.com [52.101.69.61]) (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 1EA6A215007; Tue, 8 Oct 2024 19:54:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728417287; cv=fail; b=CmXAfdI6d2ws/V5lMNUF+KDIBuVEjo1Nx92VpRjs6mJuY6NWyalpVH//hbuo6lHRQR92ud1BeG/aUCqSML2hkhYctvGK9xbHg7GvyfOtObhM5lSYE84L/JzzxjaXjrgVn9vYXSO5mTooTQ7g44qErhJsIKI8ISwhSvXtYxH+vE8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728417287; c=relaxed/simple; bh=MSaZLUc5PtP8YnYAS2wnuP2FJ1mAuEYhZZgffyYJ450=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Fs77h+lWEmtaTz9vb+G4MndKynGMc+2C0N1fhst/S2I1dqWJCQApZCAHTd5DBczlILZavyMuXl+DSY3DSH6EM9/R92KHd6TUrS2DTr+fvk429Z0+9weMj3lktK2C9v0ce/N6Ec1s2SqlS472C+Nq6tziXm3a+z4v/KkYW+8Y+HM= 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=M7d1AgAr; arc=fail smtp.client-ip=52.101.69.61 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="M7d1AgAr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Pygt9Dsp0bHKz3QMbU7AKJB2OYsa0Y/skkVDnvyJAgjj/wvRJfnQ4XoeQeBK/oMg4eLgJEVTA2ndp3HQ+V/dJYAm35P0zQ2IyA5JDp3A9L8K79lemppxGchQrpDZhLKkCXraC50NTxNhf8w7kGiVL3W6RpGFw3A8N9VHiBjvlYdZhToKnYX81ck6oWjHYBjf37BbJt38iJTkVDIlB7sO2dnuyvBlvmxlUJVYIkW5HD/nytSHokRaf2KnnzeJG+Q3Ih8oA4hiNnWNqJiCAkgWq3xOXDurQB3nKQEqZAJxTTl7Gfauu/cgy9/EG5g6SP+0FqNUlq9wnJ/CaOt894M/hw== 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=VXHYIwoka3iYigA8Wm0ay+xHwGBdoHK3DHRGpBMZUZ0=; b=TVTvqHVex77kYewmtiE3vSfPgwPb9eqdsSq6EnNqwpKFgFnlBc1LIMYQTTSJvDxEtX2kvTYPLP11kpPF4MGweVbubNYKqgj+arN1cDfSSNKJVHln9w61WbsuQYPQjGbBe3Z8WqZ5KYNqexuwg/81dlDhXaiU/n3NJJ3om3y3HuqU3IW9g74LH0cpm98wgkw0Etazrn1Wku5VUUDGNQ87MkVMLqiNTVxlulNaMWkrr2IFTLTyWwjjFTMi1LKVMPPyEO/9Cleqfwpu7aYQTLjf5oh8Camzazf99smRIWQn0DXWp5BCPytyXrnFzb71BrvkNW8ElHOL5lEbcYLhTHb0ig== 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=VXHYIwoka3iYigA8Wm0ay+xHwGBdoHK3DHRGpBMZUZ0=; b=M7d1AgArY3fSWzBAnzBN1GDkrlBjZjQtxUltB/xlHOV0IaNDaFeyeXCn3izOW1KwSLHviVoAJzfqOaR4XqAuJkB59JV1cnq7tD783WTW+ViWpMd1WVZn5y5NYGIdUfE2YuhlFNChRI6J3Wm4EMtYZZl5xT7RT1t2/GRBgBaxD+yIqz2dh5NwdHDOAEEeCbhfEIEUFzD3mYiSko0pdMMEBiGNnUna3w9QSUmTg7eBAvr20jTBTQWgsadB4vo5Th085OAWfOOXfoXWOkJiBoqUoOTWpeDjKsygF2VqidiE4okzygdK2PWoxUGGKVYZKBWkJCwe+TBfMWYlodYiID6Ypg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by PA1PR04MB10577.eurprd04.prod.outlook.com (2603:10a6:102:493::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Tue, 8 Oct 2024 19:54:39 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%3]) with mapi id 15.20.8026.019; Tue, 8 Oct 2024 19:54:39 +0000 From: Frank Li Date: Tue, 08 Oct 2024 15:54:00 -0400 Subject: [PATCH v4 3/3] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20241008-pci_fixup_addr-v4-3-25e5200657bc@nxp.com> References: <20241008-pci_fixup_addr-v4-0-25e5200657bc@nxp.com> In-Reply-To: <20241008-pci_fixup_addr-v4-0-25e5200657bc@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=1728417259; l=2455; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=MSaZLUc5PtP8YnYAS2wnuP2FJ1mAuEYhZZgffyYJ450=; b=2BbU2aQgzOxJ1q4XsiXSgRbKVGk+ZRGBAI/9m1Nmljg4YUiqIrzbXe2gsNLEaPCgmlshWIC32 Juf0XOnGXaWDIPSjMcFRUFLw7JCd/VjY3jiolhfnB7TfwFpXc2imZDK X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0195.namprd05.prod.outlook.com (2603:10b6:a03:330::20) To AS4PR04MB9621.eurprd04.prod.outlook.com (2603:10a6:20b:4ff::22) 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: DB9PR04MB9626:EE_|PA1PR04MB10577:EE_ X-MS-Office365-Filtering-Correlation-Id: 84d3e4b2-6370-4bae-2cb8-08dce7d30af6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|7416014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dkUWsbKhfoQ4xn56remGYcWdnTdprT7?= =?utf-8?q?xwSjqyVBhjGvMqWpL7sRMKMXj7rWUQM4k2E56BjshH+dNllzDkud4HvF4XSIwYz+a?= =?utf-8?q?qFHjhf9t57YwOIvrRrlMiNrUzyWT5iiKZI7+BuBEzljzmQ0bk159SC3kxOo+ZfnLa?= =?utf-8?q?37201u7Jz1iYaZDJjPh3VhnkN/qDnSuUgW7+XP/GeXmTUMfH+r5nyaxZGm0cUjelS?= =?utf-8?q?xHKCsZ7RUcsqxTxXlmRWUp4lPH+aG/uHqYs1dSUgUqQMm/emrx6ATrnXqVfIXebC5?= =?utf-8?q?qfdLkAyOI2ZmfAWyj175+eMaaWsHqQlCUOfwwMHSbQu5QmhDy1XFm3rT3IoN2Fp/G?= =?utf-8?q?xMsWpkgW/zh53n7Sqnc43JsZYUn9myplothxPLdHkv7VQx1YhUiqhoVMV8ems7t9F?= =?utf-8?q?12pd7ko6nfscSU0Sg35mU/ZYtDQSevkRTuMqdPYynPVqWEJMuh4gWQ9JZNT6lctg8?= =?utf-8?q?RPS4C+amDbbVGAjpx0Aq7MlKeSWPHL9Xh+iGyK0b+nFpgpRoi7WKuz6JMm+j7EvV5?= =?utf-8?q?KiQilOG/mYgjijhOFHAF7HwfQ5f7sEwTCoBa2mh5tcwkKdHNK3wro6xOZLBVtMCie?= =?utf-8?q?pW93+qglCm7YMe0GE4FKPqA7Vg2KgKAOekIQRr+J3N+Xq0tKDrKWiYTlJekLPNRfb?= =?utf-8?q?cPbu750L0OSEUbie/H287++pKrF72kXIsorAjE+SiKxwDuhpui6qq3iykwiLTnlzV?= =?utf-8?q?BpcpVBPPqZLLNvJlfJxEbbXtyc42jbdxPzFKQaSWyCI9GQLWLWbCZTmqhFUhXrSOX?= =?utf-8?q?0HYatomdPdxV2e6ksNtDo+scq6YnR8l3c/v8R6+WT2ysV9JSublkIhL3l70hlXqh3?= =?utf-8?q?5eIp1jDv5bOfdGAH9KdFEngNVuSaYRAY7+yyfe/gajHwIBMns0y2sMA9sRk2w3tP4?= =?utf-8?q?+wyjqa4NdsNLZiklrYRSyAQSW3sRdMH7i/H27CWLa5wH6YQ3i8kgV6k3PZuaVC/61?= =?utf-8?q?0N0qKtSsyeVS5jAZX3m7ReWFA9w3hALYKBbp9kK9xZi4NO3OHrVnd1N5WFFeeJH8g?= =?utf-8?q?rifYz8GO7JMdrEYedAk8hKI4iLbG0hUjWTTC4+XnUh9BDPTkKVmISzDi4yZUW6FXq?= =?utf-8?q?CLnr6PFa2M31Jgkb+wvKAYyiU5kxwHp8nTT2A96v6htnmzki2U4yhJVbSgJI+FyHn?= =?utf-8?q?Z5XTBnWUoNJwEnlEOrFGuTjjnajURMKtRRbhAveEVRGvAx+sbU4vM17m7IGDESykX?= =?utf-8?q?thoQesdfSEA5xobfEfSPv8tplY6k6OJL7W53OXJQ9lUAnADwhkx+jIKyQtkaJuEjy?= =?utf-8?q?tY7gPk4xG6WlJfVkA8G6/fifYeM3176yVtjH0YTIDCxEhYbYhvBk+sKo=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(376014)(7416014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EVSp7zNDjtTXVed/SYOixtgl1sgt?= =?utf-8?q?zmv0+YUQZdm/gGTGA5gSk3amyHV4KKplrHymPaC19rNtb8XOlTDU363NNqf+LChC6?= =?utf-8?q?OFygqecYauQ3hZhcc+UaODU58vrfbYUI/xbH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T700E+K8i5B/ZdTfqofsi0uo+53nLAkYm?= =?utf-8?q?Rb3xsUDwdJdfPdHdAyjfmBWXNQ32Yc6SIEA0sjTj3wvvsrQHdUXrpaxkgxyCJCrMb?= =?utf-8?q?Nl8M0TgXhSD0eMZTGxNh20mUBtjhIb9yycXHsoC2pC91ka0U7YgCnZkp7uNOxIqwq?= =?utf-8?q?rFImzxkQ5/5NrDgLxrQOPNgF3hB1QDNUrPu8YJBiUfW24r9la7Ny3qEmwg5hJ8i+8?= =?utf-8?q?MM9aX+Xl5HRPz7+nAoErLBEM1YVgcevNNbbt2YgLY3AxsG0WHfPmegdQjuhbzB+BI?= =?utf-8?q?Z8X9w+AORxF7MDY9s1eQrowS3rpq1pN337WIze5P2MNUZOjCrveKGP3sntdEOxBFQ?= =?utf-8?q?QFW2CIBdHaRbJnCqvRHg/OszuqGp58X78kKAF2MO4FYRUoNiDpxsjLjx6jVSmA5WT?= =?utf-8?q?KgSGBd5XICGBndxXAbtd87T4uLLlK7A41j2J5hVylDShExMLTtKSSJPbkRDc/thhx?= =?utf-8?q?JpdeEC+IGSNLoHyR3EnW3cBQwskBGBBL2WlkMmy1DzdrZyYQVY7BcUzfmc5+jOVj8?= =?utf-8?q?3/un8TiiGbyK?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84d3e4b2-6370-4bae-2cb8-08dce7d30af6 X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9621.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 19:54:39.0406 (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: 2Nmtj3Z+h5FgNr/9f/Mp9YY3mXJFj+Sh1YD7pjTwvhpGtGrN3TyjFpz8NujOkJHD5NA/2wxZUTc0mLpWKmeK6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10577 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li --- Change from v2 to v4 - 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), },