From nobody Tue Nov 26 22:36:20 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2075.outbound.protection.outlook.com [40.107.104.75]) (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 D76EB1F5830; Tue, 15 Oct 2024 19:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019869; cv=fail; b=R+aR0gdrddySa1SEngPqXxpfe6q6N+OA+VvKtZxaU7IrUCi2hGZa3pTymTs/MXB5tIM99ww+tJ0m913FANHtuNpTX3lPWFPJbTxMx2iX8SURoAMWEqmgE0RrY3ndqCGMIr3UxRlWSeI71zJLZtIBQHgRzqi7n4G43Xd3SPtjYHk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019869; c=relaxed/simple; bh=mpQkyAmcMxPoQ2LNPaVnnXkLHMMBxJM2cbPN+52/6qM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=dJmf4HnQ+cCIzF2p6p30y23ZdltTwcobT0lJJu4/rUVkMDkr1JhEpcxGe10+SXLXzhLJHYbH4mBxjq/yL/zNTRJbWDvaxoajY7CMiSuaM/CvhHyxtF6iqqBSF4jVQz6Uzw3fT+2J4P+2fzqmGYnAKtRt4RPpYKjPxTUqnr2cDVo= 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=jolDNz6h; arc=fail smtp.client-ip=40.107.104.75 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="jolDNz6h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hFNUhd8schFXsNX9Aok39fvhPNg2K1Xndn34PFp+aP9zKYjgoC/m67qBVZjhhHjNh97Es36YOiOb1qkyorMdnqF1fP6nlI9ID1fT9iAt8eVJFnDDSe2QNvqewsmp3AqGdWo3jeuf8Buge1wnKEnzekyUGH7o7J5XYP8po2M/mHWzVcaPEXygW+dIX+JWiJkYXfCGe7inaPywM5vJapfLnqkd4xdKNRGfFKN2mgmOicgM57azTk4Zuv983SqiUh13CgenvwisXRTOhM2vohTIhQphK4MiYbpLNalWiNmjc2cjDlNdmzV07BNeogWzZ5k/hpPnRZSHuJMys3S84y1G3A== 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=OPYi6nf5hF87bcZhksCeSoE7DI1/Kxlduip+Pl9A+ME=; b=VX23sYR/7NHPDDTppcgEOGc3aybw8mTTpDvwwgBQV1p/HNU+u7GH1sIoYAGpnLlear/ahLiHvJNiyWoKp4L1yGXEV7+Q0X7/hp3ci0sZqHd4afUlC8vzJ6iLhUidB+Jtdu5jQ0Bmp6jfvlueWVaP9HtJLN+nby8kUY2B40oF1jV3dnCZ1i/nb8lEpwo9hUi+EXbqcjyKLL75kSe5wGq+k0XoIplC35G7HyeiLk0mWKasSghpklZcnCJCgul/ZdierAZCQtdMu7L6JQi4G8chK/Y01zkuLGKsggDK93xWINz0QIc5w4V3J40RyUS0pXcNCnmTFg4NS8mujwbYIfkC6A== 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=OPYi6nf5hF87bcZhksCeSoE7DI1/Kxlduip+Pl9A+ME=; b=jolDNz6h3bWC+zrFaswi3C5hIy9dA/w52JXm7z1pzw17upGaNEvkNsbZ8/toKh4SRnIBCP/eqmsv/L6IzDuB4/P0P5XE3l50v3i8QiGzHzogaRv7BvaoGVCyyge6PsFma+kugGITWn2mZyCZg3lq5JCS88MaS3Ikyacu5VgNnBlrNMoREoj0SVUfifPimgP4hEY98NhPAH+C0cByq23meq87TqNEMetSyD/oJCsLit1zEjHszPB9ZYU3zdzWFK4Xz43BLyXhoe/ajelVhvP8vWmEXI/Cpwv+JnK4bN9Pt20Bh2hD24mPoorjiiO5WhfCcVXaAwtsDgopK9TAeGfIyg== 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 VI2PR04MB11002.eurprd04.prod.outlook.com (2603:10a6:800:280::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 19:17:44 +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.8069.016; Tue, 15 Oct 2024 19:17:44 +0000 From: Frank Li Date: Tue, 15 Oct 2024 15:17:17 -0400 Subject: [PATCH v5 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: <20241015-pci_fixup_addr-v5-1-ced556c85270@nxp.com> References: <20241015-pci_fixup_addr-v5-0-ced556c85270@nxp.com> In-Reply-To: <20241015-pci_fixup_addr-v5-0-ced556c85270@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=1729019855; l=4731; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=mpQkyAmcMxPoQ2LNPaVnnXkLHMMBxJM2cbPN+52/6qM=; b=yAk0aYUD19q9Mz9u5tenR1MnHu79q4JNoA+Uict2jX/ebVbxgfGNePvLdPw+Dmrui9Xt5LDxE RrjPRxJultiApLREyohOc57Zaa5aTq4ocyaDO8YLNHXlagw7siqVO44 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0117.namprd05.prod.outlook.com (2603:10b6:a03:334::32) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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: PAXPR04MB9642:EE_|VI2PR04MB11002:EE_ X-MS-Office365-Filtering-Correlation-Id: 915ca2cc-1e15-44c2-35a7-08dced4e0bdb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|366016|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf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S9LbVFmcjdyZ1JN?= =?utf-8?Q?Jg0bVt789HLWHTtidjpuM309gsSL2eBPBTDpc=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)(1800799024)(52116014)(366016)(7416014)(376014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NW90WHg5VXozeDhHN3FFL0hmamJVWjB6QmIycTJISU1DcW50M0RkU21tbGJz?= =?utf-8?B?QXlwdDIwK01OUGZmMG5ISHJZS05Cb2U4NEx0RlBIQy9Kc2RsaGk3WHBKZG9R?= =?utf-8?B?ajZGdHNaUHpYcE12bUEyRUxqSElROEZsKy9USUoxaVpQd3phVTZhWXpwcWVq?= =?utf-8?B?MWRGandDNzRTTExkdDd2cE1STmhnZnAyQWdyT2xMSjJrOVpKcUdHVDJrK2lY?= =?utf-8?B?dy83RWNUSzdsVStoWmYzM2FiKzBJMURiaVR1aHVQQml0RzBiZFlnS0dwVEpo?= =?utf-8?B?ZzJqZWYyb2VzZXVLTXA2YVJpL05BY0JYY1VrZVlFcnNiSTNqR2JVaEQxZFdQ?= =?utf-8?B?aEJSVkFjQ3B3VXpYczc4OUNWTFhZRzlZQllYTnVYdURKVUp0RnZXd01tQ3lL?= =?utf-8?B?dEkvQ1lDNnFKYXp0S2xNTjBLbjdhZ3c4eTZuYU1rZm1xTXUvKzNILzljbzZn?= =?utf-8?B?RVh4RERmWWU1YnErMDY5b0NkMmNXeFVIR0RWTXBtNVZaeGVJNm91MFFsMThB?= =?utf-8?B?MjIyUERvRUlSOEx1RTYxQTFYYzJIZU82RkpUaDFEZVV3ZWRORWlJUWZtYUlw?= =?utf-8?B?YnpVZVpReTU2RjUwUlpzNVd4dFM5L2hVSVJINkVnT1dwaC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VXpXaE9hYkJscE14RFYxTjlD?= =?utf-8?B?RS91WmU5N3hPVk9JVG91SlFab1djWml0Vm9KdENUREdsMUxsMnRqNE1DdTNL?= =?utf-8?B?L3Z1RXo4M1ZsSnZaamx4QWhaVjJML3Uvc0JveHB3WmhQaDRsUVUxdkFpejEx?= =?utf-8?B?eGpDUWljbExqcDVjQ3I0b1Z3NkFCV3ZsTnRVM3JhNnJVNXZVOEtvNGRTUmJQ?= =?utf-8?B?aXNTblk4VHlJd2s4bE9VVkpqZFA2QnBxakVMOS9nU1FKVVhQenJSV01qWnhC?= =?utf-8?B?QlcvcXBjV3d1TG9mdUt4ZGw2R0dhZ1hpL2VuS3RnSkp2RGFveVhYNHJMZzRw?= =?utf-8?B?SXVHZW1LaU1hTXhpWWJrUjVEVnFqekVoempjdVpsNnJHV1ZETVZ3enFLUW1Z?= =?utf-8?B?bk9WRXZhZjE0dkp4RUxMcGdtUzVVVkNBWXl3NlhsZU1TaXAzbmVXNm1FOFBQ?= =?utf-8?B?QktRcGtLMUdlWFBWNHBoaTNIb1lwd0ZBOURwMnFFc2E2ekRFNmw4WklhRVM3?= =?utf-8?B?endOTXdUaFpTdDIvcEV4V1hBRm4rdnlqQ2FyRGpyd0hZOEtma2YvNlRrc05w?= =?utf-8?Q?+8kE=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 915ca2cc-1e15-44c2-35a7-08dced4e0bdb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 19:17:44.2821 (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: xc2rtHGTlkrULzy6w6+XBXq3IupCZLahZWyt0jCUb4sfBblRJtFlPJlYKENjTCMHbknPcTy8H4GZpBR38yxb6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB11002 Introduce field 'parent_bus_addr' in struct of_pci_range to retrieve parent bus 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 struct 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: 0x8ff8_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: 0x8ff0_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 0x7ff8_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 0x7ff0_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 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 =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 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 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 <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 struct of_pci_range can indicate above diagram internal address (IA) address information. Reviewed-by: Rob Herring (Arm) Signed-off-by: Frank Li --- Change from v4 to v5 - remove confused <0x5f000000 0x0 0x5f000000 0x21000000> - change address order to 7ff8_0000, 7ff0_0000, 7000_0000 - In commit message use parent bus addres 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 struct 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 824bb449e0079..38db2074494b0 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 9e034363788ac..0cff903653916 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 Tue Nov 26 22:36:20 2024 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2084.outbound.protection.outlook.com [40.107.103.84]) (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 84EF9201016; Tue, 15 Oct 2024 19:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019874; cv=fail; b=bpRmyPjBUZii4avRkF+1Oqihq/J+Kz1WOLRA9zHB688Ge5iB+2W/SraCID4aaV4RzgSdzH4b07apaUOEmiJYcvbQNN0fw5tB1AY5tg3drVoO3xhQQTxutToQAhbtUBws+Cxqv6fqcAzvVpQC0Babve4dgR9xr+/cUlMFdHurK1Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019874; c=relaxed/simple; bh=mxnXQtsQ9r/Ji6o5AXb2owHgaiMSnmyNmFBnlNFd3kM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=hpeCvHO6MIM4h5xnmlRP5fn0hFByfuOsggi+xUgvw15eTZK3xU2tb6h8LEPltf32bHZTGezzUd6eGEl+8B58VcKetQk+WAIdthNrzmj6uQsjr3fc88Mb2lMbP+AL+nXofqxTMPG3Vry5vQSB4MWj4J/1yQw4QtRqmnTiaWN9zFM= 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=kD6QIQGE; arc=fail smtp.client-ip=40.107.103.84 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="kD6QIQGE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vM8R+d/LfoZGuLYyngUyDupJ3aO/O4wV8vmVEtu83yOvevgg+P9Ltp1ds3e4/a3Q/bE3+cmtg8DzbvWplwsJUMLCEUAx5puhLuxrR9hRV6zWW4GeErW6Qa1xiWZiRaepLAMCdeew2tC9wqvnwzg2F824Bu9k7UDr63UgEXVKW0BjVZhDD/UERtYkq+FnvxXqOJFV0QGcCOa+nx6IXPuaUdgqMoJTcN/wxyt9xNOGG4EEvkacth1eNnJlbO0vX/+b4wLi6/6K+Lsv7IKLgVwh/XTvMOch8mmNHNpvwuJVTz3eNy5jJYtn+WVD2xmuN2ztqeP64Rf+oOACZT8fMYxd3g== 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=fL3UKGvdWP+KFjAwQhRXw53UwJq+kOcQRY6+VijyXiM=; b=k4VEdOcQNdZwvInN5iIFh469wpD5CL7Xbq/yvZdtBHmD59ebkKmsEjb7/1tTyDDt7Mzu02Soi0PNvVdLBMMb1Sel0Q2aFapEvcN6yfj6pGwdTkT9+6HJVQt13cmAxCd10N4lVtKFF+LRWlPk1fu7XCNGW1gclvlIV2ypcyLe7oiduW7a1BwUbTvKwK2rx/kPPEGh9xyeApQQkQ3oB6Hjx9M3MvyLPurWD6v/99dvAULohSvuEvSoAJOnAziGfoS+HpphZidu3mw9l7U8EdND2fC2MLsirsj9Mveh+3b/OUsydYlxMf48Py3UuOyxeMTXkCRjgTQFqu97HZQAFja4sA== 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=fL3UKGvdWP+KFjAwQhRXw53UwJq+kOcQRY6+VijyXiM=; b=kD6QIQGE6DhlVjt7VzLe8SYXFu1/rbs/BIOd1a7ryeKgMklakfEt5Vv6YQse0UlHOjO+dmLXDfF+T2IwK+7zykFhN/p1r+XISr7/dgYssNQjl6QQUJKMcixplAStf7Blr0SNN0+YdNb5xNKsp2oLyPG5ZLnbU7rQVJlyZdIbQiyEgBpTuHbcwAp4hBYwgiMgY850r4GiZJLUAJsBYsCBGdiiWDlXtZl3Fp2q8plY/3cCmglSoPNv2ABCy2mrkfw2cuSbjeUDJqeAZ08+a4OEtMX7eE0RqVbkbRi4745SyRbezhbMP3M/zJgj1lJlalu5vxF18LOOJmHwT6Qmkp0VIw== 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 VI2PR04MB11002.eurprd04.prod.outlook.com (2603:10a6:800:280::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 19:17:49 +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.8069.016; Tue, 15 Oct 2024 19:17:49 +0000 From: Frank Li Date: Tue, 15 Oct 2024 15:17:18 -0400 Subject: [PATCH v5 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: <20241015-pci_fixup_addr-v5-2-ced556c85270@nxp.com> References: <20241015-pci_fixup_addr-v5-0-ced556c85270@nxp.com> In-Reply-To: <20241015-pci_fixup_addr-v5-0-ced556c85270@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=1729019855; l=6561; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=mxnXQtsQ9r/Ji6o5AXb2owHgaiMSnmyNmFBnlNFd3kM=; b=hCXFkStAglAgicEerZg0T9vjbjZOfT2D6EApXOSIqlVLvUcP9FLTbnekzA8GqCTVnl6JiHKeh 93wW59KQVo5AvoqIVG0mHxDp4xZOBJdwVOFC0RUTEyiZBKNbGLA9Q9V X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0117.namprd05.prod.outlook.com (2603:10b6:a03:334::32) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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: PAXPR04MB9642:EE_|VI2PR04MB11002:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a7990a5-dbca-4741-e6b6-08dced4e0eef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|366016|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RW9PWmFVVE1GaWRuMWtmeE0yQkVmd0xrQmErYVppT3dZSXp6dkdkOGpwZGZ5?= =?utf-8?B?VWRPWkJUNDdFVjl3WWR0M3V5VTR6WnpyWnRBbjNDaENSeGJ6UklWdWpjU3RL?= =?utf-8?B?Y3lZN2hyZkVXbEhuc0RPcEtUT0F1NDVGSXBVVzdVVG5iQU5OSmxEMnFsS1FH?= =?utf-8?B?cmVxa0tVd05IQTc0bUNCRHk1QjJ1dVFUUzhDVFpZVlNQVjNsNWZydkpiRFI3?= =?utf-8?B?dW1jTDViMEtKeTdYMks1UWNOelVPT0J4eWxnM21OOFovWGd1cm9ZVmI4Q2NB?= =?utf-8?B?dWo3djR5VFhnZWpzOWlWS3FQZ1FnN2JCcThvYmZYNXc2clpZMXpZdWMxZ2U5?= =?utf-8?B?ajFrbTdBeUVueUdKNkQ1Rnl0dUl3RUVMSU9mR1EySTVOZTZqYnZvZUxJZ3Bi?= =?utf-8?B?OGh2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xZTR3aVBIQ3ZxNWU5?= =?utf-8?B?VkU5eDZQcEp6OGR0OU9kc3Q0bldHdURCcXlvWnBZc2VudXJyMTF3Z1I4STk3?= =?utf-8?B?TGNGeUtMNXg2eGdaUVN6Y1R3V1grV3Rjc1ZQRWM0aFNVem5jazlKamJsQko2?= =?utf-8?B?VDhCRHZBeWQ5QzVUcVpxRndyRTh3U3Jrc0h3M1NRWnBVWDhRclpha1RBMEx3?= =?utf-8?B?Zk5wUkFiV1dzL3FqQTBhZzJLdWNDRGUrMlVyUGl2WUc0M2NZREluVE0rU0hU?= =?utf-8?B?eU1nSHVXVTdMckpsenFBMGpYWmJNMkJtV3VtZDEvbVBBaU1ZVXorWGNyQTd2?= =?utf-8?B?M3FWV0I5TjAvekNQeFR6TXdmaGR3UUR4NERSYWZJYXlVUllWWjlJUEFjUGdx?= =?utf-8?B?NE1xUUJFcWVlaHJJRGJRdUYvZXFEckVNbGc1NTRJSTEyaHNXUGQxWWV6alk3?= =?utf-8?B?VnROZ29ZVFhxcVVNZXAzZCtNcGpldnBWTVVxZTVlRjRzOWNvd0dvY1BoOTd4?= =?utf-8?Q?Vs0AQAVyGJ4PPMVUncf/c3+i4bDSlcY0uuWEA=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)(1800799024)(52116014)(366016)(7416014)(376014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NG5seDJyMkNCbGdlREM0RUhHdzZEb2VwempnRTdlNXA2K2pkU01ob3pYK3Ju?= =?utf-8?B?aTgvMy9VLzQ0dVJ1SlplRktQb3lvSkhQMHBYNFRkU0U3c2hMUDBIVUlSR2tG?= =?utf-8?B?eUkrMStscmJlL094SldWc0s2dVhPNWl5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ajdTOVk3SG80?= =?utf-8?B?RWtUK0Z3UHNXRGFRS0Z5cnNZWUVKdmdQbm9vMlNjVEFXNDZaY2VQWFFLZ1ZB?= =?utf-8?B?TWZBOUZldE1MWm0zUmZFNzNyL2ZKcnZDNkRuczRMMWorQUxpUGNVRG9kbUVB?= =?utf-8?B?dHhwR3ZQdlFnZDYzb0U0dHdPaWc3Y3d4MFdEUitsSWtabFhOam94dm9PcXkx?= =?utf-8?Q?Stbs=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a7990a5-dbca-4741-e6b6-08dced4e0eef X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 19:17:49.4657 (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: NduNIf2tDf0Rls1GonXUCjvlSzQyN/oWuMJ+6eRhxvTkhsk/CS0PKj+hTH9oJeR4M0R/AOuoqP1/LgkuV5WpWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB11002 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: 0x8ff8_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: 0x8ff0_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 0x7ff8_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 0x7ff0_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 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 =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 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 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 <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 v4 to v5 - remove confused 0x5f00_0000 range in sample dts. - reorder address at above diagram. 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 347ab74ac35aa..f8067393ad35a 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -463,6 +463,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 Tue Nov 26 22:36:20 2024 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2058.outbound.protection.outlook.com [40.107.105.58]) (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 10B9D1B6CE1; Tue, 15 Oct 2024 19:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019879; cv=fail; b=o9xuspSOB/VKwz0WAxYO7uyBabrPJi0w+7ldpR6CR4s7LxHdjvqOFgm9EyF7+3JeUOPMr0Ygwp/9bh4XpxXv9H6BbEwQYNT6PpIehyl1p3ceq5iJgwdWvzocxYRAkoq9xMVRnVGwiHEcRw7Gi7jrMhM+DCHQ4IkNe6gRCch/D1g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019879; c=relaxed/simple; bh=Xur3w88Prm2U9ti80meGJLxIu6InmfTZAzjgILmrVU0=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=RYp1LTQ2ARjOhQUgWCgkvJhtNbzWdYb4irhVZI8g01PMCwr/kPNanqeDGMGeKrGm9O4ouRCPHxS6XwowbeZfxhJp6L/MMpM/d6t8Y63RSqEQUGOZd0sMuO7qHFDej7ShQ0qnqsxMJXGaXaFvUQbhQpjJRLUTitMXqytB2FJ01f0= 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=Ig9KZhvo; arc=fail smtp.client-ip=40.107.105.58 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="Ig9KZhvo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PjKX9s4C8O+HNEZVFwkQz/zBdXvgt/lmg0b+rWZ+gvgubkNFw4BcvB+Y0h0B72rJSPBG4wCOFNAedvvVj3CZF7C5b7Qo0D3HJ/oQDBN7ffeW7gAYFWaXJvLSBsDTZiJFgDreXUJDUNFc4vWrKrdINpiIB1VYC0SLwEQJBfhYzyLAHpv+66qiRXeP7NJjOshrHQNKecwCBa1DJZnrpvHvtd6XLNWXBkW4gdeKeyAPDdBSwinMrKict7BjVD6vGLf5AD889RESxfTWKKSgm25SPkCOxKeA+bbEJ+jgVdSmMMeekJW1r+LrlsX1q5cc1YgyMq5dnRYh3TVEkeYUodnSTw== 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=kFdkiX44EjkJj3LAqVwNHMJG8BXqkLT7bhkwcmGyI8Y=; b=Tjsz/dFsnwJ6eqZisRBYthZLvWzz9PphxCzlap/ISEM6oMroMgikkS69nWWuTmHKa0irkoZCIhG3OUSd0OXRt/HlotBprRhRXbXF8I7nLLMunauXgraSTSJoyiFlme7QKHoKltS+7xOeEfG1LP6QjfKscYpXEsoeRRa783WCSzPREkHiojMt344Fsdhz5Q3DDqhgCVGkbMMWg9JZiqQqBG4QzJq09jKLXbl1UXAL5GwTYER3JtqOp7xB+mmqx41E2zTW8soe8Baj6FdAInZ/AH7A98UaNmo6GO7F52FUnZ+l3g2lnxrAbJG/L37VzasNVMmw1vJHJeyAHxvI+pXdRQ== 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=kFdkiX44EjkJj3LAqVwNHMJG8BXqkLT7bhkwcmGyI8Y=; b=Ig9KZhvoxxBtKwaq9W6Dpl2i3KHO+TmXIVq0gKGEiG5iw+LXqO1yl0fOj8MYsqEsW9UI4VciRGnVR5UZUHl+ZQskiw0oqe+hqSj4DGYZPy7P1su4+Tw02Rw/6lupquhIqMAEJ0ljYHJcHmi+Z5wQWPN/94RWPRnq65LQLvRUs3APdpRL2zMETojAHdTqYvURd5mCVjE2i5g1Nywv6/g0yRUsxxEZNdPIK9Z1onWUjShZ6luYj75oiAhQQ4K9mJldjLB7BXo9t5dy2KvCgE4Tf8afg+5BIxk32uI2q04weMm9r47mz1YE3IsE6fIdFRM0idnaaEd32QWoLb/CP3cLkg== 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 AM9PR04MB8826.eurprd04.prod.outlook.com (2603:10a6:20b:409::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Tue, 15 Oct 2024 19:17:54 +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.8069.016; Tue, 15 Oct 2024 19:17:54 +0000 From: Frank Li Date: Tue, 15 Oct 2024 15:17:19 -0400 Subject: [PATCH v5 3/3] PCI: imx6: Remove cpu_addr_fixup() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241015-pci_fixup_addr-v5-3-ced556c85270@nxp.com> References: <20241015-pci_fixup_addr-v5-0-ced556c85270@nxp.com> In-Reply-To: <20241015-pci_fixup_addr-v5-0-ced556c85270@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=1729019855; l=2455; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Xur3w88Prm2U9ti80meGJLxIu6InmfTZAzjgILmrVU0=; b=CfiwpnLOP6TFyvQ9YuQRyjLyR4VWCIAxMb01L2DT4ROCDyrMXEuNW+7QF1uF9bn8Yoc5jn3/o McSsd5Uo+9mAC590Kk5w+kk6T1xmuiHJ+h7yGdod53WsPHxri9YwBXv X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0117.namprd05.prod.outlook.com (2603:10b6:a03:334::32) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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: PAXPR04MB9642:EE_|AM9PR04MB8826:EE_ X-MS-Office365-Filtering-Correlation-Id: 5232c217-a128-4570-3cee-08dced4e11aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OW5VRFRKSTUyNmdLdmVGdU4zZDFvY0JHSko3N2FwdklXdUVud0s3enJTbXhH?= =?utf-8?B?cld6U1hrZllzb3FRaHd3cWJQYm9oN1IwVGszQXkvVm5WcVdyWDhpeEl2OGh4?= =?utf-8?B?eW5hdEtjaGpWa0ZxYkdwQmF2SU9MaE1yYmFqWHg3MHkzTWI0Ym5GRXFGRnlP?= =?utf-8?B?WHIzWGlKMnp0Y3kyckwrZVBpdTN5VEtSbTBQWWlOQVdXdnBqT2ozc1U4bGc1?= =?utf-8?B?QVh1RmdJOFllUUV5UnFUcTdyMVRpdWx0S09RRklnNGVHMEVwSmdjYTA3ZHNY?= =?utf-8?B?dXpaMnZjR3BmWlRnU2Z1Wk16RmVSREprYXlUa3o2K1R4N0Z0NUV6ZHZ1U3du?= =?utf-8?B?WHBtdzNTck5NQ2JrRFNEb3p5bGwxODR5anNxTlJKc3E3cjdLV0xWZ1ArdlhC?= =?utf-8?B?S2ZkWUR0STlWRHk4Qi9tVysyMU5YbXFwSWNNRFR2TXltbDVBZ0pRaEF0YzNE?= =?utf-8?B?bm9vVUduUnd1bWhDWDliczNnYXc3VlphQzZkZzJaaXJWYU94RXl5WkNqSE44?= =?utf-8?B?SFBDSUFpN1c2Y0gweitUZkxzWUNmb3AreHVWVy90OXFWSlNuZW15UnpxSzMr?= =?utf-8?B?UURraUFkQkFBRHlzczlxLytLemVHWjR6dzZaMm5McUdZWXhHVE9iQUpBUlk1?= =?utf-8?B?Q3lYYVpiajIyNXFReFJZM0pQQ0xaaUh2NWZuTmlsaWFoS2FNOFl2VlQxMmM5?= =?utf-8?B?YjBJSFQ5am55cU0vQ2FtK2IzTE9QVkVEcTFYN3JHNit2Qzl2QUJqcmZJRWQv?= =?utf-8?B?a2hBUWJpNGdoNz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?B?b0lSbHJuU1ErYUJWcmlaY1FtY2gweW1nMitzd1k2UDBVME9BYVA1cXBqNlE1?= =?utf-8?B?WHk4N2Q1KzlhVHM3aDhGcVpSWkdVWXNYejUxVDBrN0JIN0k3TFNEOW5rUG9l?= =?utf-8?Q?yX7c5eFa+DZ1M7X7C2STt6slcpLOKG65fKRQ0=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)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZUErUkljQ2loamlMeGVhVEpvZU5uL0pCSVYxR3A3SU0yRjJoMjZtdVRUUjlV?= =?utf-8?B?WkJaZVc0M1VJQnA2UHgwOXh4eVFOQXNWNGFjNjY1alZhcHlEcEhBdjQ3ckR0?= =?utf-8?B?THFvMEhIZU5wakhVRXZFSE4xWmdxa203dUU3Z2tBY3ZhTnJnS1hBZ095RldC?= =?utf-8?B?MFRtMll4bnV6VUZ0UUxndmpGNEFaeFJVa1FqTmxpVStwVFFCMkNqWFlZd2JD?= =?utf-8?B?U3V5UHlJM0VSTWc0QkJBR2krN0tDV1dCYlY1eit6dlJ4bDlkU1RnOXpRN3Ro?= =?utf-8?B?aWhpN3kweU0yajFyZ3JOeWtHV2VmeVMzTERNZ0Z6QTkrUkx3VEZBOXFnNEM0?= =?utf-8?B?NTc4YTRiYXlZZmZ2bDljLzZKajlhbHdSSmFLSXZVbW8xTU5TY1cxNUpDbUhr?= =?utf-8?B?YTY0VzhlUWxqd1JxNUNtUktNelBIT0tlY0ZyUnM5cWZQMjh3NWtkbG1OSkZh?= =?utf-8?B?Vmt5OUFHR1RMNDRNRjF5OTM2VUh4K3RHOVgrMUZJMWtPUnZwUF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Wk4dHR0MVZBL3FW?= =?utf-8?B?TlBacGxocmhFWU81RzBKNmp4TGNjS1dZQ3EzcnkydTdOK3M5anhTVjF0QW5r?= =?utf-8?B?OEtpSzh4clBzUFM1c0FZOVAzbXJhQlNGakV3cVQ0cjdyWit2eTAxZ2YrWnc5?= =?utf-8?B?ZG5GQ3c3cmdSTThsN1BBc1hGUWc1Wk0yU2hObVA4NkJpd3lGVGEzNTdLN0Nk?= =?utf-8?B?QU9rZjM2NGxWbjd5SUU5SERMcVdlMmVxbFVBSVFHRnI4Z3I3M1VPc2tSSVdv?= =?utf-8?B?SmVUKzREbmJRN3d0OElxclZWT09zOThSVi9QWVRaMXVWQWQ3ckJSVkdwRGEw?= =?utf-8?B?dzcyMEU1MWI0SlZyVktzQkQ3a21SYVB1OTRCdUo4cFZrNFdLL1dUMGNaT1Qv?= =?utf-8?B?UDJmZ2tFSktWUXo4bDNYZGJvaW9wQzhnZ2JaQktCOVo5UW8vVmpKV2xtcDJ0?= =?utf-8?B?aFlqR2lHV3dKUTFMNEl4QW9sMjBqbGEwQXAwR3ozNXJEY1d4Nk1uRjU4Vk9z?= =?utf-8?B?SkhMNVZoNGVUQlROUzExK0NGVlpjK2dneGVnVmg2aGQzYkpKTitRdUVadjYz?= =?utf-8?B?dUt1TzdXcllFekx0Znd2endsU1ZDTlZoT042b09OQXhMN0g1eG14RHpyTWxX?= =?utf-8?B?c3hjQjFHaGRYQk41WUJZZ0JCaFVPcklQVk1idU1Ma3NtSGduM2JMWVR3c0Fz?= =?utf-8?Q?Ms3Y=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5232c217-a128-4570-3cee-08dced4e11aa X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 19:17:54.0391 (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: LwDgHXVUwOZ8uwmSt3jy8jYtO8nSQVFA4wzLJa7wepfIW2708qFbtqR5ICUT5v65zVkaAZ9Z05GUVJYxqqO2uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8826 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Signed-off-by: Frank Li --- Change from v2 to v5 - 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..533905b3942a1 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) =20 #define imx_check_flag(pci, val) (pci->drvdata->flags & val) =20 @@ -1012,22 +1011,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, @@ -1036,7 +1019,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) @@ -1446,6 +1428,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) @@ -1585,8 +1568,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