From patchwork Thu Oct 24 20:41:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13849692 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2045.outbound.protection.outlook.com [40.107.105.45]) (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 D2CA3217302; Thu, 24 Oct 2024 20:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729802542; cv=fail; b=JmYgw8tC18u0an8m9usVcGoKiB4jpRBATQYW6kyX1nEFEF67mCmbn04cI6QG/DEHCOsiGjgnc1XBwYuOkcfuQDx42AHoky+uxzGotTe7CIHy3yycICXsP+vjnspJHSub+lKGgF+QOuC6d6y8C/n2js6MH8/nM3aLsmBCbepdofA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729802542; c=relaxed/simple; bh=GsBrY/rr2TGV9C/ufXVpAjG8EooxUe4YBDJ9aZkc+U8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Wpb/SloybnvEkzkhvSj06vv6ss/qfEBE7WPSToZXMs81IYr+Vqdoo0CD+djp8kS32BzFESSlXCxloa4qUXFSoaQqiuWtulaRAfT6FzyDVQWdbwG2OTG/2rBVtyAqqnQciVZt/sbOnJ16u/vpmq19bUb44Pkg7jkisTsiXUjEwfM= 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=Aw4USNMB; arc=fail smtp.client-ip=40.107.105.45 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="Aw4USNMB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xExKwUHTn6oZsXwRvMdoP5g6tFY3lG3X7l0RcW/z1UD2lC7dG1lvPl28BEEKtau64lquy2Igx+hHPzkq7k3eUPiqGy2hp+Z0RornioV5Rufcu6FVyBRFhkE31MbpbNFTtxahvUX7eLWb8TBgZi+v2s1+datJ5VdlxXvD4u/YBHVt3/rAWRETR6u4HYqwktaLNXsEFRc97bkwUoGE+boLbhy0QNZ4lB2JEZRP2sx5R+wzaMD6oRdxSFF5Hv8HJO8J47HjJxciz2tLiV9VUx8i5kNKyEhB0zapMwCYoPWd5u2g7TEBBHkqVMP1nUjr07LDw1X+drqmaudPMV+xDr4RkQ== 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=2ZEqB5SgGYv/wLtHKqtrS28/MuvXtIH7arWnGnAkSxQ=; b=TMpLZgd4wqcziKR01Gnb01GGQHPnCkDE2eYon8t2+9/C//29d7UEjLtEpmvGb80Jm+XsbCTDb0drI4A27g5AMMIT9aEsfv/OphxEKhm+g3ocrBRn8ghVPNNG+68ECWogiAOR2sxI467qi2D8/nbdtcqTAJm61K1Ap5b9vEPCGs2OIfzzMWcm1jYGhymmz1Esuas6dJX4nh8LLwoV1na+WFSR5Gzgx76eD7LzbZnF/5ehXyOLDNLcOm2jZcBYcQzLERWGoIdLNOOso5YH+t/yDXMPZMqK7PvyyWEf5tL+IbQfoJXe4cF8FsVglIKLeGh9c+RsNkLhSBlMjpqgxGZITQ== 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=2ZEqB5SgGYv/wLtHKqtrS28/MuvXtIH7arWnGnAkSxQ=; b=Aw4USNMB7TKUDptBJ8By0tAsio2H54K6A2agLXSKMjAjnLezJpjfJ9VAScAZtoyayt7c0K7n/LqonB8RFHmbEdftHUbDTJ7QIHiPxnepuOPXmM+qlQXKnzIEa5yc6wDuieu+QMF24ACtbNAoXy5bdZvUN4eQXqHgQzZHzuyGNj8Heh5q5cSIalIPUq0XC9N9lgw0gMsw9ZwDiD7/DX3wg++z7onJKQ63dVoMKdpiXwar1B14gHAYwn1pLjGiPxmkSbGMDhOyUd5QLn3tpI6yLdCNiWwMd5qEhCs9fJGKFn55whcAImSGM/hsZ1Sv/tbzqr3ln+bB7zMCI2Mk+2wBdA== 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 PA4PR04MB7517.eurprd04.prod.outlook.com (2603:10a6:102:e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.21; Thu, 24 Oct 2024 20:42:17 +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; Thu, 24 Oct 2024 20:42:17 +0000 From: Frank Li Date: Thu, 24 Oct 2024 16:41:43 -0400 Subject: [PATCH v4 1/4] PCI: dwc: ep: Add bus_addr_base for outbound window Message-Id: <20241024-pcie_ep_range-v4-1-08f8dcd4e481@nxp.com> References: <20241024-pcie_ep_range-v4-0-08f8dcd4e481@nxp.com> In-Reply-To: <20241024-pcie_ep_range-v4-0-08f8dcd4e481@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=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?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1729802524; l=6280; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=GsBrY/rr2TGV9C/ufXVpAjG8EooxUe4YBDJ9aZkc+U8=; b=ovwh5BoEazxQSkess/heM2mtUzNAlTzZAc/9uH+fSvCv/SPD5JyAPhMC9HLfFwlBinBisJRMO x1V7/EzLQxnDDtthTziKY2Fyl95BKt58z/edAtVscRq+yEPYD8VG2Th X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0112.namprd13.prod.outlook.com (2603:10b6:a03:2c5::27) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PA4PR04MB7517:EE_ X-MS-Office365-Filtering-Correlation-Id: 5808ea38-83a8-4067-8006-08dcf46c5926 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|7416014|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?kNXGlpbypasjCpruFX/Dk4RNvfcGtYY?= =?utf-8?q?FvJ1K3qjre/Ees56AoAuD4mdg8dTERGtMBt7HtjP3fi95+vLpHEG0p0KnRoCXHsIn?= =?utf-8?q?xrwAQGmXUnbJcfvz9Di7J+Jq7HrjqYM4tMVwCon4XGwKGXfFPzSC6yZ9hKLwwVzRL?= =?utf-8?q?rc5EDeao9ABH+qQd0XxFsHvDq8VdYmj04OXyZwCfs5KTQiwP/blWHVB5iBeCEijS2?= =?utf-8?q?96w7NjdDNiPYCUKaHUp8S/s+2p7BlkWDd/FtEyrsLSjCgZNBBb29iNQ+xFwW7JsE5?= =?utf-8?q?Q9Q5nvofqpYJpV81pmAjtkjggm/kJRLMtvbwHATIWA9SdfmO0SGKQf3qeJ8/iZC14?= =?utf-8?q?xra/9GsvJUmZ7rfuWupSgX13EyUwDi0wUrqwUQSJwfawnrZ1er3qV/yg+Eq1jD5RN?= =?utf-8?q?Dk+1+f74c95z+so6WPrR017Vq1m2oXawX/wuuDzmmIFIQI3HJs92U4koxWBB5vsdH?= =?utf-8?q?B5VJ03s7AFGbfChX9LocwJ4UpyJ6Nz4C1O+Qa44/lrVyQ1jjwODaAtbWPJ23nWM1C?= =?utf-8?q?RxqhX8qKMKbWuZsT3iHOwCxXCCFUp8jiAWzOjPjqUHGeXc3lr02tz7EKnQSq+00qB?= =?utf-8?q?YXxTkFRflae/LrXpWjOfCUo8WpY+hXaQwB+UH112e7Vp50EJprd+m/Ht4+L/A7wQo?= =?utf-8?q?lgDuE6u5QN4a4/LcsG6l2XGyo5Rq/tKyohrAVEb8ctorlOoVuNRQenUcZi521LTIV?= =?utf-8?q?Y/z1SNqoCzBLKjaVZDieZA9fOHMhScfYdBhV1NunBoZZGwESh8cWcau2D2qBVwAiG?= =?utf-8?q?LctMQ+kCChNRcaXj78ftmQ2A98KYGZR1xELHBcFtP9RKKRBI3mVOUXvHo9leYFvin?= =?utf-8?q?3NRZc4h6zcQAJQaDbva+dUDlc54M5ufpV+xcUu1N+CHlPTJ+FSWzfYCei3y7uL5IG?= =?utf-8?q?5nXaGtoNp5P+3RbK5rk2PwYp527dkgofz/LdyPFTpnHzolhns6RH7pd8EOE1mDlsK?= =?utf-8?q?oOzHWBR53V2TY2pmtLjar1TGqf+ElFD3KgqIlw7pVMbCGTXdrZXc3ZmHq7i5OGIkE?= =?utf-8?q?pLFOJ8FGBlykl7L0obCQgVFQMSg6BiI3a5rbc8lisHAtSj5Z8ivqxmFIVNdGuL+rR?= =?utf-8?q?reH6Yey39rNaGyiqMal3FFBaQHKo/l37Hxnwe4zeWdrSawEIKn+dpk3IjQq62zMTD?= =?utf-8?q?m3dUQD0QHUkt33kdlpD++JUWkb7ihzcoZTc+y0oO9QVApidFc2EKKT703fIVI1S6Z?= =?utf-8?q?seRpIZ9kxplkUQaGjgc8wQ2ue6AMciKtX929W27TqinRvB6kXbwiHwTFjLXz+XjMc?= =?utf-8?q?1nSlzZCLNurT25ltzY3SqkhUZi4beV/RMDw4cFWM3B1wZAiVkDTZKk+UKbUKB1cx/?= =?utf-8?q?Rc2r42GZKaJwRaBST4SH/CSb+5NOiZI8Xg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(7416014)(376014)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jM6OoKrWqTmpi1xA2KaN7kPGiWtv?= =?utf-8?q?pCxPmquZIxiWpVFBmb3u6Ad/9DxEw/QBwGfi5HkyeaMid7124IGpdrrcxAp6tYPkZ?= =?utf-8?q?Rg02YKdZDvxpUBc2LI4e1vypiCDG3+dNv0UZ1oAFfLVilEALDRCZDgkagDGC2uVMQ?= =?utf-8?q?y3fEtfeZ9SYGJUaPJyeTHIu/10y09SfvQkZGyNFGLNRR0TEyCdnwYkGzGzZkbGdkS?= =?utf-8?q?YPbUz6B+LNIyvQkIPtR7PCE7Y2IISbYhq8Y8btaNMSdnxMAYAaM5XmhC8WkThg6eh?= =?utf-8?q?bVucGIBozzhXKic1RfbrsuLjMEmwQ2aEwgKCozc9PVtBEBMeWzTDGGXtRktow/xT8?= =?utf-8?q?bfKDdymaM42g0r1Keh2QpXqYzcMUPKyKur47HCTVRwcaoIQJnVJHkzGs4ItHy3jLO?= =?utf-8?q?d3ZnBQdIAntaImDWfnRSeRlpoPuNiMDUAKx0pMr2aXGp1QloClicbRS4pY0BmYxUs?= =?utf-8?q?0dJWq02Z3ib31QZLFAhufsOkFELUUT707aukORNqWJ5cK1p7PkBFn5e3g8BIcItE7?= =?utf-8?q?WrEb2HWQKMEZUsQA1pjOoj9+C8RV5xisrsfGXCqxPSbAsOBRvGPTmwcanCrQCBCQr?= =?utf-8?q?ZownWG49qO/D2SKyvTmxPOIYydKTy7aZDyEDzF2wEDOF9kL9DHpfispkMwBSWsSTH?= =?utf-8?q?KP/YhXFDryR3F8phdice1SbasDEVWBx2XRy2cT27jfzyAjAAna+0l6mNsSfWhHsQ+?= =?utf-8?q?V1KPOfWMqVypqgsxQdnieHB4CPEkgmzRAL9Xtg6yg3LlyKUUGmYuXmzLsVfQYIfaK?= =?utf-8?q?fA/WqABuiSJNNgAwH9OpVEyOwjoNbvJGyW7pvi7IiC7npR8g1qQ44n2eg4NjlTP87?= =?utf-8?q?GxmmP4C639VPghCy/+WSRAZsb9Gz07KrsDS9EIrP3wSlGE5a/Ah75HghlNoUEHFHj?= =?utf-8?q?DhKrTeY5PiwseDjNv/hr700pqqnTl4E9sKOYUTs7mpZyuDEVjxEOUyblDeEJQEm86?= =?utf-8?q?iUAHmxzKA8OD+aF+w5GaS1a+RCJvWX+BPZs1h4ItcFMWUBV0/XRxEwOfAdZangzPn?= =?utf-8?q?3FtUvFS+M4uPq4Qd9/6sXYVbmuh4QDY6u6/atDIp8QS5ldaSi+0P4den8d3D6O2Qx?= =?utf-8?q?y9lCb9jvG+5Zksxxf/eZKOfnXsVcWd7DjKLNjY9N7+cjUa5cga+Z5PmVKiPuv7qkx?= =?utf-8?q?ibNA+SlzU7BCeUSGKAHgHS9I2monczHeaUBeEFDKSKL+xd/vShPBe1K/8GxHuc1Je?= =?utf-8?q?152cbA4+uRwWybGRVWQFMBQOfhqsoBTrtb/mJPoWYj+CTjaMM82vCC84g14t/LqlN?= =?utf-8?q?El+BJqyy2d+UhPnckNEwrpe1rlnFV1lF7BFMzPODhq2XyC26l1XoGUpyof0H1a0wy?= =?utf-8?q?ULDg7JmwtXyKBEYOxycPXlnxaBvN5TWddpQIP+IwL+IG5rauRj4KUdYKaBFT6iVB5?= =?utf-8?q?qbYU8PDZBKa3LCgFUD4sdRF5Z3zqeE56W6xQiy0upmDjn+ILRZ7XHshnAP3BKXK2U?= =?utf-8?q?dsIHRghO0ZQTfB6AcIt7N/fuIdvAYOvQdpvySYPEP4zTTVG7ElsZalb4qUMy+NEN5?= =?utf-8?q?mnv9f7aZJ3uu?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5808ea38-83a8-4067-8006-08dcf46c5926 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 20:42:16.9954 (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: y4CFhmwQgPjtm6HpIfBMFVCgSlvykrxv4LHTMEEAdLn8tfbUbWos+eB9Ke+vFrYo9qW1fu7CmdWbZE7O9NJlAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7517 Endpoint Root complex ┌───────┐ ┌─────────┐ ┌─────┐ │ EP │ │ │ ┌─────┐ │ │ │ Ctrl │ │ │ │ CPU │ │ DDR │ │ │ │ ┌────┐ │ └──┬──┘ │ │◄──────┼─ATU ◄─┼────────┼─┤BarN│◄─┼─────────┘ │ │ │ │ │ └────┘ │ Outbound Transfer └─────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Inbound Transfer │ │ │ │ ┌──▼──┐ ┌───────┐ │ │ │ ┌───────┼─────►│DDR │ │ │ outbound Transfer* │ │ │ └─────┘ ┌─────┐ │ Bus ┼─────►│ ATU ─┬────────┼─┘ │ │ │ │ Fabric│Bus │ │ PCI Addr │ │ CPU ├───►│ │Addr │ │ 0xA000_0000 │ │ │CPU │ │0x8000_0000 │ │ │ └─────┘Addr└───────┘ │ │ │ │ 0x7000_0000 └───────┘ └─────────┘ 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 = "simple-bus"; ranges = <0x80000000 0x0 0x70000000 0x10000000>; pcie-ep@5f010000 { reg = <0x5f010000 0x00010000>, <0x80000000 0x10000000>; reg-names = "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 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@intel.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 | 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 #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, atu.func_no = func_no; atu.type = PCIE_ATU_TYPE_MEM; - atu.cpu_addr = addr; + atu.cpu_addr = addr - ep->phys_base + ep->bus_addr_base; atu.pci_addr = pci_addr; atu.size = size; ret = dw_pcie_ep_outbound_atu(ep, &atu); @@ -861,6 +862,7 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) struct device *dev = pci->dev; struct platform_device *pdev = to_platform_device(dev); struct device_node *np = dev->of_node; + int index; INIT_LIST_HEAD(&ep->func_list); @@ -873,6 +875,16 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) return -EINVAL; ep->phys_base = res->start; + ep->bus_addr_base = ep->phys_base; + + if (pci->using_dtbus_info) { + index = 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 = resource_size(res); if (ep->ops->pre_init) diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 347ab74ac35aa..f10b533b04f77 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]; @@ -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; }; #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp)