From patchwork Mon Sep 23 18:59:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13809937 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 7777CCF9C71 for ; Mon, 23 Sep 2024 19:02:36 +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=rrUk9YwMPnne01ifz2s05Q5PhJgj0l8sUAQNIs7aG8g=; b=kIgzJgLPv+sRC2CuaKF5g2KKZB aoyTFjGBhpi6tZxZiCWayKGNwB8LYul3p40YPX+zbTQnUSy8miCDsbibHeV/r13KW/rbcmF0YNr8x 4dNc61m+u8I8obtv4+xWVkYTlJsjOTm3WSugrrsu10FrkzpnB3UXGKp2LDVFF6mMK7CNnJM+Zdtbu OUz+HbDpLYXsKE5uZZWrBjDdfB3djK5Eeq6uPG/LGEWYsooofu5UAd/5F2ewerrQyqhDS/qNvw5v8 4hyCfYrwyqTPRKL3OxoCS0SOstuTLfkQt1W/eG9rTSsMGl+Uy2evJ/5l7diA/YuoBgGH0tTfbGnf0 Hav7PArQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssoKG-00000000Jjq-0tpd; Mon, 23 Sep 2024 19:02:24 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssoIC-00000000J7N-3bmS for linux-arm-kernel@lists.infradead.org; Mon, 23 Sep 2024 19:00:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uGcWf3gVh/Wp19NEGOYxatlsQwD6oTeuJGTzP7qNRsqkn+aNaoUIBsVZb+jZoeXlv3nBzldUy+S0fQwcdg2xNxHSimuOTIY7dTYf5mv3PoYup/1oceutROh3OZvtl9IRSEbxW7/p1tA7RZPoNGOZP8T0H64vaI3zzdMJccdprcmygUtwuRdkDanOu4pgo6feNjP3MOd3iNbn+JgdlSKBZ/sQnY+6CQNYVIQI0lOw7oJuUpSvDN2nmq1gSXSSgmsYkOqcCGTgdOWczHUwUvIEyf64zpvYTHaycSMecz+TR5zWvvrJwCGZqBmvv7a8VsS3MQ9Klzvc71BXdv6ECkbprA== 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=rrUk9YwMPnne01ifz2s05Q5PhJgj0l8sUAQNIs7aG8g=; b=jB3mYGIc4Ue7mjcvlCOUQdxoZYspNmWqzrTv2oufa2QZskQVwf0TL7Z2clBwpw/UqvnYbt7+eq5wDRlrHJVjwM0km5j9uqj9+/E4uVOATkVuSdBULZkvnXh8Tox5ZOXgR77bOX1XEL8UP7U2Oki/WoVP+Zpzh8CM2kWcfGdGzMWyx27bt0T68oiH0p2d0q63u/BxLH8oM3PC2V/dzMRP7azVRRCtrQj0kOc0ui6RMLXJSCLGxjtW0A5U+Vmnw6e0+p1w8Yw6KtdXeqhgSnM00A4SQzXIpHsyc7N38I1GDLl7ZcxADdtPDaXTxPYgnmYHrDSxs+h38i05NyB3yByIfg== 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=rrUk9YwMPnne01ifz2s05Q5PhJgj0l8sUAQNIs7aG8g=; b=PlAIqhYizFjiB+nMpgYChosSqMRQaRFHQkpDTyg1Lyrp1y5NtfcmjqpEPQWL9LvLpyFP6sI+IgnvWvh8eelyvtkQvMn/MqsLbeOJ8m8mOWYnjtKf4Ej3FJZ8jFx8+2gNMLQrSvZ9GV+VACH2TtTHwSiGc3aPo6qWBifRXz2Eh51ceqV82By8qvW3O+Dy/w7aBwc09CPr/urN3T57YBk7++txnBflSCrhxhEG4E+Oh0Bze4NjU5L4TSQwRqt2oRMBhTk677aXq9j5q4/dB0EOAkLJIhTDhFYoBDNlODFwga94qtc+Qe3BaBabDdFBdq6XAd4MWkgir9NDDZKWzKYodQ== 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 DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 19:00:08 +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.7982.022; Mon, 23 Sep 2024 19:00:08 +0000 From: Frank Li Date: Mon, 23 Sep 2024 14:59:19 -0400 Subject: [PATCH v2 1/4] PCI: dwc: ep: Add bus_addr_base for outbound window Message-Id: <20240923-pcie_ep_range-v2-1-78d2ea434d9f@nxp.com> References: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> In-Reply-To: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@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=1727117997; l=5222; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=UA8d+sBLH56yo6wbs19BhoTsblTm17oh+2btuJvmpbk=; b=AbThf7zokd+Nv7jvltfFUDJ986D5PciTOKU6Rru46M6BXfAO9/TFa5BhSXmyWj6AkTYAat3sx kpbS9UXXIybAAVH0+5QuOnwyc6VwfvPW2alKUtk39Ua+RunUs0qU5/z X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9562:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b9668bc-bd6e-4f4f-6159-08dcdc01f1a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8nsN2l8bCnWIebSLkKIG5kxHacGXuKA?= =?utf-8?q?FGiO/lItBFoYj2zd7dXthJoA9fjzKXhiIneRu5NVJMRiLZUj43uQP/ZL8GgXTVz9Z?= =?utf-8?q?753E/DEBQug6p4GqfDlYTxh96IJ2MM6ISQtQlltdtXUVtxdt9WZqU7S5/RuxbgkwU?= =?utf-8?q?8dlVLXbUXoTwnlqxMqiPvWyfFwgSKVUi88j/gM3khv1qiVf+DQbECzeS7/2cIKjVP?= =?utf-8?q?u3yYcKjmUVrXRrgQv1lA7oEDJfCnW280ft0SN/KwPI8KZT1KwbpJ5hKlwzCBklWKU?= =?utf-8?q?N8fXnzn57XizEj3wnQ26wUR+XyME2qPWdgoHzk8I3vGS+BF3k83dTyuyvKKPFhiOn?= =?utf-8?q?T5ikoLPUIeRzE8moq0bWbCPihBWeQMufAzEXfm7OiNSWAWaC7tK2FilMJwfePmM/L?= =?utf-8?q?+i7wYxLkuZoAHh89VCcQrKLdtW/nriKlXk+z5HDRLJ91qnuSdVDJnJQ6a5fQDhHyw?= =?utf-8?q?XIV1p6Qth6+B935wkBJh8BeRxWTLp9NxYHJkCJH4JSSX/t7E5pMlReZMzwi9OIKCH?= =?utf-8?q?mcBpcvxtGMaLYtaqQfedMWdKm/cfcRXc7/Uprbv/X59xG++4DTEY+yAgEtFmeUGPK?= =?utf-8?q?D1DdJ6AHtaIHJsvGEBjs6T9TYwbBiXy/VxcF/hz2lAvjtLDnyiRw/2sb2Y8VISAU0?= =?utf-8?q?vHkcmOfEhjrJ9eVyzMk0X4m8/Lp/7shOhUXLcyR59MA4zYa5lB++6dozPHWi7ohtr?= =?utf-8?q?QA682VEarStENZ5QKui6PhksmcdjyXNPdTDpY/w8ZqbnLTR2Gmaz0j1r3jVY4gvt/?= =?utf-8?q?fyDbb8A6VgScTqeTyO44CbR/VW7Ovadbvv8W3R45OawLtQgSgNCPWWJEBfFGsHhp3?= =?utf-8?q?5/uW/WyDVyK5YLLLv91PuevtylJnMLNGSKvUp9WY67AuzERelt208iWMoO4HS5Ubh?= =?utf-8?q?7A/RaJAsypTI8LsIUgwTGXzOE+Mhu1BdcBGeOWABqA9/+VsJ1ejwhPAyzUL+3jCKi?= =?utf-8?q?mj4X1e/43LDuHVdkUYVGVGh0/pmlpoyYbx21XDiCVzy7BeAHO1nlGkOuCtZsLyZ/Q?= =?utf-8?q?gxMZB+hs6DJSKN30gUvPkWtZ7jRXn29gRWx1fPMLO+E4eEg+EL4x8fzHZ3ThRhoht?= =?utf-8?q?HiRcQjQTjvyi1IqxHddPd4nkBSmvGlwIWijwErRvmiN+GQExt7vLSxb4XNBB/dp4k?= =?utf-8?q?AeDs5dzT48UlZ3/ucORqGVJfCmcI+TSmn7iDKUFQna+RnGNnlwOWjH65tjNavFXLA?= =?utf-8?q?fv8zBCzNT2p68gydpwnQD20YdquXeSK3HLELM4U2JGdBRAW616Vzzm27myvVbszK0?= =?utf-8?q?hCHL/e2weRL0Wie89++uBvM4vAIDkKFP81HYGMqE/ucxJPrzNd/+srINJuqCbDHK1?= =?utf-8?q?ZKqzH0tvwpj00LpMOUiX98NaTViLT8ejQdZEliPqlvHWu9KO+EUyxuQ=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)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lQExcd70yYPQ1hUDBtfzZq2ZD9YR?= =?utf-8?q?1mtoloUIF98U+yoFduz+9dNL4A/m2HmR+2/x89vyb/XYY5aQpqQMDAceOMmWNiKuu?= =?utf-8?q?wqK5aS9MWnCxiyu85iuvuLqWkYaHwQxJMJsWW1h1rxTVOws6q/eGOltCVkKPdQ5aq?= =?utf-8?q?16+omM1u9FOmpR7UL6Qsp7VlQjiHJ5X+LoqrKDSJXI73jf+gCGmoIXXElsyBJMD9m?= =?utf-8?q?AQ7nPum4bSzndPRD3WNPsrdiDWSMRVsyVr0ImlUOKxnZ07eCsQUrv8HdpfKtAjk2V?= =?utf-8?q?1smkDYJ8J26tpWc6+7LZ8G6lC8FqaQx8wG/LJeNJ7oaAEDYNqt4jdX2ka1U+S+5YH?= =?utf-8?q?AfKPhRkHLL/23zuwYXiy0P70hQ1dj6o5k8JmXC0Rxp8BnYYj+n372U4vb/dzp6BEe?= =?utf-8?q?blGRiAPBmL0UclQVBG7tlitjQJ69KCRumPplvAyEThjVRaSFJaYgQl5lvsRr+4cMr?= =?utf-8?q?HoVpVzRduxPtcDwVjeVlEbptvrZz48bJ2UzQ80VnknvaPQjW7UMd8QsyowEd75pgZ?= =?utf-8?q?INKfJ66Z35iQTgkXSYmmLpOhF8iWemAa6E/4Ytrc2M+sjYuop9ZJLtGs7IkR2mInh?= =?utf-8?q?lXErm2BeTNZVCToTlZFRg10p70CZcfvGDdUt655nPZNJsq2eAWOTFOezP4etpHtha?= =?utf-8?q?oXshnz8JRJmHIRfCeFJAL6BKN2XrtEOrCjt/k0HQRSBhrwsjXs7xYvjEbogVqgv0C?= =?utf-8?q?1FsW/2qgBru69zcoE/DO+NpwcrVgoGRiG9l5VCUz0NNVBt3Xh6inuwydhgGPMQcAl?= =?utf-8?q?pnRHVgPywJoei0odT7yIYH8Kgj1BcTbVoAZDnT5cUHCJ7hftAOZqKmQOlPwnYufcG?= =?utf-8?q?IptgOqOlkrTDW1EFRSK+JNcgJ2+4ZxuDFylGclVrsQqrZWMScDoj+foeBTKq8Zrxp?= =?utf-8?q?1rnJTpCEu6nlJh8YMVhAfGnfZI5omUrinm4AYv+ciojn8hKkSA1tVj+cMOcKMYWF8?= =?utf-8?q?yZkG4PPBH7Zq1h8OI1ZadYzTIGhPbp/69aeowuPGH/dOmH7F5li44gO9Cyz8XX/0d?= =?utf-8?q?XmSKV6yd/7OdKwTNSb0KA6DQArev1BkYAB9fiI+EhGxG2ZKVLH8ZgrdORR/4wsZal?= =?utf-8?q?QC4pf882NsstvvdWTgbDMuIszD78kCQcdyjmfZwYR/u3kSxbcss5tZ+2CstNHX/D1?= =?utf-8?q?83rvfPknCnP70lEPkrjFjVzk6PGcIjeT4VBK3r3K0jrDFky7/RX85l6gQcm4exJr7?= =?utf-8?q?hMnF8J5a+m5UNRqx3OYX0fjORmv+s5lgIn5yzEDEv8YgPNjmj4yQ+rTojN193wTME?= =?utf-8?q?APRjpp3L30Fb67zo0zfykCBxZQGCAZpFDvkFk5bry69+KF5jKgDNpGoLfosKaO/cl?= =?utf-8?q?amFLee/VrCe7bAcNxHRqv320NHdcYzBJ3A9znujKfMwx/L+ZtXgYi+m8akWuGmzh9?= =?utf-8?q?cQt98GkkXBPMny4xL91L70hUdNS+jCcOnJSEWtA1VgueQ1qqubdLCHydairM/7Nef?= =?utf-8?q?6bdGbpGa6mQtYHKKVPB1URT6QWfjsGWch3AtcMO8qcudYjF1Z7ewGSoQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b9668bc-bd6e-4f4f-6159-08dcdc01f1a8 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 19:00:08.8174 (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: c23GZINQrMYjkDJ2D5qEi2AU2FlJMAcnjjXeKVR4AMmh2CKa4gFhTQDD0bR+YmnDTM1Uw6BmVkNBNw68+ThBwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9562 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_120017_087683_CB2DB14F X-CRM114-Status: GOOD ( 17.46 ) 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 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 = <0x5f000000 0x0 0x5f000000 0x21000000>, <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(). Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pcie-designware-ep.c | 12 +++++++++++- drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 12 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..51eefdcb1b293 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,14 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) return -EINVAL; ep->phys_base = res->start; + ep->bus_addr_base = ep->phys_base; + + 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..c189781524fb8 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];