From patchwork Mon Oct 28 19:05:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13853949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D37FAD3E2BB for ; Mon, 28 Oct 2024 19:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5ilQ06dZ+gRqsAnBOtuudd2FBhIfbsL8re509y5kH6U=; b=3ntRyL8T8EhQw8Lz7tyn6uHwBs hR3H4EXW4AWr8QX5uBYFTCvP1fE55fuebAUJft+ZMSe57boXEYTVbFHbT8cU2sbOI/RKeJRyHnNef DCOtYH+fo3ZiTEfbEr1K7tDIKh4pcFuEDXr+08FaRMaApSQedlWm8kv84+jpd8moOY4Qw37GOxDoM kxfWn+JiODd4hP86+CXrgTXJhRRWJ3/Wk9h+BxfzOmcNZ9wFZHsZtFEfPvJ6WZ9F4xndq3t8aGK65 9pXlMNIhq8UG5doSbRH2W9cLjReOtN1O95Wlm/y5eevnmPltnK5i77PzUb8Zr2R8pwgZH7HA7qaJS 2dkaFFYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5VNx-0000000C02I-4BZG; Mon, 28 Oct 2024 19:26:42 +0000 Received: from mail-vi1eur05on2061a.outbound.protection.outlook.com ([2a01:111:f403:2613::61a] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5V4L-0000000Bwf8-3GzH for linux-arm-kernel@lists.infradead.org; Mon, 28 Oct 2024 19:06:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YnFsSnT8dtkr9cPeii5vvS6munI7Pi0twrD7z4imwDDM5FPj7WeIdwPlqrFgdI9KPr+5KAVgW0s1cRkv//y02go/g4T0QeAX6xaRnCIY9nhrRNsqmFJxew1tDtzc/FymqPtDMqFrKZdPD+lfK+wlhNisEmoQoeIJI//t9G1OgQcN5ofRIj6jhT8Jte8XU+8g9CW+R8J6544YN1guYIATnBEGfSSqoaexq84GGFuyKCZkxR4Df2dYIjFId1YiCId2VXCnv+hMldNpyqWZmTsxjam2cTp1BWWwwEe7zsdqEVG0Np34bkSgqzLEGp5hclBOK7jYqjMTaQq3aJSRk3OniA== 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=5ilQ06dZ+gRqsAnBOtuudd2FBhIfbsL8re509y5kH6U=; b=utDSc75tLU/nUHT1jvwjwOQ0puDGO1spxw1/+HgCS0YG42CKIiqZ+P2bBVjPBYH0Ma3fxV6upw/hbW7VFwTZZEWVqzCdGxlscYA1ehHXwqMTQnO1VizK0ZnSqTqv+dn2QIByIPC6nXwrBwdrVXgJ0yly3v3A86FfOAGQw3hUHgnmN2pW1FtP3KCKfC9BdggtgHtBEwSOrNQDeRCAhFpESABO4kOAVQ+E0ANs2S10JODjCI1jEVVOy5T58K7giAatEYbf+03/vyFvsIH2Z8rQ5riGHBQ0aRsti+DNztRzz/kEq+ObBZGo7smflBd8lXA1tGIDDdBlaBARVMUPPzzNQw== 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=5ilQ06dZ+gRqsAnBOtuudd2FBhIfbsL8re509y5kH6U=; b=Behj/9mtJ59S3b8sm4ogk3Zqk18D2EXHG1m25RLSVX7etMM64u9v1LLpIlximVYAKI+YulPMU3bsR9IvTV8JJ9NrbWwSrH4dMSKEIoKmuKfGnRXIGJUZ/9nf89xbp/o0xxEgl3/9wInW8snwYFUePiYUWRw+DTyyh1uZAfnbW1ukkjYSdYkOacy82geJd/paCKkXghxJvQ7WiV7dYtuKjv9VWlg7xSQcCVVAPdWPrfZmjcnCRaEYpZHX4KEKvxHB/bPoWbS5+nPpwdn4Cjtldni236Ow9VdBcgDznYxw4iLLHfXFKzAldGutRLZNHun5ILpil/9wnYcP/jY1GN6ZHg== 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 DBBPR04MB7946.eurprd04.prod.outlook.com (2603:10a6:10:1ec::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 19:06:21 +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.8093.021; Mon, 28 Oct 2024 19:06:21 +0000 From: Frank Li Date: Mon, 28 Oct 2024 15:05:57 -0400 Subject: [PATCH v6 3/7] PCI: dwc: ep: Add bus_addr_base for outbound window Message-Id: <20241028-pci_fixup_addr-v6-3-ebebcd8fd4ff@nxp.com> References: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com> In-Reply-To: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=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=1730142363; l=5630; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=wjq39b1bSlaqsK6CqdYI9THTeDF6beeukudaMwC5+eM=; b=OkTwnRGEyTpEsvbOP8JxrxmK7S1zO2r8ZqzQDDCSgQTstxt0IDtyadD3Suu3yRVF7yfa7/KT5 lp1tb+eBOuqCLfKtJaGjwCcceNyXd0Rh0P3jBTkUfn64VE6+oYN+1el X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR03CA0005.namprd03.prod.outlook.com (2603:10b6:a02:a8::18) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DBBPR04MB7946:EE_ X-MS-Office365-Filtering-Correlation-Id: b641c80d-0b8d-455e-f3d5-08dcf7839c65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Dj1Wctz0vv7Gio6yE/+f+IXssZoKkaA?= =?utf-8?q?UwC2CWtdhE4DfOpo/R2BeTkV8zpeNTEfeGsEEgafULSnvXbTleptVuWMwUKPYctmX?= =?utf-8?q?aH9vMtluwwsiEyZUOwamXPXjkvSsChUjKP/lsHMcns7kUYP+wpsaQ9RVNeT+8cUO+?= =?utf-8?q?gXQhNgFP49uno45YKTuxpwMI1VqCchB+035mBamT0jQcUx4wgZ4x921pe8w41lZmP?= =?utf-8?q?Ev2Unw3cKKvQmgL5e31iLZ76c6q3cxryU63M6T6YzG70h4VRk3iVUUD8uIRV29HM2?= =?utf-8?q?nX9kfHSoI2RWdViwL46aaFy/cIjvg84PtrUZF+EjsfZGxUkRg0n3Q64jrz0FD4aYT?= =?utf-8?q?ZMhtziHrVHgiNOYkb1fexbwU4D5iwhEfVgrdbzYOcMrnjttNOKY8idlkybYfXXVT8?= =?utf-8?q?EpZnltmm9/xPM2RGYLTjUUohK/R/MwElVYiETw6JquvcL3cb5orW8zothOEBpNba4?= =?utf-8?q?A823ZvxABR3MtAX9oo6dnG6spxygQZkhHUEsMyHc5uUvaEfIbvEQRl3mkE7QAePm+?= =?utf-8?q?Jico8LVTu7oNJpYs6wR84CdcoPhNck01DKd0gxAgmmzDJHgzH7xYZigEdKwo8g+wR?= =?utf-8?q?Wg6MToVTH0+/37TWSgVmzW2uE03FD2Xel01VUCYYWAbfcF9lRrFozGNGfcukHy4PX?= =?utf-8?q?7PsZv4Pqu0Lwn9oBsyrEqvLxXmHjcyY7ZvqLRF9OQHzNQY8pk4lSRQwylz03nZxKm?= =?utf-8?q?ARClE3ucE/sdCSmO2cQgC5qDYVzBi0rViw3/zOPAdUK7hIXxNFCO2rvL3FlMw1IDk?= =?utf-8?q?0oPDwq6AL19zHmjLN/JCpAidNbrYRHg7IwXVD7HUXFMLz3Y0tGm3PNB24t8yV2HVW?= =?utf-8?q?uraHOrli3nC1rqNEvQ9qM9ZSARSYx4zVsyu5zdy0Br5WznRS3JWPybMkNTLnhiISc?= =?utf-8?q?rlplbscZ+g3H1PkYaVJmGqVN4sAiGQyX1Mcs5+puglxbcrZ6UTCJQ0bV8CL8ganbk?= =?utf-8?q?Ga9Q6xr5j6JY7YMKLxRInM9emVEG1elT8KrG/OHo8CTy/YIzJyXKVb2FDOM7kCnzV?= =?utf-8?q?BPUtMPfo8BZ6DPP48wjzfS2yQos5PWstRy5d/5JVD6RWoFZO+yuw6nQevns90ojSS?= =?utf-8?q?ZJotewLoeI/8mEnbvDa1e1mf4O5j9UNWqNq3M7djAiQlMaPhtLxQ7QB2kgte8MDaP?= =?utf-8?q?Kb8oBHhjqb9q5dtckzrbkf7/Qp/E/9nR6/vlpU6t9KCRjFcXEKsPQibLnVZlRhbvk?= =?utf-8?q?/HURfNNv/VvAmWhVA3NNtHbGUF8plwuhrMKk2PWLYPvTMCP7Dz+IXWI29waJg9Q4r?= =?utf-8?q?yk/HcCC75ucDRn/tUm/Hr7Vcsvh01Qpyj7OryWoc+gh678qTr03demvZ1EZiZbXTx?= =?utf-8?q?LaVUXbf0iF4Nz0L8089gB0UqDwSZT5KgTQ=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)(366016)(7416014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kGfhJuqtLR7oG7mvuT6aLPhjfHHF?= =?utf-8?q?fvKiFkijvlHCoqMTpEc1xwDxKfexj+e6GcazEFg5EfQZY736eDm9E1YW0qm4UGwtB?= =?utf-8?q?psM17QlR9RM+orJkVLoRMky+vlbrM4wy6uYMtVmQddaijpbK24/Ui9We2eAG/iSYy?= =?utf-8?q?/C9zq0kME/LR5eI6ARB0UQ3XLakmME1QR13cHMgOQlnuOdyb/v6JXaE9yeZTLV+rD?= =?utf-8?q?Hr6flijFcik1oelOld1ZHA14tpbrcJjln3d5zjDje6b2diboCcGws9xKR/c97WawH?= =?utf-8?q?dB0XKwYwAo577sRzITForGRKjQyA5btPVBGQB0EIFQqQKOqpy1RV7H2o8nDYPc8ec?= =?utf-8?q?EiNhLg/kOmmqRUvJnNzW2jbpyd7rvcnOdeqa2OfakgGpf26up/lY9kStSYoMN5rRB?= =?utf-8?q?dvH6NHkt403Iw0+ruaxqSraa4iV7TsVzN0GTX6G2gSzV759MiCiMKuwQgp9tDiEVW?= =?utf-8?q?U9U/FUokBRFbgLNFlrd+NMx+cn2hREwurg5gS1OCiLN+RrM3UDYPBMGG7qljpZ7QI?= =?utf-8?q?/nWzmFUpS5FNxupQ1Bl0IGpHbUe2K/ZtbIt+0mBEq/V9wMSi5H+XQ/bxcaqgBtO7Y?= =?utf-8?q?ISQW2HHLdYdpI9zNDa1sp1zvlLX/lfbDrSpoRehjLjC4G6AO8DMqSdYYiFHPG8K81?= =?utf-8?q?pmOrMro0qY0mN9qBSipfxIvOj0M3uNt4kCEX/jTGHmO30Ohfea2IBxsIjreU6Uo9o?= =?utf-8?q?+DC/ZFTlI4l8H4aiUT7iHuKh1L49ZnhhntLbTCkI8Oz308I7h40QhBioWPsifJ2Ib?= =?utf-8?q?b/t8QjDRcWjZNb3r+Bv9mdC44G/BcPhKhRIk1FbKlWR0XofT1n93rylG6WJvRZcZu?= =?utf-8?q?IatjendqpoGJmkqbC6lA/NwRdZ0tdAFr2HZTlnJteS94DqRgQVNM7Zi6XHcjg11U8?= =?utf-8?q?aY0Q08lErkISNgnNz0HNk2TlKHaVcEw1Dol5qTHSS8drfx8eZfgfZTFrjFkPO4fSV?= =?utf-8?q?BGW++Mzay1uvHj6UsnvcmR4BC0neIetRnrQzFLQt1IO6sF+7EwfEh4B9LA/Dr3IX8?= =?utf-8?q?kQ1zSYFSW/g9ckTauKl7NSFgdHI11iRg7ArqygV7JJsfcRrpynm7DlN+pAz/m4I8w?= =?utf-8?q?DGR/ReJ5j8CptjBq4ME9I5ochxWE7gadSPvYAptrFhTvr4TZJQxGtYLztTFIoMD1Q?= =?utf-8?q?KY/x5PG3E+1ZoiYhoHAVUt1unq0yGi5v/ngurYH2t81x9NPFXSL2BMJELiPq2tjdZ?= =?utf-8?q?nrvCsnAqPP2P8Zovcqh18AWq+KXcqWvvBooXVImgqxILy+5uPGFR2l0lMzqyLY9VE?= =?utf-8?q?MOrbdFQOsCXQWnyYNE4pQcMzqCLYSx06YX42514nr1hsABy90/wOsYenwteA8vOok?= =?utf-8?q?G3p9qCQW2435Y0Z+KzBgUPX8iX09Efpd2R9ba1x3X670jxjdrrS4ZvIClE4FIND7A?= =?utf-8?q?eGOh7Iljluieao7IurphcoRpxYjUO5ZHD3d4LiVtvJD5tzbQzXUBY+Z+lHVTGE9O3?= =?utf-8?q?9y21KKnBwhf3XQasmJw367qWMbyKVCCTwyRI1kNbO7B1pSh7whwDp2j5vR8zC8FX6?= =?utf-8?q?Lgiw2LaRCJRV?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b641c80d-0b8d-455e-f3d5-08dcf7839c65 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 19:06:21.7565 (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: QPD8tend6DRo+XH1G3qGxRN7VGdu142qLEuVFTF2tFuo8xViqjpRlqSjW+plZyQqSAiDgvhGL3oRFWk/hFlPiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7946 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241028_120626_014694_F04ED569 X-CRM114-Status: GOOD ( 19.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Endpoint ┌───────────────────────────────────────────────┐ │ pcie-ep@5f010000 │ │ ┌────────────────┐│ │ │ Endpoint ││ │ │ PCIe ││ │ │ Controller ││ │ bus@5f000000 │ ││ │ ┌──────────┐ │ ││ │ │ │ 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 = <0x80000000 0x10000000>; reg-names ="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 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@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 | 21 ++++++++++++++++++++- drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 21 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..a5b40c32aadf5 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,23 @@ 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; + + /* + * Retrieve the local bus address information, which is sent to + * the PCIe Endpoint (EP) controller. If the parent bus + * 'ranges' in the device tree provide the correct address + * conversion information, set 'using_dtbus_info' to true. This + * allows 'cpu_addr_fixup()' to be eliminated. + */ + 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 f8067393ad35a..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];