From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 894A9C433EF for ; Wed, 24 Nov 2021 17:01:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7FC6783681; Wed, 24 Nov 2021 18:01:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="nu1fT4j1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F70C82FBE; Wed, 24 Nov 2021 18:00:53 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09D4B830E7 for ; Wed, 24 Nov 2021 18:00:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 6CE886101C; Wed, 24 Nov 2021 17:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637773244; bh=Dq6VkD/ULRC7Y5rTts8O4vrh/cgigFCdgEO00oSCbJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nu1fT4j17ahSxHGlKbbHGMxmr/Hjk1+C/CwCleJo8cjNAuY/g0pzOe7dWc/G1k3F7 OdumM4u3S4ujlh/yO/ljQkQUd69X+AW6JIUyU2ISVzzw117zbGvq3bpdN7Kz3YDfcT Sq0PlmBxaxeo/j10+nIZX+2iRiQb8JCkopz1DoR1j9dYd66cLOMTJq4mGlTKRzjsl6 eo+xKk6mUaQpiEPKM/gsK7unyDg5iZrgG5qGieXPg8+pVP84haS5XD6CxSFvEwk2+8 xMbI7Ob5jzdx+q9l7fp5d1JlVtFyyKtL2aAXI9hPGFLxCTE+LxELili7msl96YIHlL iFE3NBlC9t0WA== Received: by pali.im (Postfix) id 9D911B01; Wed, 24 Nov 2021 18:00:42 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , Simon Glass , Bin Meng , Nicolas Saenz Julienne , Matthias Brugger Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-next 2/4] pci: pcie-brcmstb: Use PCIE_ECAM_OFFSET() macro Date: Wed, 24 Nov 2021 18:00:31 +0100 Message-Id: <20211124170033.4137-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211124170033.4137-1-pali@kernel.org> References: <20211124170033.4137-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Replace custom driver macros by PCIE_ECAM_OFFSET() macro from pci.h Signed-off-by: Pali Rohár --- drivers/pci/pcie_brcmstb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c index 90225f677955..1de28021138a 100644 --- a/drivers/pci/pcie_brcmstb.c +++ b/drivers/pci/pcie_brcmstb.c @@ -97,9 +97,6 @@ #define PCIE_EXT_CFG_DATA 0x8000 #define PCIE_EXT_CFG_INDEX 0x9000 -#define PCIE_EXT_BUSNUM_SHIFT 20 -#define PCIE_EXT_SLOT_SHIFT 15 -#define PCIE_EXT_FUNC_SHIFT 12 #define PCIE_RGR1_SW_INIT_1 0x9210 #define RGR1_SW_INIT_1_PERST_MASK 0x1 @@ -227,9 +224,7 @@ static int brcm_pcie_config_address(const struct udevice *dev, pci_dev_t bdf, } /* For devices, write to the config space index register */ - idx = (pci_bus << PCIE_EXT_BUSNUM_SHIFT) - | (pci_dev << PCIE_EXT_SLOT_SHIFT) - | (pci_func << PCIE_EXT_FUNC_SHIFT); + idx = PCIE_ECAM_OFFSET(pci_bus, pci_dev, pci_func, 0); writel(idx, pcie->base + PCIE_EXT_CFG_INDEX); *paddress = pcie->base + PCIE_EXT_CFG_DATA + offset; -- 2.20.1