From nobody Mon Nov 25 05:42:55 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.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 170801D2234; Tue, 19 Nov 2024 19:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045483; cv=fail; b=qxBo/FJ2Z/YalxJPTJKtqU+BZpzmshgvWSbYecoMtFy0525MiAHT5ekQF9n6c6P9cvU/ReOJIF/4OvMgSCktKontyNTVuyOptq5u7dTjN9LqJihEyjXQGi1f74aheAUQTAtybtXICUlbrB6M2iw3eO32Jf+Z0pHWRItf3W+n5b0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045483; c=relaxed/simple; bh=qjpUcIbnkk/T4kjU5qqs7K3xKeASfuBpjDR59WiM6kE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=K1j+xSa/mCIQuMPy1oVgMOvQRGTiwPK6zBID/Fyi72s/zH0BOuEgHxDvJw6xtHvVgPONb8d6rM3RZyTl8NrKlSaHhu4hLJIBtyhOkGex/EtgmPQ5bTYzdWSWqr9EROZGv7LDeaD5IRJV/bR0tU3qqBUhQmm4MwSLacTYVMWfDs8= 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=d6GB91o9; arc=fail smtp.client-ip=40.107.21.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="d6GB91o9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pRmzvwnZUT8O+vyPmjpVFs09Bs9HE7Vvctgl4+vjQjtL/lr8iDdc8+/53MDiIY4p4T7AxpyJwA4E2WycDcrMjbC+Me973H7OQG+aaQjAzX0qhmt7sBGw3XJKZ4gTZRxclHryQ3eHIyxvjhBkHwO85WWwzbwWHrc2Zpq/wD0sGFFOKX03s9iNYySRwUwMUK+drIFjXNvTh3oXIMv1PQFuBzS1RvnmkWNjyjUjCxfE8IhRMRjU4Z6ttbxVM8oWqxR8nhn0SdrdiLYCTDljq6jckpxW9svtpp5WxyY/Sac81q4+CE/xZoyFWLoMGIn5UuAu/kBfLEM9F9ptC/31SH/SgA== 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=xbHBynal3pF/RegJFlo7IroGpXvPbJAYX+a27w56dGQ=; b=XLPpPn+REQDj1VmvNnnRodJLWQLLomflFJOzUT8BkWaA/uF/gB4FuvJqmHbu0JTcjRK/pcpbVgT9/+kHm43CVGEFZfk8IfoZwzvcWXXAlUSLiBCIe0wCYQ1gEPAJXEPiGJFtbcQaqiq5nC17cMgJuF7Dgo4Op+Szv5t8lUYXc23W+3LCcZXpAGGWEhs1/Dp6FqkvGcmBkz9VojKDBzGQUa6HTxOatiZjPrNAJQwWgZdLlk4RNY2nEdOpgkPKjIBR165SRwBeEWO9kvAUTy6+nNtM1ph/CNTJml74RUMcrwERbItLiQ3A5wTcjZ2EuaDU7U2GFyLU5M9Yt44omsmPKw== 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=xbHBynal3pF/RegJFlo7IroGpXvPbJAYX+a27w56dGQ=; b=d6GB91o9boo2gFLzpuaCFvPvZ6HJVnCGruBwjnUbABYHkSspL7SlmGoQC0W4vMIYP88R4O9NnYLvZGgjLMrDdse1hbHrCsCl6/fjpvGhwn/AAdDezBpehVIPeD+iN3A8FjAHiyKTdPfNGpIxncTktqQ9bAigbmxJt1Yr79v9sYK3zYINzB8+5Jvtt2iN6gDtVZXNb9ADtIgdWl4AAAeYq74zXrwvjyaxbIrQrnCb0m+tgMv1SSepLOUDDwVSIANtRRUbot1J5zJND0dKP+5lnrO5awljPwVEa8szUXMI1Fn5hlk9WFWoUnIyRXYz2IdETyLC8+2yOw6TTzk4F7TaEg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:44:38 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:44:38 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:19 -0500 Subject: [PATCH v8 1/7] 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: <20241119-pci_fixup_addr-v8-1-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=4876; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=qjpUcIbnkk/T4kjU5qqs7K3xKeASfuBpjDR59WiM6kE=; b=iO4hrat6JoC6X9ncQ2MPC4tB19yUm0v3tRRt1J3qno05fE/u5aLA7nr42Ka7xwfmMHmVTaLIP P/T24/1OxQfA0ABYFLq2EzOx7gpVAW8Wn5iRPR1VUVEXC5VfpgqvnqH X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: 0354921e-19d6-4ec2-4389-08dd08d29a94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38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jRYZ0Qx?= =?utf-8?B?aFhsTkNkbjR5eTNtN25tejB1RFB3WHp0ZXdyZ094QWRWbmpIQlY5eGExNiti?= =?utf-8?B?ZmF5WUhZbGZtN21LMjdkZ2VQMWNKblRtRmZkM1VEeVFkUzZ0bk5jZVUzaVE5?= =?utf-8?Q?DZA14VSWfsD1h?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eUUxYkNHN210QXRpalRCU0VObXRiVWpxSCs3ZHVhM3JlVVk5cmR5MU5tVnoy?= =?utf-8?B?a0dnaUEvNmM3Vkk4NFR4dXh6OHNrT0JBaU9Rc3EvK3dWQjNlOUEzV01Vc08x?= =?utf-8?B?Wk8xbVNhR0NoSERqK0xhYWZPbERTT3pCNWk3dWtPOWRLdkwyeDRFaEoxeGI5?= =?utf-8?B?VGh5cU9XWGR4N0x4Y3RGazlXSXRzaXdPQjhNZ0U2R0h6K3VNa2dRUFNFL0ZW?= =?utf-8?B?U2k5dXZtK2hLRi93ZW5FTFg4ZXNmZWR5dFFjSVppdWpmZnQ0dkt3SHlZemtF?= =?utf-8?B?M2FMWVFTK0tOdkpDQStHREhDMVR2eW1uOGZFM0gzMlFwZnUxUVlsS2ZwaS91?= =?utf-8?B?VWdLVnNEb2dHMEtpNm53Z0o3OUEwR2dRbys5RUtyMkp6K0EyVkJnQTFYWk40?= =?utf-8?B?dkVsS2w2S2QyWHYyeVJjZHhHS1ovamdYd1JXWW9BanZ3MGJTdUZLczBMYjl6?= =?utf-8?B?RTllK0hTb3NUU2JoQkZFOVVjMFozc2xIU3NLUndudHo2anQ1QklxZG42eStG?= =?ut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YjNNOGlJbDQreWtzaSsxc2ZP?= =?utf-8?B?bjBGcnluVlpnUStmU3VRcmN6a2J5UzF1TWg1TW12ZlRFZUJ2ZjkvTnJHakd1?= =?utf-8?B?UmVTaWZXS2hLQ09DZkFheW1nQmUwYmVXWFNzL0xvUnhmVURJRU9rQXA2N3h2?= =?utf-8?B?NzRSNTkvVzduWDRTS2ZBZW0zWWlvd3lJc1dHRXcrc3M3SjFOL3JhcWFlbDM5?= =?utf-8?B?TmlyTzRUYVdzR3AzVWEwZ2JCZXdMQmJSUUpPaXhjQnNDZzZDblQ2aVBVZFRS?= =?utf-8?B?OTFqWWpVckJZNWxHd0hsTGIwMlhtbk5LUFN2SVVqdnVsNG1pSDN0UWp4eDl6?= =?utf-8?B?OFFoZjZUYmdodXdTKzZIWDFhdXhqbk1IZkpHRHdmT3krU0pEcFdsdENvUmRz?= =?utf-8?B?a1NxZ0RKL2VPYXdHQm0xdXJmYW1VUkQ1MFlJMElncGFROEplQUNtOGhFNGVn?= =?utf-8?B?b0F4dUs1TDQ5ajMvVmNMdFZRcTlrSEtac0NTSFNWb2FjV3FyUGhOQThJWFpB?= =?utf-8?B?OXdQQUdLM1pWZmpaRmVpTXlsSTlYQzBTWjFsaCttQzI3NVRqeVJEMnFzTUV0?= =?utf-8?B?T2FqSmRqMVUxejFVQUlmSGdSejBNSW9ZUEVJRlFqNUE5R3p0OWhJZ1ZLZkJL?= =?utf-8?B?SVQwa2JXL1JLSFMrL1Z1NWZqQVd1S25oSW9oaVBDeGE4QjJPT1lVaEFEbHZ6?= =?utf-8?Q?9EpRzMBQwtJKQgm3gsh4mk+K0?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0354921e-19d6-4ec2-4389-08dd08d29a94 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:44:38.7371 (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: sCr5miW0KnDWxaWOvy5hhUShmXcjiPz5YxbSPrOpyKLOHW89ClONC+YYev0g+bb/TIQbX143S5f/0b9MITRPBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 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) Acked-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- change from v7 to v8 - add mani's ACK tag Change from v5 to v7 -none 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 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 Mon Nov 25 05:42:55 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2078.outbound.protection.outlook.com [40.107.20.78]) (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 D42B11D2234; Tue, 19 Nov 2024 19:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045492; cv=fail; b=YwjAxpdXZdjFv38+dRAcL2Oge32QvvOjnqk8ThmAg1O2mxkucCpUqwyQ4+iOgWvIBhcs0bYlf/0o8E1X1NQgfwEU16e4XgGWQNcwbmwtZjHqcU6qhwQ7V3Y9KcJ3N3GZa8sWFsBaH9e9LPpPXSpahLKRCzXCayGUTg+Eg+K6ObY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045492; c=relaxed/simple; bh=pBEr3qIZ3MtXH8tsEo1g0q/TpoDEnc9FIkQttuF8yAU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=rSxOpR+wuW3UCAd1tWBzJDrdWI96tzLo0yeBw6HJIrzTFFWlq7HhfiaKDooTuiu1yFoIcHf2OVDyVxr+5vqI79KupBCNCHJhutsW+4MJ30gkBywqFs0xt3VjtizjL81ONFRUJZ/CIw9eZzyQNRGNzIhYjgHylpuMO28oWR+axCs= 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=ZfVtg563; arc=fail smtp.client-ip=40.107.20.78 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="ZfVtg563" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oSap2T2G5yPjhmHzu1ufqvXIbi4vpR2SzLmRbtC6CDKF3RTUMEZAKvZ+dPDoRYqZ2uZ5oT3gXkvff8Ohpgk/fpZ16ID/lWliyA18hZwu45hrp7zV98GGTkljxm6z0i5Zr0OIDuKA4649Taf6BJIwnTisjYHiAFHQ5ffvUNLB7DC1sRztddls5W8yHrCEyCsw8DXcxO+xwgQGWMIqk/Nh2y35X4JRapwm5Uvji3ZxfTm+60l7yZFcfZIXOqjplL8Zt9Q+apa+yANur4g09GAB6pYnZ/pb8bi1FlYoM0K7/PL40xrVCw02Zv8PGIUxDRh/l32IhF5g61IUgBbdANokQg== 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=zMo3hBX8GeMdL53WMeb8f+oFb+ZgvK88u9g588A/Bz8=; b=WZrnjyrzUavolmo7BVilXyhQ7EI7LR+eBoqLeGWmas3IyUj4CpMVOp9yK2VTnkahITUP+VfPldhxr2wARcpE3gDrXtMeMmoZviy1ViiS4kTVsplsiVhZ/0s4+VvKGajC3+L3au3POAq2jNfs8K8AmhWpLtw1eOmnEmJTzPb3+Be6tebEpd45jDRStbZ6ZzSUYTspxuoILnFK8CLaJu/ervBR23doYFemCmNO080swe6oKeVz/ARNMiKaxtr4/WLzVi+u74nRzZK6C/w18GN6TICePJTW+mrOpN6kP7EChXhtjq4pkA+8omlm3fAhHiEeIoCTXbjSMGd8LAmtPpTKZg== 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=zMo3hBX8GeMdL53WMeb8f+oFb+ZgvK88u9g588A/Bz8=; b=ZfVtg563NtoFPQ0Ji+loiZBtEshOFevKTV7Uuqc/Ckj1SAOxIXd5kwxD+D6Y8mdVgJb6QTxG9rkg1/L4zLuKs44TAjyzKncr7D40O5eOJIwdW+WJf/LSkpoGZfmNcEBaeM+V2q0CxJXNcOWQZmFFLWZgVAd3kbHcSUyeIxWBZ4+hZFCGm1wZ2AOvDdVx40S4+lx2NUc6+IM/oMjDRItCUaeIB1bAleNbz2nx/CyJpMUZ7pv4KuyM1uNXdRs4+vkDLVVZHHnDnDTBen4sRRTP7Ncc+xUus9z0JPpQl62er+shy7PW0CpvahswFOpK9IGKbNq7dS3zUa+79zM/dKqQng== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:44:46 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:44:46 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:20 -0500 Subject: [PATCH v8 2/7] PCI: dwc: Use devicetree 'ranges' property to get rid of cpu_addr_fixup() callback Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-2-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=8867; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=pBEr3qIZ3MtXH8tsEo1g0q/TpoDEnc9FIkQttuF8yAU=; b=KZDByhYYt5+VS4oBF47h3gWxfMGGXGgWkRF98wXxz0OpFfcGPdbHAJ5LWbo/uwZaRYA941MNC 1ndPTBaw00RBfTidx8qI8xR7bKYKW4l9+OWoXpUJ1XZcK5esbwmMvfx X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b7987f9-93c7-4cd5-77fb-08dd08d29d6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UExQUkRSWDN3b0M2VVpFbEU4emRmdUZRZDNOMHF4em8vc2ZGNVh6bkdnSXZ0?= =?utf-8?B?M2dWSmQzRElIUzNvTEY2N0txNzM3NmJYMlNJaVNsTzNJR1ZGaHRYc2tpbEd3?= =?utf-8?B?VG0xNDJueHhSdjRHUzhGdEZrc2Z0RU93UmhwYVNINmFNM3hWblYzM1MzUUpZ?= =?utf-8?B?RWFkNE15QUJ4SG9IWVRCeFhhUkRzTk5TajFoZ0hJWC9WK3lMUlBaOGdpek5Y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A3?= =?utf-8?B?ek5BRnlOSU96OUJWbVlUbVNYNkxKeTV2RldKNGd2cGlLWW1pVk1rZlhXbXph?= =?utf-8?B?OVVvTi9SclY5V25tZlNxQnprQ0hEWGhJeTBkWllOTEdBQ0cyWEJ2TU9KZHFG?= =?utf-8?B?eHNkL0tQMSt6aE5wek1GSWp3K3VUdHZPYnhMaUxzajBSVmRtalZYVDROOWdV?= =?utf-8?B?UmpsMVdRaXp3SjliRVdFbGRDMUJSRHR0dUJFWVBYc3Bib1ZhRTFESk1pREJo?= =?utf-8?B?VUViWW5UaWlzUFJUU1FCanB5d0V5ZUo5T1h6M0RRbmN4SEx5S2I2aUd6NjJr?= =?utf-8?B?K3JrQ1Eva2o3RnNCQnVKZXhmdjFtNlJBZklTTUlrSlRlTG1OUk5EdkRDVkM0?= =?utf-8?B?ZzdRRXpQNzE1cm5IUWxvTnQvU3RUeGtiMXMyYURUTGo0S1I4UFBOZ09xVC9E?= =?utf-8?B?OVEwb2gwV2x0SDFZT2hTaHNkMS8zRTR0Zm5BS2RIREZaUnV5K1o3TnVnTHNn?= =?utf-8?B?cURzcmdoNEd4WEVtdmdDajNkNmhOdHkrWDMrYnF6TjNOcEVjUkg0bjB0by9s?= =?utf-8?B?Q29GN09pb0RjUXk0ZmVhUWtLN1F5YXZ3T0hZTTJmc3B0cEhUWndOclQ3VmFk?= =?utf-8?B?b2kxOTg1SDNWL05nZXpGSE0vUGRjSkhTTm0xeTJWY1IwNGl2VUdicVBEUmt3?= =?utf-8?B?b0tLNlBXbUE3azdwa2w4Mlh3YkZwc3hqTnZjWVFKSFhKYlB2QnFGYUZadmZG?= =?utf-8?Q?+4J7WhxCHWeiT?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;S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VRsYW14THA0WWt5Ylp4Qnhi?= =?utf-8?B?Y2RNaEFRQThkajdCK0ZaNDVSM1FQYmI0REtLdFQ3bmpzeUtHaEdUOVZwNTlm?= =?utf-8?B?SUpVRFJ2V2lybXhxa0VVdzlUak1aSTJtVDJrcmVzWmdTZ1VlRFZxdlVMbmlt?= =?utf-8?B?RnNyeVdNWFVpWVhKMzhHQkRzRmFoNnNlTVJrWGdiZ1ZzcFFLR0Q1eXBYc0Vq?= =?utf-8?B?emd6ZmhQQWdhLzh1NURZRnJwdklMci9paDM3RHlPbjRwQ3ZNaFdMN2NHNmh3?= =?utf-8?B?dG5QWnd5SEp6V1VialFmdUJMVWRFRW1Bck9PeHFtVEdpRFJWbUVyQU8wMHVr?= =?utf-8?B?MER1Q3B1OUoxRXMwVlcxbkRDbllVYktoYUNGaEFzNktIS21XQzh6UUsrNUhM?= =?utf-8?Q?xHUA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b7987f9-93c7-4cd5-77fb-08dd08d29d6e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:44:44.9652 (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: F7bHEOBH8hZEi5Wb+wwBJCcdXvxd1iOl92kC8RtRKHqy8OICK2LHXkICz9veKa1jsTtzwpxozSuIGh6DVr/96w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 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 Reviewed-by: Manivannan Sadhasivam --- Change from v7 to v8 - Add dev_warning_once at dw_pcie_iatu_detect() to reminder cpu_addr_fixup() user to correct their code - use 'use_parent_dt_ranges' control enable use dt parent bus node ranges. - rename dw_pcie_get_untranslate_addr to dw_pcie_get_parent_addr(). - of_property_read_reg() already have comments, so needn't add more. - return actual err code from function Change from v6 to v7 Add a resource_size_t parent_bus_addr local varible to fix 32bit build error. | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202410291546.kvgEWJv7-lkp@i= ntel.com/ Chagne from v5 to v6 -add comments for of_property_read_reg(). 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 | 57 +++++++++++++++++++= +++- drivers/pci/controller/dwc/pcie-designware.c | 9 ++++ drivers/pci/controller/dwc/pcie-designware.h | 7 +++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pc= i/controller/dwc/pcie-designware-host.c index 3e41865c72904..f882b11fd7b94 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_parent_addr(struct dw_pcie *pci, resource_size_t pc= i_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->use_parent_dt_ranges) { + *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,20 @@ 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->use_parent_dt_ranges) { + index =3D of_property_match_string(np, "reg-names", "config"); + if (index < 0) + return -EINVAL; + /* + * Retrieve the parent bus address of PCI config space. + * If the parent bus ranges in the device tree provide + * the correct address conversion information, set + * 'use_parent_dt_ranges' to true, The + * 'cpu_addr_fixup()' can be eliminated. + */ + 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 +505,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) pp->io_base =3D pci_pio_to_address(win->res->start); } =20 + ret =3D dw_pcie_get_parent_addr(pci, pp->io_bus_addr, &pp->io_base); + if (ret) + return ret; + /* Set default bus ops */ bridge->ops =3D &dw_pcie_ops; bridge->child_ops =3D &dw_child_pcie_ops; @@ -722,6 +769,8 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) =20 i =3D 0; resource_list_for_each_entry(entry, &pp->bridge->windows) { + resource_size_t parent_bus_addr; + if (resource_type(entry->res) !=3D IORESOURCE_MEM) continue; =20 @@ -730,9 +779,15 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) =20 atu.index =3D i; atu.type =3D PCIE_ATU_TYPE_MEM; - atu.cpu_addr =3D entry->res->start; + parent_bus_addr =3D entry->res->start; atu.pci_addr =3D entry->res->start - entry->offset; =20 + ret =3D dw_pcie_get_parent_addr(pci, entry->res->start, &parent_bus_addr= ); + if (ret) + return ret; + + atu.cpu_addr =3D parent_bus_addr; + /* 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.c b/drivers/pci/con= troller/dwc/pcie-designware.c index 6d6cbc8b5b2c6..e1ac9c81ad531 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -840,6 +840,15 @@ void dw_pcie_iatu_detect(struct dw_pcie *pci) pci->region_align =3D 1 << fls(min); pci->region_limit =3D (max << 32) | (SZ_4G - 1); =20 + if (pci->ops && pci->ops->cpu_addr_fixup) { + /* + * If the parent 'ranges' property in DT correctly describes + * the address translation, cpu_addr_fixup() callback is not + * needed. + */ + dev_warn_once(pci->dev, "cpu_addr_fixup() usage detected. Please fix DT!= \n"); + } + dev_info(pci->dev, "iATU: unroll %s, %u ob, %u ib, align %uK, limit %lluG= \n", dw_pcie_cap_is(pci, IATU_UNROLL) ? "T" : "F", pci->num_ob_windows, pci->num_ib_windows, diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/con= troller/dwc/pcie-designware.h index 347ab74ac35aa..4f31d4259a0de 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -463,6 +463,13 @@ struct dw_pcie { struct reset_control_bulk_data core_rsts[DW_PCIE_NUM_CORE_RSTS]; struct gpio_desc *pe_rst; bool suspended; + /* + * This flag indicates that the vendor driver uses devicetree 'ranges' + * property to allow iATU to use the Intermediate Address (IA) for + * outbound mapping. Using this flag also avoids the usage of + * 'cpu_addr_fixup' callback implementation in the driver. + */ + bool use_parent_dt_ranges; }; =20 #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp) --=20 2.34.1 From nobody Mon Nov 25 05:42:55 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2078.outbound.protection.outlook.com [40.107.20.78]) (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 5E9DF1D3588; Tue, 19 Nov 2024 19:44:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045494; cv=fail; b=CqA+3gTdQr7E25eYABsBOK14UWtS+l3zXlNZco+/XApJCeapF1dn3yUe5Qt3Uoxd5B9qi6DqRWmkGGW5DRGhpY6dSoeucZ1aGK/kn0kwuX+Sr+bck8RhdPX4JrJbsJlAAllkiDhqOBna+quxKHK379AVN5cu1v6WqULnDyG9x3c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045494; c=relaxed/simple; bh=aXXX11evuoHeJzI2romv1WKj3Ah+7csb/vVjNpesoog=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=C1ly7GVfyfRU7quqzeTXH+NeCzjAG7zzkCdilb8N9hznTFqSslPeufLbM2X6UNIS7OkJJRpqdMPggrSouU9imVD4aPSp8NzgUKMNhqI4o4dhbXyxiOExyJ3xv3KpJollaUl67Ti4F+nCHl/Wl71aqVkXtxCsvHZaEmhD8kRyInE= 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=HHoDgQH5; arc=fail smtp.client-ip=40.107.20.78 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="HHoDgQH5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m+wPI0HzNlq+7iBN35nCWAB86weCdsa8GiVhpSD5fNaJCr60k03hk20/LtjT9A+wNwFySzEHQzj2DZY/h4mjgO7Ks+Wk/gGmTJdfHtGNN64YiG01ib+31yT7H5nb+IwblahauvCSlfuAvYz4+STPyNlBW7TP2eEqW9KzuGmLOyJmzV49OOxsmEcd9bd6YX8IRYR7RRMMB7X5uLNX36Po+VDkoIsDvBZ4OBsWkzi5hQdhrxUTUdQ0nR2RTQNCHBi/+k3DGQpMPLSSYclh+NpIIwCMtBa0P5TbjR8Mmp9jHbXXnQ4s/hWSy4RpgooGs0IpjPHiD6Ftfd96tsso5ktHpQ== 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=/Slmhx3u+CKxItrsOA2x6YrotWMug+CZlJbr0no/5ac=; b=aeJRrBlMNi19CMrNuigFkbjlvcI03IXMEnkhwOzySw7seFhVUyQjybmduU2oGmXou4vo2JQBjxFkUvsZnbt9f46IwtjhMUx4sZhCXoPuYfrjSsNXGp+drapvY+U55xbq2WqduFVRiU+uIFYsrRF6j5PZkUyWp4hzEgDyIFA8nyAqmuNowu1pESD35cgJDMGnzdC5vQ6+rqrjtIAzLyXSvG8HjNdGVIxrF2ek9zUS7ZdYd8N0YXjnrVUEK+3e76FmWfJCIkpBVCAn/yIPZu8guKujQ/UdG7K75hTaE0yTlnkOL6bz+AkfYn47bJwFvVGHqaPdCNTo6Z4X0fvq7ilJZg== 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=/Slmhx3u+CKxItrsOA2x6YrotWMug+CZlJbr0no/5ac=; b=HHoDgQH52Jtiv9D2AyZohgH2cQdx/h+uSghtSWxpL9jk/FrRyt1e9pd5pE3F1iDChj8TGct13cBD/eRWxk49rd6dbipsCMVZbgZILbRkcYp/WLl47ic+BLV997Uv6RWjQvv8UvevGuSzISGlPX4ktZFlkcRTo/QooDwQ9ilj6wz9S8+AJ1OG+YtA0BUjIkpbXMmFe3//ZjkCRnnHV3duoy37V2/8wzOQRwRJZ+g8tPZiB5r0HawEZOHB2XoEDItTtEv6q2/KksfQBuDVNRTMQyTcTlK6orBEVIuJWXPpKjK04CT/m7XWpcov0fZUNabVH1/02sGUzIXqjVkcN5wyYw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:44:50 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:44:50 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:21 -0500 Subject: [PATCH v8 3/7] PCI: dwc: ep: Add bus_addr_base for outbound window Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-3-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=5694; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=aXXX11evuoHeJzI2romv1WKj3Ah+7csb/vVjNpesoog=; b=qSrTkruYBvzE9sSni5f6eei2fmbhebzWj/98M3g1QQaBKtAYEoh0RQW17+6ziD0eBc56BsCry DVIq028IQf5Dqapv2Xn5Jx4tVQhrVkr76jseqgyHA4lqU226iE+iMqU X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: 17c717f2-5ac8-4eb6-4aec-08dd08d2a168 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YVJCa0xzNXlUQ0VrZ3BoaGZKQVlhdEVubEFRR3JmakwzdXhoVTQxS1lZVkZP?= =?utf-8?B?TmpxWlNVazc5b05KYTUzM2N1ZTB4aGhGcG5FR1Y5M0Zpazk4eDJKQXhyMTFj?= =?utf-8?B?OW4yUGd5ZEw4eXJaUEFRWkZEL2cvZDhrTENwZTQ3WlIvckJOSTBXZUwyVzZS?= =?utf-8?B?QnZja2JKN3NrMFduNWtuZWtCbkdxWVIzZkg1N2l0K1dMWFpYZEx5OVpTTTI4?= =?utf-8?B?ODZTUHpTS1NiTG5rWFM5bmtqVEcrNm4xV3hhdlFNMkIrR3RXTVVMUEpoVVhw?= =?utf-8?B?OVllaXlDRmpwbmFEajBLZGR6aU5hWHZlY01MYU1ZdGh1eEtMWUFnbDgrQmNj?= =?utf-8?B?OFZkano3bXNQRm1iWWQrTysrbGIveU9LMkN1NzVjMTlrcGJDVms3OG81aWY3?= =?utf-8?B?RGFmWkxDS2VuT3RlK0tQTldMZVhJM1ZsSFJ3T1AxL29OR0FwTDBveGJMYmJV?= =?utf-8?B?OXlHbTVCOHczcXB2Z29JRXlMSTdxM0lpcm5zL2l4eUZRRFowL1FHZ0xRdHUz?= =?utf-8?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Y2hnbEo5UGRv?= =?utf-8?B?ZzFUeElzaHNtTzJoVWxhVThNeGFNK2JGb1BSMWhuMlQxV2wyWVpvWW1hdExO?= =?utf-8?B?dTl2ejdGb1p6S2ZqOTdEdDlLbHR1cmkzTnVobm9OMiszanRlcWxsKzhPL1By?= =?utf-8?B?NTBCMDFIYlNmbzVFVXUweHphdWsvazBiRHVxbHhXQThyazBWOXpXSTBMazl6?= =?utf-8?B?VkxadHkzbEZlaEJ2TUdxS2pLNTRjVERiVFRjNm9aS280SFhiRmViZXRKZUdw?= =?utf-8?B?dmwyaUdBYkRaeFVIMk9EQkZsTG5HNmRKTzFOdU8rV1lpTUI1dmExQzFVekU2?= =?utf-8?B?S3VWZ0dKNE9hZU1BOW44cXFuaUovR0VRdElsT1d3OWpWc3hvdHd5OURBR1ZY?= =?utf-8?B?a2pZemE0Y1ZvQXFiT1BMbWIrVXdTanBGaThvNDJVMmtrVVRCTXhGb0FWY3VK?= =?utf-8?B?dzhjU1FSWUx5SmlZUHhjQkZ3R2N4QStmZlBKM3lsRDA2TWc9PQ==?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VFROY0k1WGJINkV3ZnYxY2hjNDFvb2xuQjh3bkl0ODUweDhhaXpPbjVrakZp?= =?utf-8?B?YkVKZzNKd0Y0U0dzM2FUM1JGQmpYN2V3cGMxeEVpZVNXc1NRLzRlenNwRWY4?= =?utf-8?B?TllDUFJaV2YxaVVDMnJXdFlKYnJEUS9LaDFjUUkzWHlESHlFVE4rR3ltR2tT?= =?utf-8?B?QkphMGljTzZSaDhLUEZGNDE1S2lHdm5iS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xZlQxZ2w2WGFwU3Uy?= =?utf-8?B?UFVMclpGU0d0bXJBK3N0d0FDbHVzeDErWk80YmltZVI0ZzlyVWNycEVYUGNI?= =?utf-8?B?aXZTQ0syNlpDWWYwbnFLZFg3Q3cxUFN5NTFYbE9CVzVDeXJYbHFiZFB5Y2dO?= =?utf-8?Q?bsqM=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17c717f2-5ac8-4eb6-4aec-08dd08d2a168 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:44:50.1887 (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: u/e0QEdPud2YhDTNNP4pXV4dlDdQUXde98+yGjX3wyyFn+xSyitXFDUMSvTk3s9kYOIX4t4H3Jd/1fM3n7+czw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 Endpoint =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=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=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=80=E2=94=90 =E2=94=82 pcie-ep@5f010000 =E2=94=82 =E2=94=82 =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=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90=E2=94=82 =E2=94=82 =E2=94=82 Endpoint =E2=94=82= =E2=94=82 =E2=94=82 =E2=94=82 PCIe =E2=94=82= =E2=94=82 =E2=94=82 =E2=94=82 Controller =E2=94=82= =E2=94=82 =E2=94=82 bus@5f000000 =E2=94=82 =E2=94=82= =E2=94=82 =E2=94=82 =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=90 =E2=94=82 = =E2=94=82=E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 Outbound Transfer = =E2=94=82=E2=94=82 =E2=94=82=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 = =E2=94=82 Bus =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=96=BA=E2=94=82 ATU =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=AC=E2=94=AC=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 Fabric =E2=94=82Bus =E2= =94=82 =E2=94=82=E2=94=82PCI Addr =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=82Addr =E2=94=82 =E2=94=82=E2=94=820= xA000_0000 =E2=94=82=E2=94=82 =E2=94=82CPU =E2=94=82 =E2=94=820x8000_00= 00 =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=98A= ddr=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=98 =E2=94=82 =E2=94= =82=E2=94=82 =E2=94=82 0x7000_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=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=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= =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=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 Use 'ranges' property in DT to configure the iATU outbound window address. The bus fabric generally passes the same address to the PCIe EP controller, but some bus fabrics map the address before sending it to the PCIe EP controller. Above diagram, CPU write data to outbound windows address 0x7000_0000, Bus fabric map it to 0x8000_0000. ATU should use bus address 0x8000_0000 as input address and map to PCI address 0xA000_0000. Previously, 'cpu_addr_fixup()' was used to handle address conversion. Now, the device tree provides this information, preferring a common method. bus@5f000000 { compatible =3D "simple-bus"; ranges =3D <0x80000000 0x0 0x70000000 0x10000000>; pcie-ep@5f010000 { reg =3D <0x80000000 0x10000000>; reg-names =3D"addr_space"; ... }; ... }; 'ranges' in bus@5f000000 descript how address map from CPU address to bus address. Use `of_property_read_reg()` to obtain the bus address and set it to the ATU correctly, eliminating the need for vendor-specific cpu_addr_fixup(). Add 'using_dtbus_info' to indicate device tree reflect correctly bus address translation in case break compatibility. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Change from v7 to v8 - Add Mani's reviewedby tag - s/convert/map in commit message - update comments for of_property_read_reg() - use 'use_parent_dt_ranges' Change from v6 to v7 - none Change from v5 to v6 - update diagram - Add comments for of_property_read_reg() - Remove unrelated 0x5f00_0000 in commit message Change from v3 to v4 - change bus_addr_base to u64 to fix 32bit build error | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202410230328.BTHareG1-lkp@i= ntel.com/ Change from v2 to v3 - Add using_dtbus_info to control if use device tree bus ranges information. --- drivers/pci/controller/dwc/pcie-designware-ep.c | 18 +++++++++++++++++- drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/= controller/dwc/pcie-designware-ep.c index 43ba5c6738df1..42719ad263b11 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -9,6 +9,7 @@ #include #include #include +#include #include =20 #include "pcie-designware.h" @@ -294,7 +295,7 @@ static int dw_pcie_ep_map_addr(struct pci_epc *epc, u8 = func_no, u8 vfunc_no, =20 atu.func_no =3D func_no; atu.type =3D PCIE_ATU_TYPE_MEM; - atu.cpu_addr =3D addr; + atu.cpu_addr =3D addr - ep->phys_base + ep->bus_addr_base; atu.pci_addr =3D pci_addr; atu.size =3D size; ret =3D dw_pcie_ep_outbound_atu(ep, &atu); @@ -861,6 +862,7 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) struct device *dev =3D pci->dev; struct platform_device *pdev =3D to_platform_device(dev); struct device_node *np =3D dev->of_node; + int index; =20 INIT_LIST_HEAD(&ep->func_list); =20 @@ -873,6 +875,20 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) return -EINVAL; =20 ep->phys_base =3D res->start; + ep->bus_addr_base =3D ep->phys_base; + + if (pci->use_parent_dt_ranges) { + index =3D of_property_match_string(np, "reg-names", "addr_space"); + if (index < 0) + return -EINVAL; + + /* + * Get the untranslated bus address from devicetree to use it + * as the iATU CPU address in dw_pcie_ep_map_addr(). + */ + of_property_read_reg(np, index, &ep->bus_addr_base, NULL); + } + ep->addr_size =3D resource_size(res); =20 if (ep->ops->pre_init) diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/con= troller/dwc/pcie-designware.h index 4f31d4259a0de..5c14ed2cb91ed 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -410,6 +410,7 @@ struct dw_pcie_ep { struct list_head func_list; const struct dw_pcie_ep_ops *ops; phys_addr_t phys_base; + u64 bus_addr_base; size_t addr_size; size_t page_size; u8 bar_to_atu[PCI_STD_NUM_BARS]; --=20 2.34.1 From nobody Mon Nov 25 05:42:55 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) (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 D3F6B1D356F; Tue, 19 Nov 2024 19:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045500; cv=fail; b=s7KtpNc4A4OVowI/s20S4TaGrKg08GJiU4Ntv2Ynff8dkezyoD25/8LmuYrQvyNyc7IxmrgaDQ5G9O13GL2J8TPfDhU1K+35/k7wk6lreuBYc1LAesDrn5cY7aYlukSOCfAuHv2scHBPp93crTK9T0JNx5IODQy0EsnntHdr0S8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045500; c=relaxed/simple; bh=I0aB8s9mgt7c/wPNl4Q9fV9Vkbql7lyhVemIzXKa6vk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=JQEF1QYI9cRqFfDH/spuHfboq7egfu5wbnvtVbVRv20yWJflvTzJm8TiBjqiSthd/nuDuflDwcogNcRxixPAv9VGDEFKS32hlRAjBhD3OOc7QWsApT6fqZrZZls33cA1vtiiFKylKKKvHN9JRxaqo8Kbb2FMfhYvlrdXEAcXm/s= 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=CYXh/0no; arc=fail smtp.client-ip=40.107.21.41 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="CYXh/0no" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yqNPfHA2sfXqtikoV1IoTrufKV92+7vw5jN3ER4N5WWsu/2s87KOuoriVeWxULP9b0w2YcgX6j+stfOqCsGqov5h2rTvhxraVpNcOMIlpT5ked3DycBsyZbjIo1KwV8ztGXOgG/l4IAnWvnJnm2JHqDF83n8v35iYUNoC65v8aOCILsAghZqhqzIlc6utXt2yvB/MmqQLget9MwIapW3yA+X/bzH0fGyuK74hRXUUhyRFTXEH4+bHh/jLa8dZaUIMVeWDpJvVGjm7aCcNFISUHmh31O3qb7Vep6czBX1/G4t5cZyIMCIixjinGJPTBO8kKWKjJCBjE0Q73f9yQHgfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5MDrE0QkVGaSwDsZhJXehBvAhAGHitWF51NhOtmt0vo=; b=otFdApvdLt9UTSHrmZfyNknEveFMuEALSy7YMN4c2mWy6lf6wHNh79GOLwgC9xycgtp770Kaoh65bT7Wn1tQ6QSP4iAFBq2GguEEGVSpKRiQBi5T5t7KmJyg2WyhJSWJo5PjIZXHNj8SNFBLVbDpS/ux+Fn6yyyrsna0nABUaG8d9Q2vm7SuCCET/C+x77uAfdiUSVj9t5qeLUWizKrGDXciwQ0DgeR8fcUL6zbq/pZPqmqMu9+hEjh2/HudzozzvZ0qQuoD0uw6KuoYqBauWn97GucQ4cVwz0Oya4V01szVJnWq/LPyg4msOJXSkCLkTCUktXHeRtXtpzHG72JoCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5MDrE0QkVGaSwDsZhJXehBvAhAGHitWF51NhOtmt0vo=; b=CYXh/0noeP6atpqILw20anNKjQVxkadudOmfMRT+cyyyyIgDAGwAA2ihbjE4pKwGaFBHuFQPJ62wQffJGTxWOWxmZ5QefRfbm/9MwUd+oqcMnmwg8RNm4jBdb4u8DxvzVilb0zz6+jiMvzGEHSaxAn7ue3qAj8BR1m973j7heODhcT/MhasosEODOSdCs9kIAsEdNHtt1BqlXLd57vWM7bbSxt2OruqECRgcD7qhZfj1ZCrz8rKcBO+GRUaWeorAnxYooGlPopVJfCRsmaerBBdwpTYyoSjpy17fVjagoPau/qOzNNtQORA4LeRhHkwPmmiIIeX6ziyHNXbuI8MRTw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:44:55 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:44:55 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:22 -0500 Subject: [PATCH v8 4/7] PCI: imx6: Remove cpu_addr_fixup() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-4-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=2679; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=I0aB8s9mgt7c/wPNl4Q9fV9Vkbql7lyhVemIzXKa6vk=; b=MATppPIs138QqC88p86N6l8VmPqKeOgbQxRpSnrquzgj6hwnWbc9VRRhTp6OLF4zpVzKW09Zq Yqe7zLnVjGwDjc9hjEsxIFWWIczSNm4brHolgj3ND93qUR2SBO6sH7V X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: cc96936f-c6ec-446b-4bf7-08dd08d2a441 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RWwvQVFQbXpMTFZPRTJCdWRZUURVQ3FoY2RRQ25tdmVad09wNFpjdE9XekNt?= =?utf-8?B?UVRRRjBJSEsvdGRQSFNQOVBnTVZYakQxMU5qcis3aG8wRG9ZMFZLaWZDcWtD?= =?utf-8?B?eVhrOTdZTkg5SVlwUTUzUGVjQUJLVVNxUVhTNFlQN3JzRTBGdkxWYlRhRTFD?= =?utf-8?B?cXQ4OHdkWEdpWklvOVVndWxWM2x0MWdMck9pN3JRREdhd1hBRDV3UVlVWTEx?= =?utf-8?B?N0JmdmswVzVHMERRR255ZHJjRStZNW9UWk43L0ZLM2tLZ2JKQXNzSDFITDJu?= =?utf-8?B?RzZTK1J1QlFRTmtaTC9abkZ3eEQ0cTZuTjZYM3h4QmFDcWNXdVR3RjVHQWxF?= =?utf-8?B?eXBPQ3VDVFJFck1aeWJzVUthVXJUYUVMYXJjeExTQklqd2xoSC9kaFc1NEF2?= =?utf-8?B?dHJYSW9WRVhYd2tEUE03NEFBNnpETjdqSXczQXViWWQ0UUs4YkR4TnVnR2hz?= =?utf-8?B?aDE4TmNFZk01RFNHN0ZYTlo0cEJq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8?B?QzVXbTBKWHZyaVI2YVpxOGFTR3d0N3YySVV2cWU2L2E1WXVQLzRvYkFjdXpC?= =?utf-8?B?TCthQ29XS2E3M01QWEFhd3p1MUJOSFl1QVk0MVdZWm5JMFNWTmhyZ0lDVDNH?= =?utf-8?B?eHFTMDVSc0Exa0dRYnJDa01EMlVWcGQrVlVFQkZraENNdkEyRDRVYmZudFFF?= =?utf-8?B?SldYRlExekZQTWUva09WbXY1dVlSV3BtRlozZHRDYWpoeFBNOXlQdjV3aE9y?= =?utf-8?B?MnJQVkl3R3dvRmkvb2JCSW1VMzVVRGxPV3dXSEcrWG1oUHRPVitQK1ZibXN6?= =?utf-8?B?VXMyNUlaSjdvU1ZXbzMzelpGMVBvZ2FsOTdvdC9laTRPY2pJUHhyRTRoVGFy?= =?utf-8?B?OVNmYmpkSDVNSEo1ZTBKQWhPczNIZ0ZzMU82ZnhQRHJ4eUZqaGlEczRuSTJS?= =?utf-8?B?VVRqNlcvRVdqWEpEcEE1aHFIVkhGWm1aRU5lMWNmZWduZFJXNGhOaUNoTkhD?= =?utf-8?Q?mbuEC0op+FN2C?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aVdCNkhWVkZISUFJY3BlTmJ0NHJOWVJsUGF0UTNkTkM0S2crL2RvTEtzaDNm?= =?utf-8?B?c3M1Uko1aG8xcTlDc2p3VEMxemY1Rk1WdjNYRmN5cytXK1RPM0Z6ejEyeVMr?= =?utf-8?B?bXVPSE5hU2oyRitJVXcvSTI5VmdGaUxTWEdOMjRITFNZT0lVa09uekhoQ3M4?= =?utf-8?B?YTYyUjFRU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KaldP?= =?utf-8?B?bTh5eVVjcmFtL2Z3bk5SQ3V1cVBoRzlhRFM1WEgyRFBaamxDTTVScW11T0Qr?= =?utf-8?B?RG4vbzg4K1FQbjR1Y3FSc25XSXIyY0lQT09DdXhjb2FjNzdMUDB2dUdBZmJa?= =?utf-8?Q?8YXY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc96936f-c6ec-446b-4bf7-08dd08d2a441 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:44:54.9924 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: URTiZVC12JfT8kPndQFN71YIC24KE1jRBWlYIn7JmtNLeZA2gB0h1kaXQEQeodQ8feeaLkCHL2aiUXKaSS2Y3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Acked-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Change from v7 to v8 - add mani and richard's review/ack tag - use varible 'use_parent_dt_ranges' Change from v2 to v7 - none Change from v1 to v2 - set using_dtbus_info true --- drivers/pci/controller/dwc/pci-imx6.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index 808d1f1054173..cf033e672dbde 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -81,7 +81,6 @@ enum imx_pcie_variants { #define IMX_PCIE_FLAG_HAS_PHY_RESET BIT(5) #define IMX_PCIE_FLAG_HAS_SERDES BIT(6) #define IMX_PCIE_FLAG_SUPPORT_64BIT BIT(7) -#define IMX_PCIE_FLAG_CPU_ADDR_FIXUP BIT(8) =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->use_parent_dt_ranges =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 From nobody Mon Nov 25 05:42:55 2024 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77]) (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 A71741D54E7; Tue, 19 Nov 2024 19:45:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045505; cv=fail; b=KBVIprrwE/Q681PvUdqwsU6KkqX5hpo5hfB2qbLN7FKykyznNwOb+gsJkwWm6R2ljraFLOLfT6Ynoxibrc/gmmWb0v3gsdAK0JKPhFPo55MJxbKaGn8GhL8qs/Jw5+ilMS2wbQQO3g3t+hNxg28Cvt+TXiuZQe+8qC09hzuXDLE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045505; c=relaxed/simple; bh=KCFf/kpOBLVWg/CB7YyvqJwaYB8a0PfjuuAqUcU9aFM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=OT+fhALNquG9dhyXf3VSfp7MrROXsSSWQvLEXVotepq8L6A2kO9uLgcE7xO+Uq5Nb58+R3IAJKEheidzB8bj3rGYyC3bng9ElR/OyEi8E6oafJg5Ki0YTowrD1wSofrLU46RluYhzFMWJLNyT0puYIw/XzkRhzOoY/pAVfcf0EI= 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=iyqxNOhv; arc=fail smtp.client-ip=40.107.22.77 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="iyqxNOhv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s7ewZ5mPiaQyy6dMT5pbLEjMVbMMF01UOtunjOQa0aHhCfkCA7DWjPXc4c3MYYSnl9+Io/288SZ7ZJMiquowR66Djw0HB7IHu1qLKjurFSD3gSERwetxPe0v4dWmpe9b1mq8zKwkf1bw1ix1mbT3SO8ylpelAU07vSYk8E4RZoJoOQDCdU2n19BzzUxWyfbrjd+hphqAQ7vHL2lYNQeDEBudap8IKvL+wsHaIzDS734iy8lM3pTHmyIfrrvGKdu4L5YtZ2bLqF6Qd/YWpbMlvm+ixgRYXtxazYmAb+2QjABsRAW6GLhuHgqDYygmsQ0+j/XYTdiBrtPmvMnUlPScqQ== 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=xo880m49XDBtiS+4QbnI4MX0ENP0IFEjlOSwgPnwq6Q=; b=Z2BDKhZwIjWUp6tAxQzQh7cJyoLwVO1XGIrod2j/MB5RPsR6pi8vHHKRFUKMqptv24WkWcilGPtiApQgDob3sKrnzh/1YeD+PYs+3TSEg+sF8nirjCHYSQqtf27eIjDmbYJfh+T8lJ6VYgUpclJ63TxtS8c/eaHHfztFqcCqJn751O1613Wt+qOB/RauPRWGPYSlJVX1QUDlvBbx5KVl9Rk4gkV/kUyAjwUV8nI6TZjVg6oYWMHqrU55yRkmPnamUFyCs0xGRIZ/gr1tM8xbx8Vq23xOYUFPfSoqQ7iyNW+KundYaBXLYV/UmCUO6jPAaL/kB2vXbBJ3+VA+aGeZfQ== 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=xo880m49XDBtiS+4QbnI4MX0ENP0IFEjlOSwgPnwq6Q=; b=iyqxNOhveUk1tiOHccV13C+uHS3Nuchoyqkv3Hs8BzOWHiH/LJy8y9B9NHka3nnxoUutnuQ8d4ebzLgCrs/6g/odcCXTGL9Tc4B89lFbqYf3Epe7r3w8H5j/ES5GS1YH4Za/eYwLY3PdQXV1knkosmJf6NglrtNRsRVs63vx6RdLrWYZrDr8/kKEjCzL4erZCRErJP1f3zEsML2vGQKE8smYyfdkftRsZ+n1Ro9jqmOEkEAUWCQWFaWnc2XErL5XU6WnrLdrTnMLB57PlNgtgVSOQGyKg7oY86mp1FuzW8gRaDV6WwyLNkaIHJCaEn0z0Cy0cCjX1Z1K3F1c5sZP2w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:45:00 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:44:59 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:23 -0500 Subject: [PATCH v8 5/7] dt-bindings: PCI: fsl,imx6q-pcie-ep: Add compatible string fsl,imx8q-pcie-ep Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-5-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=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 , Conor Dooley X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=2245; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=KCFf/kpOBLVWg/CB7YyvqJwaYB8a0PfjuuAqUcU9aFM=; b=EkYvMVCH/Bzr/fRcfMaFf1qNPMxU2/f3B8LGbJF8zNEzeda5732d8hQ64ffPQu9js4BxynKzw tablQmaPlhKCofN9MWcbNDZJa3YsFbY6j4JjpFaZggAlg/lluGLeH14 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: db05c448-bcd7-43ec-1d57-08dd08d2a73b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?eXRBRDdEUEgvTGZYYUpaTEMrYlVRQks1Ym1rYUhqTHhQQmZRRXYwTy81SEJx?= =?utf-8?B?TUxQOW5TSmRCOU5FNGFlUEdRZE1EMXRUM0k1dCt5L1VZUjQ0QVZPYXVXd0pv?= =?utf-8?B?Ti9GY3R3WmcwWFRvY3pZR3RhaC9oUXFJVk1rOGl0VlFBYi9JK3EzbU9hVXFi?= =?utf-8?B?NU1aYXY5T0Y3WnUxNkdRbWlhVFdVTUk0UlRXNWlvM0dkUzhQcmgwR0dMRS9o?= =?utf-8?B?ZjN5bENadEZMSnY5ZE1RQnBoNUIwRTljUkJtTDE2cDkwb0lBM1phTkhMZ3cv?= =?utf-8?B?OVBHVjFaVFJNUHhkTjdBT3RhYlZUWDhkTEhJc3hNSjdjUC9pSTREeGIza25V?= =?utf-8?B?TG5ZNFNiT0lzVGJHN3NKeXU5WjB0NGwxSXh0RUVJY1J0QzAwajk0VHM2Z05M?= =?utf-8?B?enoxOE5nQWtEMGNmRXZFRkdqb0N0Q3FHRlNIVVhSUGNlSXhMZnAxcXVkZVo5?= =?utf-8?B?bUpoZWZITVdyMkFaQTNxa2ZPTHhZMGNSQTlJT3FoV0dicStURWVPdTlDT29y?= =?utf-8?B?NUZ2UERqb01EcGdMbjQ4b3hjUnBJNEp3VzRVR05BM3JHdkNsdmlpOGtnV2VL?= =?utf-8?B?dzBDRTZ1N3RVeUMwMUltRjF4UkRsNEYxZ1dES29MSzlqK2pRbXozU1VMK0xR?= =?utf-8?B?K0x0UkxHS3dtU1BIdlFzS1I4K1RuV0RLRmYvSGlzUHpEVTc2SDNPSjZxWDFN?= =?utf-8?B?V3ozMEJZSE5hVWx0Nzg2Z3NtVW9PS1lHOHd1NkpNTFhQQTFoMk0xK0tzbXpu?= =?ut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f-8?B?dmhGSXZmUUF1ZTIreVc4SDBGL2VKalZscGswamxuRDNyTU1DWmxaMmJLY3Z6?= =?utf-8?B?em9IUlpQR2Ftb1ZNQThjSGc0ZnBZb3V3TXRoZUdUWDk5VHZrd3h4REdJQmlv?= =?utf-8?B?Wno1aEpWbDEzdWtGYkxUck5BQ0JUazQ0WDJuTkVpcFl4ZmVRVU5yVlZIaTR3?= =?utf-8?Q?/Q8EsUNf2V888?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a3VTM0orQjUyYXBiTzJlbXNGNERwb3VJcFBoUUV1YS9kMjZrNzR1MjJGSVg2?= =?utf-8?B?dnpFbGx2bVBBYzZOMGVjdnNsckhYOEJpNENVTFk1S3h5M1pZdVRZWmNGV3pt?= =?utf-8?B?OVdielJYTEZnYmVFMTZyY3Nzc2RjRElyYlFLcXlaMkptbys0SXNReGtEWDhT?= =?utf-8?B?WVJnaVY2Q0FVQmo1WU1vWHN2UU55aWJob0QyV2xHdUUvVll1K0pUaHROTkVO?= =?utf-8?B?WWFTQzVMZFVldmFFSXFnSUVHRGY0TWZlT2RTR2FPMlJmbmdnbGxKZjhSOFdn?= =?utf-8?B?OUo0V3VzMEdpMUJCY1N2dVpxZ0FNY1haODRuTmExK0JLRmptalREWS9KVXd0?= =?utf-8?B?NWtLVGJMRUJmcGZHS3BRSTBrYmxtSVZLVUM3TlRBRlFqUWtXZjYzQXlMMXJC?= =?utf-8?B?YUxMalp1dHpHWGk1OStwVGZ4OVQvZXdIUnlCM2tlTkdCbVZiWGJqK1E2SC92?= =?utf-8?B?QjIzODFBTXozdFcz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f-8?B?NUV3d01nS25jYjhPV1ZJRWNlK1ZYaDY2UzlIZTRab3FhdXFsbkVnVG5ad09Z?= =?utf-8?B?N1VXbStKRWdwV2xoTjNrN25wZEpQWXovWldsU2xjcVQvSXlXZ0Q0eitIRDFa?= =?utf-8?B?UVQ4UGo2L0ZrK2l0UExJTVdDbUZoaGczY3FKeHNZWFMyL0xORDBiZEdBTkZC?= =?utf-8?B?K3VRVHpkWTBUNDB6ODBlVWpabnFiZ1pjRlE5cTloSmw5R2NxSGFwZVBtQW04?= =?utf-8?B?dHJ3MzR6Y2VJbVlMTEsxMUJva2JlRkkrK1hvMVlHNkVuWS81M3UzRGNLQXlO?= =?utf-8?B?ME9wc0JjaDdaMFUxcStwLzRaRkpYVUdXL3BheTVtUXlXUFBJYzhRTVU1MTd4?= =?utf-8?B?Z1RMVXdxOFNuSXQvYUtleGRJV1VLUGdGVjY0eTVlZis0NUZsQm9rMEpGeGha?= =?utf-8?B?MmRUTTVPU0lpNy9BWHp0UllROUsvV1N4WWh1OHBhRGZkcTU2MElHT3BVZzdQ?= =?utf-8?B?dVc3b3VjcHo4dE04QThLdXQyNUJMWWRCY2hTMFh2N2NkOUg3YzFKQTBmR1Rz?= =?utf-8?B?QmJxWXFBWC8vWmM0QlhDQTExNkZoMjMxNWtTakd6Nm1TTXE0U2RpYjF3czFH?= =?utf-8?B?Yk1sbHBRWFp5QVBOL3JlZDRFUmc0R2k4QUlVdjBsdXZqTjBIcC80ekRxb2J5?= =?utf-8?B?ek4vcW12Z2Q5dTJmYjFLUlhoNHZLSzM5azB0MkVaNnFER1oxOFkxMFYrM0hG?= =?utf-8?Q?xGvzShxkm7w4fNXieNDzB9+Hs?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: db05c448-bcd7-43ec-1d57-08dd08d2a73b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:44:59.9425 (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: Y/rElYdKCtK4aoGvI5kfRRVsOtTYGVOG+NePP6ANUBcA3FSjm1uqUOcmWB2AktpAF0fe8zJ/KqklyoQaG0i6pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 Add new compatible string fsl,imx8q-pcie-ep for iMX8Q. reg-names only needs 'dbi' and 'addr_space' because the others are located at default offset. The clock-names align Root Complex (RC)'s naming. Acked-by: Conor Dooley Signed-off-by: Frank Li --- Change from v3 to v8 - none Change from v2 to v3 - Add conor review tag --- .../devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 38 ++++++++++++++++++= +++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml b= /Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml index 84ca12e8b25be..7bd00faa1f2c3 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml @@ -22,6 +22,7 @@ properties: - fsl,imx8mm-pcie-ep - fsl,imx8mq-pcie-ep - fsl,imx8mp-pcie-ep + - fsl,imx8q-pcie-ep - fsl,imx95-pcie-ep =20 clocks: @@ -74,6 +75,20 @@ allOf: - const: dbi2 - const: atu =20 + - if: + properties: + compatible: + enum: + - fsl,imx8q-pcie-ep + then: + properties: + reg: + maxItems: 2 + reg-names: + items: + - const: dbi + - const: addr_space + - if: properties: compatible: @@ -109,7 +124,14 @@ allOf: - const: pcie_bus - const: pcie_phy - const: pcie_aux - else: + + - if: + properties: + compatible: + enum: + - fsl,imx8mm-pcie-ep + - fsl,imx8mp-pcie-ep + then: properties: clocks: maxItems: 3 @@ -119,6 +141,20 @@ allOf: - const: pcie_bus - const: pcie_aux =20 + - if: + properties: + compatible: + enum: + - fsl,imxq-pcie-ep + then: + properties: + clocks: + maxItems: 3 + clock-names: + items: + - const: dbi + - const: mstr + - const: slv =20 unevaluatedProperties: false =20 --=20 2.34.1 From nobody Mon Nov 25 05:42:55 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2060.outbound.protection.outlook.com [40.107.20.60]) (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 526271D6DA3; Tue, 19 Nov 2024 19:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045509; cv=fail; b=NploMD06MX5ihWnGFu2Hij4JkUdxCPGRNoux8ep+J4XNnHqcxlKSlGTaTiCxztLOfHAn+DUkydrgGwvTWjIpvnhYvf7amk4t4nyhTn9L44kc3zfM5rL604Cq8I2rurvO2m7Q1tVhts/TJqt5yZqxeKosllSE6gttMQUfhFQbKKk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045509; c=relaxed/simple; bh=I1xS6x/bVgth6uCt4K17fnxBjFtfeZ9wcN/vlP80bSs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=FReRVLzA4R7AgNV3nyltF81OOAeguUFkRArbCVCH3GyJUfIyq7BdL2WP2MfC3M4ZAyb2tCcyjmTSANqCFogbcJtb794FYCFFmBPhxo+DbYScn50h7E9UoOoAOWnzYBBTTTgieohMHVupmroof8vTAHWUvhC+HRVOPL1aGIS69Sw= 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=FxGHMjg5; arc=fail smtp.client-ip=40.107.20.60 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="FxGHMjg5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RhZiQcpeQzQs1p9cAthpkGgw4seZ01YkUNc/1ZTOFettsOmPI5sWlVPhVf+bSQ+/h8zSePRNVmtsvPjyU+U18bDaxl/FUoDAWKw7X8M1iMmfWd7V+9SbRYnvx0G0dAu3CQ0HNX8ABOEgFQ15NXmblhMgJW6+IvlqRDnm5KyZHGLzqK3ivyYrzY6+GGR21nAb0EyJ4vKyGEPl0aBpMe0rJqWrEPMITE8qE5JNV+M9acFTQPm1yigEMwn2f2uDV8spUczmREnJLQLHrl2zVz0RQqZNgnCV53PDK07DvBaLTB6k7kW58bcyl7sHJ31zvaNmRJRzZbuAHhJcHCtQPw4FFA== 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=ayvkn6j5ctMor6f5EgGeTcwZhVoL9kYC9Om0+bxxxyY=; b=teuODFJ1GCYdO7Zp6yybrrpR5hUTCLM2KlcYY77sN3deLpOYZvb0TRpFobo9RWBvsUUQj3FQfc84KCLIW/qt0rUzZsK9AKPct/yw8wmRNEmjwXxUEG4yQRTJCoQcbWOBdvNwimM1TDDxqZwBGfLqoYuo510jIXfFTSbNtQp2N958T/hmXRZphHehDLdqHSIu81XiciSfbRTODatDfpVq/3dWrBEnd9Es0co1ghmx/xI/CDEc60WsuE54sqCdtn+pJVINtN7baI1qJEHqrQoMFk9VpSUgsKaKxtQ9GNyBQU3yDFYmj9RaU6o2GdM+IM27eUVOF2RO91v7VbV5j88Okw== 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=ayvkn6j5ctMor6f5EgGeTcwZhVoL9kYC9Om0+bxxxyY=; b=FxGHMjg5kA/qrGfXCAKc1XNJ1yl867ATuns5FtCzzToORztWt0ugonCGpjPrjclGo/hdtirDTynhAf4eZK3sA8lFf2CwfdGPAI+aq3N9tJrFX0aHBbAAY17cP5i+KjpeMhHC0iRbfer7JzO0JOZUKuFPTkGcwkFBZHEC95rr8st8UcHwYvuvQ2T1DhfcJmuprtcO+iwX7sg25Zrnce2Ndbsf8uV/jvZnGOsgd3fTs8s+o/3O0UrwRoQyHqwiAK4H6GI0b2Gqpi2inwKGwv9z7TgnOmrSc5mxu3GXwtXZ1XD1vFDS2IylEJ6DhG6dz+WJ+AhKqyyiIy0UoFAR9UgO8A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:45:04 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:45:04 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:24 -0500 Subject: [PATCH v8 6/7] PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-6-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=1266; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=I1xS6x/bVgth6uCt4K17fnxBjFtfeZ9wcN/vlP80bSs=; b=tM6zs543BtrgjN+85Ni4hJ2pKwjs7eBwgMkk2DbgBE1oEAHzhCwHvhLAwLFVdTcqgDQe2qwb3 8xYSXCRa+xuB9yGDIQJoUsUZiD4KiTkVuFOsSBOLJDW02QUIYO24EYF X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ed88dad-ec27-40a7-6370-08dd08d2aa13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NW9mcDYvQ3Z0UnFhM0NvVklVTEhXTVBBeEx4TW5taWJKdlFKdmZSL0twVTFP?= =?utf-8?B?SkhJeTBsd0NheEREa0NXYUdCMW9VR1Y5OTEvckxDUWVSQ1JMeFNDbXBJeU8v?= =?utf-8?B?WU5OdVIrZUdFb3VsNlN4aW1OaVhmTHc3eEhLL3o4anhBajdLQis1UmxoVzZn?= =?utf-8?B?UnJNeVptNm9uTHhQdW53emNrL0RSZVY2TEhsZzh4MFQxNHpIMlpqWWFYamU0?= =?utf-8?B?MDVxUnhtN3hkd0k5Z2pjZ1FkNWE5QTA2ak9yZmNKRjV1bzBzdGNtYWRFU2xa?= =?utf-8?B?OWdLUkhRNXIyNFEvdUF2QzRURG5Kck90QnlVNUMwK1ZrQ3lsWVNQNEVteC9l?= =?utf-8?B?NFlvYzh5ODFCVHZVNURKY0hoVVBsQXVHT2NRL092TytqZm5GZFY0WmlnOXlt?= =?utf-8?B?U0E0TjQxWVV0QnJ0N3ViS3Ivblk2Tm8vYWdOME5oKy9CMTRodit2eDh0QnVP?= =?utf-8?B?YmthZUVobTFISjMvS1ZjRGpVOWpyQ3pWdm1jdmozbG1sclFHUjZRbjZqL08y?= =?utf-8?B?UGEwcUZjTDhPN2VtUHlDWTdWZ1F1blloUEtXbkJzaC9DMTBabE1ONTJIQUdw?= =?utf-8?B?eWZTbm5XaTNlZGYzU3lLUjhLamVxK0FoSUNMbVJkeXdNVkUxTWd1RmFwcnVO?= =?utf-8?B?NU8xUVozS3NCVlpmUVhxUGNQaE81YlNQdk9qYkE5b0crdT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VZsV2NiVTNIRlByYTNGQnNk?= =?utf-8?B?U09WcDVlMVpXNHVQWkNyc0FzR2NFeEw2U1J5aDNuUENNaEtGUGNqUWE1dTNM?= =?utf-8?B?azBNUytDaHlvTm5QdHR2NXlKZXYxQzA5RUNNS0RFMDMraGpSNGpmVmcxSDY3?= =?utf-8?B?dHY4MEhVZmtvWmt4ak1TamdPM0w5cnVMUkNKbmNIOVpOMG9SWnB4YkxZcmt6?= =?utf-8?B?N2VtUnEvd2U3ditoUGc1ODR1TVN4cTh6WUFYaG0rUkt3cXhmakl0N3d1RTVw?= =?utf-8?Q?w3GiZ3A4igvS2?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cGs3OVNHYWZpT0lvSm5yenhGWENleEU5cUlnRndDeVNxeFJJZWdTWFpuVU5I?= =?utf-8?B?T0M1SHV4bU1kRUlwVFd2QlpCM3prRU5FMThRU1dxbGdTRkFPNi95UkQ5anZJ?= =?utf-8?B?MTczK0NRTVZvY2JBRHBLWnVKb0hVL3liZlRFUTJxczArWk11SWlQUUQxUk43?= =?utf-8?B?cmJpV0hNTnlZb0lmc2E3ck0zZGs1Q2NoTW1OcHJyYVpLRXRNOENJUW9mcFNE?= =?utf-8?B?UDdVWEZnVXdKdUZ3cVhpbmNBbk1wUnIrUWRvQmlLekc4RkErdW9vL0xHc3pG?= =?utf-8?B?R2Foem1nQnJhdlpxU1lKNU4wcVQyMEM1cmkwT3BxRE80VW1aeDlkcnk3cWsw?= =?utf-8?B?RmRHajMyd0lYcUExQ1Q2YStmblJCQy9PYk5EVjIxUnpKM1lzY29lNGdNRWR5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-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:45:04.7260 (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: AQh1LdT33bwMeG+oRapj3Qd7ecwb2EOYLWRnHTlSPHL2KKgLdpqix2VQRTfC8NUaWRRkye1ISzoc/uBz5B2ruQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 Fix hardcoding to Root Complex (RC) mode by adding a drvdata mode check. Pass PHY_MODE_PCIE_EP if the PCI controller operates in Endpoint (EP) mode. Fixes: 8026f2d8e8a9 ("PCI: imx6: Call common PHY API to set mode, speed, an= d submode") Reviewed-by: Manivannan Sadhasivam Reviewed-by: Richard Zhu Signed-off-by: Frank Li --- Change from v3->v8 - none Change from v2->v3 - Add mani's review tag --- drivers/pci/controller/dwc/pci-imx6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index cf033e672dbde..5303dfc3dbb41 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -960,7 +960,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) goto err_clk_disable; } =20 - ret =3D phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); + ret =3D phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, + imx_pcie->drvdata->mode =3D=3D DW_PCIE_EP_TYPE ? + PHY_MODE_PCIE_EP : PHY_MODE_PCIE_RC); if (ret) { dev_err(dev, "unable to set PCIe PHY mode\n"); goto err_phy_exit; --=20 2.34.1 From nobody Mon Nov 25 05:42:55 2024 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2055.outbound.protection.outlook.com [40.107.103.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 8817F1D31B5; Tue, 19 Nov 2024 19:45:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045515; cv=fail; b=Lcx0ISUdThZaaYk3unQN4S5066kao6zYYuu0efjbEy9pvBQipYqnBIihe9yTpzRkW+9sWMAf3WhyBPmiPcHjg7N3MdPTf2mJF5sagTVtFI2OaRQN0OpM6wRMoPSuL8RZWpm2iTIVsXyGUQf5mMGpI2HkXDg8bWWZr47fYh3cPAs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045515; c=relaxed/simple; bh=mbHe59tkIpbHTtvY3w/H80mU68bHhQgeFO0tnBttso8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ZNFaEdPgYfMJKsx6e+M0LS8zRyQS2Z3i4Wy+dneYJKILC2CPBSM5//z2t+LFK2BTh42efnWDDM42oNxse2obdAR2oFMgaEQaN+T8LVcfWqJTYdZ6gBu5Y/yVjgf7bjPbkSkvVzHJs6LnMIS++5Nr1JAFhSYfTbniJZ1sBS2wlGo= 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=iId3zEjR; arc=fail smtp.client-ip=40.107.103.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="iId3zEjR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qMyUQHftAbEqaz4D3/FUQTGQzGzCzf62tVdlP0tPB6rhWdWFsle8ZiFlfp/z82eZfnhsGvnhGmhcKxJVBOkWoAOrN4KddEHZpFWWwvsAoNNGNfs7A7f0DceEhMSdiL7XWsU9SBgaAQj6FBEPpAa2GFftaCoG4Fzctyi+H33W9W4qO7Wbm79HyN3bkyMjjdOMLBzSAYhb6QS75yZYULryP06P0S6xS00b9I1bCtZIFaqDJFm9u5FYR1iQfotcEFsIb/uVEeT3wvd83VPAOKQjIgtz5mV0N8BCIbEcADbzbxm3JeBETUE5FDIQns1pXaSA9WNTiQAP50gTiLVZ77iIag== 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=L02xQI8CqGMvu/Xott6SAD1YcJnHf27P2jsLGw+ynKY=; b=sPHpX0Hq1E/5XgiCIqkk/+GZsdLipcZ09aTKO7fd2+bFf2gyAi25t//9p8f4swT2yQM9oM0vN97xxOS6+8KNx2AsCWwZmflDOaJ5gVrlogIHYPr73xoNFFNDA/TbKGCltvBiuGeuUh2QHlC6/4xcsz2GCfGLc8SHhsh5oKZwOu3Nc6WIYtffdAZ35Nyht1nSOaKXJ3nG5CJ1rk1HNAH5y1h70tcJqdQrkFWEVUA1/mwmLdqrvn6kPeHZvYM7NH5CEivoELup95Sx4Fj+xxqAK098VIBbakmdBu0CIM4VVfiRo2SZFNR8s9qE4knfV6Uj4xaH1lJ0R3dKmE5amZ6kmw== 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=L02xQI8CqGMvu/Xott6SAD1YcJnHf27P2jsLGw+ynKY=; b=iId3zEjRBJIpCymv3E28zXpQYv5o3XkQRx25nvmzsAHPi3J8anUdcc7YtsWop+PDqC5P2Mj/PR2ZR+5/Q7CiOoKgZQjV9MNl426Pf+URC9wNvOp4nNgwfJnnK9z9uYbSX/lnvE6sj14vKN5g1kdcAaRKuNDDhj+GlE52rjXNPBnIJ3BQmcra5K9jC6o1RJQfQSLPQtzFiFBgOuyDlaTcAjm96kI+j0lce5LxMU8g7suX7mj572bmd78uq8kxKaXKNHOcKfWV38c0BzCEdgujEMoJolckscA+cdVAdmOjD5A/GPGqAlji1lFy/bJk2JKbIaXASXgQb9TMnv0240cvdw== 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 DUZPR04MB10014.eurprd04.prod.outlook.com (2603:10a6:10:4db::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 19:45:09 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 19:45:09 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:25 -0500 Subject: [PATCH v8 7/7] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-7-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=2548; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=mbHe59tkIpbHTtvY3w/H80mU68bHhQgeFO0tnBttso8=; b=s8zSC1wVV41AI86MzbTvnNDCe+Z8XvF9S85E+UaQQbDhYDbZkgOb+t8zjBVPlKUYzwzLYX+1y hYuk1VmUiZvCBQjEUR43aRvHcrRiY+707uRzoIMZKJgS7iCtVRIH1Ob X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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_|DUZPR04MB10014:EE_ X-MS-Office365-Filtering-Correlation-Id: 97664a82-7382-4f8c-661c-08dd08d2aceb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1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yYkNHczRpWXdWdm80?= =?utf-8?B?QVZwdGJEeUc1S29tUUpReVMzOWNLYmo3eWl3MzBLZlBVOVM5eExYZHJKdy9q?= =?utf-8?B?TDhQaEd5RzE3M1E5emV2R0E1UUl3MlZBQ3k1QUFKa1ozb1RIa2t6RWNaM3VK?= =?utf-8?Q?MAw3ArUFJQKd8?= 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)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SHgvRHlqK1h1ZU5nNitsc2ZXeUt0MzQ4OCtWVXJRT3gvTWxzVENFNDdSN3lR?= =?utf-8?B?SkhybW9FVjFaVWJMcWRuakZtdzA3ZTEyaE0ybzZVUkZ1d2pUNlIzUnViaU0x?= =?utf-8?B?R0J0VWxvdDRvODFEVlV5T1g4SXp4UGN3L3hGSExUbFlNNUdvOWt3cXpIRnhr?= =?utf-8?B?RlpCOHhxUkxpOU0rdWJSaW95b1hoWUU3L2JJZGUydVgrZ1NqRC9zTkE0eE1K?= =?utf-8?B?emVGVHM5NlMvaE1oZ0NOYU9PQ3B4a2hOTWVncVpZTk9CaGllSVJzUm9DUENX?= =?utf-8?B?cXhNM3M0ZkhvdStsbFNUTWZFdzNucnBmbVcxekxqU0tDVjZTdlNvSU8xOEZx?= =?utf-8?B?djV0ZHZ5ckRaMVlDUVBpU2hCVWdLbEpUNzBoOTZWb0VUSUROYlhlQU85R3hR?= =?utf-8?B?VUJjM1Z5ZGV1S2pmcmhsVXY0cUlOV29HZTJxeFdoSG0vNlJtNzVIMThiVnFs?= =?utf-8?B?RGhqMDlmRmNOZzVJdHdxejZGRFFqREJFYWhmM014Z1B0OHU5eXJjZUF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FZktOVFdYRkxa?= =?utf-8?B?NC9tb29DUkZ5U3QxRk54Um8xb0doazhjcis3MXl5aG9VWGhWRlpNNndqRTdr?= =?utf-8?B?N0o2SnRaT29FemJ1SXBGcXJaL3IrUGZlcy9ZMkpIaFkrYWI4K1pRQzZhelJY?= =?utf-8?B?RjhuMzRwYktQZURBUi9HWk85empVVFh2b0liRUxWaWVzZTdyK3BEN1dHVyts?= =?utf-8?B?VDh4K1NSdCtsZmJnZ0NVV1h2T00xOHA4UDRKYnhJR3hVVFhldTdvM3lxS1Bo?= =?utf-8?B?ZlZCZTFwd2dzN1ozYmo3RVRVbHhUa1lPSDlULzJNTmxZY2xSTXlzYWdJTkRq?= =?utf-8?B?bHVIWVp4djdzZGdUcjZISVFmSUZEeDM0V2xVUnBYdVUxODVXQkM2VENMWHgw?= =?utf-8?B?MFc4emwyUWhqeDBMY0JCL0srZFlsTHlHTHlkY2FHcDVvVWt5ZElBTEs0MDZx?= =?utf-8?B?UkJhRmc5T1lwSFVSVTNuRHlTRWhScUp1UzlKR09kRHFjTjFaS1E4Yndua1Nn?= =?utf-8?B?ZE1WaTl4MzJqMXBuV3E3WDNuVHFqYzJNSG40b0kvTmlTNmNyd01qVW9uSGpn?= =?utf-8?B?WXlGbmhRZE8rNno5bE5kbkVNSTNOVW8yQmRsN0wybU1FdGsyS0ovTWMyczhX?= =?utf-8?B?RHM4QnJ3Y3dGdTl2UnBiVjh4Z3RERmZhR29kT1FWcWtaM0w4eFZoT2lzcmpj?= =?utf-8?Q?awv8=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97664a82-7382-4f8c-661c-08dd08d2aceb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:45:09.5248 (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: d1/zzoPF1jcGfQUTur3z25o48loXrecIP4G7FWte5TGJr/KqpsHaxD1XXtmiBG52vTubhOrrYs/yx/JJPd2nMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB10014 Add support for i.MX8Q series (i.MX8QM, i.MX8QXP, and i.MX8DXL) PCIe Endpoint (EP). On i.MX8Q platforms, the PCI bus addresses differ from the CPU addresses. The DesignWare (DWC) driver already handles this in the common code. Reviewed-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Chagne from v3 to v8 - none change from v2 to v3 - add Mani's review tag - Add pci->using_dtbus_info =3D true; --- drivers/pci/controller/dwc/pci-imx6.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index 5303dfc3dbb41..d457514d17485 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -70,6 +70,7 @@ enum imx_pcie_variants { IMX8MQ_EP, IMX8MM_EP, IMX8MP_EP, + IMX8Q_EP, IMX95_EP, }; =20 @@ -1061,6 +1062,16 @@ static const struct pci_epc_features imx8m_pcie_epc_= features =3D { .align =3D SZ_64K, }; =20 +static const struct pci_epc_features imx8q_pcie_epc_features =3D { + .linkup_notifier =3D false, + .msi_capable =3D true, + .msix_capable =3D false, + .bar[BAR_1] =3D { .type =3D BAR_RESERVED, }, + .bar[BAR_3] =3D { .type =3D BAR_RESERVED, }, + .bar[BAR_5] =3D { .type =3D BAR_RESERVED, }, + .align =3D SZ_64K, +}; + /* * BAR# | Default BAR enable | Default BAR Type | Default BAR Size | BAR S= izing Scheme * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1627,6 +1638,14 @@ static const struct imx_pcie_drvdata drvdata[] =3D { .epc_features =3D &imx8m_pcie_epc_features, .enable_ref_clk =3D imx8mm_pcie_enable_ref_clk, }, + [IMX8Q_EP] =3D { + .variant =3D IMX8Q_EP, + .flags =3D IMX_PCIE_FLAG_HAS_PHYDRV, + .mode =3D DW_PCIE_EP_TYPE, + .epc_features =3D &imx8q_pcie_epc_features, + .clk_names =3D imx8q_clks, + .clks_cnt =3D ARRAY_SIZE(imx8q_clks), + }, [IMX95_EP] =3D { .variant =3D IMX95_EP, .flags =3D IMX_PCIE_FLAG_HAS_SERDES | @@ -1656,6 +1675,7 @@ static const struct of_device_id imx_pcie_of_match[] = =3D { { .compatible =3D "fsl,imx8mq-pcie-ep", .data =3D &drvdata[IMX8MQ_EP], }, { .compatible =3D "fsl,imx8mm-pcie-ep", .data =3D &drvdata[IMX8MM_EP], }, { .compatible =3D "fsl,imx8mp-pcie-ep", .data =3D &drvdata[IMX8MP_EP], }, + { .compatible =3D "fsl,imx8q-pcie-ep", .data =3D &drvdata[IMX8Q_EP], }, { .compatible =3D "fsl,imx95-pcie-ep", .data =3D &drvdata[IMX95_EP], }, {}, }; --=20 2.34.1