From nobody Wed Nov 27 16:38:30 2024 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011055.outbound.protection.outlook.com [52.101.70.55]) (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 4AF92213EFB; Tue, 8 Oct 2024 19:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728417272; cv=fail; b=oAzxqKfD7nPXfgHKkHchdyTCyqy1OhOE2rVqpMl/ngkt4UFKslT5t4IffYzms3na0Q7aytacpD82N219S4zHnTs1PeUkhUyw3QV1YH2vr+a0w1jf0PZHtyG4STjKW/jXpHM9XZVo6TgbUVYi0OcMmHSaQVyI40/lvWD4OQI8EOg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728417272; c=relaxed/simple; bh=6lzXCmq3a0nuDAFW89s/3o0ihCyVHX43B4MeidRoOSk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Xacquz0oNBxRVlsj2/ppW8ETsW0uHvaZUZ4c3mT2rXeOZN+ja197Fgsx6ZMa8fT+DRO7QyieNnfN1oKmD3heQlpPvQ1RBH7kzZNHvV4Bo9rxrVsTjZ2TNUunY4WCW0FHNg0bE+7iQwSRfZYVWMcj77+6p6qyOPmeT16fQNEOe+8= 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=LwYHvNR5; arc=fail smtp.client-ip=52.101.70.55 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="LwYHvNR5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MHFZK2cYIVChOGZd4oig+D50cGf64cvl6Ya9atQXEQ8fpSGala58NMc7FMG9EccVO4X8vZc6TItxYVyVKS/XoimhFXd26D7nGutGYuq5u3IThel1s8jZNUKzpXOQskfw65yI3Nne1s1rvOM23uW9eiizNMe/q3tPSzY0LjtDS7n7ceLbNVhgAtpPrWyDFpWpTIj85xfXIy4ei0wlbyTpvKmqhtWbySjNj4bxwN8/0vSyeX6UAlNSMjP75uYARFJA2orEH3KVaqZ2p9fCq5i2Gq7yq4b76ojP+zPRlkx13yxmwsW1OTGMSlulrVYuSwqdx73Tq//BP9RMsqoAPbUC9g== 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=33uAPZwvH7h5pgdZmtVwE3KTxsUxxUoGDbfjmVnW3NE=; b=JNN7f2gK5sHcx+OR7FaE980t7x0Wa78Z7GRCd7OhyOGC/RIHXdmvXYfLhQZV7mR4RSFxlBEIDmzCPftL90B1VQ+ZNTp170E1m9tU/Qxb/z9VeWDZ60MoRVJY7qX0ZXO7QcNCe5jKIgPyVIuTaJKxJN/k4vDpl8F/r9mvubuvHKNV//nHKQhSgxv8Xgr/FzBe7ZkT3W4bvQMLgrrg2i8P1x+Eu+dVdaPfPtBfnFmON7HlKAMvOZOOpcouEUKtChQpZYtu1UyztVgrr0AnARVIhZ7W1dG4jwf1k1uumNRfOibLyKZip7E0qtdHa7iGd7W420T2gR/eSU6oSCrmA9Crmw== 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=33uAPZwvH7h5pgdZmtVwE3KTxsUxxUoGDbfjmVnW3NE=; b=LwYHvNR5Et7Jy50c8YCBwgHZffigIH0+kwc77VVMkyi10o3m9JO+YL+TKxdgr6abnp4c9sozlhc20C/BQh4Gtj9Zze1TIxiyDKnNgOnwJ5jEOIFI7KIbAV27M0wJAiYekqrMSgF8lMH0ErDX2TU+4m4+3GTrbfLXkYkiH7abMWBXrSpfekHavRj6CxFEg6zCdY8XwyMfqYoC7bRZkVWgTAq+2ZwvaLoH9suuyHiuu+lvCJQ+phMgONuAgM8sj3bk7MdvdDzq8xVwcSrqmDiEdDNJ9sseJU/pEY0I1K61OaQ5rCaypgiQDlGseuhZvd1g44xJwRL/KELuHk7YGv4Trw== 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:29 +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:29 +0000 From: Frank Li Date: Tue, 08 Oct 2024 15:53:58 -0400 Subject: [PATCH v4 1/3] of: address: Add parent_bus_addr to struct of_pci_range Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241008-pci_fixup_addr-v4-1-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=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=4582; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=6lzXCmq3a0nuDAFW89s/3o0ihCyVHX43B4MeidRoOSk=; b=l47AOoAmiJoxrDG5/o4piSsM3sOyKS5HTVtwlyfdahw1RGw5bzy1NEL6FKAIS6md/pN2jNFLU 6dKtMIieij+DiKgmDTsWQ6qfQA5WB0e/9ocaj3fKfu/md2yijG5h/RT 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-kernel@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: afaceb21-3007-4e12-1eba-08dce7d304fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|7416014|1800799024|38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?utf-8?B?OHBvNUYxbGZ4MTEzSWFiQ05sN3h4OWUzYlpEK2R6WDZHcjd2TEJCek01dWZ6?= =?utf-8?Q?DTvgzKU5WPYGqqmQbLpUCeedGVqN8CpWRa0gg=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?B?aUpQanUwdzJxSERZZ2dUOWY0RkgvUjk0a2t6WGdzQzZYMjkvYlpaSWxFVXRH?= =?utf-8?B?ZGhRSnhPZnlFdGY1UFBadkVIVFI4SjhzSXBtL2kwdkZ5Q3FBdVo4aGNGT1la?= =?utf-8?B?cThMRWJGZ2FQZnY4OER4ekJvd3ArQk5WZ01Lb005ZU8xWGIxYXd0emNJWlRv?= =?utf-8?B?NkdObkdIczRHRlU3dm82djd1WmQxWFU2eS85eDNmQWpQZkQzMEtTRklWZWRj?= =?utf-8?B?elV1V2hOSkthVkpPVFp3MTRrcERJdENyajhxMk85SlJYRDh1elNQKzkxVWZz?= =?utf-8?B?Z1A1ay84YVlBanlSSWZGMVpCekRGcFZrRHloYTRKVi8zS1pkYUpkRmFXZU5m?= =?utf-8?B?RWEzOUhlODI4bi9aRDVRQVBZZENMUlRuZ0tXeElrMzFnNlN1QktIVUVia3g0?= =?utf-8?B?MFdOWmJZYzdmZkNuUWZQMHYwZVRwQkRQbDNkWGxDQ1BrSGYzQ2ZFZzZRNlla?= =?utf-8?B?eFpIajVLdS9IcEpvbVRaY081WTBCaG5oekpva0poOVpiNnpzQ0pFbHl2bVBJ?= =?utf-8?B?eWRodThkOGNQbXlkdm5VTFZ0Rm9HaGdUdnA3Vk1WOVh3UzJkTk9XTWtON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UzBJdEJHNmta?= =?utf-8?B?WVdRRkRpUlV0OEk4bGY2Y2ovaElKNHZndDhNQUd1ek16VWtYYURMaGV2bENa?= =?utf-8?B?Mk1Tb2VIS0Q2WU44L2locXdpRDdOQXQxZFZWWVBwQ0EyNGx5WXVObmxSMG82?= =?utf-8?B?L21HQVNjMmZWNTQxYytsY3hwb1V6eTRDYlBiTWxKeTFGbmpkcGd1bVIrRDNm?= =?utf-8?B?Y1dSc01LbFlRYTlrTW4vL3lQU1FvVXZ1MVVqYnVzSG1pZ3d4bjFwbmpuMWNG?= =?utf-8?B?aCtRemRabnRIck9kWHZGd0lkSGd2dzJGOXdnbFpyVDM2WGR4QXp4VUZ3UEo3?= =?utf-8?B?VTR1TkNvbCs3bTZ3dzkzaGpJUzBSdk0zcjlkZk01TkpzcHBqMWd4QTgxVHY5?= =?utf-8?B?NnVqZ1UxMzN2TXZtSURqbEZEN2pJQngwaGZWSWNua0k5YTRxb2pjMExmcEdx?= =?utf-8?B?Y1JTYnZsK1phNmRsb1BiTHlZVlBFbi94STk0d2NWMHdpL2VhM3l4YVBGT09C?= =?utf-8?B?cUZGT2JZY0tDT04vd3ZJT0M1OGFSaFN0T25JMm1OSnNBVDV1NUdSMkpUOHdR?= =?utf-8?B?NHZMbEJkYVN4Z25FSU91L3JYSmVhelJLTTJqQWNiRmZDTTNtVXloN09kRzZi?= =?utf-8?Q?qrMyS/7RdkJh1kEgIapT4HOzL?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: afaceb21-3007-4e12-1eba-08dce7d304fa 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:29.0133 (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: qVcQNdLmntIybsrBmYkwFNESf9oKZzm0DzcKQOveY8w/JOsppZzRO96nDmWxcwUUkYrRlCiPJH9lbQNx6xfTlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10577 Introduce field 'parent_bus_addr' in of_pci_range to retrieve untranslated CPU address information. Refer to the diagram below to understand that the bus fabric in some systems (like i.MX8QXP) does not use a 1:1 address map between input and output. Currently, many controller drivers use .cpu_addr_fixup() callback hardcodes that translation in the code, e.g., "cpu_addr & CDNS_PLAT_CPU_TO_BUS_ADDR" (drivers/pci/controller/cadence/pcie-cadence-plat.c), "cpu_addr + BUS_IATU_OFFSET"(drivers/pci/controller/dwc/pcie-intel-gw.c), etc, even though those translations *should* be described via DT. The .cpu_addr_fixup() can be eliminated if DT correct reflect hardware behavior and driver use 'parent_bus_addr' in of_pci_range. =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=8C=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94= =82 =E2=94=82 IA: 0x8ff0_0000 =E2=94=82 =E2=94=82 =E2=94=82 CPU =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=82 =E2= =94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=9C=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 = =E2=94=82 PCI =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94= =82 =E2=94=82 =E2=94=82 IA: 0x8ff8_0000 =E2=94=82 =E2=94=82 = =E2=94=82 CPU Addr =E2=94=82 =E2=94=82 =E2=94=8C=E2=94=80=E2=96=BA=E2=94=9C=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 =E2=94=82 Con= troller =E2=94=82 0x7ff0_0000=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94= =82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 =E2=94=82 PCI Addr 0x7ff8_0000=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=98 =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2= =94=80=E2=96=BA CfgSpace =E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=96=BA =E2=94=82 =E2=94=82 =E2=94=82 =E2=94= =82 =E2=94=82 0 0x7000_0000=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 = =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=94=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA IOSpace =E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA BUS Fabric =E2=94=82 =E2=94=82 =E2= =94=82 0 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA MemSpace= =E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA IA: 0x8000_0000 =E2=94=82 =E2=94=82 = 0x8000_0000 =E2=94=94=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=98 bus@5f000000 { compatible =3D "simple-bus"; #address-cells =3D <1>; #size-cells =3D <1>; ranges =3D <0x5f000000 0x0 0x5f000000 0x21000000>, <0x80000000 0x0 0x70000000 0x10000000>; pcie@5f010000 { compatible =3D "fsl,imx8q-pcie"; reg =3D <0x5f010000 0x10000>, <0x8ff00000 0x80000>; reg-names =3D "dbi", "config"; #address-cells =3D <3>; #size-cells =3D <2>; device_type =3D "pci"; bus-range =3D <0x00 0xff>; ranges =3D <0x81000000 0 0x00000000 0x8ff80000 0 0x00010000= >, <0x82000000 0 0x80000000 0x80000000 0 0x0ff00000>; ... }; }; 'parent_bus_addr' in of_pci_range can indicate above diagram internal address (IA) address information. Reviewed-by: Rob Herring (Arm) Signed-off-by: Frank Li --- Change from v3 to v4 - improve commit message by driver source code path. Change from v2 to v3 - cpu_untranslate_addr -> parent_bus_addr - Add Rob's review tag I changed commit message base on Bjorn, if you have concern about review added tag, let me know. Change from v1 to v2 - add parent_bus_addr in of_pci_range, instead adding new API. --- drivers/of/address.c | 2 ++ include/linux/of_address.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/of/address.c b/drivers/of/address.c index 286f0c161e332..1a0229ee4e0b2 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -811,6 +811,8 @@ struct of_pci_range *of_pci_range_parser_one(struct of_= pci_range_parser *parser, else range->cpu_addr =3D of_translate_address(parser->node, parser->range + na); + + range->parent_bus_addr =3D of_read_number(parser->range + na, parser->pna= ); range->size =3D of_read_number(parser->range + parser->pna + na, ns); =20 parser->range +=3D np; diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 26a19daf0d092..13dd79186d02c 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -26,6 +26,7 @@ struct of_pci_range { u64 bus_addr; }; u64 cpu_addr; + u64 parent_bus_addr; u64 size; u32 flags; }; --=20 2.34.1 From nobody Wed Nov 27 16:38:30 2024 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 B48262141D3; Tue, 8 Oct 2024 19:54:42 +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=1728417284; cv=fail; b=u5VQsDLzBJiHTIFBiYMzLWEggtWIXrvi0Ez8mJtvBomjhQvMmGaUvhVFNZAUkaClOfTt3hYSGcQ+2NWqeHLSxeymLSmPGaC9bob+htIgSlV6fMHSEC8RyJ/hyCXktkOvdTF/D7rkQIOHP09u5qjlwIv3Pre//bWDkpJ9+2Ne/U0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728417284; c=relaxed/simple; bh=0L3qEl/+gpp3mZUPcyNe82/HxmZU/2VbLozR9pKpTKU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=NVmCjx0gdMO9yLv8knpOJGARp+wkkz0NxuyJBM4EvCiEVWYphT0qDIdLRUFUoNfoA0ZpUz0mkfho5nr9eR3nVmDEx5AOOs8TRKdMLLS7UON3Bx+MMtZeAxvA1MvB/K95bCmM74xEuncTNpNqgvjLyxQ+jHUnjwSRYtAQucxDd+Y= 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=DmahCHvh; 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="DmahCHvh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oF1fy1nC/nB8sVE/JSLHi3VG8sqR1fRPNRsbIDKKNPKnu8s98sgaunToCdLbMPmDu+cv335hHfOXse3Y/T7RutwAOFIUc8hn9nSy80sj8TqxOMEQypmaP2TiUbuCDRDJwgnxLmKyDf/ZCBY2FEBu03ITsWexVtM4kCxOtxoFwJmHKpF2hFutYBqCQ0Q1rNprjCz3XQvRZd5P2T2/FdOKkzTjHPaIO7eQURaarhHQPsxRJ95hIQ2Ys0d5r8HaG7ieLN75ciZWKGq2VlnQlTMSnQBmTH9j9GN/wARraygSHOARnNCucC/T0SRQa50fdPUCEsto0vaX1jKbpipSLL+c8g== 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=/xjmrzgXUr8SnuZoLtkR/dSps1HgUaXdt6njq7Rjbfk=; b=Ffw0a3Rk8zzbct/F8/KbAAcdTeJb7L9OhUmHuwxPxie3l4dJSxNqteA9voHNIQj9wOzJymBlZmR8QqVo8Q+k24Ik8UHaiONXQvTTTBfk1eiO6Iex6TKFjkezfor4IuKSXqJAYVGF/Jhh7Yp4n0sfL2wvVzezK8Glsw+3wsXnCXTH2+lx8/PUwfYMzRcE/5lRELGTTM0HiP9dRyc8CH/0AV3L1KxuWAgoFfLGXTWN6R9pQDaj6sStdxVgoPPQ9wWBKcDEu0ty4Soum1nCg+kSwkZPDEYzLokFYzEpeeyN+sOG/7Z07djPOAINMoewXjXdJs+m/+ReRzy0m7buic0xSA== 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=/xjmrzgXUr8SnuZoLtkR/dSps1HgUaXdt6njq7Rjbfk=; b=DmahCHvhgtb+V5Vz5hArhx0iOoSSdzT8z9cNxin07q0cX38bDCPIun3DkpkT19qMEsUYjlLpO7tPWWlAy4btQeKfT0M3EISAyZcIKmPxAWwJQoOhL1JuGtDa+g78IGk42pjL6Mr/SjP/Khp0A38cJhlW5NoxCYY3xDA3QY1LqMWhZKawMhuA2RITTQfon448mV0zQz67+5B6NtskTlzTfKdtGJ0BGgJcfhNnq+cWMbCzpCtTF+ojWHCoHVBclYPS87GW53kcAL6Uy5VID5mkvsIyLqOoFLhmtsi2/8D5zcm38GdNIkdwWkSyGtkyvWfn6pGgW+rZd1B8sdBOvWnamg== 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:34 +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:34 +0000 From: Frank Li Date: Tue, 08 Oct 2024 15:53:59 -0400 Subject: [PATCH v4 2/3] PCI: dwc: Using parent_bus_addr in of_range to eliminate cpu_addr_fixup() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241008-pci_fixup_addr-v4-2-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=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=6492; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=0L3qEl/+gpp3mZUPcyNe82/HxmZU/2VbLozR9pKpTKU=; b=+c0mkhqtxDyYANK7fl7oYdK3Me3oM0gAyo894gvHfYjTl8GLgpijvOtaIRqiycPXA/sOpVG75 9GurMMaIJn9BMlBknOqG382vuZLJmj5KStQv/+V37il1wpVVXv80ZA2 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-kernel@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: 1c889615-f9d1-49d9-75f6-08dce7d307f5 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?B?TzlRU1p5cGxHcTRZK0QxWVVWazlvRVBiK1BNN21GL051cGpNNG1pOXdxN1NY?= =?utf-8?B?UFU4ekhHSjJ6TnhpRkFXaDlIUDYyUitKbWc4R0NKV25WVG9UbGduMFZ5ajUx?= =?utf-8?B?VWM1NTA3UUpKVjVFZ0krNEhCcWxFejRtQTlQSEFDbjhrNDZyd24xSHJYRk13?= =?utf-8?B?U3F6MnJzbjI3N2tuNGNQdFA2S3JGcmtONkdhZUkzQy9zMjVzNlF0NWtHVE1V?= =?utf-8?B?VU1jeUFiQWZxbEdFVXVmQlc3V2hEaEhsTHIrNDJhOUZIQ0srVnd1cE8xdGd6?= =?utf-8?B?anRrZk5yVmdWa3ArcFRyMXJTekljV1l5NjduN3NueUJwUUJScVM1NG5MQXNj?= =?utf-8?B?U1kxYklnUVEwT1JrQlUzR0RMclh6N0VSdVFCOUpQRkRwOE1mZGxpZERjMGhY?= =?utf-8?B?QU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B?NUlpQUFObXlsNHczcG5yOTU0ZGU0NDNzaTE5d3RVUU1LZis4QkNqbGYwSFNL?= =?utf-8?B?RnNzSHhOeUFXY2xqcVVCbnRRQ05zWXRXeDhoUm54ZGNscEtOVEZSRm1yNjlm?= =?utf-8?B?eUtPRytOckJOalFnRFRKOHY4bFRiMnFpdDdFc3JmOHdTcFB6NmxaeUVmRVd3?= =?utf-8?B?M0xKeVZvUTNOMUl1NUxOZnRld1VOZENEZXBNcEtTUmtXZmZrQkh1bTVQRXAz?= =?utf-8?B?K0ZvQ0VhbEY3NEdOZDlNUDdSUWZjWjhnTytvSHkvTW1uVjZPd0o2UTZQN0s0?= =?utf-8?B?S3RnWFRRRWZUZmJwdjY2RzFYSjBDTStqWVpGdVNlUkFLdDlJMlFrMyswZEtN?= =?utf-8?B?ZTB2WUVRdWVBc3BoOUNxdldmcU5jWjhtTkdseXYweUw0dmVIRGpCVFUxR2Jh?= =?utf-8?B?cHU2Y1YvR0M0YUVrcTVRdGUrL3VHaWVrV2F3ZTVEVmo5b3k5bmlJK01FQ2ZX?= =?utf-8?Q?TriFrPD9xETHl5Isz2g7t7vMuHqecfBLM+4Ag=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?B?L0ZLTXIyNmFxT0dPVkgwTG9qS3NxaG9HTTJkWWJ3eGxSTFNZd1JTb0tLM0Qr?= =?utf-8?B?WjNCL2oyUzl0M2pSL1RQcnVySnhVTkRQaU9HN1I0d0RBZHhBODlwTllNUTgr?= =?utf-8?B?WVlxOXRuelhOekdKVVhHcmFzRy9BSlNjNUwreDFIN0NXMXVSb3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SnF5QnZOcGRTMGNN?= =?utf-8?B?aWh1ODZxVU1paXZBRjB6NWhuWWdRbUJTOEZKZ29Ec3kvUW5OQitGMWhsNndF?= =?utf-8?B?K1dkQTlNdUt3bHdoTytKVlc2Z0YwbHpVVCtyM1hvTitkKytITHFjWXFHZ0J4?= =?utf-8?Q?EE5M7OX0u3Q4NEbQ0n40b3XTk?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c889615-f9d1-49d9-75f6-08dce7d307f5 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:34.0340 (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: ZnHuMhiainRCtcHtCZtm8JgbC0hH2mKqjnASiKuwO0aDMoxR/ixYwllynxCi5IXocCAf+X1OsYaoG7MJ1/CKuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10577 parent_bus_addr in struct of_range can indicate address information just ahead of PCIe controller. Most system's bus fabric use 1:1 map between input and output address. but some hardware like i.MX8QXP doesn't use 1:1 map. See below diagram: =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=8C=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94= =82 =E2=94=82 IA: 0x8ff0_0000 =E2=94=82 =E2=94=82 =E2=94=82 CPU =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=82 =E2= =94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=9C=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 = =E2=94=82 PCI =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94= =82 =E2=94=82 =E2=94=82 IA: 0x8ff8_0000 =E2=94=82 =E2=94=82 = =E2=94=82 CPU Addr =E2=94=82 =E2=94=82 =E2=94=8C=E2=94=80=E2=96=BA=E2=94=9C=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 =E2=94=82 Con= troller =E2=94=82 0x7ff0_0000=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94= =82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=82 =E2=94=82 PCI Addr 0x7ff8_0000=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=98 =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2= =94=80=E2=96=BA CfgSpace =E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=96=BA =E2=94=82 =E2=94=82 =E2=94=82 =E2=94= =82 =E2=94=82 0 0x7000_0000=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 = =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=94=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA IOSpace =E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA BUS Fabric =E2=94=82 =E2=94=82 =E2= =94=82 0 =E2=94=82 =E2=94=82 =E2= =94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA MemSpace= =E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA IA: 0x8000_0000 =E2=94=82 =E2=94=82 = 0x8000_0000 =E2=94=94=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=98 bus@5f000000 { compatible =3D "simple-bus"; #address-cells =3D <1>; #size-cells =3D <1>; ranges =3D <0x5f000000 0x0 0x5f000000 0x21000000>, <0x80000000 0x0 0x70000000 0x10000000>; pcie@5f010000 { compatible =3D "fsl,imx8q-pcie"; reg =3D <0x5f010000 0x10000>, <0x8ff00000 0x80000>; reg-names =3D "dbi", "config"; #address-cells =3D <3>; #size-cells =3D <2>; device_type =3D "pci"; bus-range =3D <0x00 0xff>; ranges =3D <0x81000000 0 0x00000000 0x8ff80000 0 0x00010000>, <0x82000000 0 0x80000000 0x80000000 0 0x0ff00000>; ... }; }; Term internal address (IA) here means the address just before PCIe controller. After ATU use this IA instead CPU address, cpu_addr_fixup() can be removed. Signed-off-by: Frank Li --- Change from v3 to v4 - none Change from v2 to v3 - %s/cpu_untranslate_addr/parent_bus_addr/g - update diagram. - improve commit message. Change from v1 to v2 - update because patch1 change get untranslate address method. - add using_dtbus_info in case break back compatibility for exited platform. --- drivers/pci/controller/dwc/pcie-designware-host.c | 42 +++++++++++++++++++= ++++ drivers/pci/controller/dwc/pcie-designware.h | 8 +++++ 2 files changed, 50 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pc= i/controller/dwc/pcie-designware-host.c index 3e41865c72904..823ff42c2e2c9 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -418,6 +418,34 @@ static void dw_pcie_host_request_msg_tlp_res(struct dw= _pcie_rp *pp) } } =20 +static int dw_pcie_get_untranslate_addr(struct dw_pcie *pci, resource_size= _t pci_addr, + resource_size_t *i_addr) +{ + struct device *dev =3D pci->dev; + struct device_node *np =3D dev->of_node; + struct of_range_parser parser; + struct of_range range; + int ret; + + if (!pci->using_dtbus_info) { + *i_addr =3D pci_addr; + return 0; + } + + ret =3D of_range_parser_init(&parser, np); + if (ret) + return ret; + + for_each_of_pci_range(&parser, &range) { + if (pci_addr =3D=3D range.bus_addr) { + *i_addr =3D range.parent_bus_addr; + break; + } + } + + return 0; +} + int dw_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); @@ -427,6 +455,7 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) struct resource_entry *win; struct pci_host_bridge *bridge; struct resource *res; + int index; int ret; =20 raw_spin_lock_init(&pp->lock); @@ -440,6 +469,13 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) pp->cfg0_size =3D resource_size(res); pp->cfg0_base =3D res->start; =20 + if (pci->using_dtbus_info) { + index =3D of_property_match_string(np, "reg-names", "config"); + if (index < 0) + return -EINVAL; + of_property_read_reg(np, index, &pp->cfg0_base, NULL); + } + pp->va_cfg0_base =3D devm_pci_remap_cfg_resource(dev, res); if (IS_ERR(pp->va_cfg0_base)) return PTR_ERR(pp->va_cfg0_base); @@ -462,6 +498,9 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) pp->io_base =3D pci_pio_to_address(win->res->start); } =20 + if (dw_pcie_get_untranslate_addr(pci, pp->io_bus_addr, &pp->io_base)) + return -ENODEV; + /* Set default bus ops */ bridge->ops =3D &dw_pcie_ops; bridge->child_ops =3D &dw_child_pcie_ops; @@ -733,6 +772,9 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) atu.cpu_addr =3D entry->res->start; atu.pci_addr =3D entry->res->start - entry->offset; =20 + if (dw_pcie_get_untranslate_addr(pci, atu.pci_addr, &atu.cpu_addr)) + return -EINVAL; + /* Adjust iATU size if MSG TLP region was allocated before */ if (pp->msg_res && pp->msg_res->parent =3D=3D entry->res) atu.size =3D resource_size(entry->res) - diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/con= troller/dwc/pcie-designware.h index c189781524fb8..e22d32b5a5f19 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -464,6 +464,14 @@ struct dw_pcie { struct reset_control_bulk_data core_rsts[DW_PCIE_NUM_CORE_RSTS]; struct gpio_desc *pe_rst; bool suspended; + /* + * Use device tree 'ranges' property of bus node instead using + * cpu_addr_fixup(). Some old platform dts 'ranges' in bus node may not + * reflect real hardware's behavior. In case break these platform back + * compatibility, add below flags. Set it true if dts already correct + * indicate bus fabric address convert. + */ + bool using_dtbus_info; }; =20 #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp) --=20 2.34.1 From nobody Wed Nov 27 16:38:30 2024 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() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=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-kernel@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?B?ZGtVV3NiS2hmb1E0eG41NnJlbUdZY1dkblRkcHJUN3h3U2pxeVZCaGpHdk1x?= =?utf-8?B?V3BMN3NSTUtNWGo3cldVUU00azJFNTZCanNoSCtkTmxsekRrdWQ0SHZGNFhT?= =?utf-8?B?SXdZeithcUZIamhmOXQ1N1l3T0l2clJybE1pTnJVenlXVDVpaUtaSTcrQnVC?= =?utf-8?B?RXpsanptUTBiazE1OVNDM2t4T28rWmZuTGEzNzIwMXU3SnoxaVlhWkRKalBo?= =?utf-8?B?M1ZobmtOL3FEblN1VWdXNytYUC9HZVhtVFVNZkgrcjVueWF4WkdtMGNVamVs?= =?utf-8?B?U3hIS0NzWjdSVWNzcXhUeFhsbVJXVXA0bFBIK2FHL3VIcVlzMWRTVWdVcVFN?= =?utf-8?B?bS9lbXJ4NkFUcm5YcVZmSVhlYkM1cWZkTGtBeU9JMlptZkFXeWoxNzUrZU1h?= =?utf-8?B?YVdzSHFRbENVT2Z3d01IU2JRdTVRbWhEeTFYRm0zclQzSW9OMkZwL0d4TXNX?= =?utf-8?B?cGtnVy96aDUzbjdTcW5jNDNKc1pZVW45bXlwbG90aHhQTGRIa3Y3VlF4MVlo?= =?utf-8?B?VWlxaG9WTVY4ZW1zN3Q5RjEycGQ3a282bmZzY1NVMFNnMzVtVS9aWXREUVNl?= =?utf-8?B?dmtSVHVNcWRQWXluUFZxV0VKTXVoNGdXUTlKWk5UNmxjdGc4UlBTNEMrYW1E?= =?utf-8?B?YmJWR0FqcHgwQXE3TWxLZVNXUEhMOVhoK2lHeUswYituRnBncFJvaTdXS3V6?= =?utf-8?B?NkpNbStqN0V2VjVLaVFpbE9HL21ZZ2ppamhPRkhBRjdId2ZRNWY3c0V3VENv?= =?utf-8?B?QmEybWg1dGN3a0tkSE5LM3dybzZ4T1pMQlZ0TUNpZXBXOTMrcWdsQ203WU1l?= =?utf-8?B?MEdFNEZLUHFBN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?UTlsVUFuQUR3aGt4K2pJS3lRdGthSnVFanl0WTdnUGs0eEc2V2xKZlZrQThH?= =?utf-8?Q?6/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?B?RVZTcDd6TkRqdFRYVmVkL1NZT2l4dGdsMXNndHptdjArWVVRWmRtL2dHVEdB?= =?utf-8?B?NWdTazNhbXlIVjRLS3Bsckh5bVBhQzE5ck50YjhYT2xURFUzNjNOTnFmK0xD?= =?utf-8?B?aEM2T0Z5Z3FlY1lhdVEzaFpoY2MrVWFPRFU1OHZyZmJZVUkveGJIaDFUb041?= =?utf-8?B?UUxrOW4rckZLZjhaWWxrRnh4NnRTdWUzcjU4OXdKUlVxbjM0OE4zd2orbEgy?= =?utf-8?B?cWY3UndXUU02Y2FDTkxQVnRNY2VGalp5UnJpTGhCUUtlaCtpUzZUdmw3U29s?= =?utf-8?B?TWkyNVFELzVHSXhOajMxOEM5YU53ZmNwSU8zcklXN2Y4U0UvYTFuRFFrQi8x?= =?utf-8?B?SXZxaTZUSjAybk9QeUFZSVIrMWNsd0JyMVpVSmtBMVh4cWZDWWNyNW1XdW1w?= =?utf-8?B?SkdqSXFBczJTQlhpVVhhMHRuS0M4OWJVeVIrV3lSQ0NwT1M4YVUreTFzbm1S?= =?utf-8?B?M0w0UkZRSXhUZWgwT0N5MktmOTFwT1o1YWlPZUdvSXFDb0diSkIxWFJaWSty?= =?utf-8?B?MjF2WVA1a1JLalJaRWhKcFR2WWI0RnY5SmxmV1RIT2NKMGlhVjNkNUMyR3hB?= =?ut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n?= =?utf-8?B?eHlDSkNyTWJObDhNMFRnWGhTRDBlTVpUR3hOaDIwbVVCdGpoSWI5eXljWEhz?= =?utf-8?B?b0MycEM5MWthMFU3WWdDblprcDd1Tk94SXF3cXJGSW16eGtRNS81TnJEZ0x4?= =?utf-8?B?clFPUE5nRjNoQjFRRE5VclB1OFlKQmlVZlcyNHI5bGE3TnkzcUVtd2c1aEo4?= =?utf-8?B?aSs4TU05YVgrWGw1SFJQejcrbkFvRXJMQkVNMVlWZ2Nldk5OYmJ0MllnTFkz?= =?utf-8?B?QXhzRzBXSGZQbWVnZFFqdWhiekIrQklaOFg5dytBT1J4RjdNRFk5czFlUXJv?= =?utf-8?B?d1MzcnBxMXBOMzM3V0l6ZTVQMk1OVVpPakNydmVLR1Azc250ZEVPeEJGUVFG?= =?utf-8?B?VzJDSUJkSGFSYkpuQ3F2UkhnL09zenVxR3A1OFg3OGtLQUYyTU80RllSVW9O?= =?utf-8?B?aURweHNqTGp4NmpWU21BNVdUS2dTR0JkNVhJQ0dCbmR4WEFidGQ4N1Q0dUxM?= =?utf-8?B?bEs3QTQxajJKNWhWeWxEU2hFeE1MVHRLU1NKUGJrUkRjL3RoaHhKcGRlRUMr?= =?utf-8?B?SUdTTkxvSHlSM0VuVzNjQlF3c2tCR0JCTDJXbGtNbXkxRHpkclp5WVFWWTdC?= =?utf-8?Q?cUzfmc5+jOVj83/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) =20 #define imx_check_flag(pci, val) (pci->drvdata->flags & val) =20 @@ -1015,22 +1014,6 @@ static void imx_pcie_host_exit(struct dw_pcie_rp *pp) regulator_disable(imx_pcie->vpcie); } =20 -static u64 imx_pcie_cpu_addr_fixup(struct dw_pcie *pcie, u64 cpu_addr) -{ - struct imx_pcie *imx_pcie =3D to_imx_pcie(pcie); - struct dw_pcie_rp *pp =3D &pcie->pp; - struct resource_entry *entry; - - if (!(imx_pcie->drvdata->flags & IMX_PCIE_FLAG_CPU_ADDR_FIXUP)) - return cpu_addr; - - entry =3D 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 =3D { .init =3D imx_pcie_host_init, .deinit =3D imx_pcie_host_exit, @@ -1039,7 +1022,6 @@ static const struct dw_pcie_host_ops imx_pcie_host_op= s =3D { static const struct dw_pcie_ops dw_pcie_ops =3D { .start_link =3D imx_pcie_start_link, .stop_link =3D imx_pcie_stop_link, - .cpu_addr_fixup =3D imx_pcie_cpu_addr_fixup, }; =20 static void imx_pcie_ep_init(struct dw_pcie_ep *ep) @@ -1459,6 +1441,7 @@ static int imx_pcie_probe(struct platform_device *pde= v) if (ret) return ret; =20 + pci->using_dtbus_info =3D true; if (imx_pcie->drvdata->mode =3D=3D DW_PCIE_EP_TYPE) { ret =3D imx_add_pcie_ep(imx_pcie, pdev); if (ret < 0) @@ -1598,8 +1581,7 @@ static const struct imx_pcie_drvdata drvdata[] =3D { }, [IMX8Q] =3D { .variant =3D IMX8Q, - .flags =3D IMX_PCIE_FLAG_HAS_PHYDRV | - IMX_PCIE_FLAG_CPU_ADDR_FIXUP, + .flags =3D IMX_PCIE_FLAG_HAS_PHYDRV, .clk_names =3D imx8q_clks, .clks_cnt =3D ARRAY_SIZE(imx8q_clks), }, --=20 2.34.1