From nobody Tue Nov 26 06:56:45 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) (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 067991DEFD8; Mon, 21 Oct 2024 20:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541276; cv=fail; b=TD+scf17KRRUSHzs/JVmoO0Q5IfNvd8Qh+VXqxSc0Eh0aj7UM4rkHW5DhIbvtImRSuMcRMDm/gjBMVgCqYmvTIYtzfN3bphadTezCvxEuNGswOW9L2Q2LTybIzLBnE2Vc+F1/mhZoesNIXOH739QzzdPjE5K1fuz0ggL8Va7aPk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541276; c=relaxed/simple; bh=z/qjOkp5hDUbKkPREBnGFcyAmTYIDRDWM3qKhQ4IVc8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=EK31jCZroe8PEcZ8x5DU3/UvZliDOlL9KxQqSMwJb2HHDA5m2NGNi+N9bqizdNVfh9GkzDr2HZ1/31uWhyAmJvTz//8PYGJMXRLjknTp9HV1/qhSiRQ8awlsYhChnLn3a+xEau17NILWjXy5Zabf2cdghtSojEVDm7gtbO3cR1M= 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=M8IB0YX8; arc=fail smtp.client-ip=40.107.21.74 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="M8IB0YX8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KfWAs6+M+oErTg3vqx92HCqpnf2hhuk0qF13zMI7UEdQV/e8t9zK5K46jLOVgu/GPM/fxu9B1tRFOThq2Sww/2xsbnXUErPeK71ksV2xy7SOtw+7rcHhb1Butlj1hEITIojy1b/d0sAXcaNZZo3tPXHG3As0LtGjp5hN74PUq4fQI200wRgoHu2BzfL1u73/HQeS6+XopbPxScaL7FGSiavZ899eMls+Eio3zM7dsSdTmF5HwmIDnf59JMmX/e6C+vtbwVA7rWZX4JcV5GcVSzxp0893oHalnepM015gZfDJJNO8A5Qc2EvJR6O78IT1lOrMgeXAH/tpKIWwbAw1YA== 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=3Bk7q8jaB5ypFH4kg7DtQLBpo4spagjA9PptU/sPGm0=; b=TvEfiZwoLCMPaAE8WpUc2VZK2NHiM7eOW+p2SZf1kTbW/hVN6zJQVPW4/KtEJjU7iu1S6B2QPQhsudY/NYcQ98WKBqo2xuwjQKeXPQtFDAbcLpq6PnOdmuqGzDGGDyrJtrahZrrtWazBE3NVuzynFSFHSdo9cTmLTcZ6efOsI7Mtts55KhM9WYBKCt0vw5K0WPlqJAdJJLFdtzbDGXfDgINQU/CJKSPTitDyWK11iJx/hup/sNSa4TRjM37oZAHIWkCdbso5YDEZjFoRZQ9TS4Z6ckhdpO6D2lFqp/RS5A7g7VzLqtQs6pxQBs0MOsV3NofkqsUt3IkMEv0c6fQcow== 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=3Bk7q8jaB5ypFH4kg7DtQLBpo4spagjA9PptU/sPGm0=; b=M8IB0YX8v1nQuoBFCe1mAPduB5iEXeRIq60fESldaO9hLUmyBKIFcqHyY6FNtMUHzX7rCh+J5R3ZQJoyyH62p5RUlAe16Jru1noGJrizpPNGHFlZfYRi151iKnf5dz8QXasmNJUsx6hNF4YsNhRtOsr5PpyetMDas+0QC3zh0G4qyDwzMXV6cSnNWZzMRR+qUEmB+JvL/vmQvYqEO5SGUBfA4/ccmVS1tOvbS3Ji3vIRkVTAT1TpCk+qPs3N60U/3CfLNUSuwoH5OGHelmv30u8BVjpQB2EasGSaihh2r+1sGkkQu95RjbDaKuVSXbbNl8QhECBa1USX8Any1BuQtg== 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 AM0PR04MB6882.eurprd04.prod.outlook.com (2603:10a6:208:184::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 20:07:52 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8069.024; Mon, 21 Oct 2024 20:07:52 +0000 From: Frank Li Date: Mon, 21 Oct 2024 16:07:36 -0400 Subject: [PATCH v3 1/4] PCI: dwc: ep: Add bus_addr_base for outbound window Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241021-pcie_ep_range-v3-1-b13526eb0089@nxp.com> References: <20241021-pcie_ep_range-v3-0-b13526eb0089@nxp.com> In-Reply-To: <20241021-pcie_ep_range-v3-0-b13526eb0089@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1729541264; l=6071; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=z/qjOkp5hDUbKkPREBnGFcyAmTYIDRDWM3qKhQ4IVc8=; b=NB9QyP5FD+su171LzohM4TyXh/YDwW3sB1H/1vi82nQ6RRL5v8bUUFioIfVQ1pFn4ddhsOtSz uWCtPSYEejgDd/4ZJ7AQc0V9raeQ+4gaBmkL5dSA5Xd1GmrWNQJLxdy X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SA9PR13CA0071.namprd13.prod.outlook.com (2603:10b6:806:23::16) 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_|AM0PR04MB6882:EE_ X-MS-Office365-Filtering-Correlation-Id: b262bce4-4927-4c3d-2e68-08dcf20c0b19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?QllIUXg5MG9KRmh6TnZHanZ2VTdHMG1NWDNZREZockJqdGVWRmtjTGJqWE93?= =?utf-8?B?U2JNMjV3VmJHYW1DTUhsa3pENmZaWnc4M25SZFkvTEdEd1VSV3pKQ01ZZll2?= =?utf-8?B?eGFydkJtcFdkaS9iYkF3V09oQzZGOVc1MDZUQVc0WnpCVGY4Z0lqUFJrYmlG?= =?utf-8?B?ZUVYdEphQ25ZZjJIa1ZjRXp0ME02Rm5pRG5KTVlScjVjNm9NM01rUUdtQ3pr?= =?utf-8?B?THVodE9HRkIyVjdlRkc3dGhSNUxOUk9WTEJzWnljeGxmQWhIVngzdHVnSldE?= =?utf-8?B?NW5WREhnQTc5eE9yY0wzZ0t4bjI5aTZQUlpnRlJsNVhDK3U4RGoxblhuRXZp?= =?utf-8?B?VXZLWHYrVktwU3R2dUEyUEcza2hBRDh6M0xKSHdZVS9aQ2xRcHczL05tQzVB?= =?utf-8?B?R0dJcXhMcStjcENLZmFUdGs2NFQ3YWxUUnBXenlBeVZOdEM5YlYwUnJ0ai9s?= =?utf-8?B?QzkybkhhQ3J1cjIvUXlBSXEzQ2R0L3JUQkNmMFh2ZC9zY2pJeVdXOEY0dVd5?= =?utf-8?B?TjhyMk4za2ZEUnZ0ZEhMZ3ZJUzhOT2xJeU9ZRUxKQmZ1cCtUdGt1WnRwNVhL?= =?utf-8?B?UWRTSzBrWWV1WWlveEhnWGNRaklCZ3hUWC9hb2RCUURLSzVKMGFMMGhwdHQv?= =?utf-8?B?NTlnbC9JY3ZlUi8xaU9wTnExdytQenVXV2lVL2V3d3VvYWRWS2hSbmdlb1Fp?= =?utf-8?B?ZWtXT2ZRdVIrVzI3WWJHMlZaNVluTXFJVm1vR3pkL1grNzVwRVFjZTR0YWd2?= =?utf-8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OXdlN0Jt?= =?utf-8?B?RlpqQzV3dWk2RXRzREFoaEpmalNGMGFpb3ZkaTFFMFlqMFNKVVZDQmoraVVR?= =?utf-8?B?QVMwcWJvL0YrUjZxVmpzZDJyZ0FvZkJDKy9iSGhkMXhDdUVhT0VQc2k1TVNw?= =?utf-8?B?cHBzQ2Z1N1lrdWdiL3BmREtaVjRoRTFWb2FyNjBDZVQ2ek1YSUdwQzFNY0Fs?= =?utf-8?Q?4Dkz+xlcD2rYq?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T3JXTWVXSEtpbGJPdmkxRFVkN0c1MHQ3TzZBeFJCLzV2Znk4enVSbkpMNjNB?= =?utf-8?B?LzZaeGtIUzRUQ3RIMGwvUlYraVFCL3ZlWmtlTHFaTkE3Zk5CMWZXbDRSRzhZ?= =?utf-8?B?Um5DbHIvaldVRHU2aCtNQWlhZSs1YldaZGFwTFFDbld5bnRzbnQ5UUxkZmZU?= =?utf-8?B?QVNxV0h6YVF6Q1U1TDY2dzcxaXRTS3FrM3I1RXNxTXZzSyt3ZFNHNDhOWVVz?= =?utf-8?B?YWxIQ1dGNTArbzRBOUVJUzNGYVFObzkwVEtCRnFpaUtXMEUwMmp5dlJnYmxR?= =?utf-8?B?aUhNYzU1WExZRWFtN0c1OXdRaERhL1NBY244SXBUdWNtWDRZYVJTSHVBVXRP?= =?utf-8?B?ckFTd0ZmWllPSStPL21XWDgwZkM1MEpSUi9mQTM3ekxRb0RFL01uOFk5WXpS?= =?utf-8?B?cDJaV1RJVnRTSW15bFBJOEN1TDYvQmpTckhCcEhSWE54Z2tMdEc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.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 20:07:52.0156 (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: cnibLKj8M7lRn/IX/PC/LWtI0rA07Zzpj/XcP5AnQDxHvmhsCtZ9R/HY/wbHn0P52hToJb+DhEV5+LoHHpjRBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6882 Endpoint Root complex =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=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=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 EP =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 =E2=94=82 =E2=94=82 Ctrl =E2=94=82 = =E2=94=82 =E2=94=82 =E2=94=82 CPU =E2=94=82 =E2=94=82 DDR =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=90 =E2=94= =82 =E2=94=94=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=82=E2=97=84=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80ATU =E2=97=84=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=BC=E2=94=80=E2=94=A4BarN=E2=94=82=E2=97=84=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=98 =E2=94=82 =E2=94=82 =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=98 =E2=94= =82 Outbound Transfer =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 =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 Inbound Transfer =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=96=BC=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=90 =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= =BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=96=BA=E2=94=82DDR =E2= =94=82 =E2=94=82 =E2=94=82 outbound Transfer* =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=98 =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=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=98 =E2=94= =82 =E2=94=82 =E2=94=82 =E2=94=82 Fabric=E2=94=82Bus =E2=94=82 = =E2=94=82 PCI 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 0xA000_0000 =E2=94=82 =E2=94=82 =E2=94=82CPU =E2=94=82 =E2=94=820x8000_0000 =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=98Addr=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= =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=98 =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 Add `bus_addr_base` to configure the outbound window address for CPU write. The bus fabric generally passes the same address to the PCIe EP controller, but some bus fabrics convert the address before sending it to the PCIe EP controller. Above diagram, CPU write data to outbound windows address 0x7000_0000, Bus fabric convert it to 0x8000_0000. ATU should use bus address 0x8000_0000 as input address and convert 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 <0x5f010000 0x00010000>, <0x80000000 0x10000000>; reg-names =3D "dbi", "addr_space"; ... }; ... }; 'ranges' in bus@5f000000 descript how address convert 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. Signed-off-by: Frank Li --- 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 | 14 +++++++++++++- drivers/pci/controller/dwc/pcie-designware.h | 9 +++++++++ 2 files changed, 22 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..81b4057befa62 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,16 @@ 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->using_dtbus_info) { + index =3D of_property_match_string(np, "reg-names", "addr_space"); + if (index < 0) + return -EINVAL; + + 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 347ab74ac35aa..e22d32b5a5f19 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; + phys_addr_t bus_addr_base; size_t addr_size; size_t page_size; u8 bar_to_atu[PCI_STD_NUM_BARS]; @@ -463,6 +464,14 @@ struct dw_pcie { struct reset_control_bulk_data core_rsts[DW_PCIE_NUM_CORE_RSTS]; struct gpio_desc *pe_rst; bool suspended; + /* + * Use device tree 'ranges' property of bus node instead using + * cpu_addr_fixup(). Some old platform dts 'ranges' in bus node may not + * reflect real hardware's behavior. In case break these platform back + * compatibility, add below flags. Set it true if dts already correct + * indicate bus fabric address convert. + */ + bool using_dtbus_info; }; =20 #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp) --=20 2.34.1