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+Yf0jiSYDh5RAJypVuWCgvehamLvY8e3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n94ZNd9IXFGEx2NXE+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.