From patchwork Thu May 6 15:31:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12242647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31592C433B4 for ; Thu, 6 May 2021 16:03:20 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B19AA61154 for ; Thu, 6 May 2021 16:03:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B19AA61154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2CA/O18WlsOcSSl2di0K0zMnHzeV+uSQtNGEbyIMXRw=; b=RvHv+HUvV80j9dqu79KtTiM87 CIpWodPNb5+dYU9gzcbrLPpW7hp63DqpkC0/wpppO3iBTclt5i0I/Ht6nw7mKQ64clTg4BJBvjBsd Z5u7OUmCdXpTRRyyrA8poPAxlJYo4E1nd5hf9aa6NGAgptxghJwZIFrip0BIvV/ICaGNEeDwbvLgc qwZsl47ICsPApnQ0HMNzhZoFRFgU8+HwPbH5oBJNowXm4P66lCJ20uXkQmB1EPkL4En8Hr9q7exIs N0w4dTz0sCdCtXkf3Sjn+1tQdbyM3wrbZY3nsDJ7ZmjDda6T5KdfgOpZaJU5rHvA/Ayn1f1sHUmP0 9lJ7ldZvA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1legLK-004hHG-Vc; Thu, 06 May 2021 15:55:15 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lefzs-004a7P-Ti for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 15:33:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=MYns9vLon5kpIG8iRb4tqZhdZpmmL/xEa1X3k1ybeUM=; b=kiyvAtAct0GwrHKA2vaUtWWTYD dfFmAQCjo19xV1hEvXTUPSwiKHkI/M5DM0XHfJnVJCn+EGtoQOs8Pu+xlB53bv3yqCBbpaTIMcZUw x6G5AczAGUtTMcZfCOv63iDZv5f265XDiYE/YEl++sdL7KriWc9cf01ULu/RzxkwmDA8h4tjDq4ff y0KN0HeevVHGy/XY6M2YNxeUiyH102dMODn8Ev30LVX1eEERrLgv651Od3dEgnCBw5/lyIEz78i8i mR4sDr/09ncLBrQwRJn80sO+OlQdPk+fHSXBNcZIQOPOXQWW8PRvW91PpG9z53wtoCzJvTDI0cYUr TwFR19Uw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lefzm-0069gb-4i for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 15:33:02 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2DE07616EA; Thu, 6 May 2021 15:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620315175; bh=ghapb+8oJP9gj5A73iBbcuKAnKFz+Keg3CDg5iz9MEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8P8TDdbEUPvkU0OkVC6L2OvsSvneY0lKfmp3NdonzS4GBLtOK40hdUSJqwRsoZF1 waa8XISVltL1qDT0+U+GlKRFNhSnOZGVjHC8xpsUVuuSI95c0QZe5hrCaG//WjGT5L RgAcsHSZiiGY4Mbf7SzININ6+VCiDiUwZiHoVeo7xREGbnOGNrXV5kkavHwGMiXMKO +039AZJTln4dFqABX5ocSY2GZk76BfON4BAbQgeBTUzIhbMEcqL9ZkbAtO3rQK/NGe xVYnLrHGEqN/+zHJT/Y6UvpFb1lF5hwgHRqve1v1yFVNf0iR3QDJM9BjVV/S3v3a9E 2CS0t3hZym7pw== Received: by pali.im (Postfix) id D94B0732; Thu, 6 May 2021 17:32:54 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Lorenzo Pieralisi , Thomas Petazzoni , Rob Herring , Bjorn Helgaas Cc: Russell King , =?utf-8?q?Marek_Beh=C3=BAn?= , Remi Pommarel , Xogium , Tomasz Maciej Nowak , Marc Zyngier , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 36/42] PCI: aardvark: Replace custom PCIE_CORE_ERR_CAPCTL_* macros by linux/pci_regs.h macros Date: Thu, 6 May 2021 17:31:47 +0200 Message-Id: <20210506153153.30454-37-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506153153.30454-1-pali@kernel.org> References: <20210506153153.30454-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_083258_276034_1CBE9312 X-CRM114-Status: GOOD ( 10.54 ) 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 Advanced Error Reporting Capability registers start at aardvark offset 0x100. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún --- drivers/pci/controller/pci-aardvark.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index d8fb43604154..d99462d99ed8 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -33,11 +33,7 @@ #define PCIE_CORE_CMD_STATUS_REG 0x4 #define PCIE_CORE_DEV_REV_REG 0x8 #define PCIE_CORE_PCIEXP_CAP 0xc0 -#define PCIE_CORE_ERR_CAPCTL_REG 0x118 -#define PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX BIT(5) -#define PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX_EN BIT(6) -#define PCIE_CORE_ERR_CAPCTL_ECRC_CHCK BIT(7) -#define PCIE_CORE_ERR_CAPCTL_ECRC_CHCK_RCV BIT(8) +#define PCIE_CORE_PCIERR_CAP 0x100 #define PCIE_CORE_INT_A_ASSERT_ENABLE 1 #define PCIE_CORE_INT_B_ASSERT_ENABLE 2 #define PCIE_CORE_INT_C_ASSERT_ENABLE 3 @@ -370,12 +366,10 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) reg &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); advk_writel(pcie, reg, PCIE_CORE_CMD_STATUS_REG); - /* Set Advanced Error Capabilities and Control PF0 register */ - reg = PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX | - PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX_EN | - PCIE_CORE_ERR_CAPCTL_ECRC_CHCK | - PCIE_CORE_ERR_CAPCTL_ECRC_CHCK_RCV; - advk_writel(pcie, reg, PCIE_CORE_ERR_CAPCTL_REG); + /* Enable generation and checking of ECRC on Root Bridge */ + reg = advk_readl(pcie, PCIE_CORE_PCIERR_CAP + PCI_ERR_CAP); + reg |= PCI_ERR_CAP_ECRC_GENE | PCI_ERR_CAP_ECRC_CHKE; + advk_writel(pcie, reg, PCIE_CORE_PCIERR_CAP + PCI_ERR_CAP); /* Set PCIe Device Control register */ reg = advk_readl(pcie, PCIE_CORE_PCIEXP_CAP + PCI_EXP_DEVCTL);