From patchwork Tue Jan 28 22:07:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13953237 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 AD098C0218A for ; Tue, 28 Jan 2025 22:14:11 +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=uTuZtBV4X19Rh9dpt07l8O2/CoaPLj4uomuMR/R4G/4=; b=hzx68V0zJVpMDd5z0aBJXKWsQJ CPj4fMqFsyg3VPtY3Oij/gO30ty37MszMRi5j+aoZjZ067lvtMwU//1OynIgH9Dt2YRizFUAZlxod 7sC7g5g/ODwGzTB9XzeSKO85VB25MgswMzO2vRoTgYKAWYJ3NqtojjLVTIi/FmqxRMd8JtU0ZrL8u DqjBIEBckN+aNPW9lm+zQaG55Qw6eCourJyY59Av9yuJs45A9s5nAhmfC0k926gGxB0vRXbQrIWyI 1EI0Ydn+sW0pNzVK9sPAW7nr6FZERZLgFMbRYUDhxHiNwgJsm0CpRN1KKKDW43SZC/PR6du9usy2o rkh6w++A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tctqI-00000005uNA-0y7M; Tue, 28 Jan 2025 22:13:58 +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 1tctl5-00000005tXI-1wne for linux-arm-kernel@lists.infradead.org; Tue, 28 Jan 2025 22:08:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sHV9msM7L6FvCXn9BJsQy7UcQUV/0AXJd17Yv6qkad/vnRIzIXgT2H9UoOjt8vp+Nkw8hlSSBEM+bIAzH1f0uKzLPyUeir5+KZhnWkWLO9tvoxxsoJ5M5IOcRhnvykK8mlI6Ojo3oa+6opOpTXyeiJsZ6EgdBQHq6YqMWNZOgOrvEbxEYjzSnNMbO8JD5SoRmFxN9ZlhDLJNOwA854ksljo9YT9OzNrM1VbLh4YArKpFoHqZi7LYnX/0/xvS7Nyethsx61E8cDLQ7XQu5o/M9deK8GzcO3J+d9PSy5QQcH0LK0R1tUtEEGXS0u4T8nQMagGxD/r0LXJFeaHCXCPg1A== 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=uTuZtBV4X19Rh9dpt07l8O2/CoaPLj4uomuMR/R4G/4=; b=MOzkFde6H0ULFHzSl3EWP6w4AISNX/k4w4sjF/WzqeGHwStxEcp30zFjOERcyjmA1uw4VYebgmmMmuU0qHUhTzwF1lMGWKipX+pcN3JrPXBXzuUu72hR/TgIooxc69lkDiJ/zVf48ocN9u/xymuuxa81J5YKdYEjFJbLJKQXlQuND04aBF8X6asTbyBdb4anDADa1H6kOR7RQrXa42mWRZs2E8+7tnmBiSJwXrp1S1+jCj4lQaIYl1ZJOm8H8/1yC6m9E0HgWQeTlsCt4znwVtxWt2DJ2Oj+baDxLstz7cGdaiVhKBIj3PbLCd8aFS54+P7wTM28QK376kRoQ0cUrQ== 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=uTuZtBV4X19Rh9dpt07l8O2/CoaPLj4uomuMR/R4G/4=; b=ZrBEblGTmECPjTAu5WhVdrOtq/8g3oUG+PT1yDXTOywYoJi5kRKiY+LBG8L9vYVgUJGTOHICqVD84vAsgG9/CKcRTmVaCqbGsdQS7S+Z9URUnrVtJKUJhuNIWUx45Dtb2UuXi3OjpaUTxajcygYP4w/iXSCARL6WRmoERS6JDMbtgYGNd/ozMg37nRwCOBA5MuNpeXTtQ2AODWSet4fp2Qgy1ziixGQl0oBBZ0mebXXzQdMXDkQi37xv83lrBXDtknyQLRN1IBCDBUc1T22a0Wv1mtopd0cbIHjuZTE9QrMebdLcGEdGArJD/6YXSegiLjf9MunACBC9Zjf0aaX5ig== 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 AM9PR04MB8555.eurprd04.prod.outlook.com (2603:10a6:20b:436::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.18; Tue, 28 Jan 2025 22:08:34 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8377.021; Tue, 28 Jan 2025 22:08:34 +0000 From: Frank Li Date: Tue, 28 Jan 2025 17:07:35 -0500 Subject: [PATCH v9 2/7] PCI: dwc: Rename cpu_addr to parent_bus_addr for ATU configuration Message-Id: <20250128-pci_fixup_addr-v9-2-3c4bb506f665@nxp.com> References: <20250128-pci_fixup_addr-v9-0-3c4bb506f665@nxp.com> In-Reply-To: <20250128-pci_fixup_addr-v9-0-3c4bb506f665@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, Niklas Cassel , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1738102099; l=8860; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=zdPiv6W4EwoEDikp6bIO3+h//fUGK+Gw+OhRncm83oA=; b=9SJ5Ha9pZUHxUxBTELsyjYZOVqsLA985hLWG/ZygSP1mnYEOJPGkDQxvP+8FEViYtsib6oScf vCREh5pHoX7BqioHcroCzbRxgQsBpCWMeE+pELBxAbqnGS11+lBeT2d X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0130.namprd03.prod.outlook.com (2603:10b6:a03:33c::15) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM9PR04MB8555:EE_ X-MS-Office365-Filtering-Correlation-Id: eed99987-69f1-4b5b-abe5-08dd3fe84ea3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8qUXhKxDo26POEyw0sP9etFB3hQSdJd?= =?utf-8?q?EyNxFkKwHOLHLWgpQJpxOlFeJ49gZm4W7Rsye9Z5Q+kHv1+iM/3DEzGvaS0FNA0TV?= =?utf-8?q?1Tj0FWzWWiFrr9fRJu1k3HE4OOHcCCNxvMo4c8V1lzip4+jR+mkCLLUnrJJseOU3N?= =?utf-8?q?FOZxTF3D2mjGwO95YFshyKgKbZHYgnwcoufTXSdaqu8PETuJRQctnNrQZHZpr6FDu?= =?utf-8?q?GPjmI9jgwhqsxRvJrq2NKzvbq32eVmqryin0GLwT8OkEQtQmdYmq0CA7Nd7g/64Fv?= =?utf-8?q?1rAPz1PMZz1x5o5HCynj7VEd8f8ypin1cI00y0Q0X4osIBn1qfk77ZQQLM9IYepsX?= =?utf-8?q?5weMoQ2/yKHSLjJJ9x0u9sUqHbQJYFNvSCN7XVjldor2F3zCnb6DdUrgwzCpjOMBo?= =?utf-8?q?hpGWbsBq6QqZMo5TUadks0ecnr07n2HKDXvEGmQ1yYkZ6EuzLWf5ar+QmcR8La40y?= =?utf-8?q?gkY+YHZ3o0W/DfnaHU/ldPPeEkI4pbRAZXalOLBQG70kX42isFao/r3GZbwjzeIrB?= =?utf-8?q?pvAFs9pIdC0941cZzfucrr8BwqhUAD2Z7r+HzQIu+pZKtkq9t6TSNMvrbsSz9MqD5?= =?utf-8?q?Bd62tHuNQdudMW2kgYBgtPr/iuygelHiBk9dsEsFH5lLgiWew+4yj7C7BMdhwWdHk?= =?utf-8?q?gFLhsO76Jwx2J6a52fhmyY/RxqbpX/h+dEV5vftpMV2gL72ILCgs90hnWj2fqkOIL?= =?utf-8?q?sfyTQRK2/SplRA4Tn5QBKL3b/V7qm/JGJDg37N64EGxfRLEUo4pgufgXdSf3FNA3y?= =?utf-8?q?eHGfkv9M9JQ+dYftzERQo1b26Y6dVPpz7X0OKyFhLmHp24SD61b3N4tlj86jUWFMP?= =?utf-8?q?m2wkTUWI9VMJdxMCY+aVxLYlERkBSQFui8biPX1CicYbwJbslh/B3wH/ZhiRqfv09?= =?utf-8?q?ZjtLj+CZYlKWXix2BT2aUzBfQOYXBzsI46Vrki7UBMNd8fQ8hIXlcY20bt/Q5KShy?= =?utf-8?q?Br5IJham7p9XDXPq9VD4djWVyl/3Pl/HzVoWQS42y+KrW/K0DP/0TpM+gzAsW/ehh?= =?utf-8?q?rgxHN+SjS2XZn6MFxud4yxMmKOtxVQKIlVGW561mVb6S05p7t1D2rlo20jJycK7bl?= =?utf-8?q?9GUZ5cIQvOY4SEt54YHrFwMVInJt4FrOAyBgvMCbki3eweszOFMowRhDM8jVYJyGL?= =?utf-8?q?ztQ7t9cLXMHAdCkCqFcqpqaztMRqwUQok1+dI62igeb1gvHQaAXXiRe3xmyDjSp8F?= =?utf-8?q?cBsQjVkjg3bc+VJKnLptDSQ/vQpJk+J/7ukwVhvNpBWQH2t5j//7Eld00O5uK9sO4?= =?utf-8?q?DIibhlNeZBzsUe0wEZcFD2RXLrei84k1vVG3Z2QXoH1yyuuKLlAPQDuNXKOTTPBub?= =?utf-8?q?aORlJs2mKzAxpLYJzFApXxbKUXR9Tda1JLdxnwu0lz5j3vVvLuiqEjdtqI/f65dj8?= =?utf-8?q?47PpZeFhf0psfkKSceJbonmDRgWc2kEzw=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)(1800799024)(366016)(7416014)(376014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?AyPc7l/QZxvpFJGrzOG6IfmkYnAB?= =?utf-8?q?8DtQ4Nl6Wlq1x3B0AjcC8UesDkwAfYQJF/t3uAQqVfAs6SBs7hmbJA0Hb9iISYl30?= =?utf-8?q?kuxaIE2P5Suc/SzSaY9ZghOJLhCSVOLcyZO6ifjEJZFRS71YAV9byHogE+Y0XStSE?= =?utf-8?q?28dHz+p6RQsORjG/S/ec0WG4id/IunhMOGGJjO8CSUtkgz2suDOufS8rck5aAjhhV?= =?utf-8?q?8w6bambQCbJtnBq8lKyhypkJWTgK7YLJfr21J+8Kln3pNLRfsGqL/clm6MNWTThd6?= =?utf-8?q?mu/RO0remBUsffUshDjCtw7u1CiK91I/1Q81holth0heBnvUFn9KXdvR3iKuggdP/?= =?utf-8?q?IY2GeDzz4erWaa7AUsTbYQUPBD9/z8gdEj/bgoLwdJu7y5d87Vy+K4kX5dz6WRAjK?= =?utf-8?q?w4qIfK6ebMEE/fhg4W4RV2NyZCdHvlt2yJZ3CtgoK24ZDm6ELUf1ljesytJaaN5ti?= =?utf-8?q?NyTcgoCyf6Zl3FKMpuzRXGtgFX3W5fpDvbHlP83ElrfSe6pqK2p/dlvOMbq1cNCZu?= =?utf-8?q?J71a15PdoOaby59VvQnximmERWRW+Png0Ubn+AtLfutA7zQge4lYXOL3TT7F9iD0n?= =?utf-8?q?riFD7kjIRue9UuGd7l+UpwGcPiMuTzNsXbVD/V1xzeL4KMpoZ1xneYrtEE3GIgU+b?= =?utf-8?q?fKf7i9oUvuLdp54K1U/fzU1Y06B3nFN1oaL7k1coLuSM+1tkLHLjlK6LC5PIosdZx?= =?utf-8?q?JS6Yes+NwUi2NUP+SM1xzBAev3/OTWzKOqoN57a4usPYDTVzQnzoi50qHV2NTokAh?= =?utf-8?q?w4zNTTNZ7j/oFzdO4xwAKCFwzd7VtFSXro5vzPMoRXmTuyj3Od/CEeIOKanuJif0W?= =?utf-8?q?H4nZzk/KbRHF3TUP/2rfEiDkJaSzujSDwZQcc8mxfw+mcdr9uOlztqSUv7qEiqnhr?= =?utf-8?q?Og8rnIvOIlqXAFhYfRLrpi5iokkr0ae96VY3HZu8kNVUkMCaF9Q76hOEP7IoFItMu?= =?utf-8?q?0P/rBRV+RwQWSBJde8NsnAgYQHo9+1rsZ5LPpM16yn1JixzfbumWo831Vp+/PGf3e?= =?utf-8?q?I+8Ux7waa9s00dX8D9u9SAbmROdd6oHND/a3Pw7tDMt+zF3hJmE4NNno7qNrmdBBf?= =?utf-8?q?ra5br5xQypMck7X5QCYYUEv8rQHAS8+OXYjFhbLIm5zg7ZPq599EL8cV3gHp9oEeo?= =?utf-8?q?Qfo0GAEwwL6UknepHZ3AzYht3GUX5jXFJpc4WftZeEbLWXvsHbsZhcNxCVoCXHkmS?= =?utf-8?q?N1QqJ/CQZ39z5HWzdzEMc+/ceiw4mNSNwGn68MyQ3rvmiobYXZu3u/74+vTmgIJZ9?= =?utf-8?q?eRNLsPldt+xEuECaqRozkH9p8YL9G+ouWL6bh8gJk4f700fPXBBz4ZJba2aBYdyVf?= =?utf-8?q?B7/HYx2Qu1+z+bCU/ysYYPQZWJnMPhBeE/bHWb32l1YQ2SnUfoxJmbwuJjywugNmo?= =?utf-8?q?XkbTmZe9DssFajtFlQtVFDvqRTX1+xOqHNBt0AaOSAKV0wYtyGhoyjoAeY1jFIAcy?= =?utf-8?q?EDurl1Mr/5hgOJZypsbQGZ5Dy3QbvEC20QTVr5YV6f7CCc8F6uhOoabyC1rqNcW6u?= =?utf-8?q?cFiPIWZIgKV3?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eed99987-69f1-4b5b-abe5-08dd3fe84ea3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 22:08:34.1834 (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: 2qAa9UtudV5vmuQbRqwHinlA3hTV8v9XP94aQibl3BxKxzwas/XOEzvdsDA9fsCcn0vhD5TglHrbTWl+qPChrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8555 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250128_140835_513977_6B5FCE6C X-CRM114-Status: GOOD ( 15.39 ) 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 Rename `cpu_addr` to `parent_bus_addr` in the DesignWare ATU configuration. The ATU translates parent bus addresses to PCI addresses, which are often the same as CPU addresses but can differ in systems where the bus fabric translates addresses before passing them to the PCIe controller. This renaming clarifies the purpose and avoids confusion. Signed-off-by: Frank Li --- change from v9 to v10 - new patch --- drivers/pci/controller/dwc/pcie-designware-ep.c | 8 +++--- drivers/pci/controller/dwc/pcie-designware-host.c | 12 ++++---- drivers/pci/controller/dwc/pcie-designware.c | 34 +++++++++++------------ drivers/pci/controller/dwc/pcie-designware.h | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 8e07d432e74f2..80ac2f9e88eb5 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -128,7 +128,7 @@ static int dw_pcie_ep_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no, } static int dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, u8 func_no, int type, - dma_addr_t cpu_addr, enum pci_barno bar, + dma_addr_t parent_bus_addr, enum pci_barno bar, size_t size) { int ret; @@ -146,7 +146,7 @@ static int dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, u8 func_no, int type, } ret = dw_pcie_prog_ep_inbound_atu(pci, func_no, free_win, type, - cpu_addr, bar, size); + parent_bus_addr, bar, size); if (ret < 0) { dev_err(pci->dev, "Failed to program IB window\n"); return ret; @@ -181,7 +181,7 @@ static int dw_pcie_ep_outbound_atu(struct dw_pcie_ep *ep, return ret; set_bit(free_win, ep->ob_window_map); - ep->outbound_addr[free_win] = atu->cpu_addr; + ep->outbound_addr[free_win] = atu->parent_bus_addr; return 0; } @@ -333,7 +333,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.parent_bus_addr = addr; atu.pci_addr = pci_addr; atu.size = size; ret = dw_pcie_ep_outbound_atu(ep, &atu); diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index ae3fd2a5dbf85..1206b26bff3f2 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -616,7 +616,7 @@ static void __iomem *dw_pcie_other_conf_map_bus(struct pci_bus *bus, type = PCIE_ATU_TYPE_CFG1; atu.type = type; - atu.cpu_addr = pp->cfg0_base; + atu.parent_bus_addr = pp->cfg0_base; atu.pci_addr = busdev; atu.size = pp->cfg0_size; @@ -641,7 +641,7 @@ static int dw_pcie_rd_other_conf(struct pci_bus *bus, unsigned int devfn, if (pp->cfg0_io_shared) { atu.type = PCIE_ATU_TYPE_IO; - atu.cpu_addr = pp->io_base; + atu.parent_bus_addr = pp->io_base; atu.pci_addr = pp->io_bus_addr; atu.size = pp->io_size; @@ -667,7 +667,7 @@ static int dw_pcie_wr_other_conf(struct pci_bus *bus, unsigned int devfn, if (pp->cfg0_io_shared) { atu.type = PCIE_ATU_TYPE_IO; - atu.cpu_addr = pp->io_base; + atu.parent_bus_addr = pp->io_base; atu.pci_addr = pp->io_bus_addr; atu.size = pp->io_size; @@ -736,7 +736,7 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) atu.index = i; atu.type = PCIE_ATU_TYPE_MEM; - atu.cpu_addr = entry->res->start; + atu.parent_bus_addr = entry->res->start; atu.pci_addr = entry->res->start - entry->offset; /* Adjust iATU size if MSG TLP region was allocated before */ @@ -758,7 +758,7 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) if (pci->num_ob_windows > ++i) { atu.index = i; atu.type = PCIE_ATU_TYPE_IO; - atu.cpu_addr = pp->io_base; + atu.parent_bus_addr = pp->io_base; atu.pci_addr = pp->io_bus_addr; atu.size = pp->io_size; @@ -902,7 +902,7 @@ static int dw_pcie_pme_turn_off(struct dw_pcie *pci) atu.size = resource_size(pci->pp.msg_res); atu.index = pci->pp.msg_atu_index; - atu.cpu_addr = pci->pp.msg_res->start; + atu.parent_bus_addr = pci->pp.msg_res->start; ret = dw_pcie_prog_outbound_atu(pci, &atu); if (ret) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 145e7f579072c..9d0a5f75effcc 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -470,25 +470,25 @@ static inline u32 dw_pcie_enable_ecrc(u32 val) int dw_pcie_prog_outbound_atu(struct dw_pcie *pci, const struct dw_pcie_ob_atu_cfg *atu) { - u64 cpu_addr = atu->cpu_addr; + u64 parent_bus_addr = atu->parent_bus_addr; u32 retries, val; u64 limit_addr; if (pci->ops && pci->ops->cpu_addr_fixup) - cpu_addr = pci->ops->cpu_addr_fixup(pci, cpu_addr); + parent_bus_addr = pci->ops->cpu_addr_fixup(pci, parent_bus_addr); - limit_addr = cpu_addr + atu->size - 1; + limit_addr = parent_bus_addr + atu->size - 1; - if ((limit_addr & ~pci->region_limit) != (cpu_addr & ~pci->region_limit) || - !IS_ALIGNED(cpu_addr, pci->region_align) || + if ((limit_addr & ~pci->region_limit) != (parent_bus_addr & ~pci->region_limit) || + !IS_ALIGNED(parent_bus_addr, pci->region_align) || !IS_ALIGNED(atu->pci_addr, pci->region_align) || !atu->size) { return -EINVAL; } dw_pcie_writel_atu_ob(pci, atu->index, PCIE_ATU_LOWER_BASE, - lower_32_bits(cpu_addr)); + lower_32_bits(parent_bus_addr)); dw_pcie_writel_atu_ob(pci, atu->index, PCIE_ATU_UPPER_BASE, - upper_32_bits(cpu_addr)); + upper_32_bits(parent_bus_addr)); dw_pcie_writel_atu_ob(pci, atu->index, PCIE_ATU_LIMIT, lower_32_bits(limit_addr)); @@ -502,7 +502,7 @@ int dw_pcie_prog_outbound_atu(struct dw_pcie *pci, upper_32_bits(atu->pci_addr)); val = atu->type | atu->routing | PCIE_ATU_FUNC_NUM(atu->func_no); - if (upper_32_bits(limit_addr) > upper_32_bits(cpu_addr) && + if (upper_32_bits(limit_addr) > upper_32_bits(parent_bus_addr) && dw_pcie_ver_is_ge(pci, 460A)) val |= PCIE_ATU_INCREASE_REGION_SIZE; if (dw_pcie_ver_is(pci, 490A)) @@ -545,13 +545,13 @@ static inline void dw_pcie_writel_atu_ib(struct dw_pcie *pci, u32 index, u32 reg } int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int type, - u64 cpu_addr, u64 pci_addr, u64 size) + u64 parent_bus_addr, u64 pci_addr, u64 size) { u64 limit_addr = pci_addr + size - 1; u32 retries, val; if ((limit_addr & ~pci->region_limit) != (pci_addr & ~pci->region_limit) || - !IS_ALIGNED(cpu_addr, pci->region_align) || + !IS_ALIGNED(parent_bus_addr, pci->region_align) || !IS_ALIGNED(pci_addr, pci->region_align) || !size) { return -EINVAL; } @@ -568,9 +568,9 @@ int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int type, upper_32_bits(limit_addr)); dw_pcie_writel_atu_ib(pci, index, PCIE_ATU_LOWER_TARGET, - lower_32_bits(cpu_addr)); + lower_32_bits(parent_bus_addr)); dw_pcie_writel_atu_ib(pci, index, PCIE_ATU_UPPER_TARGET, - upper_32_bits(cpu_addr)); + upper_32_bits(parent_bus_addr)); val = type; if (upper_32_bits(limit_addr) > upper_32_bits(pci_addr) && @@ -597,18 +597,18 @@ int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int type, } int dw_pcie_prog_ep_inbound_atu(struct dw_pcie *pci, u8 func_no, int index, - int type, u64 cpu_addr, u8 bar, size_t size) + int type, u64 parent_bus_addr, u8 bar, size_t size) { u32 retries, val; - if (!IS_ALIGNED(cpu_addr, pci->region_align) || - !IS_ALIGNED(cpu_addr, size)) + if (!IS_ALIGNED(parent_bus_addr, pci->region_align) || + !IS_ALIGNED(parent_bus_addr, size)) return -EINVAL; dw_pcie_writel_atu_ib(pci, index, PCIE_ATU_LOWER_TARGET, - lower_32_bits(cpu_addr)); + lower_32_bits(parent_bus_addr)); dw_pcie_writel_atu_ib(pci, index, PCIE_ATU_UPPER_TARGET, - upper_32_bits(cpu_addr)); + upper_32_bits(parent_bus_addr)); dw_pcie_writel_atu_ib(pci, index, PCIE_ATU_REGION_CTRL1, type | PCIE_ATU_FUNC_NUM(func_no)); diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 501d9ddfea163..ac23604c829f4 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -343,7 +343,7 @@ struct dw_pcie_ob_atu_cfg { u8 func_no; u8 code; u8 routing; - u64 cpu_addr; + u64 parent_bus_addr; u64 pci_addr; u64 size; };