From patchwork Mon Sep 17 14:24:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 642D617D5 for ; Mon, 17 Sep 2018 14:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5299129DCA for ; Mon, 17 Sep 2018 14:26:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 456D329EEC; Mon, 17 Sep 2018 14:26:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18B0029E97 for ; Mon, 17 Sep 2018 14:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uR4P2xcYyd9uy0Y8bK6CV+UfZnnNqbaCvKrGnQP4zRw=; b=kCXNJM91L9oOYy +YdDu1HI0DZv00h5wtnJTyGaErWpbtUMg6cqFH4/co/rh781MPD/+b2n2rOK+5ktniDxldmOB+2SV iww+Vld0B0JgkTXK3HTXxHHhurkTp/+SHFibl+A9AiwplC+evJUSLz+zcyTrdoodynWPaJKz2b7Z3 D1dwEkVY2mfTUKazcT1+v10R+Zqaja/Hj2EihmA1Eu1FKB5NU1jn7hygun6NMf2dW9BxDcmK6vu+S YggDLIdnaxfx3X1favpR2sWA5JzkAqACuoHweuc/mTPYIIX1M5z5vdtJK8SHD8rdDJImrblmsh1vb ZuHbXZccQHD1z/DMfmIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uU7-00087Z-Du; Mon, 17 Sep 2018 14:26:43 +0000 Received: from mail-bl2nam02on0071.outbound.protection.outlook.com ([104.47.38.71] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTA-0007hq-Kz for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:25:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RbR3fLzO92FLbnn0FpatGAZw4MgV1t8PyiVaoNMXrYk=; b=gjC3fNakS5IsPy26B/fuR6xUa5AgVwhR+zu7Qrl0d5EOouzh546CeCMV/5RFFHNmueiGMaFdaS8foWU+LdtcDS3CHbcRs6Q0aWl2xO0HGeYqI4ryKkgqHs11T/qbrHhaCfa39HW1FB0U/T8eL/ww+mjPtL6rlIqlIoC9pDKniks= Received: from MWHPR0201CA0087.namprd02.prod.outlook.com (2603:10b6:301:75::28) by BYAPR02MB5111.namprd02.prod.outlook.com (2603:10b6:a03:70::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Mon, 17 Sep 2018 14:25:31 +0000 Received: from SN1NAM02FT037.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by MWHPR0201CA0087.outlook.office365.com (2603:10b6:301:75::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Mon, 17 Sep 2018 14:25:30 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT037.mail.protection.outlook.com (10.152.72.89) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:30 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSv-00056H-ME; Mon, 17 Sep 2018 07:25:29 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uSq-0005LT-Ii; Mon, 17 Sep 2018 07:25:24 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPL4t007854; Mon, 17 Sep 2018 07:25:21 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSm-0005LA-Um; Mon, 17 Sep 2018 07:25:21 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 27313121463; Mon, 17 Sep 2018 19:55:20 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 1/7] edac: synopsys: Fix code comments and naming convention Date: Mon, 17 Sep 2018 19:54:59 +0530 Message-ID: <1537194305-9243-2-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(136003)(376002)(396003)(346002)(39860400002)(2980300002)(438002)(189003)(199004)(42186006)(36756003)(6666003)(63266004)(54906003)(110136005)(16586007)(106002)(51416003)(76176011)(305945005)(48376002)(50466002)(47776003)(5024004)(14444005)(316002)(4326008)(356003)(5660300001)(2616005)(106466001)(8676002)(336012)(426003)(50226002)(2906002)(26005)(6266002)(2201001)(11346002)(7416002)(44832011)(126002)(446003)(90966002)(8936002)(186003)(52956003)(486006)(36386004)(72206003)(81156014)(81166006)(103686004)(476003)(478600001)(107986001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5111; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT037; 1:QvuF1UGbIzA4t9DhQ2iG6Po0hdGALJXGTuFHjf6Hb81aA4/vPDxvOHST1wAC2nQDhTfKio22dkx5tkRGpEPoV9MTkpxbU0nF8F9nprt0LNBn3KV+io+XAWbhUIB/2PYy MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4154e4f8-1a08-47a0-4674-08d61ca96c12 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB5111; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5111; 3:r+odYkzdPC3xmSY0W+AAJmOQHJXgXPGrADqR1OHaFdBO2gGJiyPmpq1PcTw1eOoS+VWKDE3J9xgBqpl5Igeg0VZrAHv+jCuDIuSfdka9Tdw3rdn4W+Ingn5+4HhLaUR6awZ977OFgzwAjf7PP1O3bSMQzqv8+SvVYjND05Yug4ZMH8tyxt9iVDWp+rYW57k5WI2mUVsEMB0sCCMdsgq5M7joQq2YxWrwvl1XfuwEvn9jchwzHhFDIq+1b59ucmVl80fLZpG3MRjVDbfAzU6OQgyQRmeTRuNLa/3vohZWb2WRzFMolzTBlL8QRYQbflpakd2aBpVdKh+0LKqalfiDEEN7vaeAGaJRCIO0fq8fr6c=; 25:cVN4nbLoNwruXsq1zlExjsK2gAZhHwg4WhqEQDpJ3qKp0br6gInW4yjiNQynBy5By7eY/JgZfXBDrlwXR56jSQgFEvSP1x09p4GouE4YCN68xZwxc7h0/LuHEELg5YvFDmkahjaTWqz7PcbeD1pkDvesv87bMDhlrD2f1JnunyL0aDYnJufPq5h6rjwcYu+Dx0I3BDczSFi3oVnepqhtPjl1SNdMnpD2/zxlYIM1z7vulUhhnB9i8mxXbf69bpAJaFOiqB2sdbsI9LX2iPmOdd/FgnFtOEAD1iqrh4vPag3D0t0EH65kLIPeg2+un4/EnsIb3Z8L4gp6v7+PJbt4kA== X-MS-TrafficTypeDiagnostic: BYAPR02MB5111: X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5111; 31:hOXFeK+u+iMbRExx7NsHc4go9gugQbUQiathRvD25BeVILJNOC/UGrRi59BdTaKQaT9BLAX8cpcgMHWKZscxQp/CDmKqPBePdwiitf/vs/rBPOBfFbkSK0i4k58l1YghvQkXxhP2QpyJKJr4r64sgjRzGBthzUBzOYs7tl7er6IsNgI59UOIcXwbXv+1KAQgD7nXbsD0Be3iPAS9AI7IW458GsYHt+tsORFxn0WvJQk=; 20:S7rZf0lvIUtu6TW0wYV7Z59u7wXvgrdb+AbCqC6UID5iwdiEj7Z3M4MvJJRd2j3+aZm0bH6ykVYRSkEjVI6yacxXBKcwM//AOASQvGc8bYs/L6oCLQW1MIslVYe1qENDkBJRHDBBZFt77zjOhMLKpGuW2xlz4RuLqC9VqB6s5q47TA5aUfFyUckeSLlPANMTSgUx9CfgXP7w10vm7Ephp17vFXuO+FvPGfT9RI0HoBbln54jLtID84I93Ex9hOiKYY11EpftrEROxCM2nk2zKq6wgXdEBC8TYrR5zN5rpl+DjWzUi/JaJlaHJvUB5J760En6ymL79emHRJ7EbTM1Wv8ngR2xCoZp8MqwDYN/7cuf1L0SM8Jt1AwM2ZtrU35dxjgcuMpm2JGStS/PMlxelr9CC/lt3rb9+TlCfcJT+KD52+eGXG6TkrwTJ+F8yfGng2zEir9kC7c9yX8wEi8PVECrGQibWj/R+brJjwfjJePZUiezMEXE7zjtZ35vLQ9/ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(105169848403564)(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:BYAPR02MB5111; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB5111; X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-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5111; 6:ykpCzN5vhObthAtq8xOgT+idJw66VDvEvRQtEqpfn0qfBSPTOb5ZH9AQSLJ8k9Nw8vN/oVQBbCAT5oHEseKogoGhNSmiW4W7+r1yMXfG0a51G6GjVtc92toEAqIRms1yHX0mIYRi1Lht7dw/cQXlkTgBB4aziqnoP9W1qSMd0258POCNEiMTTJ+BYrPnwuebj1EGehGxhj2LudMYU3yiBfaqOul2Zz+0xyOB8LE7XTaQnh9kM2utkQ9OGf5798qsTqgnIP3e0NTtPWOVinc/MXFKg/2WYMYkzOyVXhJS3Z7q5qok5OH3zPdoaSwXe3+3teAU3MJz8HH5yT6AruBLzbwWcJs/IZcIKkUNb8TJxW3+5bTzdoX/EncNXjOZkjFuHcRwZHlA2aF4X3tRAOrBZK33oz3m7eewanBgPonieQvPNj4VhWgdzZ8wXRH5e2/6P86zrD/BuzhLIGQCnFzauw==; 5:BcZ2Lhf0rAPjCBGjJ1x7JTBHRSFInnnPlPNeK+C8tYURMs39OKdRtU2T55CSVamr7uJ/SexCmB4N3zE/znfkrH4FIY5DEprgr7sZ6a1NxM/W3K1jqHmEqlL91z4lB0Q5Nd2XJB9RjZOfa2FB/cIUssE/789b9VcHzVhQZP4JQLQ=; 7:64e8GrTozTHTBRJFioK8uYW+wKfgSvNsKhm5h7MhChAGtcvIi3xn+47FRVIrVJSpwufUhGUCJUCqHCzr6Fs6Fg7yPR/abzqCkHKdaJNpjTt6KQAdkr3/kBnfmYSiTE5Rzf7VAyi0OD2LuC83gTolHaiI+HySjwR3papfYVOU+8Sb+cNJMGpKhEoPoVQt1nl8/wOWxnEetQHRz/whX9uzIIU5pfiMV62XYCbGPaLMB+Mue+3F38+FcRK4Fse6Ezjk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:30.2535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4154e4f8-1a08-47a0-4674-08d61ca96c12 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5111 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072544_834377_D95CEB38 X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Update the comments in the Synopsys EDAC driver. Minor changes to function names and return types are also included. Signed-off-by: Manish Narani --- drivers/edac/synopsys_edac.c | 176 ++++++++++++++++++++----------------------- 1 file changed, 80 insertions(+), 96 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 0c9c59e..4963930 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -96,12 +96,12 @@ #define SCRUB_MODE_SECDED 0x4 /** - * struct ecc_error_info - ECC error log information - * @row: Row number - * @col: Column number - * @bank: Bank number - * @bitpos: Bit position - * @data: Data causing the error + * struct ecc_error_info - ECC error log information. + * @row: Row number. + * @col: Column number. + * @bank: Bank number. + * @bitpos: Bit position. + * @data: Data causing the error. */ struct ecc_error_info { u32 row; @@ -112,11 +112,11 @@ struct ecc_error_info { }; /** - * struct synps_ecc_status - ECC status information to report - * @ce_cnt: Correctable error count - * @ue_cnt: Uncorrectable error count - * @ceinfo: Correctable error log information - * @ueinfo: Uncorrectable error log information + * struct synps_ecc_status - ECC status information to report. + * @ce_cnt: Correctable error count. + * @ue_cnt: Uncorrectable error count. + * @ceinfo: Correctable error log information. + * @ueinfo: Uncorrectable error log information. */ struct synps_ecc_status { u32 ce_cnt; @@ -126,12 +126,12 @@ struct synps_ecc_status { }; /** - * struct synps_edac_priv - DDR memory controller private instance data - * @baseaddr: Base address of the DDR controller - * @message: Buffer for framing the event specific info - * @stat: ECC status information - * @ce_cnt: Correctable Error count - * @ue_cnt: Uncorrectable Error count + * struct synps_edac_priv - DDR memory controller private instance data. + * @baseaddr: Base address of the DDR controller. + * @message: Buffer for framing the event specific info. + * @stat: ECC status information. + * @ce_cnt: Correctable Error count. + * @ue_cnt: Uncorrectable Error count. */ struct synps_edac_priv { void __iomem *baseaddr; @@ -142,15 +142,13 @@ struct synps_edac_priv { }; /** - * synps_edac_geterror_info - Get the current ecc error info - * @base: Pointer to the base address of the ddr memory controller - * @p: Pointer to the synopsys ecc status structure + * edac_geterror_info - Get the current ECC error info. + * @base: Base address of the DDR memory controller. + * @p: Synopsys ECC status structure. * - * Determines there is any ecc error or not - * - * Return: one if there is no error otherwise returns zero + * Return: one if there is no error otherwise returns zero. */ -static int synps_edac_geterror_info(void __iomem *base, +static int edac_geterror_info(void __iomem *base, struct synps_ecc_status *p) { u32 regval, clearval = 0; @@ -172,7 +170,7 @@ static int synps_edac_geterror_info(void __iomem *base, p->ceinfo.col = regval & ADDR_COL_MASK; p->ceinfo.bank = (regval & ADDR_BANK_MASK) >> ADDR_BANK_SHIFT; p->ceinfo.data = readl(base + CE_DATA_31_0_OFST); - edac_dbg(3, "ce bit position: %d data: %d\n", p->ceinfo.bitpos, + edac_dbg(3, "CE bit position: %d data: %d\n", p->ceinfo.bitpos, p->ceinfo.data); clearval = ECC_CTRL_CLR_CE_ERR; @@ -196,13 +194,13 @@ static int synps_edac_geterror_info(void __iomem *base, } /** - * synps_edac_handle_error - Handle controller error types CE and UE - * @mci: Pointer to the edac memory controller instance - * @p: Pointer to the synopsys ecc status structure + * edac_handle_error - Handle controller error types CE and UE. + * @mci: EDAC memory controller instance. + * @p: Synopsys ECC status structure. * - * Handles the controller ECC correctable and un correctable error. + * Handles the controller ECC correctable and un-correctable error. */ -static void synps_edac_handle_error(struct mem_ctl_info *mci, +static void edac_handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p) { struct synps_edac_priv *priv = mci->pvt_info; @@ -232,38 +230,38 @@ static void synps_edac_handle_error(struct mem_ctl_info *mci, } /** - * synps_edac_check - Check controller for ECC errors - * @mci: Pointer to the edac memory controller instance + * edac_check - Check controller for ECC errors. + * @mci: EDAC memory controller instance. * - * Used to check and post ECC errors. Called by the polling thread + * Used to check and post ECC errors. Called by the polling thread. */ -static void synps_edac_check(struct mem_ctl_info *mci) +static void edac_check(struct mem_ctl_info *mci) { struct synps_edac_priv *priv = mci->pvt_info; int status; - status = synps_edac_geterror_info(priv->baseaddr, &priv->stat); + status = edac_geterror_info(priv->baseaddr, &priv->stat); if (status) return; priv->ce_cnt += priv->stat.ce_cnt; priv->ue_cnt += priv->stat.ue_cnt; - synps_edac_handle_error(mci, &priv->stat); + edac_handle_error(mci, &priv->stat); - edac_dbg(3, "Total error count ce %d ue %d\n", + edac_dbg(3, "Total error count CE %d UE %d\n", priv->ce_cnt, priv->ue_cnt); } /** - * synps_edac_get_dtype - Return the controller memory width - * @base: Pointer to the ddr memory controller base address + * edac_get_dtype - Return the controller memory width. + * @base: DDR memory controller base address. * * Get the EDAC device type width appropriate for the current controller * configuration. * * Return: a device type width enumeration. */ -static enum dev_type synps_edac_get_dtype(const void __iomem *base) +static enum dev_type edac_get_dtype(const void __iomem *base) { enum dev_type dt; u32 width; @@ -286,20 +284,20 @@ static enum dev_type synps_edac_get_dtype(const void __iomem *base) } /** - * synps_edac_get_eccstate - Return the controller ecc enable/disable status - * @base: Pointer to the ddr memory controller base address + * edac_get_eccstate - Return the controller ECC enable/disable status. + * @base: DDR memory controller base address. * - * Get the ECC enable/disable status for the controller + * Get the ECC enable/disable status for the controller. * - * Return: a ecc status boolean i.e true/false - enabled/disabled. + * Return: a ECC status boolean i.e true/false - enabled/disabled. */ -static bool synps_edac_get_eccstate(void __iomem *base) +static bool edac_get_eccstate(void __iomem *base) { + bool state = false; enum dev_type dt; u32 ecctype; - bool state = false; - dt = synps_edac_get_dtype(base); + dt = edac_get_dtype(base); if (dt == DEV_UNKNOWN) return state; @@ -311,11 +309,11 @@ static bool synps_edac_get_eccstate(void __iomem *base) } /** - * synps_edac_get_memsize - reads the size of the attached memory device + * edac_get_memsize - reads the size of the attached memory device. * - * Return: the memory size in bytes + * Return: the memory size in bytes. */ -static u32 synps_edac_get_memsize(void) +static u32 edac_get_memsize(void) { struct sysinfo inf; @@ -325,15 +323,15 @@ static u32 synps_edac_get_memsize(void) } /** - * synps_edac_get_mtype - Returns controller memory type - * @base: pointer to the synopsys ecc status structure + * edac_get_mtype - Returns controller memory type. + * @base: Synopsys ECC status structure. * * Get the EDAC memory type appropriate for the current controller * configuration. * * Return: a memory type enumeration. */ -static enum mem_type synps_edac_get_mtype(const void __iomem *base) +static enum mem_type edac_get_mtype(const void __iomem *base) { enum mem_type mt; u32 memtype; @@ -349,54 +347,47 @@ static enum mem_type synps_edac_get_mtype(const void __iomem *base) } /** - * synps_edac_init_csrows - Initialize the cs row data - * @mci: Pointer to the edac memory controller instance + * edac_init_csrows - Initialize the cs row data. + * @mci: EDAC memory controller instance. * * Initializes the chip select rows associated with the EDAC memory - * controller instance - * - * Return: Unconditionally 0. + * controller instance. */ -static int synps_edac_init_csrows(struct mem_ctl_info *mci) +static void edac_init_csrows(struct mem_ctl_info *mci) { + struct synps_edac_priv *priv = mci->pvt_info; struct csrow_info *csi; struct dimm_info *dimm; - struct synps_edac_priv *priv = mci->pvt_info; - u32 size; - int row, j; + u32 size, row; + int j; for (row = 0; row < mci->nr_csrows; row++) { csi = mci->csrows[row]; - size = synps_edac_get_memsize(); + size = edac_get_memsize(); for (j = 0; j < csi->nr_channels; j++) { - dimm = csi->channels[j]->dimm; - dimm->edac_mode = EDAC_FLAG_SECDED; - dimm->mtype = synps_edac_get_mtype(priv->baseaddr); - dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels; - dimm->grain = SYNPS_EDAC_ERR_GRAIN; - dimm->dtype = synps_edac_get_dtype(priv->baseaddr); + dimm = csi->channels[j]->dimm; + dimm->edac_mode = EDAC_FLAG_SECDED; + dimm->mtype = edac_get_mtype(priv->baseaddr); + dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels; + dimm->grain = SYNPS_EDAC_ERR_GRAIN; + dimm->dtype = edac_get_dtype(priv->baseaddr); } } - - return 0; } /** - * synps_edac_mc_init - Initialize driver instance - * @mci: Pointer to the edac memory controller instance - * @pdev: Pointer to the platform_device struct + * edac_mc_init - Initialize driver instance. + * @mci: EDAC memory controller instance. + * @pdev: platform_device struct. * * Performs initialization of the EDAC memory controller instance and * related driver-private data associated with the memory controller the * instance is bound to. - * - * Return: Always zero. */ -static int synps_edac_mc_init(struct mem_ctl_info *mci, +static void edac_mc_init(struct mem_ctl_info *mci, struct platform_device *pdev) { - int status; struct synps_edac_priv *priv; mci->pdev = &pdev->dev; @@ -415,17 +406,15 @@ static int synps_edac_mc_init(struct mem_ctl_info *mci, mci->mod_name = SYNPS_EDAC_MOD_VER; edac_op_state = EDAC_OPSTATE_POLL; - mci->edac_check = synps_edac_check; + mci->edac_check = edac_check; mci->ctl_page_to_phys = NULL; - status = synps_edac_init_csrows(mci); - - return status; + edac_init_csrows(mci); } /** - * synps_edac_mc_probe - Check controller and bind driver - * @pdev: Pointer to the platform_device struct + * synps_edac_mc_probe - Check controller and bind driver. + * @pdev: platform_device struct. * * Probes a specific controller instance for binding with the driver. * @@ -434,19 +423,19 @@ static int synps_edac_mc_init(struct mem_ctl_info *mci, */ static int synps_edac_mc_probe(struct platform_device *pdev) { - struct mem_ctl_info *mci; struct edac_mc_layer layers[2]; struct synps_edac_priv *priv; - int rc; - struct resource *res; + struct mem_ctl_info *mci; void __iomem *baseaddr; + struct resource *res; + int rc; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); baseaddr = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(baseaddr)) return PTR_ERR(baseaddr); - if (!synps_edac_get_eccstate(baseaddr)) { + if (!edac_get_eccstate(baseaddr)) { edac_printk(KERN_INFO, EDAC_MC, "ECC not enabled\n"); return -ENXIO; } @@ -468,12 +457,7 @@ static int synps_edac_mc_probe(struct platform_device *pdev) priv = mci->pvt_info; priv->baseaddr = baseaddr; - rc = synps_edac_mc_init(mci, pdev); - if (rc) { - edac_printk(KERN_ERR, EDAC_MC, - "Failed to initialize instance\n"); - goto free_edac_mc; - } + edac_mc_init(mci, pdev); rc = edac_mc_add_mc(mci); if (rc) { @@ -496,8 +480,8 @@ static int synps_edac_mc_probe(struct platform_device *pdev) } /** - * synps_edac_mc_remove - Unbind driver from controller - * @pdev: Pointer to the platform_device struct + * synps_edac_mc_remove - Unbind driver from controller. + * @pdev: Platform_device struct. * * Return: Unconditionally 0 */ From patchwork Mon Sep 17 14:25:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F338112B for ; Mon, 17 Sep 2018 14:47:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F42929DF9 for ; Mon, 17 Sep 2018 14:47:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6078829E0D; Mon, 17 Sep 2018 14:47:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 353E529DF9 for ; Mon, 17 Sep 2018 14:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i326kwqWatZOd7DaV+IXTH8C1F+QG79RibRzgJj4HN4=; b=TekxZnS7zjIFvX KlizM2UcwWLyCTth3+AeuuwqCJW4cpbsSSHlx963NjX62Dftqejai8FUK+LR2qHfEPVtnBIEYL8E9 S7LFkrcYgxJG7eLxra5HadRITf4Ax5MausuMuk3WWzJvOVmfbK3I4yF2eFfxTZH3RtHmt1kl+xCdC j6r0dT77t9+NOJ+mftlq9wpmLQSfq7HYGy59u//FZlbZxAWwi9Srw9c7tU97kQwtLWbm/XomrEIiN G2GWHJAI1IahA1wyBJ/fGVPOsT2e5gW7jscG07cn4NChAAIM5tuW8IOAl035tDPf/I4T3g+lK0Cqt qW1hPbYIIYeb1X2WaaaA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uoS-0001kG-9H; Mon, 17 Sep 2018 14:47:44 +0000 Received: from mail-bn3nam01on0045.outbound.protection.outlook.com ([104.47.33.45] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTX-0007j5-Fk for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:26:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRFLOamB5d6g6J5tbeFJ04z+czbe6CyCzCs/jWCyjFI=; b=niDY3U37eqg8TpCiZXRya1fYeMOrSAze0L1kBu14VnYdV+m8dRsvTa3y/WrrrCwBic/gh45RCm0yy2gMFlv3+SCIkYnixKv+pF2L5fFd7z0qTNWQ/8+FsAa8tXrF0ugZKBS8ohK8rIeQUke48LxfaGw/5/BYDTt7153xhHSzwJ8= Received: from BL0PR02CA0067.namprd02.prod.outlook.com (2603:10b6:207:3d::44) by BYAPR02MB4471.namprd02.prod.outlook.com (2603:10b6:a03:10::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Mon, 17 Sep 2018 14:25:42 +0000 Received: from CY1NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by BL0PR02CA0067.outlook.office365.com (2603:10b6:207:3d::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.17 via Frontend Transport; Mon, 17 Sep 2018 14:25:41 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT019.mail.protection.outlook.com (10.152.75.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36847 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g1uT5-0000sV-Sz; Mon, 17 Sep 2018 07:25:39 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uT0-0005Mt-PS; Mon, 17 Sep 2018 07:25:34 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPN0u007864; Mon, 17 Sep 2018 07:25:23 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSp-0005LM-82; Mon, 17 Sep 2018 07:25:23 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 6D8C6121463; Mon, 17 Sep 2018 19:55:22 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 2/7] edac: synps: Add platform specific structures for ddrc controller Date: Mon, 17 Sep 2018 19:55:00 +0530 Message-ID: <1537194305-9243-3-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39850400004)(136003)(2980300002)(438002)(189003)(199004)(126002)(14444005)(16586007)(47776003)(426003)(2616005)(81166006)(72206003)(316002)(8676002)(63266004)(90966002)(110136005)(2201001)(44832011)(356003)(446003)(52956003)(11346002)(42186006)(54906003)(486006)(305945005)(8936002)(476003)(4326008)(81156014)(6266002)(103686004)(336012)(478600001)(2906002)(26005)(186003)(50466002)(48376002)(7416002)(50226002)(6346003)(5660300001)(36386004)(36756003)(106002)(51416003)(106466001)(6666003)(76176011)(107986001)(2101003)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4471; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT019; 1:FYLtmTYzbz+m0rMnTEz6DPn5QOw0h4Io5Be4wkoLg5q6JAOVj+VZ3B82frJUU7JZqIdibZ/M4NSQ7nGCf3FtFkt9LrbKXZysZDzfnkG9hYHnUA9HRgoFU4oXoBz+iEou MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e30180a-1bc5-4d0d-1119-08d61ca9723f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB4471; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4471; 3:P/KKH+t7U8OwpZHLEqaFrYDLljFMty+IamR2Xr3/5vXUdj55bIA+0GGxBdjQhhQFy2jrLNftcDm1eljDbJJNGa3Q0Vu+ckIEiZVSPw9aicbQH6Cbsre3icPnJYEtHVdd8oMD2L6n6iI3Cm4UbAeoMTwRN5Z45F1LCkza7DL1xBio3XJjgRVSrrnRpBYnASrJ+qfetVpKz88NeHyiV260DQ2o+M1yl0gcq1zk31YT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KWv1kHrpczje5yKW9I4q+oRryuuo8OPQbR2EQL2Wo10+RomteRxCQIo0l+u/ANpbitKyR38/TBmRGvjxOLbM5R8zGhKFa4GlSAT5ySfYofPg79xI3EDStwfHAfjQeha5KAapEDUf2SupvUGCew8FZOp6sY7q6JOGB9xJBK/T0U05WYfD1r/qaSUXnWQyiBQjGCVfb1/rF039mnRYGIhZUOET1+AjhgrZQG X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050)(76991041); SRVR:BYAPR02MB4471; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB4471; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4471; 4:YKeYgAmAYZyhpojf7o0HNJV+phZsidzZggO2I3xgJnrLJ2XqTgJMcm4JEN2ayIgauT6T6i+/3T9y0EPXuidkXwZ09Bj2WwJtBUBvkD4bzKUlBeNR1jTIhcXA1QXPiMSSQeCD9Xbla7u1uqR1ZMPrt6BUdiNzHYzHR0pIAA9otEtu0Ru5wPZUuou41VFuhfS6wcPETFLgesvNCjoI/OEhWpL4IZcYugj1sXOO6gx2VPUpQtdfiflZFbvqh1t/uQoYXeIqBALPFvEHIX0UMwi68avs0UGHjuXNwgL2tw4TCa4WZsH6KTFmAkQc1/GFAkizqhuRCgAAnS1SduByG3FE2PPQsi25ySJ+Gf4fg9zUBG4= X-Forefront-PRVS: 0798146F16 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR02MB4471; 23:ufa3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TvBqozdg+3noEnooo1bVeGv25JsPH+vtMbOZmv3jLbd8RydyQDzsM5LPnfnBoJlPaoTGdR+9RiqtluGOmf3NE0pBZ8xhABuor7kjZDy+Rhy/umsX3qiRVfXaZg66W3+BDzELY4TMVcAfPzMrlqVGIRcXcrw7Y+scRl075DFr0vmx43ME7YRxcg3PMlDbpFAVH89VAoeNVN56xj/cPNwQ4HeTu3zg== X-Microsoft-Antispam-Message-Info: yy8wHHChY9Nv/7m0OSq6rStIivM81x9uCJI2Fz0QliT0h3+TktkW9xSLmcJJgE9YMts6bwql2mwwO6GcF3PmCk+29r2pnmpZD0tmPJv0uO43kiqHzn5L2VRBK9fnAkICbulI5pZ796X4w2QnxbNwjn5YHHAcsKJSiEv8qB81W00PKMRtj44g6BwRvw1HbYz9eMHQIia785DoTsQr8aey6qH5RRlLrfVFugUJij5lTPORDQdD6wvzNsQuqlW1qri363mN0wtCp66ki00yQ9RuD7mmi/3TtTo/6dt6lUn4bP/mJi5li6LKlRkXMKmXmyw7qouOT1EYRIwSsmHzETRaSYWG3wOENmofVXWDc2+6ors= X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4471; 6:ivyvycMx7TR5p7VmSq7HH+pnBkqwbhQPBE39tue8ZH6ExP2Yq9Ygc1gTjF8wlJCssjjv5kvmgQ9/SNvaWNCNEz3Vr+TDr9o61oCt9lVAwOFSPxFq8U41RYH9INAStfGsaKU+b+NHsps2R/xASQ5aH056aqe1friI5wEUku8RVhopaLwELNlhfdHy26P6rxdprvMq/SEa4yOBYt49nSDoWkTD9pZbQoSOe2HJFesIzaF215LI+U/l1h5tNvjVWmjEd16XEWhGTSF1YieJUaqROYAzjkYL4NiapdUIe/QgBLG0eNXaWpDIrxI+UkjoEplw3XN/uZC+0f+Lll3y1Jr3ElyerkVNBvDT9s7zFx3kZ4Y7xVczg5SIDsh8g2TYoIJpUrZyNPJX9ck4ognzh7Hdw5ZEhXgzYoroh4XlBGodOpeI8J9C8MndEd6J8ISLE7G80WyXU/u6of84GlvLMBziAg==; 5:Xz4qGO+wY6i8TEmQLOcmzpuhaS9OlXLDUCnnXuGF4pzsQT2f8HQpUigGg+mv3JYjJMgdArRgof1IDAJvHKZrxZdS0qj1sv9syzzI6FdivCOLAnS11pEazJJwmI9ofSyolWzbwtW+o5X2eR4tw1Ekkawex8N72/USOlyDzh/n0mE=; 7:cgqE4gvHhIjrjp58mxyTKVdcZblSKWI2IsHN1HDn4IqxYG0dUqs5ThxjMNc+a+P+5Gr0MBy9RbEgiNnaF3T8lVIc8vJ+8tiM/c6bAX4QTHkstICxWj66bZlh2k6s377HCWpIyXPmrAD3q9f5h1e9cQAJ80Jj7BZxpN0+6I0tHr369IFUsH0pX4bN/mj0amsplg+WhyuXnvpe/Li7ITFKThuuILhjWbdR/TfsfEnxH95V1ySyfVhNSGCdaaS9evCD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:40.3790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e30180a-1bc5-4d0d-1119-08d61ca9723f X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4471 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072607_636732_8ED22F05 X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add platform specific structures, so that we can add different IP support later using quirks. Signed-off-by: Manish Narani --- drivers/edac/synopsys_edac.c | 91 +++++++++++++++++++++++++++++++------------- 1 file changed, 65 insertions(+), 26 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 4963930..eb458e5 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "edac_module.h" @@ -130,6 +132,7 @@ struct synps_ecc_status { * @baseaddr: Base address of the DDR controller. * @message: Buffer for framing the event specific info. * @stat: ECC status information. + * @p_data: Platform data * @ce_cnt: Correctable Error count. * @ue_cnt: Uncorrectable Error count. */ @@ -137,21 +140,41 @@ struct synps_edac_priv { void __iomem *baseaddr; char message[SYNPS_EDAC_MSG_SIZE]; struct synps_ecc_status stat; + const struct synps_platform_data *p_data; u32 ce_cnt; u32 ue_cnt; }; /** - * edac_geterror_info - Get the current ECC error info. - * @base: Base address of the DDR memory controller. - * @p: Synopsys ECC status structure. + * struct synps_platform_data - synps platform data structure. + * @geterror_info: Get error info. + * @get_mtype: Get mtype. + * @get_dtype: Get dtype. + * @get_eccstate: Get eccstate. + * @quirks: To differentiate IPs. + */ +struct synps_platform_data { + int (*geterror_info)(struct synps_edac_priv *priv); + enum mem_type (*get_mtype)(const void __iomem *base); + enum dev_type (*get_dtype)(const void __iomem *base); + bool (*get_eccstate)(void __iomem *base); + int quirks; +}; + +/** + * zynq_geterror_info - Get the current ECC error info. + * @priv: DDR memory controller private instance data. * * Return: one if there is no error otherwise returns zero. */ -static int edac_geterror_info(void __iomem *base, - struct synps_ecc_status *p) +static int zynq_geterror_info(struct synps_edac_priv *priv) { + struct synps_ecc_status *p; u32 regval, clearval = 0; + void __iomem *base; + + base = priv->baseaddr; + p = &priv->stat; regval = readl(base + STAT_OFST); if (!regval) @@ -230,17 +253,18 @@ static void edac_handle_error(struct mem_ctl_info *mci, } /** - * edac_check - Check controller for ECC errors. + * edac_error_check - Check controller for ECC errors. * @mci: EDAC memory controller instance. * * Used to check and post ECC errors. Called by the polling thread. */ -static void edac_check(struct mem_ctl_info *mci) +static void edac_error_check(struct mem_ctl_info *mci) { struct synps_edac_priv *priv = mci->pvt_info; + const struct synps_platform_data *p_data = priv->p_data; int status; - status = edac_geterror_info(priv->baseaddr, &priv->stat); + status = p_data->geterror_info(priv); if (status) return; @@ -253,7 +277,7 @@ static void edac_check(struct mem_ctl_info *mci) } /** - * edac_get_dtype - Return the controller memory width. + * zynq_get_dtype - Return the controller memory width. * @base: DDR memory controller base address. * * Get the EDAC device type width appropriate for the current controller @@ -261,7 +285,7 @@ static void edac_check(struct mem_ctl_info *mci) * * Return: a device type width enumeration. */ -static enum dev_type edac_get_dtype(const void __iomem *base) +static enum dev_type zynq_get_dtype(const void __iomem *base) { enum dev_type dt; u32 width; @@ -284,20 +308,20 @@ static enum dev_type edac_get_dtype(const void __iomem *base) } /** - * edac_get_eccstate - Return the controller ECC enable/disable status. + * zynq_get_eccstate - Return the controller ECC enable/disable status. * @base: DDR memory controller base address. * * Get the ECC enable/disable status for the controller. * * Return: a ECC status boolean i.e true/false - enabled/disabled. */ -static bool edac_get_eccstate(void __iomem *base) +static bool zynq_get_eccstate(void __iomem *base) { bool state = false; enum dev_type dt; u32 ecctype; - dt = edac_get_dtype(base); + dt = zynq_get_dtype(base); if (dt == DEV_UNKNOWN) return state; @@ -323,7 +347,7 @@ static u32 edac_get_memsize(void) } /** - * edac_get_mtype - Returns controller memory type. + * zynq_get_mtype - Returns controller memory type. * @base: Synopsys ECC status structure. * * Get the EDAC memory type appropriate for the current controller @@ -331,7 +355,7 @@ static u32 edac_get_memsize(void) * * Return: a memory type enumeration. */ -static enum mem_type edac_get_mtype(const void __iomem *base) +static enum mem_type zynq_get_mtype(const void __iomem *base) { enum mem_type mt; u32 memtype; @@ -356,11 +380,14 @@ static enum mem_type edac_get_mtype(const void __iomem *base) static void edac_init_csrows(struct mem_ctl_info *mci) { struct synps_edac_priv *priv = mci->pvt_info; + const struct synps_platform_data *p_data; struct csrow_info *csi; struct dimm_info *dimm; u32 size, row; int j; + p_data = priv->p_data; + for (row = 0; row < mci->nr_csrows; row++) { csi = mci->csrows[row]; size = edac_get_memsize(); @@ -368,10 +395,10 @@ static void edac_init_csrows(struct mem_ctl_info *mci) for (j = 0; j < csi->nr_channels; j++) { dimm = csi->channels[j]->dimm; dimm->edac_mode = EDAC_FLAG_SECDED; - dimm->mtype = edac_get_mtype(priv->baseaddr); + dimm->mtype = p_data->get_mtype(priv->baseaddr); dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels; dimm->grain = SYNPS_EDAC_ERR_GRAIN; - dimm->dtype = edac_get_dtype(priv->baseaddr); + dimm->dtype = p_data->get_dtype(priv->baseaddr); } } } @@ -406,12 +433,27 @@ static void edac_mc_init(struct mem_ctl_info *mci, mci->mod_name = SYNPS_EDAC_MOD_VER; edac_op_state = EDAC_OPSTATE_POLL; - mci->edac_check = edac_check; + mci->edac_check = edac_error_check; mci->ctl_page_to_phys = NULL; edac_init_csrows(mci); } +static const struct synps_platform_data zynq_edac_def = { + .geterror_info = zynq_geterror_info, + .get_mtype = zynq_get_mtype, + .get_dtype = zynq_get_dtype, + .get_eccstate = zynq_get_eccstate, + .quirks = 0, +}; + +static const struct of_device_id synps_edac_match[] = { + { .compatible = "xlnx,zynq-ddrc-a05", .data = (void *)&zynq_edac_def }, + { /* end of table */ } +}; + +MODULE_DEVICE_TABLE(of, synps_edac_match); + /** * synps_edac_mc_probe - Check controller and bind driver. * @pdev: platform_device struct. @@ -423,6 +465,7 @@ static void edac_mc_init(struct mem_ctl_info *mci, */ static int synps_edac_mc_probe(struct platform_device *pdev) { + const struct synps_platform_data *p_data; struct edac_mc_layer layers[2]; struct synps_edac_priv *priv; struct mem_ctl_info *mci; @@ -435,7 +478,8 @@ static int synps_edac_mc_probe(struct platform_device *pdev) if (IS_ERR(baseaddr)) return PTR_ERR(baseaddr); - if (!edac_get_eccstate(baseaddr)) { + p_data = of_device_get_match_data(&pdev->dev); + if (!(p_data->get_eccstate(baseaddr))) { edac_printk(KERN_INFO, EDAC_MC, "ECC not enabled\n"); return -ENXIO; } @@ -457,6 +501,8 @@ static int synps_edac_mc_probe(struct platform_device *pdev) priv = mci->pvt_info; priv->baseaddr = baseaddr; + priv->p_data = p_data; + edac_mc_init(mci, pdev); rc = edac_mc_add_mc(mci); @@ -495,13 +541,6 @@ static int synps_edac_mc_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id synps_edac_match[] = { - { .compatible = "xlnx,zynq-ddrc-a05", }, - { /* end of table */ } -}; - -MODULE_DEVICE_TABLE(of, synps_edac_match); - static struct platform_driver synps_edac_mc_driver = { .driver = { .name = "synopsys-edac", From patchwork Mon Sep 17 14:25:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9C71157B for ; Mon, 17 Sep 2018 14:28:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A0B029DE8 for ; Mon, 17 Sep 2018 14:28:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DDF129EBF; Mon, 17 Sep 2018 14:28:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17FE529DE8 for ; Mon, 17 Sep 2018 14:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=34oSzBT5aY8TflLR5EmXy99XNSpm1vKOgL7q+Cb8A4s=; b=TNplf5Kih37W5h o1p9GpuPkj7V8mnl/2N8QEftTqimY4p32UmwB+MKUdUQBLHYWgedBurGgnv1uVJzp9QZ2ByLZZuid 0ZJVg8TBUn2gUxG/r2KafIXXHISJcCRdmFlvLo2b/eJcuH02X70vuDaOoE6WzOMwTeMPMnhRAcRDP ZbsdkdG9R1eASrGpnNhRvrGETxnfKoLSbCwbww0PeSjOnsR05bBaN4F3G1b5UAf9VMvOwwC/BdUtN moWcb87IAPo5TCAIx6EXlQks/0t1paWQl26+voSq0xXo9+sJcW9ndbwSm/4sFHetAHOabIRKBfEfX KrQvLCr7A6mOFR3heC+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uVd-0000Ha-Ap; Mon, 17 Sep 2018 14:28:17 +0000 Received: from mail-bn3nam01on0085.outbound.protection.outlook.com ([104.47.33.85] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTL-0007j4-25 for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:26:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LPlgHWwxxGeMmES3iC9R2B0x0FGDcuWpvXvIdyeQU0I=; b=DkDcXWTpNc/f+y4jSXjL3kc6Ku8bwGGNG/DHtRp7qSpzvZIm+di6IH3OB/0ByuUJtXw8Pb/PJZTynRb3wkOt87uOEuYznnhzQvzLIy6hRRmupSigfGX2/e6Jdu8CsP0XYXnWsROYghomF4pb2+wLu9YsRRwh/77YmMi7f1N7Se4= Received: from SN6PR02CA0030.namprd02.prod.outlook.com (2603:10b6:805:a2::43) by BYAPR02MB5109.namprd02.prod.outlook.com (2603:10b6:a03:70::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Mon, 17 Sep 2018 14:25:42 +0000 Received: from CY1NAM02FT039.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::207) by SN6PR02CA0030.outlook.office365.com (2603:10b6:805:a2::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Mon, 17 Sep 2018 14:25:41 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT039.mail.protection.outlook.com (10.152.75.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uT6-00056S-5r; Mon, 17 Sep 2018 07:25:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uT1-0005Mt-2W; Mon, 17 Sep 2018 07:25:35 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPOVC003529; Mon, 17 Sep 2018 07:25:24 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSp-0005LN-VC; Mon, 17 Sep 2018 07:25:24 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 23BC51214B4; Mon, 17 Sep 2018 19:55:23 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 3/7] dt: bindings: Document ZynqMP DDRC in Synopsys documentation Date: Mon, 17 Sep 2018 19:55:01 +0530 Message-ID: <1537194305-9243-4-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(346002)(376002)(396003)(39850400004)(136003)(2980300002)(438002)(199004)(189003)(90966002)(81156014)(7416002)(106466001)(48376002)(54906003)(76176011)(51416003)(50466002)(106002)(316002)(50226002)(110136005)(42186006)(63266004)(8936002)(16586007)(5660300001)(478600001)(6666003)(72206003)(81166006)(336012)(356003)(47776003)(103686004)(486006)(2616005)(44832011)(36386004)(426003)(14444005)(11346002)(26005)(446003)(52956003)(4326008)(36756003)(476003)(8676002)(186003)(2906002)(2201001)(126002)(6266002)(305945005)(107986001)(2101003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5109; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT039; 1:ofnh19/48ArLhcY4DRVmyZ4oV/gXATk0kROM5b24g0ljYIX/ZciqDjOf8wz0zT6IuY6/1oodBjH+vgobHOcUfEkC4n45fg3FxlH89MAU0If5kuiMzFRBoT6cMEupym8m MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1973761-a8db-438e-1b99-08d61ca97262 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB5109; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5109; 3:3p9YOH7/PJBUI3qVKBkM+zrK41WDmwJjdMOM0oz8dsf439UHxpd4AhuHEHVWmfkerx3Ft1MKVA5apGBc0vhvHpCWGpGFPE2EMNRAXi7OEKBjJD6DxROMgWIw8rZgQIj7bHXPayFZjoc+emQYCYWPqVRx6voTiaJRmzHnslOntz4GdMBHAlAtAPpvgYJPXlH76jQyd8gMZHYDPfS8x/B/A4MgVwb0TbSsJczqtN42iHbiuGVPQsy+5TMnUsx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CNIvc5pzuGNqkc7SUvteocdfsGFTWAFnbLFedVageWWdx2ifMXVfR/KOrkUhtA8lWFGi/nyVlAyGR0l3iSD+5CeYiswMQ95pGXTz2jPMVpfCKGaKIimt6Mqt/hEFU6vgER1AL9aoLp/Hv39+dnwI0+IvV41cH53hCwhMvlDb86Q50mks+K0WALUmZyRIXZfT8Jgiwj X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506)(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699050); SRVR:BYAPR02MB5109; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB5109; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5109; 4:8/ffKC0FsOdsDCnuMS01dMCIFWVK0l8W6//NwjQINSSP1m9n317tLcrtE4Srj+t6WeaXRrK79oka3Gcp1hQuWeyVCvv9KEy5H536rxKjdCcOxQrkfLYBwgBXJaZWAd116an7+qOcG+yWR7mc5qVwZkmjHyHt3S3HUTTARj621BrpRM46B1Ww1mYnWaCptplZwf72Tc6jbFTh+oRzZxs2pAnsCZQ6EupcFhIUamVlkqfbiuJQfBFV3ScpoEd8gA5Sm35+aRNmVYyIbJuhFw5o+gcuCxqA26IDTimrmZxT9gcYqiwRW9zqrBuVG6Kvtz3nxXyK8PJMSRVERYlz0RfDKBYBnIuKBldY48/nZ3q5db4= X-Forefront-PRVS: 0798146F16 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR02MB5109; 23:PoCqqEpWVTAB7Cblcioj79XXMMda6l6qBKVkdIqX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hjjNdyFbQfDmPU78UfPwnVL0XLqgFkjFQ==; 5:zpd7wf30GSygwe5BYZdtM9C19hgJm/1lWWLeAi+geyhAm8AX4JRuhmlZigAa54VvR0RlXZsy7avE4YhScDORPGnQXoHd3O1Gr5M8683Cer+zXo8TRGiKopb/ZZlsunuDyKPhRr+QFjAraVeWCMVI4fa/sVIRLwYqi4B05MmfAvc=; 7:3zDRluceSI1CllXBENNvkcNHsQFPo9KW+wGbnyyEwBCSMW9eqSmEmKtHDIEw6GwpfCv1EkrPXrpklbTDUQg+fWmFHUYOihJmh0CzbvSuOGYK6KlflRTGWGTM4xWgdHAQpRrKC/RcbXeE86F7Va+M1uZEyTE8ssw3KAuX4ZN/S0BLVEYWeJ6o0PRTpOppW0EI93cxU0PGITeLXGVoY1r/fk+ZuSJX/Zt0nEyZZDpZ2UuEqYDkYHu67qGnHnObR3pg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:40.6711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1973761-a8db-438e-1b99-08d61ca97262 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5109 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072555_416048_0A046DF1 X-CRM114-Status: UNSURE ( 8.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add information of ZynqMP DDRC which reports the single bit errors that are corrected and the double bit errors that are detected. Signed-off-by: Manish Narani Reviewed-by: Rob Herring --- .../bindings/memory-controllers/synopsys.txt | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/synopsys.txt b/Documentation/devicetree/bindings/memory-controllers/synopsys.txt index a43d26d..9d32762 100644 --- a/Documentation/devicetree/bindings/memory-controllers/synopsys.txt +++ b/Documentation/devicetree/bindings/memory-controllers/synopsys.txt @@ -1,15 +1,32 @@ Binding for Synopsys IntelliDDR Multi Protocol Memory Controller -This controller has an optional ECC support in half-bus width (16-bit) -configuration. The ECC controller corrects one bit error and detects -two bit errors. +The ZynqMP DDR ECC controller has an optional ECC support in 64-bit and 32-bit +bus width configurations. + +The Zynq DDR ECC controller has an optional ECC support in half-bus width +(16-bit) configuration. + +These both ECC controllers correct single bit ECC errors and detect double bit +ECC errors. Required properties: - - compatible: Should be 'xlnx,zynq-ddrc-a05' - - reg: Base address and size of the controllers memory area + - compatible: One of: + - 'xlnx,zynq-ddrc-a05' : Zynq DDR ECC controller + - 'xlnx,zynqmp-ddrc-2.40a' : ZynqMP DDR ECC controller + - reg: Should contain DDR controller registers location and length. + +Required properties for "xlnx,zynqmp-ddrc-2.40a": + - interrupts: Property with a value describing the interrupt number. Example: memory-controller@f8006000 { compatible = "xlnx,zynq-ddrc-a05"; reg = <0xf8006000 0x1000>; }; + + mc: memory-controller@fd070000 { + compatible = "xlnx,zynqmp-ddrc-2.40a"; + reg = <0x0 0xfd070000 0x0 0x30000>; + interrupt-parent = <&gic>; + interrupts = <0 112 4>; + }; From patchwork Mon Sep 17 14:25:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EF5617D5 for ; Mon, 17 Sep 2018 14:29:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E60E29EDB for ; Mon, 17 Sep 2018 14:29:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 623DD29EED; Mon, 17 Sep 2018 14:29:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ACDCD29EDB for ; Mon, 17 Sep 2018 14:29:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=23KQgS+wYB0kz/bX49Vyu6eMk5vGqQGBc2r2GMHYrA0=; b=qcHSrdIxVdAv4C g73ZVdJ8l7vugDDt0X9ZnpdjDe0rNum8+slJdY/XRR3wPC+P7MfgaK3HSozCK4OBz0xtxqMFBFb51 dzfKESjtRkdElephweZVdtOXEhNItr74YbHPam3Zpy5ivxzHABPIpPq+aJhSwbV4AqMGCIcLsxhAY wYOXyYvlzXtXtRBMPyiYhJtd+y2St0imrrc9LP9Uxk39xuF8Wq2YW58eqKck9BFCJi2VF0/zYf0cL EhoTTIxHJMzXTqK2139uVzT4TVxqn/i7sykkGkHp0gsAxeTDeKt/FVJYYMjXPT1xokwrrq19J4G8R h8vOIxa/ORfqSblCPReA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uX7-0000tc-Cj; Mon, 17 Sep 2018 14:29:49 +0000 Received: from mail-bl2nam02on0044.outbound.protection.outlook.com ([104.47.38.44] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTL-0007jK-9P for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:26:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wxYznD8722s7a2M8FIzPk7h2tOrvoGk+tafkb7UnGyg=; b=1gvjX1KhqfN4t2ArqZ0QcKbN0CNnV6qEySb1btALxb9E2OYHCCnwutxxTyfA5uKZPMmp6lJzssw62GAgtwOP7upot5YJeTWVUI6i//R7RXw5hl/i/39LqJeoIYqcRUJ9ktykLuChtJ+gvKmSZUJ2Agn0UkIe61tEzCm3VoxJqRM= Received: from BN7PR02CA0031.namprd02.prod.outlook.com (2603:10b6:408:20::44) by BL0PR02MB4468.namprd02.prod.outlook.com (2603:10b6:208:4a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 14:25:41 +0000 Received: from SN1NAM02FT029.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by BN7PR02CA0031.outlook.office365.com (2603:10b6:408:20::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.17 via Frontend Transport; Mon, 17 Sep 2018 14:25:41 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT029.mail.protection.outlook.com (10.152.72.110) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uT6-00056U-8u; Mon, 17 Sep 2018 07:25:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uT1-0005Mt-5X; Mon, 17 Sep 2018 07:25:35 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPPdZ003531; Mon, 17 Sep 2018 07:25:25 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSq-0005LQ-GB; Mon, 17 Sep 2018 07:25:24 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id A904F12159B; Mon, 17 Sep 2018 19:55:23 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 4/7] edac: synopsys: Add macro defines for ZynqMP DDRC Date: Mon, 17 Sep 2018 19:55:02 +0530 Message-ID: <1537194305-9243-5-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(346002)(396003)(2980300002)(438002)(189003)(199004)(103686004)(476003)(72206003)(356003)(486006)(186003)(63266004)(478600001)(48376002)(4326008)(2616005)(50466002)(90966002)(305945005)(11346002)(44832011)(126002)(2906002)(36756003)(8676002)(5660300001)(42186006)(336012)(426003)(110136005)(7416002)(54906003)(6266002)(50226002)(52956003)(446003)(6666003)(36386004)(2201001)(8936002)(316002)(16586007)(51416003)(26005)(106466001)(47776003)(76176011)(106002)(81156014)(6346003)(81166006)(107986001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4468; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT029; 1:Q0uDU4tO23SbhIC2BUKMSmjb16d2ag3+zlDvCXE3x1bF97DR/KxOL2PyEi8XNh4GEJKnaflbfgb+fjoLwbKmJP8hjkkoXAnp7lc3kU47GGJaalfWEG8WJq4NiLpuNC+Y MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e6195f7-af2c-407a-21e8-08d61ca97247 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BL0PR02MB4468; X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4468; 3:DT7d54XNcOPR1qzEPFNk6+VHlmXRAySy+fZ/rK1yw0cUDb88kzFb3qyDv26EMk8TeyFBpJrWVs6eY9TvB5RigsymADSKlvMfIDLBVdR7H8F51Z5G0lwexNFIuxJOkWjm3zMwTEax43fUYVkQYORyXnT3nNS6aZxXUIc4sq3owuP4WOBLfA3lFpQSxp8xqz5D58x11/qII1zgRxvR4GuPAG9gqbPEEdgAD73zOV9U4sZ5K1Li6ouCvafx1/qOM8Ps42cAPTAKkdQY28e3wRuLF9nmwCSVnIo4dMfFbZqPeHLq554Rx4sVWChYkPm8/1mdMHKNt101rM+CtjDZtB64YqtvQ9KSZoPTOjPYjfwhwhY=; 25:n9wAPlzUr03h3PBJqdM2KD7WHvUMyg9CPIPwyWjVc7opGHFtknBDAnVldD02K8rZxtyalu1rojh+fCdXubeU5Q5aQMkKLPwrHkqWfL/2C39qW3rfV1eoxgj7BYjcSVCdJ5yfzjBoQuHcI1917NjB738pqKgk7xRe0Ah/fFSY5dvrWSD5eBWzRIXL2KH1OUGdNypPNrSwAz3c3RoAtTFmWzCbKn9ldnmbm2ZG7Sg47MTfyQxpHSPyeCWqzpzc7PLc1a6gNn/RlWB3hfosUHmNtruoXlDL84qXnCzhUxMY1hRUrNxbpx43rcKO4FM5oUR5x7BYvkPWvQ2I9V4sOnuKjQ== X-MS-TrafficTypeDiagnostic: BL0PR02MB4468: X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4468; 31:0ivaJwyBMjfCnEhKxRGfNoMZAvXvNwXC2g3GC+gbI2NTmiXceSH0ZisPNFVcnJX/4gKAoKyh/YzGD0qHRjinwYA24fW8MRvU6Q5iUmhwiivsCEOYf+K/TGGJsk6UVv80F4a+adsmdEjcyyK7PIr1VgybJLdacLGb1RfNqdzqrGWpjaFDXv551RUj7ZPvqb+LFF2b9neOlMKSlMapjRkd6HexbcRGlAZfKbRJFbWuo/4=; 20:yuOSLBg3zOovXNXajmL/REsTFtndG3CCUnWSPFAnKYgkWbP0ccE9TNUkCobaT5o+DqllAHN8aZ0WDv9KZGuHrmpiCnRgrZiCx8X+kSWdrc6/sBchYebb1WqpsBX8NLoDmMdIpTNM2TBn63y1Cg5A5n3qa16iaRM00w45xcjhnfn6sJRks0dRSwQ5aC8Ond6d/6ZKVKJ9xUd22CT6o5VJcumOr3cdfYJWsOp+sUBO9C8UC9itcmV1HB6y0qJ9okqG8EsZPYxbbRDcs8ql0Re7eMjPcQbfppYA5pLYd4Q5qzZibBlqpltG78xQp75G4o1FrsWrgtgTW22CQi30FbExEkmXje5FTGY5ruUAICxoV/62tgqPGdJPIMvSID+s5BAkN6ZQJTMoDzBbddt5VJS3WhA1VByO20H4AiECOM9RvIC/vuKrOu//XvgriAF0iRWfcirpKAjs9bb6AYmnLMuMOamhONIPxiJgGJAUAYtlw5WUD220RI0nuqtYPuMXuoPU X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(105169848403564); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(93006095)(93004095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050)(76991041); SRVR:BL0PR02MB4468; BCL:0; PCL:0; RULEID:; SRVR:BL0PR02MB4468; X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4468; 4:G7SwPHBkUDs0MRdkJk2D3VbLxKIS+Yf0jiSYDh5RAJypVuWCgvehamLvY8e3JmnhoimwCv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FGEx2NXE+jRbFjJWezMp1F9R8b9SDTEJ1PgbExZDHfWMAYiYB87Fm8/9LnkZ06xVKlL672xHN7GWEmycWfyyEy3dLm5sNuW+qgiqN/hjvYSeYjMPrWLNt4Xbwu6ktt9jL7xLUEVb0nkhZAVWvpVYO2ouMv4ffDKfR0HWvFYofuJCP6TcU6Ritp1qXGxhMJh8/tZ8dsstuYa4FNgAAJJeTp07QwJFWP3P/LgjFa9Mh6y6/crC7KvK74ZzHZd/ei0P1gvXd1/LlsM9UU4vP48l9btBnRGVNmyjv3g7KBsKCLmpVJnUu7GQJ1AUYI07PUf93hjfPLlljmqJe2NcVfc689w==; 5:0v3KfXFT+2anTw8tinIwGipVIORsST5hsTIAifn9Dq4wWz8yjS8di+KkmhXtR7rVKTPm5eex0imzrSRWKp5IRFeCrhp4pgNLLKYMhbr3fRjycetiHYqKZAB3BStudvohYnigGrgizgMbj8+cf77GRjYMlrJgaCMNAO6CWxTw44A=; 7:D6R8WcRJOk3K+kkufkziquPQIw8odZ3mx94grqyOW4YzpmABcs2xX5EZBPuaw5ZdRqT0ka/86CccRr/i1kL8y0OA5pjLfUVYYJ72cb38SZC5fc8bbtL7d4nzNYwogf5IwFYfgdBgf+UdHOXKdntgZ4aFCiMnN0QUalF3tq7SFq+DJuTZMLB8hOhy6ECIrU5qNHCYNfeARsonjV0j3zvgzMga6aVJyUva3IMxMgEhhXb1MS2/0eXjQOd+weeH7k2d SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:40.6975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e6195f7-af2c-407a-21e8-08d61ca97247 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4468 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072555_559207_CC1B7EED X-CRM114-Status: UNSURE ( 7.38 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add macro defines for ZynqMP DDR controller. These macros will be used for ZyqnMP ECC operations. Signed-off-by: Manish Narani --- drivers/edac/synopsys_edac.c | 168 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index eb458e5..6bf7959 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -97,6 +97,174 @@ #define SCRUB_MODE_MASK 0x7 #define SCRUB_MODE_SECDED 0x4 +/* DDR ECC Quirks */ +#define DDR_ECC_INTR_SUPPORT BIT(0) +#define DDR_ECC_DATA_POISON_SUPPORT BIT(1) + +/* ZynqMP Enhanced DDR memory controller registers that are relevant to ECC */ +/* ECC Configuration Registers */ +#define ECC_CFG0_OFST 0x70 +#define ECC_CFG1_OFST 0x74 + +/* ECC Status Register */ +#define ECC_STAT_OFST 0x78 + +/* ECC Clear Register */ +#define ECC_CLR_OFST 0x7C + +/* ECC Error count Register */ +#define ECC_ERRCNT_OFST 0x80 + +/* ECC Corrected Error Address Register */ +#define ECC_CEADDR0_OFST 0x84 +#define ECC_CEADDR1_OFST 0x88 + +/* ECC Syndrome Registers */ +#define ECC_CSYND0_OFST 0x8C +#define ECC_CSYND1_OFST 0x90 +#define ECC_CSYND2_OFST 0x94 + +/* ECC Bit Mask0 Address Register */ +#define ECC_BITMASK0_OFST 0x98 +#define ECC_BITMASK1_OFST 0x9C +#define ECC_BITMASK2_OFST 0xA0 + +/* ECC UnCorrected Error Address Register */ +#define ECC_UEADDR0_OFST 0xA4 +#define ECC_UEADDR1_OFST 0xA8 + +/* ECC Syndrome Registers */ +#define ECC_UESYND0_OFST 0xAC +#define ECC_UESYND1_OFST 0xB0 +#define ECC_UESYND2_OFST 0xB4 + +/* ECC Poison Address Reg */ +#define ECC_POISON0_OFST 0xB8 +#define ECC_POISON1_OFST 0xBC + +#define ECC_ADDRMAP0_OFFSET 0x200 + +/* Control register bitfield definitions */ +#define ECC_CTRL_BUSWIDTH_MASK 0x3000 +#define ECC_CTRL_BUSWIDTH_SHIFT 12 +#define ECC_CTRL_CLR_CE_ERRCNT BIT(2) +#define ECC_CTRL_CLR_UE_ERRCNT BIT(3) + +/* DDR Control Register width definitions */ +#define DDRCTL_EWDTH_16 2 +#define DDRCTL_EWDTH_32 1 +#define DDRCTL_EWDTH_64 0 + +/* ECC status register definitions */ +#define ECC_STAT_UECNT_MASK 0xF0000 +#define ECC_STAT_UECNT_SHIFT 16 +#define ECC_STAT_CECNT_MASK 0xF00 +#define ECC_STAT_CECNT_SHIFT 8 +#define ECC_STAT_BITNUM_MASK 0x7F + +/* DDR QOS Interrupt register definitions */ +#define DDR_QOS_IRQ_STAT_OFST 0x20200 +#define DDR_QOSUE_MASK 0x4 +#define DDR_QOSCE_MASK 0x2 +#define ECC_CE_UE_INTR_MASK 0x6 +#define DDR_QOS_IRQ_EN_OFST 0x20208 +#define DDR_QOS_IRQ_DB_OFST 0x2020C + +/* ECC Corrected Error Register Mask and Shifts*/ +#define ECC_CEADDR0_RW_MASK 0x3FFFF +#define ECC_CEADDR0_RNK_MASK BIT(24) +#define ECC_CEADDR1_BNKGRP_MASK 0x3000000 +#define ECC_CEADDR1_BNKNR_MASK 0x70000 +#define ECC_CEADDR1_BLKNR_MASK 0xFFF +#define ECC_CEADDR1_BNKGRP_SHIFT 24 +#define ECC_CEADDR1_BNKNR_SHIFT 16 + +/* ECC Poison register shifts */ +#define ECC_POISON0_RANK_SHIFT 24 +#define ECC_POISON0_RANK_MASK BIT(24) +#define ECC_POISON0_COLUMN_SHIFT 0 +#define ECC_POISON0_COLUMN_MASK 0xFFF +#define ECC_POISON1_BG_SHIFT 28 +#define ECC_POISON1_BG_MASK 0x30000000 +#define ECC_POISON1_BANKNR_SHIFT 24 +#define ECC_POISON1_BANKNR_MASK 0x7000000 +#define ECC_POISON1_ROW_SHIFT 0 +#define ECC_POISON1_ROW_MASK 0x3FFFF + +/* DDR Memory type defines */ +#define MEM_TYPE_DDR3 0x1 +#define MEM_TYPE_LPDDR3 0x8 +#define MEM_TYPE_DDR2 0x4 +#define MEM_TYPE_DDR4 0x10 +#define MEM_TYPE_LPDDR4 0x20 + +/* DDRC Software control register */ +#define DDRC_SWCTL 0x320 + +/* DDRC ECC CE & UE poison mask */ +#define ECC_CEPOISON_MASK 0x3 +#define ECC_UEPOISON_MASK 0x1 + +/* DDRC Device config masks */ +#define DDRC_MSTR_CFG_MASK 0xC0000000 +#define DDRC_MSTR_CFG_SHIFT 30 +#define DDRC_MSTR_CFG_X4_MASK 0x0 +#define DDRC_MSTR_CFG_X8_MASK 0x1 +#define DDRC_MSTR_CFG_X16_MASK 0x2 +#define DDRC_MSTR_CFG_X32_MASK 0x3 + +#define DDR_MAX_ROW_SHIFT 18 +#define DDR_MAX_COL_SHIFT 14 +#define DDR_MAX_BANK_SHIFT 3 +#define DDR_MAX_BANKGRP_SHIFT 2 + +#define ROW_MAX_VAL_MASK 0xF +#define COL_MAX_VAL_MASK 0xF +#define BANK_MAX_VAL_MASK 0x1F +#define BANKGRP_MAX_VAL_MASK 0x1F +#define RANK_MAX_VAL_MASK 0x1F + +#define ROW_B0_BASE 6 +#define ROW_B1_BASE 7 +#define ROW_B2_BASE 8 +#define ROW_B3_BASE 9 +#define ROW_B4_BASE 10 +#define ROW_B5_BASE 11 +#define ROW_B6_BASE 12 +#define ROW_B7_BASE 13 +#define ROW_B8_BASE 14 +#define ROW_B9_BASE 15 +#define ROW_B10_BASE 16 +#define ROW_B11_BASE 17 +#define ROW_B12_BASE 18 +#define ROW_B13_BASE 19 +#define ROW_B14_BASE 20 +#define ROW_B15_BASE 21 +#define ROW_B16_BASE 22 +#define ROW_B17_BASE 23 + +#define COL_B2_BASE 2 +#define COL_B3_BASE 3 +#define COL_B4_BASE 4 +#define COL_B5_BASE 5 +#define COL_B6_BASE 6 +#define COL_B7_BASE 7 +#define COL_B8_BASE 8 +#define COL_B9_BASE 9 +#define COL_B10_BASE 10 +#define COL_B11_BASE 11 +#define COL_B12_BASE 12 +#define COL_B13_BASE 13 + +#define BANK_B0_BASE 2 +#define BANK_B1_BASE 3 +#define BANK_B2_BASE 4 + +#define BANKGRP_B0_BASE 2 +#define BANKGRP_B1_BASE 3 + +#define RANK_B0_BASE 6 + /** * struct ecc_error_info - ECC error log information. * @row: Row number. From patchwork Mon Sep 17 14:25:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B7B5157B for ; Mon, 17 Sep 2018 14:31:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A97B29FFB for ; Mon, 17 Sep 2018 14:31:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 183282A058; Mon, 17 Sep 2018 14:31:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEAE32A067 for ; Mon, 17 Sep 2018 14:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MlC32HMKwK7DTaK5eahB98cg/ps1PZBGC4qU5rcwFrQ=; b=KFIu3lv7H18dB+ 8KlPgg52ih1foi1Z1+RkUhs7FbwbIXqKCaFAbBEzvRlWJxpRGm/2zBKGQi/vChv2dHJT8bC8D5cmp 4mOieCGHqGe9W1QQagE1A/FsKccSjdFZfnU+cFMvgVLOtCI1sm2FduMAnxhj1fSWU53UtSij3SQgn EV55l0c220nGSt0pwMuPm0KIgilFWhJucy3Ezs9BTz40pviy7+N1CmE61AcU/bznd6Tf6R3XfgGde fh+Spno3DXUqqJ1KQvM52rhnAjMgs4LxJviFY+r82wPPd/7X0noxwccqHmwZr1UIdJjJJaHsX4cG5 3Y1XWTEWaYfyuU1zVeSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uYV-0002ey-VJ; Mon, 17 Sep 2018 14:31:16 +0000 Received: from mail-sn1nam02on0607.outbound.protection.outlook.com ([2a01:111:f400:fe44::607] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTL-0007j3-CK for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:26:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kzarhEKjH4bFxmnCAsq9G7Xufpt0jiGEopcXTjYX8TU=; b=t1IpcJxWjOb6ME5nXDwLUog5+rIfhhJRqap4JtN9d+0LYkC/5V3JdtFS4U5wOGwqRGRiTB2IlSsBB37ocAtNjJ01Z9Zycaf5J0kOignsDK8VViThcK5AtgNV7HCo9MvqGivfBFFphYCAhCuyx0doGEC2j7bzztgMK/OebUoAGr4= Received: from BL0PR02CA0054.namprd02.prod.outlook.com (2603:10b6:207:3d::31) by SN6PR02MB4768.namprd02.prod.outlook.com (2603:10b6:805:90::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 14:25:41 +0000 Received: from SN1NAM02FT032.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::205) by BL0PR02CA0054.outlook.office365.com (2603:10b6:207:3d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.17 via Frontend Transport; Mon, 17 Sep 2018 14:25:41 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT032.mail.protection.outlook.com (10.152.72.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36861 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g1uT6-0000sW-2i; Mon, 17 Sep 2018 07:25:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uT0-0005Mt-Va; Mon, 17 Sep 2018 07:25:35 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPPHo007873; Mon, 17 Sep 2018 07:25:26 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSr-0005La-50; Mon, 17 Sep 2018 07:25:25 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 52FF5121463; Mon, 17 Sep 2018 19:55:24 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 5/7] edac: synopsys: Add EDAC ECC support for ZynqMP DDRC Date: Mon, 17 Sep 2018 19:55:03 +0530 Message-ID: <1537194305-9243-6-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(396003)(136003)(346002)(39860400002)(2980300002)(438002)(189003)(199004)(8936002)(50226002)(2906002)(103686004)(186003)(217873002)(305945005)(90966002)(81156014)(26005)(50466002)(48376002)(14444005)(36756003)(81166006)(47776003)(72206003)(356003)(7416002)(42186006)(110136005)(16586007)(51416003)(316002)(36386004)(486006)(478600001)(5660300001)(76176011)(106466001)(54906003)(106002)(336012)(8676002)(6266002)(126002)(476003)(6666003)(4326008)(63266004)(446003)(52956003)(11346002)(44832011)(2616005)(426003)(2201001)(107986001)(2101003)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4768; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT032; 1:ilJ4i/ItP7DN7Q67+6g3y4WNsGkPqrJe3/3BL2PwMl8uTQM3uyZJvOtihHcVmclx0ziHe8Q+mlAtx7tqQAmC9PFKGv3qlGv3/Z4hYrNvBIXtgGAgUTUsN0tGVks/Ez/T MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2599ecc6-32c1-49be-2f6d-08d61ca9722e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:SN6PR02MB4768; X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4768; 3:Whs5oaYZdiJNeYJ/TpO206nvchmJF4XWFpxA41QNXGCneJ5LN5AKScCacmmhr5pvHQPi48I1fmqsph4lsvlhJ/hKyjw49AIhVR9At/7db+51V4eRCHuLl3lPGcN5u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sYeoGpd+QfDvoJDKiD3+WjwhACe41FkFwPlx/0t1DOkSCDLC0+gLQSWGrjjOe7/bEsrB23OtlEJK5SDlDIQgI2QwPpd5IeByymKXwofi1awRk4ePtiqDRNgBiCFnoFrM2k9UhB3U3n18WGeSJwstzEjcoA/9rRhPdr8yJWWNZ5GmLCSFDC58Z5zTQNoYBnb2uljl0YCmrsU/Re0q6DzZtWrK5L4MmBa3iRTyc4BuBA0bOzwiwu/7MskxIbFABbdMoHf9FXitkfgwPqHMH5dv7NwgSr5bAdhMZwgnCFhMWtu4SEuGjF9BpW1zCVGjVXj27PdSDFoog7uOVIh5rNNCubwbF3sK30 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(105169848403564)(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93004095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:SN6PR02MB4768; BCL:0; PCL:0; RULEID:; SRVR:SN6PR02MB4768; X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4768; 4:4Fb1amrqZraZQiahDQ/6FnAFV4i/Ly6KwrBlsL0uO4hjGTDfewtmAHP0vOCKZ/0B8/pCiLr/8Axvt0XmZrz1qiouSkSe8Z0nG8E6TqO6EWH/OZVvg7PJFvi+YRIeiGt5oCCJ1MtciDot0RMbk0Lfw8cX9hfJMN/y03WJFFx2wOpokGrDkKr/SjTZhCQBgbOLOIV/SZD/EQ0CaXFCCtT++xdfY0H/r8kS9R1YVQAwJit5tSowTyDdN9bCh+rWHkJcJvRSApXsCr5LHo3HWeHPKIsdLk05LheVT6C7HJ+Mw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EctmbXQECfZqaDpT5FZ4EsY7YtY7p0lUdGiGSuraYjsMuVDJj0mtc76yQLH7COV+r8XAwPLfbU8NB3QWn5loAeWrarM9tCGx7cchrK63MQ6/M7dzHPw19Yz+nIg8XmKmn63tqyj1G5fe7GxI/Y+P62TqG8EqGpawKL6Rd5esOay2J851jMkUQ08YnKTiWVRa1JyUHw==; 5:poNP9PdOEzP2BVNTqXnk5sfkE0A1n0WzbZajuCpsQMgRaG6W2uifWtEGRaZECVoqYudpSEAPPJWfq87QHV6zmHDgJZUkfjYHzmA7NlXECdheZCJ0H3kL+YmwFZA68oJ2Z/cMFof2ypWvzPA3D1wuT0aqUqxwuXn2weGadKAw6v8=; 7:/DOLguhQUnDLteLpG4sR9Q0w/HhbmkzBtdcsUvRa4cv69eLQZ9x/Dx2iJuclFAH/dRh3EbQDzE3Y9odAREwSLAxLNHbsLMfuFitlkJV+dYHmckSS54ieyCq3F1jNUGkZAs1s7vQTA+EU9EDbaSKi1jriNhaVL10oLciLEaHbh9CUkQPLRPG/GwfMrliCNG0B/Xcmgc5CC6hRZY0dg6Qu5H0UaTCM4PzixbXMzBB6NOkWcO2Hiwet1JhR0vfWvdim SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:40.4871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2599ecc6-32c1-49be-2f6d-08d61ca9722e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4768 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072555_933517_1A787F19 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add EDAC ECC support for ZynqMP DDRC IP. The IP supports interrupts for corrected and uncorrected errors. Add interrupt handlers for the same. Signed-off-by: Manish Narani --- drivers/edac/Kconfig | 2 +- drivers/edac/synopsys_edac.c | 304 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 287 insertions(+), 19 deletions(-) diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 57304b2..b1fc7a16 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -441,7 +441,7 @@ config EDAC_ALTERA_SDMMC config EDAC_SYNOPSYS tristate "Synopsys DDR Memory Controller" - depends on ARCH_ZYNQ + depends on ARCH_ZYNQ || ARM64 help Support for error detection and correction on the Synopsys DDR memory controller. diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 6bf7959..7ab5b9a 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -272,6 +273,8 @@ * @bank: Bank number. * @bitpos: Bit position. * @data: Data causing the error. + * @bankgrpnr: Bank group number. + * @blknr: Block number. */ struct ecc_error_info { u32 row; @@ -279,6 +282,8 @@ struct ecc_error_info { u32 bank; u32 bitpos; u32 data; + u32 bankgrpnr; + u32 blknr; }; /** @@ -385,6 +390,68 @@ static int zynq_geterror_info(struct synps_edac_priv *priv) } /** + * zynqmp_geterror_info - Get the current ECC error info. + * @priv: DDR memory controller private instance data. + * + * Return: one if there is no error otherwise returns zero. + */ +static int zynqmp_geterror_info(struct synps_edac_priv *priv) +{ + struct synps_ecc_status *p; + u32 regval, clearval = 0; + void __iomem *base; + + base = priv->baseaddr; + p = &priv->stat; + + regval = readl(base + ECC_STAT_OFST); + if (!regval) + return 1; + + p->ce_cnt = (regval & ECC_STAT_CECNT_MASK) >> ECC_STAT_CECNT_SHIFT; + p->ue_cnt = (regval & ECC_STAT_UECNT_MASK) >> ECC_STAT_UECNT_SHIFT; + p->ceinfo.bitpos = (regval & ECC_STAT_BITNUM_MASK); + + regval = readl(base + ECC_CEADDR0_OFST); + if (!(p->ce_cnt)) + goto ue_err; + + p->ceinfo.row = (regval & ECC_CEADDR0_RW_MASK); + regval = readl(base + ECC_CEADDR1_OFST); + p->ceinfo.bank = (regval & ECC_CEADDR1_BNKNR_MASK) >> + ECC_CEADDR1_BNKNR_SHIFT; + p->ceinfo.bankgrpnr = (regval & ECC_CEADDR1_BNKGRP_MASK) >> + ECC_CEADDR1_BNKGRP_SHIFT; + p->ceinfo.blknr = (regval & ECC_CEADDR1_BLKNR_MASK); + p->ceinfo.data = readl(base + ECC_CSYND0_OFST); + edac_dbg(2, "ECCCSYN0: 0x%08X ECCCSYN1: 0x%08X ECCCSYN2: 0x%08X\n", + readl(base + ECC_CSYND0_OFST), readl(base + ECC_CSYND1_OFST), + readl(base + ECC_CSYND2_OFST)); + + +ue_err: + regval = readl(base + ECC_UEADDR0_OFST); + if (!(p->ue_cnt)) + goto out; + + p->ueinfo.row = (regval & ECC_CEADDR0_RW_MASK); + regval = readl(base + ECC_UEADDR1_OFST); + p->ueinfo.bankgrpnr = (regval & ECC_CEADDR1_BNKGRP_MASK) >> + ECC_CEADDR1_BNKGRP_SHIFT; + p->ueinfo.bank = (regval & ECC_CEADDR1_BNKNR_MASK) >> + ECC_CEADDR1_BNKNR_SHIFT; + p->ueinfo.blknr = (regval & ECC_CEADDR1_BLKNR_MASK); + p->ueinfo.data = readl(base + ECC_UESYND0_OFST); +out: + clearval = ECC_CTRL_CLR_CE_ERR | ECC_CTRL_CLR_CE_ERRCNT; + clearval |= ECC_CTRL_CLR_UE_ERR | ECC_CTRL_CLR_UE_ERRCNT; + writel(clearval, base + ECC_CLR_OFST); + writel(0x0, base + ECC_CLR_OFST); + + return 0; +} + +/** * edac_handle_error - Handle controller error types CE and UE. * @mci: EDAC memory controller instance. * @p: Synopsys ECC status structure. @@ -399,9 +466,25 @@ static void edac_handle_error(struct mem_ctl_info *mci, if (p->ce_cnt) { pinf = &p->ceinfo; - snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, - "DDR ECC error type :%s Row %d Bank %d Col %d ", - "CE", pinf->row, pinf->bank, pinf->col); + if (!priv->p_data->quirks) { + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "DDR ECC error type:%s Row %d Bank %d Col %d ", + "CE", pinf->row, pinf->bank, pinf->col); + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "Bit Position: %d Data: 0x%08x\n", + pinf->bitpos, pinf->data); + } else { + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "DDR ECC error type:%s Row %d Bank %d Col %d ", + "CE", pinf->row, pinf->bank, pinf->col); + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "BankGroup Number %d Block Number %d ", + pinf->bankgrpnr, pinf->blknr); + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "Bit Position: %d Data: 0x%08x\n", + pinf->bitpos, pinf->data); + } + edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, p->ce_cnt, 0, 0, 0, 0, 0, -1, priv->message, ""); @@ -409,9 +492,19 @@ static void edac_handle_error(struct mem_ctl_info *mci, if (p->ue_cnt) { pinf = &p->ueinfo; - snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, - "DDR ECC error type :%s Row %d Bank %d Col %d ", - "UE", pinf->row, pinf->bank, pinf->col); + if (!priv->p_data->quirks) { + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "DDR ECC error type :%s Row %d Bank %d Col %d ", + "UE", pinf->row, pinf->bank, pinf->col); + } else { + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "DDR ECC error type :%s Row %d Bank %d Col %d ", + "UE", pinf->row, pinf->bank, pinf->col); + snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, + "BankGroup Number %d Block Number %d", + pinf->bankgrpnr, pinf->blknr); + } + edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, p->ue_cnt, 0, 0, 0, 0, 0, -1, priv->message, ""); @@ -421,6 +514,42 @@ static void edac_handle_error(struct mem_ctl_info *mci, } /** + * synps_edac_intr_handler - Interrupt Handler for ECC interrupts. + * @irq: IRQ number. + * @dev_id: Device ID. + * + * Return: IRQ_NONE, if interrupt not set or IRQ_HANDLED otherwise. + */ +static irqreturn_t synps_edac_intr_handler(int irq, void *dev_id) +{ + const struct synps_platform_data *p_data; + struct mem_ctl_info *mci = dev_id; + struct synps_edac_priv *priv; + int status, regval; + + priv = mci->pvt_info; + p_data = priv->p_data; + + regval = readl(priv->baseaddr + DDR_QOS_IRQ_STAT_OFST); + regval &= (DDR_QOSCE_MASK | DDR_QOSUE_MASK); + if (!(regval & ECC_CE_UE_INTR_MASK)) + return IRQ_NONE; + + status = p_data->geterror_info(priv); + if (status) + return IRQ_NONE; + + priv->ce_cnt += priv->stat.ce_cnt; + priv->ue_cnt += priv->stat.ue_cnt; + edac_handle_error(mci, &priv->stat); + + edac_dbg(3, "Total error count CE %d UE %d\n", + priv->ce_cnt, priv->ue_cnt); + writel(regval, priv->baseaddr + DDR_QOS_IRQ_STAT_OFST); + return IRQ_HANDLED; +} + +/** * edac_error_check - Check controller for ECC errors. * @mci: EDAC memory controller instance. * @@ -428,10 +557,13 @@ static void edac_handle_error(struct mem_ctl_info *mci, */ static void edac_error_check(struct mem_ctl_info *mci) { - struct synps_edac_priv *priv = mci->pvt_info; - const struct synps_platform_data *p_data = priv->p_data; + const struct synps_platform_data *p_data; + struct synps_edac_priv *priv; int status; + priv = mci->pvt_info; + p_data = priv->p_data; + status = p_data->geterror_info(priv); if (status) return; @@ -476,6 +608,39 @@ static enum dev_type zynq_get_dtype(const void __iomem *base) } /** + * zynqmp_get_dtype - Return the controller memory width. + * @base: DDR memory controller base address. + * + * Get the EDAC device type width appropriate for the current controller + * configuration. + * + * Return: a device type width enumeration. + */ +static enum dev_type zynqmp_get_dtype(const void __iomem *base) +{ + enum dev_type dt; + u32 width; + + width = readl(base + CTRL_OFST); + width = (width & ECC_CTRL_BUSWIDTH_MASK) >> ECC_CTRL_BUSWIDTH_SHIFT; + switch (width) { + case DDRCTL_EWDTH_16: + dt = DEV_X2; + break; + case DDRCTL_EWDTH_32: + dt = DEV_X4; + break; + case DDRCTL_EWDTH_64: + dt = DEV_X8; + break; + default: + dt = DEV_UNKNOWN; + } + + return dt; +} + +/** * zynq_get_eccstate - Return the controller ECC enable/disable status. * @base: DDR memory controller base address. * @@ -485,19 +650,43 @@ static enum dev_type zynq_get_dtype(const void __iomem *base) */ static bool zynq_get_eccstate(void __iomem *base) { - bool state = false; enum dev_type dt; u32 ecctype; dt = zynq_get_dtype(base); if (dt == DEV_UNKNOWN) - return state; + return false; ecctype = readl(base + SCRUB_OFST) & SCRUB_MODE_MASK; if ((ecctype == SCRUB_MODE_SECDED) && (dt == DEV_X2)) - state = true; + return true; - return state; + return false; +} + +/** + * zynqmp_get_eccstate - Return the controller ECC enable/disable status. + * @base: DDR memory controller base address. + * + * Get the ECC enable/disable status for the controller. + * + * Return: a ECC status boolean i.e true/false - enabled/disabled. + */ +static bool zynqmp_get_eccstate(void __iomem *base) +{ + enum dev_type dt; + u32 ecctype; + + dt = zynqmp_get_dtype(base); + if (dt == DEV_UNKNOWN) + return false; + + ecctype = readl(base + ECC_CFG0_OFST) & SCRUB_MODE_MASK; + if ((ecctype == SCRUB_MODE_SECDED) && + ((dt == DEV_X2) || (dt == DEV_X4) || (dt == DEV_X8))) + return true; + + return false; } /** @@ -539,6 +728,34 @@ static enum mem_type zynq_get_mtype(const void __iomem *base) } /** + * zynqmp_get_mtype - Returns controller memory type. + * @base: Synopsys ECC status structure. + * + * Get the EDAC memory type appropriate for the current controller + * configuration. + * + * Return: a memory type enumeration. + */ +static enum mem_type zynqmp_get_mtype(const void __iomem *base) +{ + enum mem_type mt; + u32 memtype; + + memtype = readl(base + CTRL_OFST); + + if ((memtype & MEM_TYPE_DDR3) || (memtype & MEM_TYPE_LPDDR3)) + mt = MEM_DDR3; + else if (memtype & MEM_TYPE_DDR2) + mt = MEM_RDDR2; + else if ((memtype & MEM_TYPE_LPDDR4) || (memtype & MEM_TYPE_DDR4)) + mt = MEM_DDR4; + else + mt = MEM_EMPTY; + + return mt; +} + +/** * edac_init_csrows - Initialize the cs row data. * @mci: EDAC memory controller instance. * @@ -600,8 +817,13 @@ static void edac_mc_init(struct mem_ctl_info *mci, mci->dev_name = SYNPS_EDAC_MOD_STRING; mci->mod_name = SYNPS_EDAC_MOD_VER; - edac_op_state = EDAC_OPSTATE_POLL; - mci->edac_check = edac_error_check; + if (priv->p_data->quirks & DDR_ECC_INTR_SUPPORT) { + edac_op_state = EDAC_OPSTATE_INT; + } else { + edac_op_state = EDAC_OPSTATE_POLL; + mci->edac_check = edac_error_check; + } + mci->ctl_page_to_phys = NULL; edac_init_csrows(mci); @@ -615,9 +837,26 @@ static const struct synps_platform_data zynq_edac_def = { .quirks = 0, }; +static const struct synps_platform_data zynqmp_edac_def = { + .geterror_info = zynqmp_geterror_info, + .get_mtype = zynqmp_get_mtype, + .get_dtype = zynqmp_get_dtype, + .get_eccstate = zynqmp_get_eccstate, + .quirks = DDR_ECC_INTR_SUPPORT, +}; + static const struct of_device_id synps_edac_match[] = { - { .compatible = "xlnx,zynq-ddrc-a05", .data = (void *)&zynq_edac_def }, - { /* end of table */ } + { + .compatible = "xlnx,zynq-ddrc-a05", + .data = (void *)&zynq_edac_def + }, + { + .compatible = "xlnx,zynqmp-ddrc-2.40a", + .data = (void *)&zynqmp_edac_def + }, + { + /* end of table */ + } }; MODULE_DEVICE_TABLE(of, synps_edac_match); @@ -639,7 +878,7 @@ static int synps_edac_mc_probe(struct platform_device *pdev) struct mem_ctl_info *mci; void __iomem *baseaddr; struct resource *res; - int rc; + int rc, irq; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); baseaddr = devm_ioremap_resource(&pdev->dev, res); @@ -673,6 +912,28 @@ static int synps_edac_mc_probe(struct platform_device *pdev) edac_mc_init(mci, pdev); + if (priv->p_data->quirks & DDR_ECC_INTR_SUPPORT) { + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + edac_printk(KERN_ERR, EDAC_MC, + "No irq %d in DT\n", irq); + rc = irq; + goto free_edac_mc; + } + + rc = devm_request_irq(&pdev->dev, irq, + synps_edac_intr_handler, + 0, dev_name(&pdev->dev), mci); + if (rc < 0) { + edac_printk(KERN_ERR, EDAC_MC, "Failed to request Irq\n"); + goto free_edac_mc; + } + + /* Enable UE/CE Interrupts */ + writel((DDR_QOSUE_MASK | DDR_QOSCE_MASK), + priv->baseaddr + DDR_QOS_IRQ_EN_OFST); + } + rc = edac_mc_add_mc(mci); if (rc) { edac_printk(KERN_ERR, EDAC_MC, @@ -684,7 +945,8 @@ static int synps_edac_mc_probe(struct platform_device *pdev) * Start capturing the correctable and uncorrectable errors. A write of * 0 starts the counters. */ - writel(0x0, baseaddr + ECC_CTRL_OFST); + if (!(priv->p_data->quirks & DDR_ECC_INTR_SUPPORT)) + writel(0x0, baseaddr + ECC_CTRL_OFST); return rc; free_edac_mc: @@ -702,7 +964,13 @@ static int synps_edac_mc_probe(struct platform_device *pdev) static int synps_edac_mc_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); + struct synps_edac_priv *priv; + priv = mci->pvt_info; + if (priv->p_data->quirks & DDR_ECC_INTR_SUPPORT) + /* Disable UE/CE Interrupts */ + writel((DDR_QOSUE_MASK | DDR_QOSCE_MASK), + priv->baseaddr + DDR_QOS_IRQ_DB_OFST); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); From patchwork Mon Sep 17 14:25:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 294E1157B for ; Mon, 17 Sep 2018 14:27:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17B5929DCA for ; Mon, 17 Sep 2018 14:27:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BBB629E71; Mon, 17 Sep 2018 14:27:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 876CB29DCA for ; Mon, 17 Sep 2018 14:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GBm73ig61wS7TYX1G/L3r8N5x/akPmrr10dFfmlJ1PA=; b=UPNR7NeONKZKO9 Amai2jgzyavtRpbi9zED0O0Fkc54RcjVdW6byhuVarGrMec3uydDWezQezz62LzlpPFoMgdfdHCP/ ZJPq5Rqp0LFxQcqhPP0o5lhg9x95k8pS3R3c/9WUFu/wZFSFSMrmITGdS2I+kr8KwaECjmAasCPRg lc1XWb+kEVN6ZczQ9aY1xDwEsn6sEs2gA+R0qxGzz+UVYEmTc71PNG/PvVzzYRnXP95UoJ9EaEOFp j0KoUHv/kPwUj4/GmxuO52+boa6pViUTEWGI2jOJzN6ulci/N/5/YpimpbsK/lj7WYMrDx5wZ9HMa BLhfxOORgy7FMAMECqCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uUq-0008PW-UR; Mon, 17 Sep 2018 14:27:29 +0000 Received: from mail-bn3nam01on0045.outbound.protection.outlook.com ([104.47.33.45] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTL-0007j5-5H for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:26:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YMxgXdpaNgAtH53DtPuEZr/rZOAcaWNlw0OvpH0MhTY=; b=3m1k/lxhwC6QPShtBRr9IrhFY88ZmpmY8EiJdHGeGjzku5Z+ChDwcWCXCOY/oR06MCl78+DR8KBTaSrZbqGic9ky0MnzZEwbukHLQhwjJ5Bn0ulO+1KLWHF9h+XFh3OaOAjG20yrTXUyLyvm6zqmWcSWxIGDL+j3sbk8f9EZ3GA= Received: from MWHPR02CA0009.namprd02.prod.outlook.com (2603:10b6:300:4b::19) by BYAPR02MB4471.namprd02.prod.outlook.com (2603:10b6:a03:10::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Mon, 17 Sep 2018 14:25:41 +0000 Received: from SN1NAM02FT057.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by MWHPR02CA0009.outlook.office365.com (2603:10b6:300:4b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.18 via Frontend Transport; Mon, 17 Sep 2018 14:25:41 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT057.mail.protection.outlook.com (10.152.73.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uT6-00056T-7P; Mon, 17 Sep 2018 07:25:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uT1-0005Mt-43; Mon, 17 Sep 2018 07:25:35 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPQi0003537; Mon, 17 Sep 2018 07:25:26 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSr-0005Lk-RA; Mon, 17 Sep 2018 07:25:26 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 0CEE41214B4; Mon, 17 Sep 2018 19:55:25 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 6/7] arm64: zynqmp: Add DDRC node Date: Mon, 17 Sep 2018 19:55:04 +0530 Message-ID: <1537194305-9243-7-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39850400004)(136003)(2980300002)(438002)(189003)(199004)(126002)(14444005)(16586007)(47776003)(426003)(2616005)(81166006)(72206003)(316002)(8676002)(63266004)(90966002)(110136005)(2201001)(44832011)(356003)(446003)(52956003)(11346002)(42186006)(575784001)(54906003)(486006)(305945005)(8936002)(476003)(4326008)(81156014)(6266002)(103686004)(336012)(478600001)(2906002)(26005)(186003)(50466002)(48376002)(7416002)(50226002)(6346003)(5660300001)(36386004)(36756003)(106002)(51416003)(106466001)(6666003)(76176011)(107986001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4471; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT057; 1:hvzA1bupUpFLRZDJx4R20dn80xg60m0nmSxdIhIAwbLbIcrNQ0DVdORXnMaD1hjEXUdDBf+0+7wdzbel9QVPjlRBLxXWeILMoJsAx318M0JddVHLIEzmQzU3/aegh/Sw MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc44858c-e012-44d8-83fa-08d61ca9723f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB4471; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4471; 3:Qo/FI9nxQbMj65+oEX6+0zDh3CvTp5qAbM3C1UMzsg1pwlxIgxz3r4mK1Cy1FQqIGR6sD8urA7IIt0e8Ibpm5HOYFUG57wixSDn6awUcnIJlW50gkFhkvzJpAbzJ8WoPQJhTAEW1hFjSFwCHLVGWRFPRqOKNymfeEV1qEOU/OzNH1lmpSANHj/Ldna/VLrcH59unFJe9QYq1iwI6d6ZXUBv6NfC57XfqukGsm91d1sVAwkqLMZzT0kzWGdg4XbrhsQ6BjLUASUDS69JCapowjeXLOIpATwHDO/34wog5eaYI/8MDZ2bslkIApd0ml3cbE66vdCCUUbit+iW79F9WMT5yfNdKQ3JosEjKh4wSjXg=; 25:UWBN03GgJNEhB0iQTTnwd+ErZViKzgOT1ChuntPo1ikthMfVi57AC1HPxA/+hk9BJZv8srSrZYDKXQJjOLVPVtK8BwWiyfn1AsXVS9ELpcEq1PNm7eVyf0uXuPFcu3nTxgw2VYjwLAbGTlpQdzt7OuRjV7g1UtqvEg1nrFsABKaSKtu9qoIV8pir/+yFLYxiwBYBi0KUN31g+WrbJIYWJFHeJ6LQbfWPDgvUYw28Qr9lK1g+k+acBvhaYEeWXHZhIB4ZpcBOcT9jsQYucXqzwmQj12r2xC8QyKSY1MEHMbK9p7FKWNl2Ga2j7i19kvl8OG9AtKu4boe3EUDHfJVLHw== X-MS-TrafficTypeDiagnostic: BYAPR02MB4471: X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4471; 31:quOFjC2Z9tfzVDaPpcU/QFWpU6uGCdNoLCCyqhzs8gxoCB1DceKgoYfy9n99ffMASXaabVIT3vKjkSvHyj74rbkpsi/zo7cqp3GPkQYLuWqXHQFaaaOzmoBzllBZh5GIPK3X3mCnN/4RinRCuqz6NA89NrmPc8uvYyt8SYsvsR45f/CZ0aFMAhSxJzXwVmQtTv2CDAB/Io+lJoOCKPC0l7LcSiLlgOtNiEVELstp8R4=; 20:Tt/obAhGIPxU2FywbqLLfsS23y4cTBGA+AX7HwG6fCVNeQZfRgDOeZ0rS68PpUzztjIvzaalcRQzauhXi/0JfgROeYEMSU9AtC9jHaBS4TrgLEN7XUkLytsC7Y3v+TG2rUfmMwDAI6P4lJlVDSez5mlVMvNu76p2V+134c6LijkBf8bdlaa5p+Z7RyF02eLZ7YK5pvgYX6OIAK342yXjh94S5mbSq0amkWyeZ5bmejHMiOMfUikbPtGrfMFlrXyRMzQyZ7fm44qBsFJOoTYQP0bamvh365y1D7GmEaGHaGLZFrNhFI7pm31z8RnxkP06x2Y1wVAspZb06i8TZNoRCHdzaN+PPCZVm6va7yBGab4IwDdhqD/F9SeahUcfPrATLcEwa9GQHAH9y6Q8nJyWfJxB8P5G7yxA733RNijqN13asnjxYeEQr5XQX0NB/BOfssb8C/nVwLvNp451v3/mVkoGc183tbNKSaPA1VYq1kLFp+rS1yf/3KEx0qxDVUSl X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050)(76991041); SRVR:BYAPR02MB4471; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB4471; X-Microsoft-Exchange-Diagnostics: 1; BYAP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g9spVyk6NSWdbi3lnn4uY3UlTYP2I17PaNBMo/mrfzWQtnM6JM1igLwqqf48SW65F+5BY+sxReJ8PT4qRqxBDtmejPxBCAe5SCjDAEzuMRZChCUA7HC83ebS0nn4ieO5SwR7DdEk7pa2iVHdBpUW+GpPYyXu3NFSioSJdeS45Ikb/+CF4di7cxb8BiWVrg629c+c0HSKmh0pWeouN4eclSRgXHyMFQ+1PQywTxIDSEMk//I56K1vF6bwM2RAcyNYXxLNUqzZTYAeNsHSoTZCl2seL/xk99DTBebFin1f5RPn7Oig6+0Z9ZXhuCX3n36avVmaUwLQhzbJmo3OlxIQq320OxZnznwMpZP26bUTc7sQYjw6O6vIxhCEqCpAu47CbUj8NXaHowls8wCQrMhh8k7uVsVYfGeziY+V9i6VkUbZDH8lfEl9mJ1JWeMlj9JbXcUcupfnevIIPyGysfU+HaFIPFBb3dGZUPvj0NaQmdUFRGm1bQIU1mr7+rxI8FM8cOawuxdX4wggvzwYqhYzA835bDjc8VZFEGa5IaSzD7m7oHS91XLvGGbH6X2xL7Ln9oIP0E291jXrj24qju0m5n3UgYu9I0Yghyo7Dlbs+zzduQg5S7A== X-Microsoft-Antispam-Message-Info: B5k1UkK6In1TN/8LZAK7mta1n/9K/USp90CB+1wsVuK/bN35E5fNmTNXlgjYGQRlm4i4j0ZDYoZPJHP3TsSEjTmEhgpM9rF+gjJahvRCyIfL1m1QH0ihtY+nPH/PBulaVKQ3zT4U8pGo3bHTSvGN4rAaKdygArFMGkbA0869exEvNNq51nOD053TaJQwr1MES5XGUuUMd6IzS8Ut8Jfz9ikmcl7mLiwhNEvBPq90JXwQcOKwMPk0kXWOO9FcjeZfVdb1phXxO1vos06+sxL5zPNV4BChRx2L6T0ai+NmhR0xdEoOqhp346ubAbSizD0zulEHw+FWapydwrVrzamNgeuIpowZi0qjQyKNb0TWrDk= X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4471; 6:e9ndTV9xwNNNxfab8gSbvzM6VazKSsepcFew+fgSQhBuRSMx9aXoA2VlWGpltddZ0miXTAhO0f3M0+/HZ6utABGmDnduwfWxM3kpS3tI2I6MZT0GoGFc2KaB7Gq2pN9Vd3I88Ym+vNAslrzrr4DmbSPOt3dxffzT0w3fBkl1vgjXU70y0hl+BHtrI8lfTOL8EDB7dNvODjdl0s2MzlsVqjiCd/oJ5xSxmwV7/ZhOMRU8Mee0G4eTEaNZ4DzBO7Va+sObM9UvzGkbeefIhwPa7T4qMGHoeE2jk+266HPv2IxiJulP95ReDFPrZTre8wWJXnXkU2Xh5SeGiGpa9LRIiPMiJawb5hCm2ZhxXnT/rnxH8i7jA3dXbedeAZZmxTDOoBejGyeqey7EeewdkinKK+r4Yp66BwFwotHZHaPZ/icU4pqp9n19ZLY4LxHNS6aI++rHsUHFUY9ucKSm7DNLZg==; 5:Xl+Oj9/a4bTvq/h7GE6c5WgcskXvi9slpvo5YAW2pVoQYIghWOncSxCgUg6WzQfKCsT/Aqih5M4qnOgbpIIPub3oElTiYqjeG4VE6T9QA/uj4Y5CGVCqhN/5GBv9G2rTaFnpfqdJGhIud8fl/LKIdzQj2vGdzk05qfOAnua76hQ=; 7:Bqud6sxX2sKkeu2IFmeY875IyJV5QN3aeUW0bqOHPXnHuhr4CtYZVxUAGrkEkfxkRRGkQ738TFBvKgYv26PEvwwugQTGu+/sdVXwyPNGgdVyjJrt2g9YfCmMDJIFw1jpeRmuHJTSUDiKvJvig+63XdASpn7RZVwddW4Z1MxsJpRf95mirsd8rPCcCrOl2ZiYryDLSE/Q3O4ciTShYFUepFvjA63AYFlwwKNc6T4xrJwuezTDtxnk3YneHkZZ2Wh7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:40.6944 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc44858c-e012-44d8-83fa-08d61ca9723f X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4471 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072555_322660_DD245C8C X-CRM114-Status: UNSURE ( 7.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add ddrc memory controller node in dts. The size mentioned in dts is 0x30000, because we need to access DDR_QOS INTR registers located at 0xFD090208 from this driver. Signed-off-by: Manish Narani --- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index 29ce234..a81d3b16 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -355,6 +355,13 @@ xlnx,bus-width = <64>; }; + mc: memory-controller@fd070000 { + compatible = "xlnx,zynqmp-ddrc-2.40a"; + reg = <0x0 0xfd070000 0x0 0x30000>; + interrupt-parent = <&gic>; + interrupts = <0 112 4>; + }; + gem0: ethernet@ff0b0000 { compatible = "cdns,zynqmp-gem", "cdns,gem"; status = "disabled"; From patchwork Mon Sep 17 14:25:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10602831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A1D4157B for ; Mon, 17 Sep 2018 14:29:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4968A29ED9 for ; Mon, 17 Sep 2018 14:29:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D48929EE2; Mon, 17 Sep 2018 14:29:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C31329ED9 for ; Mon, 17 Sep 2018 14:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hJ9tgoan1Pg5FhWrSX19SZJ4KFM3joLLTGZiP0OFEBU=; b=bfwDXWWGJgdQFv YcfIBRwLJZu4rqb2XNKfNRxk+8KVgYrgdvWJ4mM7+O2Nf2DDsXSybzuS9zy/ZuIkqH/CByS7xVVvr vcYIJ3HLP09kaXIUBBeoj34t5KYWgCGmCjFogEU9Nxw0bGmgZg0+ohe3QYyfTlnGKqAOh+O40exRn sDybs0IMjwbXM1wSNtQGlioQoJ0+gewHfnU7yXjF1pYO9sTI7AJ1E/zzdbI+mFEeO8W35zHf8vVQI +0zgsIR8JA9wnnVOcwrng+pcVqG+BqKqEH0VWWelK2C2T+MJfmfN7hn5lWT1zMhnChfutcowlUKBD bAgb8O0pKTAD230q+Nfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uWK-0000Zu-Rx; Mon, 17 Sep 2018 14:29:01 +0000 Received: from mail-by2nam03on0076.outbound.protection.outlook.com ([104.47.42.76] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1uTL-0007j9-0T for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 14:26:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QZ3NeCBybdN9/05ncCfixJY8fgpgVOMpej2+0X+NoZM=; b=L58t7IqYmwZLgzotKWB1KJqVQer9cEA2bPJ3hetWX6mwwgJKGhqtvhkTHT+ZG7d99qIoMTATMMkaBQM7G74/2LNvB/6Hxaebm9SGGgcUryLWn00nOPB9pLoel9Uu1TucJBS0dnF8KY/4VFN39IaxHOGmqJlMS7OW1NEBTnRcsxU= Received: from CY4PR02CA0031.namprd02.prod.outlook.com (2603:10b6:903:117::17) by BL0PR02MB4756.namprd02.prod.outlook.com (2603:10b6:208:5d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Mon, 17 Sep 2018 14:25:42 +0000 Received: from CY1NAM02FT036.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::207) by CY4PR02CA0031.outlook.office365.com (2603:10b6:903:117::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Mon, 17 Sep 2018 14:25:42 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT036.mail.protection.outlook.com (10.152.75.124) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Mon, 17 Sep 2018 14:25:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36885 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g1uT6-0000sX-Da; Mon, 17 Sep 2018 07:25:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1uT1-0005Mt-A4; Mon, 17 Sep 2018 07:25:35 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8HEPRKD003541; Mon, 17 Sep 2018 07:25:27 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1uSs-0005La-Gu; Mon, 17 Sep 2018 07:25:26 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 2CF12121463; Mon, 17 Sep 2018 19:55:26 +0530 (IST) From: Manish Narani To: , , , , , , , , Subject: [PATCH v7 7/7] edac: synopsys: Add Error Injection support for ZynqMP DDRC Date: Mon, 17 Sep 2018 19:55:05 +0530 Message-ID: <1537194305-9243-8-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> References: <1537194305-9243-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(346002)(136003)(2980300002)(438002)(199004)(189003)(426003)(476003)(5660300001)(50226002)(2906002)(486006)(2201001)(6666003)(36756003)(52956003)(446003)(11346002)(106002)(63266004)(6266002)(8936002)(81166006)(81156014)(126002)(2616005)(51416003)(103686004)(478600001)(72206003)(106466001)(26005)(44832011)(305945005)(110136005)(7416002)(54906003)(186003)(50466002)(42186006)(14444005)(16586007)(8676002)(90966002)(316002)(47776003)(356003)(336012)(76176011)(36386004)(4326008)(48376002)(107986001)(5001870100001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4756; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT036; 1:rUR6nVWWK0QJH76PDLDgbgD5eHW5xK2WQlG8DZplcP8y46HT2q4WHbazO9rDWON6guE5l7mnDt67g21dV/pk7LECQrzTP9vjz6DVYWZ4IH8pnTqN0k8qcKQAGKPM6Oq0 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1218df5a-ac2b-4ffa-70db-08d61ca972bd X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BL0PR02MB4756; X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4756; 3:tpp2XI/nEkj9xWDnBM8RKwNyBUn5v/SlWO3TU6Dhf1/J/MNxJgYTh2SQ/HbpjFaerZ8VtyntsesDzcbLxKipNwDiyy80jkgIEHw8duwj9dE5qxicnhtxa/rX6YXibCeIHdYFhJSWLwMaMmP0VMxuIgSLvUJwt6r5gKb3LfuKpP5b9kP48TfvuHrFT+cSQV2fkteo5ENRFdaz2ny3SwQrIPl9sAx6vaet4MbkIdvJ4fKCWNtNoUZf0oAz0AQY2t57Kfg8TiX31kohfcPoDgICBPclP9sjlNBcYEtToMQ56SFE8DrjKC7dsh8nbcSesdpkRh5k2YG9uRawGGu1+c83H4X3shuu6xrFmvUVJ/w16bY=; 25:BaoGd4h9vrK60jAYpsWu3XLRRtC14IzxXTxhH4vyJXix+t/h1E4C0bHHWK0GP71K4LsDaXTUPy4YYwATbjtjN3FEFISWWDWm59jVysFMwc4aiD1L1MFZyWqohU4hfXq/kWDNw+fumeJesIZ3m5Jk0yFvG/uGqRUEP3hHo0IXwUXucHpj0p8Zrvn+aNOAxmt7b6FXWr5EjKCT9ST1svcYnf+DdV0hASgC7gNiJbXGyvF0FEUd8f4V7y9SWeU1h4NCP7ld2zBNaxXz0GkrwT4oRvyiMugYTMS71kqSO17Zl8kesgaSXbt392waEAc1R56Nk5ktt4JKqX/Bat1jDwT4yA== X-MS-TrafficTypeDiagnostic: BL0PR02MB4756: X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4756; 31:u+WXrF593epNdwbIXYNN1SI0IwbJBF+7r23x1W3/3ysf790EP+ucbc+ccKmK8LjFyhJ37n1rkKgjYk+29FaovnIstBjtGrev6i5eZz1jTAPub8IAPV1/pYRzic1+0vezCutx1zgkRCpdz1q+u1CII6xXIFsCSsQ3adJeDEQBIv8m+Cm73InTAcHiUuGbHS3POwaZDsbL0kPdmMtJJRosILG5b6mg4gzT8/sDz5wrAoQ=; 20:XsZCV+mbGoMd3qYx9wHhFr38BDOfiWJCcAQ3HQJ5A05E9Bm3v2zjAmrCNt13icD19tGc4gkrMdzbNsyAcwvrR8gO+7Ux0ghLea91/c7LpkuvjPhkv8hzvHE5Kcb0WLHQy95A6o9xxPgugcpgV8aSf2j+B7j7SX/7BSXTNz/g/p1+slNCVQVV3xT7lYiXdExVRw3pv5Zn8E/YSE/0pYxLXf1o3qfIQwn3ruWW4M411xCQFnEWxoVtKaNVUoAkGzy6Zr0AE5WJukgjcEBCPc9/5cDhpJBdkl4/h2p6ETaCYYlcubBrSLdJbfA0VXtEXaMQvZgCvrCyktpUpiHUJH3Eaf3YDcFDRiYGQLCv3u+2gKectCJXJzcquU0kDY0/SzOwOIE88JC1+CymOST4Kn4P5uqoc2BtQJtINc8B4V0p87PH8OBoJvrmlJ241qroqmEccVs1H/JRQeke/7cl6cEv4jMV6aG7xJUl8Sij3DNfUgZuDnPpalaKuBVkCEvJsO6P X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(105169848403564); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(10201501046)(93006095)(93004095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050); SRVR:BL0PR02MB4756; BCL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+TA1H/mJsmSwgn7IqDqlnwfwJenlCioiXUJ2XK5yH17GSzvqux3bhM4= X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4756; 6:w81FirT33DptTarWNS2mOeRNP+6hbuAIVaseCXC4/Tr7CUDYlgW4L1L+DI2Y0R9TDlm4iFyljWlDY/etEbIAkdkwqiqefUtNrECbfPb/EaMy5hgr8kXLJOdZC0X3NfKB0nD91ZYXOWHZnofZLjWj6H9PO5xqp36vmiVGg799MFfirR5+vqLNaVMj/rksDaOg9yZyD8tLRP+XlU0XaZb0vuRIGnIeriLhr6dBstLtToM7z9r+63fn7pEog1nzkDGlzwN+bIum5Fr1w8EQMsAbzmx0kH1CeOaBvxFGyLvOQZxtR/sX9Ga9zJVzZ+ZBcswzP2Vx7IT7de0Ebbw+ftXxDm4MDt2HpRkDbuIuRCAlnKpKKd0El/i/6yVIE844iPLY8YqidCo+yHRAT/BoVq5deb8hJZTi3Z/1It7BKKlSGbLDCK93l8LeBN9OvTpK478Fb/loVD2EIZYIl5dNYtU/rw==; 5:GCL1h3iRGcX+DUiox1lBXyvJpQOKkX/SZSV2j8XamvkIL1C+V+Md/BLdBmVzEd98Bay9btT2rcXbpaSgu7PJSc3wm/3zRniGdd5145xZ/8uysTFQQjZwvGUCw87a1C6nG2aQQpKRt6ZA1vvI6bkA7NCLxPsQkYL2Ex1ckk8aDqU=; 7:6catcl3C3iRg0/tFbaWRmXbJpuvM6jN538gAtjXiwu684LEV0t0rIug3e9YsK/a4UtNpi9nI0rrGjS+cq3Ei6uN/xhMQS3dk6w/oZOeIEddJgXmTf7Gxr2eCUK7xfwQBaVa/mbAJG0EpzHG++XvgnuuWJ1VFig9zWlZqEsmgoVPko8DXfJwkfWKzBGLNcWPOSivHCj5InZGMQdMDZg0wERLLtMvf0vgS+8Wtm3okSKOiqtPQFVUAu72BJiZd2O2u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:25:40.8322 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1218df5a-ac2b-4ffa-70db-08d61ca972bd X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4756 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_072555_328031_9F5962AA X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for Error Injection for ZynqMP DDRC IP. For injecting errors, the Row, Column, Bank, Bank Group and Rank bits positions are determined via Address Map registers of Synopsys DDRC. Signed-off-by: Manish Narani --- drivers/edac/synopsys_edac.c | 423 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 417 insertions(+), 6 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 7ab5b9a..177b5c3 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -302,12 +302,18 @@ struct synps_ecc_status { /** * struct synps_edac_priv - DDR memory controller private instance data. - * @baseaddr: Base address of the DDR controller. - * @message: Buffer for framing the event specific info. - * @stat: ECC status information. - * @p_data: Platform data - * @ce_cnt: Correctable Error count. - * @ue_cnt: Uncorrectable Error count. + * @baseaddr: Base address of the DDR controller. + * @message: Buffer for framing the event specific info. + * @stat: ECC status information. + * @p_data: Platform data + * @ce_cnt: Correctable Error count. + * @ue_cnt: Uncorrectable Error count. + * @poison_addr: Data poison address. + * @row_shift: Bit shifts for row bit. + * @col_shift: Bit shifts for column bit. + * @bank_shift: Bit shifts for bank bit. + * @bankgrp_shift: Bit shifts for bank group bit. + * @rank_shift: Bit shifts for rank bit. */ struct synps_edac_priv { void __iomem *baseaddr; @@ -316,6 +322,14 @@ struct synps_edac_priv { const struct synps_platform_data *p_data; u32 ce_cnt; u32 ue_cnt; +#ifdef CONFIG_EDAC_DEBUG + ulong poison_addr; + u32 row_shift[18]; + u32 col_shift[14]; + u32 bank_shift[3]; + u32 bankgrp_shift[2]; + u32 rank_shift[1]; +#endif }; /** @@ -842,7 +856,12 @@ static const struct synps_platform_data zynqmp_edac_def = { .get_mtype = zynqmp_get_mtype, .get_dtype = zynqmp_get_dtype, .get_eccstate = zynqmp_get_eccstate, +#ifdef CONFIG_EDAC_DEBUG + .quirks = (DDR_ECC_INTR_SUPPORT | + DDR_ECC_DATA_POISON_SUPPORT), +#else .quirks = DDR_ECC_INTR_SUPPORT, +#endif }; static const struct of_device_id synps_edac_match[] = { @@ -861,6 +880,380 @@ static const struct of_device_id synps_edac_match[] = { MODULE_DEVICE_TABLE(of, synps_edac_match); +#ifdef CONFIG_EDAC_DEBUG +#define to_mci(k) container_of(k, struct mem_ctl_info, dev) + +/** + * ddr_poison_setup - Update poison registers. + * @priv: DDR memory controller private instance data. + * + * Update poison registers as per DDR mapping. + * Return: none. + */ +static void ddr_poison_setup(struct synps_edac_priv *priv) +{ + int col = 0, row = 0, bank = 0, bankgrp = 0, rank = 0, regval; + int index; + ulong hif_addr = 0; + + hif_addr = priv->poison_addr >> 3; + + for (index = 0; index < DDR_MAX_ROW_SHIFT; index++) { + if (priv->row_shift[index]) + row |= (((hif_addr >> priv->row_shift[index]) & + BIT(0)) << index); + else + break; + } + + for (index = 0; index < DDR_MAX_COL_SHIFT; index++) { + if (priv->col_shift[index] || index < 3) + col |= (((hif_addr >> priv->col_shift[index]) & + BIT(0)) << index); + else + break; + } + + for (index = 0; index < DDR_MAX_BANK_SHIFT; index++) { + if (priv->bank_shift[index]) + bank |= (((hif_addr >> priv->bank_shift[index]) & + BIT(0)) << index); + else + break; + } + + for (index = 0; index < DDR_MAX_BANKGRP_SHIFT; index++) { + if (priv->bankgrp_shift[index]) + bankgrp |= (((hif_addr >> priv->bankgrp_shift[index]) + & BIT(0)) << index); + else + break; + } + + if (priv->rank_shift[0]) + rank = (hif_addr >> priv->rank_shift[0]) & BIT(0); + + regval = (rank << ECC_POISON0_RANK_SHIFT) & ECC_POISON0_RANK_MASK; + regval |= (col << ECC_POISON0_COLUMN_SHIFT) & ECC_POISON0_COLUMN_MASK; + writel(regval, priv->baseaddr + ECC_POISON0_OFST); + + regval = (bankgrp << ECC_POISON1_BG_SHIFT) & ECC_POISON1_BG_MASK; + regval |= (bank << ECC_POISON1_BANKNR_SHIFT) & ECC_POISON1_BANKNR_MASK; + regval |= (row << ECC_POISON1_ROW_SHIFT) & ECC_POISON1_ROW_MASK; + writel(regval, priv->baseaddr + ECC_POISON1_OFST); +} + +static ssize_t inject_data_error_show(struct device *dev, + struct device_attribute *mattr, + char *data) +{ + struct mem_ctl_info *mci = to_mci(dev); + struct synps_edac_priv *priv = mci->pvt_info; + + return sprintf(data, "Poison0 Addr: 0x%08x\n\rPoison1 Addr: 0x%08x\n\r" + "Error injection Address: 0x%lx\n\r", + readl(priv->baseaddr + ECC_POISON0_OFST), + readl(priv->baseaddr + ECC_POISON1_OFST), + priv->poison_addr); +} + +static ssize_t inject_data_error_store(struct device *dev, + struct device_attribute *mattr, + const char *data, size_t count) +{ + struct mem_ctl_info *mci = to_mci(dev); + struct synps_edac_priv *priv = mci->pvt_info; + + if (kstrtoul(data, 0, &priv->poison_addr)) + return -EINVAL; + + ddr_poison_setup(priv); + + return count; +} + +static ssize_t inject_data_poison_show(struct device *dev, + struct device_attribute *mattr, + char *data) +{ + struct mem_ctl_info *mci = to_mci(dev); + struct synps_edac_priv *priv = mci->pvt_info; + + return sprintf(data, "Data Poisoning: %s\n\r", + (((readl(priv->baseaddr + ECC_CFG1_OFST)) & 0x3) == 0x3) + ? ("Correctable Error") : ("UnCorrectable Error")); +} + +static ssize_t inject_data_poison_store(struct device *dev, + struct device_attribute *mattr, + const char *data, size_t count) +{ + struct mem_ctl_info *mci = to_mci(dev); + struct synps_edac_priv *priv = mci->pvt_info; + + writel(0, priv->baseaddr + DDRC_SWCTL); + if (strncmp(data, "CE", 2) == 0) + writel(ECC_CEPOISON_MASK, priv->baseaddr + ECC_CFG1_OFST); + else + writel(ECC_UEPOISON_MASK, priv->baseaddr + ECC_CFG1_OFST); + writel(1, priv->baseaddr + DDRC_SWCTL); + + return count; +} + +static DEVICE_ATTR_RW(inject_data_error); +static DEVICE_ATTR_RW(inject_data_poison); + +static int synps_edac_create_sysfs_attributes(struct mem_ctl_info *mci) +{ + int rc; + + rc = device_create_file(&mci->dev, &dev_attr_inject_data_error); + if (rc < 0) + return rc; + rc = device_create_file(&mci->dev, &dev_attr_inject_data_poison); + if (rc < 0) + return rc; + return 0; +} + +static void synps_edac_remove_sysfs_attributes(struct mem_ctl_info *mci) +{ + device_remove_file(&mci->dev, &dev_attr_inject_data_error); + device_remove_file(&mci->dev, &dev_attr_inject_data_poison); +} + +static void setup_row_address_map(struct synps_edac_priv *priv, u32 *addrmap) +{ + u32 addrmap_row_b2_10; + int index; + + priv->row_shift[0] = (addrmap[5] & ROW_MAX_VAL_MASK) + ROW_B0_BASE; + priv->row_shift[1] = ((addrmap[5] >> 8) & + ROW_MAX_VAL_MASK) + ROW_B1_BASE; + + addrmap_row_b2_10 = (addrmap[5] >> 16) & ROW_MAX_VAL_MASK; + if (addrmap_row_b2_10 != ROW_MAX_VAL_MASK) { + for (index = 2; index < 11; index++) + priv->row_shift[index] = addrmap_row_b2_10 + + index + ROW_B0_BASE; + + } else { + priv->row_shift[2] = (addrmap[9] & + ROW_MAX_VAL_MASK) + ROW_B2_BASE; + priv->row_shift[3] = ((addrmap[9] >> 8) & + ROW_MAX_VAL_MASK) + ROW_B3_BASE; + priv->row_shift[4] = ((addrmap[9] >> 16) & + ROW_MAX_VAL_MASK) + ROW_B4_BASE; + priv->row_shift[5] = ((addrmap[9] >> 24) & + ROW_MAX_VAL_MASK) + ROW_B5_BASE; + priv->row_shift[6] = (addrmap[10] & + ROW_MAX_VAL_MASK) + ROW_B6_BASE; + priv->row_shift[7] = ((addrmap[10] >> 8) & + ROW_MAX_VAL_MASK) + ROW_B7_BASE; + priv->row_shift[8] = ((addrmap[10] >> 16) & + ROW_MAX_VAL_MASK) + ROW_B8_BASE; + priv->row_shift[9] = ((addrmap[10] >> 24) & + ROW_MAX_VAL_MASK) + ROW_B9_BASE; + priv->row_shift[10] = (addrmap[11] & + ROW_MAX_VAL_MASK) + ROW_B10_BASE; + } + + priv->row_shift[11] = (((addrmap[5] >> 24) & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : (((addrmap[5] >> 24) & + ROW_MAX_VAL_MASK) + ROW_B11_BASE); + priv->row_shift[12] = ((addrmap[6] & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : ((addrmap[6] & + ROW_MAX_VAL_MASK) + ROW_B12_BASE); + priv->row_shift[13] = (((addrmap[6] >> 8) & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : (((addrmap[6] >> 8) & + ROW_MAX_VAL_MASK) + ROW_B13_BASE); + priv->row_shift[14] = (((addrmap[6] >> 16) & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : (((addrmap[6] >> 16) & + ROW_MAX_VAL_MASK) + ROW_B14_BASE); + priv->row_shift[15] = (((addrmap[6] >> 24) & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : (((addrmap[6] >> 24) & + ROW_MAX_VAL_MASK) + ROW_B15_BASE); + priv->row_shift[16] = ((addrmap[7] & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : ((addrmap[7] & + ROW_MAX_VAL_MASK) + ROW_B16_BASE); + priv->row_shift[17] = (((addrmap[7] >> 8) & ROW_MAX_VAL_MASK) == + ROW_MAX_VAL_MASK) ? 0 : (((addrmap[7] >> 8) & + ROW_MAX_VAL_MASK) + ROW_B17_BASE); +} + +static void setup_column_address_map(struct synps_edac_priv *priv, u32 *addrmap) +{ + u32 width, memtype; + int index; + + memtype = readl(priv->baseaddr + CTRL_OFST); + width = (memtype & ECC_CTRL_BUSWIDTH_MASK) >> ECC_CTRL_BUSWIDTH_SHIFT; + + priv->col_shift[0] = 0; + priv->col_shift[1] = 1; + priv->col_shift[2] = (addrmap[2] & COL_MAX_VAL_MASK) + COL_B2_BASE; + priv->col_shift[3] = ((addrmap[2] >> 8) & + COL_MAX_VAL_MASK) + COL_B3_BASE; + priv->col_shift[4] = (((addrmap[2] >> 16) & COL_MAX_VAL_MASK) == + COL_MAX_VAL_MASK) ? 0 : (((addrmap[2] >> 16) & + COL_MAX_VAL_MASK) + COL_B4_BASE); + priv->col_shift[5] = (((addrmap[2] >> 24) & COL_MAX_VAL_MASK) == + COL_MAX_VAL_MASK) ? 0 : (((addrmap[2] >> 24) & + COL_MAX_VAL_MASK) + COL_B5_BASE); + priv->col_shift[6] = ((addrmap[3] & COL_MAX_VAL_MASK) == + COL_MAX_VAL_MASK) ? 0 : ((addrmap[3] & + COL_MAX_VAL_MASK) + COL_B6_BASE); + priv->col_shift[7] = (((addrmap[3] >> 8) & COL_MAX_VAL_MASK) == + COL_MAX_VAL_MASK) ? 0 : (((addrmap[3] >> 8) & + COL_MAX_VAL_MASK) + COL_B7_BASE); + priv->col_shift[8] = (((addrmap[3] >> 16) & COL_MAX_VAL_MASK) == + COL_MAX_VAL_MASK) ? 0 : (((addrmap[3] >> 16) & + COL_MAX_VAL_MASK) + COL_B8_BASE); + priv->col_shift[9] = (((addrmap[3] >> 24) & COL_MAX_VAL_MASK) == + COL_MAX_VAL_MASK) ? 0 : (((addrmap[3] >> 24) & + COL_MAX_VAL_MASK) + COL_B9_BASE); + if (width == DDRCTL_EWDTH_64) { + if (memtype & MEM_TYPE_LPDDR3) { + priv->col_shift[10] = ((addrmap[4] & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + ((addrmap[4] & COL_MAX_VAL_MASK) + + COL_B10_BASE); + priv->col_shift[11] = (((addrmap[4] >> 8) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[4] >> 8) & COL_MAX_VAL_MASK) + + COL_B11_BASE); + } else { + priv->col_shift[11] = ((addrmap[4] & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + ((addrmap[4] & COL_MAX_VAL_MASK) + + COL_B10_BASE); + priv->col_shift[13] = (((addrmap[4] >> 8) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[4] >> 8) & COL_MAX_VAL_MASK) + + COL_B11_BASE); + } + } else if (width == DDRCTL_EWDTH_32) { + if (memtype & MEM_TYPE_LPDDR3) { + priv->col_shift[10] = (((addrmap[3] >> 24) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[3] >> 24) & COL_MAX_VAL_MASK) + + COL_B9_BASE); + priv->col_shift[11] = ((addrmap[4] & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + ((addrmap[4] & COL_MAX_VAL_MASK) + + COL_B10_BASE); + } else { + priv->col_shift[11] = (((addrmap[3] >> 24) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[3] >> 24) & COL_MAX_VAL_MASK) + + COL_B9_BASE); + priv->col_shift[13] = ((addrmap[4] & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + ((addrmap[4] & COL_MAX_VAL_MASK) + + COL_B10_BASE); + } + } else { + if (memtype & MEM_TYPE_LPDDR3) { + priv->col_shift[10] = (((addrmap[3] >> 16) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[3] >> 16) & COL_MAX_VAL_MASK) + + COL_B8_BASE); + priv->col_shift[11] = (((addrmap[3] >> 24) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[3] >> 24) & COL_MAX_VAL_MASK) + + COL_B9_BASE); + priv->col_shift[13] = ((addrmap[4] & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + ((addrmap[4] & COL_MAX_VAL_MASK) + + COL_B10_BASE); + } else { + priv->col_shift[11] = (((addrmap[3] >> 16) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[3] >> 16) & COL_MAX_VAL_MASK) + + COL_B8_BASE); + priv->col_shift[13] = (((addrmap[3] >> 24) & + COL_MAX_VAL_MASK) == COL_MAX_VAL_MASK) ? 0 : + (((addrmap[3] >> 24) & COL_MAX_VAL_MASK) + + COL_B9_BASE); + } + } + + if (width) { + for (index = 9; index > width; index--) { + priv->col_shift[index] = priv->col_shift[index - width]; + priv->col_shift[index - width] = 0; + } + } + +} + +static void setup_bank_address_map(struct synps_edac_priv *priv, u32 *addrmap) +{ + priv->bank_shift[0] = (addrmap[1] & BANK_MAX_VAL_MASK) + BANK_B0_BASE; + priv->bank_shift[1] = ((addrmap[1] >> 8) & + BANK_MAX_VAL_MASK) + BANK_B1_BASE; + priv->bank_shift[2] = (((addrmap[1] >> 16) & + BANK_MAX_VAL_MASK) == BANK_MAX_VAL_MASK) ? 0 : + (((addrmap[1] >> 16) & BANK_MAX_VAL_MASK) + + BANK_B2_BASE); + +} + +static void setup_bg_address_map(struct synps_edac_priv *priv, u32 *addrmap) +{ + priv->bankgrp_shift[0] = (addrmap[8] & + BANKGRP_MAX_VAL_MASK) + BANKGRP_B0_BASE; + priv->bankgrp_shift[1] = (((addrmap[8] >> 8) & BANKGRP_MAX_VAL_MASK) == + BANKGRP_MAX_VAL_MASK) ? 0 : (((addrmap[8] >> 8) + & BANKGRP_MAX_VAL_MASK) + BANKGRP_B1_BASE); + +} + +static void setup_rank_address_map(struct synps_edac_priv *priv, u32 *addrmap) +{ + priv->rank_shift[0] = ((addrmap[0] & RANK_MAX_VAL_MASK) == + RANK_MAX_VAL_MASK) ? 0 : ((addrmap[0] & + RANK_MAX_VAL_MASK) + RANK_B0_BASE); +} + +/** + * setup_address_map - Set Address Map by querying ADDRMAP registers. + * @priv: DDR memory controller private instance data. + * + * Set Address Map by querying ADDRMAP registers. + * + * Return: none. + */ +static void setup_address_map(struct synps_edac_priv *priv) +{ + u32 addrmap[12]; + int index; + + for (index = 0; index < 12; index++) { + u32 addrmap_offset; + + addrmap_offset = ECC_ADDRMAP0_OFFSET + (index * 4); + addrmap[index] = readl(priv->baseaddr + addrmap_offset); + } + + /* Set Row Address Map */ + setup_row_address_map(priv, addrmap); + + /* Set Column Address Map */ + setup_column_address_map(priv, addrmap); + + /* Set Bank Address Map */ + setup_bank_address_map(priv, addrmap); + + /* Set Bank Group Address Map */ + setup_bg_address_map(priv, addrmap); + + /* Set Rank Address Map */ + setup_rank_address_map(priv, addrmap); +} +#endif /* CONFIG_EDAC_DEBUG */ + /** * synps_edac_mc_probe - Check controller and bind driver. * @pdev: platform_device struct. @@ -941,6 +1334,20 @@ static int synps_edac_mc_probe(struct platform_device *pdev) goto free_edac_mc; } +#ifdef CONFIG_EDAC_DEBUG + if (priv->p_data->quirks & DDR_ECC_DATA_POISON_SUPPORT) { + if (synps_edac_create_sysfs_attributes(mci)) { + edac_printk(KERN_ERR, EDAC_MC, + "Failed to create sysfs entries\n"); + goto free_edac_mc; + } + } + + if (of_device_is_compatible(pdev->dev.of_node, + "xlnx,zynqmp-ddrc-2.40a")) + setup_address_map(priv); +#endif + /* * Start capturing the correctable and uncorrectable errors. A write of * 0 starts the counters. @@ -972,6 +1379,10 @@ static int synps_edac_mc_remove(struct platform_device *pdev) writel((DDR_QOSUE_MASK | DDR_QOSCE_MASK), priv->baseaddr + DDR_QOS_IRQ_DB_OFST); edac_mc_del_mc(&pdev->dev); +#ifdef CONFIG_EDAC_DEBUG + if (priv->p_data->quirks & DDR_ECC_DATA_POISON_SUPPORT) + synps_edac_remove_sysfs_attributes(mci); +#endif edac_mc_free(mci); return 0;