Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3493748yba; Tue, 16 Apr 2019 12:31:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhKYi7lJX1pg8AnQbrTS6BzpRLswaoFImRuqiXpUj0/PoSRAEpEnFX874rz1AlgNRJ4yBB X-Received: by 2002:a62:1215:: with SMTP id a21mr83750174pfj.126.1555443071672; Tue, 16 Apr 2019 12:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555443071; cv=none; d=google.com; s=arc-20160816; b=ap86k2QGkq2UfMXEnJs6SFjBQcfWVPd2WZGTpaA3MGnrUAT06g+yBoVB8MaJd4v9Py 2rOtDDBwIPm/p3Q+zlx1/n/7KvzcVu7JNSXui76QZ6QJsTtFBtsI5CmN+qEfUL9R2fK9 yeNdUSdl+9qV5aHWkOP4f4WWwJLvOudhJ0MRuRQuoFSo+mTBiyKcgZvSsOxR+d1et+GP vmVSBHJuEk0PNFmGtoHz8tNMBSxSBX0YWfRVZex6KBk22uwLjqHmmgjUUsF6IfIIFZtA Pztjm6C/WEYxcgKI1Ww1eXaiQ0JjJ8PwbEQJ7ZPh9V4HTeJVbh6BKLHf1ickf2QMufaY WtvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Wo5s7qFXVF6yP4raZG59sUaja/C5ExrZQIki8sI6xLA=; b=WOCUCRTIazOSSSNk+25d6wIR5XOsur0HeTUnEXn3FQF1t0A4JQ5/s6xCaOCsnWaF66 77jKG7f+hJQBFJwPfiwWIG+Li/2so2uqZ4RBte1p5ztoPJq76ka62SVo1oVX4Q6HkmEl VcEfdaWutJmx2JnWQq29vo0filNiBL5zglp1QYVlQfrSEikDEdtl01R1nE2x+Xk334t1 r22vI4/l91c6gpQe99fa0mjSeik6Hoe3bIp+MaKLCZqupg/uB/S7rhsu86q2r6V3ZtbW k+jhHWMyx5ufOMEgV4TV8n19qHSsl3UVsrWosSWYMCxFPWrlydjMyQO3HamkKwPCfBqY dNdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=WPYT0BEa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si48618251pfn.136.2019.04.16.12.30.55; Tue, 16 Apr 2019 12:31:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=WPYT0BEa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730552AbfDPT2s (ORCPT + 99 others); Tue, 16 Apr 2019 15:28:48 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:6742 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbfDPT2r (ORCPT ); Tue, 16 Apr 2019 15:28:47 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 16 Apr 2019 12:28:26 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 16 Apr 2019 12:28:46 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 16 Apr 2019 12:28:46 -0700 Received: from HQMAIL110.nvidia.com (172.18.146.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 16 Apr 2019 19:28:46 +0000 Received: from HQMAIL108.nvidia.com (172.18.146.13) by hqmail110.nvidia.com (172.18.146.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 16 Apr 2019 19:28:39 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 16 Apr 2019 19:28:39 +0000 Received: from vidyas-desktop.nvidia.com (Not Verified[10.24.37.38]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 16 Apr 2019 12:28:38 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , , , Subject: [PATCH V3 08/16] PCI: dwc: Add support to enable CDM register check Date: Wed, 17 Apr 2019 00:57:22 +0530 Message-ID: <20190416192730.15681-9-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190416192730.15681-1-vidyas@nvidia.com> References: <20190416192730.15681-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1555442906; bh=Wo5s7qFXVF6yP4raZG59sUaja/C5ExrZQIki8sI6xLA=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=WPYT0BEaKyXBakDHkBpcPJa1GAO7/CsVD4CSsTM8e/YYBHBwGpcY+GGtYhRSLWgoW S3dDCciCPFRK9ON4+A27BnS/4i18zL4Wlf0qKGyFUzKaKj/gMZRqjCh9dZ3jg3cMXV xVzSHhqJJO7fyKUk6UjfFtomChaxRgwQKFlZ76fAvB+5xv4mT9lDTUbqLphg4MtnU6 giNc+mh+J1sMkHgfgEZAbbLtkVV2bFoKA91264ydF5yX+DyPw/Sy2Iu0BKKRx42uq0 ppwDAWWRF7YWqt6ptFoKiHAHDdWkCmkQbVfUXQmi2BLSNjaoUdMP3388jtvL4DhOjN S+m/bDTNrQmhQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to enable CDM (Configuration Dependent Module) register check for any data corruption based on the device-tree flag 'enable-cdm-check'. Signed-off-by: Vidya Sagar --- Changes since [v2]: * Changed code and commit description to reflect change in flag from 'cdm-check' to 'enable-cdm-check' Changes since [v1]: * This is a new patch in v2 series drivers/pci/controller/dwc/pcie-designware.c | 7 +++++++ drivers/pci/controller/dwc/pcie-designware.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 44c0ba078452..5b416f483426 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -503,4 +503,11 @@ void dw_pcie_setup(struct dw_pcie *pci) break; } dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, val); + + if (of_property_read_bool(np, "enable-cdm-check")) { + val = dw_pcie_readl_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS); + val |= PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS | + PCIE_PL_CHK_REG_CHK_REG_START; + dw_pcie_writel_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS, val); + } } diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index fa41d675c48f..7f57fe019fbf 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -83,6 +83,15 @@ #define PCIE_MISC_CONTROL_1_OFF 0x8BC #define PCIE_DBI_RO_WR_EN BIT(0) +#define PCIE_PL_CHK_REG_CONTROL_STATUS 0xB20 +#define PCIE_PL_CHK_REG_CHK_REG_START BIT(0) +#define PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS BIT(1) +#define PCIE_PL_CHK_REG_CHK_REG_COMPARISON_ERROR BIT(16) +#define PCIE_PL_CHK_REG_CHK_REG_LOGIC_ERROR BIT(17) +#define PCIE_PL_CHK_REG_CHK_REG_COMPLETE BIT(18) + +#define PCIE_PL_CHK_REG_ERR_ADDR 0xB28 + /* * iATU Unroll-specific register definitions * From 4.80 core version the address translation will be made by unroll -- 2.17.1