From patchwork Wed Feb 10 19:26:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tthayer@opensource.altera.com X-Patchwork-Id: 8274181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 31A069F3CD for ; Wed, 10 Feb 2016 19:24:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72FCA2039E for ; Wed, 10 Feb 2016 19:24:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EA8F203A4 for ; Wed, 10 Feb 2016 19:24:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTaLu-0003xA-PG; Wed, 10 Feb 2016 19:23:02 +0000 Received: from mail-bn1bon0064.outbound.protection.outlook.com ([157.56.111.64] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTaLi-0003rj-JZ for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2016 19:22:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=altera.onmicrosoft.com; s=selector1-opensource-altera-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jUn3TI0U2m35brQEpO/SicLYZaKXGFzCIvTyUMPXdog=; b=WOHEwsCESjsRncjux1+2G2o0oeO5n5UVPsrie2YqkvXioB+BqBv3dYZEhQmnZfu3bGgAT70ILjh7hn8QPWpkrdVFkLCkih1GnzXuLBY69VE/cDSw8FFB5Ut7z2FWRqE/esuntoSIMpSIgvScfibTLMKICdGeDm3U8OELkgIFsKw= Received: from BLUPR0301CA0007.namprd03.prod.outlook.com (10.162.113.145) by CY1PR0301MB2025.namprd03.prod.outlook.com (10.164.2.19) with Microsoft SMTP Server (TLS) id 15.1.403.16; Wed, 10 Feb 2016 19:22:18 +0000 Received: from BN1BFFO11FD019.protection.gbl (2a01:111:f400:7c10::1:110) by BLUPR0301CA0007.outlook.office365.com (2a01:111:e400:5259::17) with Microsoft SMTP Server (TLS) id 15.1.403.16 via Frontend Transport; Wed, 10 Feb 2016 19:22:17 +0000 Authentication-Results: spf=fail (sender IP is 66.35.236.227) smtp.mailfrom=opensource.altera.com; vger.kernel.org; dkim=pass (signature was verified) header.d=altera.onmicrosoft.com; vger.kernel.org; dmarc=none action=none header.from=opensource.altera.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.altera.com does not designate 66.35.236.227 as permitted sender) receiver=protection.outlook.com; client-ip=66.35.236.227; helo=sj-itexedge03.altera.priv.altera.com; Received: from sj-itexedge03.altera.priv.altera.com (66.35.236.227) by BN1BFFO11FD019.mail.protection.outlook.com (10.58.144.82) with Microsoft SMTP Server (TLS) id 15.1.409.7 via Frontend Transport; Wed, 10 Feb 2016 19:22:17 +0000 Received: from na01-bn1-obe.outbound.protection.outlook.com (207.46.163.145) by webmail.altera.com (66.35.236.227) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 10 Feb 2016 11:21:24 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=altera.onmicrosoft.com; s=selector1-opensource-altera-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jUn3TI0U2m35brQEpO/SicLYZaKXGFzCIvTyUMPXdog=; b=WOHEwsCESjsRncjux1+2G2o0oeO5n5UVPsrie2YqkvXioB+BqBv3dYZEhQmnZfu3bGgAT70ILjh7hn8QPWpkrdVFkLCkih1GnzXuLBY69VE/cDSw8FFB5Ut7z2FWRqE/esuntoSIMpSIgvScfibTLMKICdGeDm3U8OELkgIFsKw= Authentication-Results: alien8.de; dkim=none (message not signed) header.d=none;alien8.de; dmarc=none action=none header.from=opensource.altera.com; Received: from localhost.localdomain (64.129.157.38) by CY1PR03MB1485.namprd03.prod.outlook.com (10.163.17.158) with Microsoft SMTP Server (TLS) id 15.1.403.16; Wed, 10 Feb 2016 19:22:12 +0000 From: To: , , , , , , , , , , Subject: [PATCHv10 1/4] EDAC, altera: Add Altera L2 Cache and OCRAM EDAC Support Date: Wed, 10 Feb 2016 13:26:21 -0600 Message-ID: <1455132384-17108-1-git-send-email-tthayer@opensource.altera.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: CY1PR14CA0031.namprd14.prod.outlook.com (25.163.13.169) To CY1PR03MB1485.namprd03.prod.outlook.com (25.163.17.158) X-MS-Office365-Filtering-Correlation-Id: 7237129b-6338-4c21-e34e-08d3324f7d6b X-Microsoft-Exchange-Diagnostics-untrusted: 1; CY1PR03MB1485; 2:RwyRIilLz6pwwBA8aoZpQAK8h8v/R3i7AVzbe/Y9R+Z+bgKlLKLqAWvno6xwn5InQHjJrygBM//Uz2z+klae1N3sAUvvnaScofY2NMe3RtJrsYyemV82gGtw3I6kz0BSyzAFQpPI2zd5XkaUr8mnffbyiKg7tJfN9VBEgLkWEFCM/ksGAA/qpxFaFpsIPRws; 3:3suNeZK/i0C80bst+n2cyZycegZnDPzoanbzWvFtVWJqloDM0OJbokwljpUaUeJS2Kq4A5dVvOf57XPmPEf1mJRc5ajJyewc2mQKbS4sNkh4765ffI5O5VOljJsrAneq; 25:nsN5rUXCNI7bu95GPXt5trzL/yNSY4w+WMw1x5t1kQTV4ICTpM2p/QA1OH7IkWulazF3IYj2Pgl1zmQxCt2zBpG07I7Ue4hlW0abyC+oGlUxUAW4MyN52ao12EC4SYfSCbN53AwfAkn2KFY4vlimcM3QJEdSP16bYwKVkE5JR4uWN2YOXf2Tykhc/7IaS8Qv+mPJZRY1PJ2FnWRgE3Ahdx9x6g6RNF9BAvwufEnaaQdFAHzjVEWH8S+F3ubaEV1AOE9hIzohJ6hiX2FQEulnMKzzAmTFHd59uMpDox2N+M1aqwo+uqoUBnSa8MurffKy; 20:yMnrf5/cccJ5d1+9FU1Ybw00r03ltsvRVOZ47w0sq0HjQ9OGwniuIVS/BBGFeZsA7H4iwezBGfOYF3mqqewjBgL8bBeQrkFdIgviQJ4YbcXTgn6fBJOdzR5xksHPR7WizfzJuurkisQZCDhEp19J3vi8BCKjVhoCN4tj7Jv6OV4= X-Microsoft-Antispam-Untrusted: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1485; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(80048183373757); UriScan:(80048183373757); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR03MB1485; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1485; BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13023025)(13015025)(5005006)(13017025)(13018025)(13024025)(3002001)(10201501046); SRVR:CY1PR0301MB2025; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB2025; X-Microsoft-Exchange-Diagnostics-untrusted: 1; CY1PR03MB1485; 4:4vRMkzirkZhXP7EZag6D3m9F37TIE3VhENDhxFhWz+qX6eMHcJFpYEeXibIho6V5FPUD6SqLdEdSRPyll/up93fDIQC4r2Qa5xYj6BRC93kb9fVW+Se6HP4ar30ylTkapIXFvtOXYYmxicSDB4jo2GZ8CQR+IqcNq8CQG3iu7L5CSQ/oqqKj85AI25P2xU+APka5DbcrGHqcPSzPLCk3dcLR+8EUnJ55i3MGDjdofCFCgYGiWW+IuvrQ9SiUqKH/YtzdWuJL3lwS1cPDRhjVw4JyF0HqvfDELuP2qtrmKnPghJLjEVB3Z/jhp7X9Br77MmH0NETsTOz2L1vZx9fpc+qNn1E2FvQc1ZQRpIWQyXuQbRAL0EvrsLqzorPYlJ6xvfzNNR7UnH0T3m6RqyurU+CPp3RdmWZlmsDksuDXR6g= X-Forefront-PRVS: 0848C1A6AA X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(33646002)(92566002)(50226001)(66066001)(1096002)(189998001)(77096005)(87976001)(4326007)(2906002)(40100003)(5001960100002)(42186005)(5008740100001)(2876002)(107886002)(3846002)(5004730100002)(5003940100001)(229853001)(4001430100002)(48376002)(50466002)(50986999)(586003)(19580405001)(19580395003)(122386002)(47776003)(5001770100001)(6116002)(86152002)(2201001)(86362001)(921003)(1121003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB1485; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?us-ascii?Q?1; CY1PR03MB1485; 23:rGHrAf1tN1iYJnfghqDeem74D+qoDymUOFkMq1Ilm?= =?us-ascii?Q?vV0+0IVE7zb9DYRLJSi+dfQ24l14IjJtk8YWVydBpJt4GXBoFIlJQWQg+9dB?= =?us-ascii?Q?soy7H0zMwxYrtS9gLM6Q0Aws2kLuZYBFKyc/XRkMk6S9b7uGEsdGadX9MY7N?= =?us-ascii?Q?ujsNYROYPJYZYMNLz8k7+qcTwZK+GzAmeX+2bxdmmDGy4NP2dQFGPEa2BHZl?= =?us-ascii?Q?vUdoe237AWc7z2CiCAhUNrP7PtCdIiG86Q4W6afOtc5TWfeEKYf5igiPthSt?= =?us-ascii?Q?kfuWJWoalywmDAgIWVNQPVKc+/pME+p4uhz8QAAlXLhUYJ5v5fe0nNwjBz0W?= =?us-ascii?Q?xuNyIDV7F/GJiSho/VhrCZrH6iIB7HdYdbYvyKgIfuOJjyBZYIww/NZ311GX?= =?us-ascii?Q?7/Y4R2/A7I0c/9dyH6F9wPMlr1QOKZkjBJI31VG7qvJkdi5eKQ65/DeKZDYn?= =?us-ascii?Q?BpYQiL3j8Hxrdy0SuSJPkdrzWr4kaf5GDQyPmPaC2+ev+6YKHMaI1r8RazV6?= =?us-ascii?Q?hO1407PUDqYvkGrofyAUZvidHquuOxpzOmM+IuflVjOjpB1KW0+hNHSZY+un?= =?us-ascii?Q?5gmQKJjFPWpGDLB3cNdKyrNPCZpTmdo8GnMmlq5c8GuqfLGLVxVnIwqU0Nx2?= =?us-ascii?Q?mvkfFiqGJv6S2f0zYfMlC9unrKJoMs0RODNctqrR+xhOBb3nTiRa0+NB+Xk2?= =?us-ascii?Q?GHYQKpq2ItIhB+unDOwZSRDlWSLMnBQTPyLRqH8LDlXy172YseSC4aB2aFJD?= =?us-ascii?Q?m6GAUuavr0V3I3I22yKiATrlUanAvJCC4juUiu5hrEziU+LIg7jvuaj/pSiG?= =?us-ascii?Q?JYi7klm4rZYEp7j/7os62LQ7t3EizJBt2ky3bs1dkB7eMmg27yscbqLBzJn+?= =?us-ascii?Q?LDsp1NOpoD5BezngmUWDF1mPH9eLklj9Lc3r1VmBKNGbXEALZt+aeLPTU+Wz?= =?us-ascii?Q?aR2yAhdqt2GGmVVPDWIw4pHn4CX5icehn6+Sz6I8ISYDudsQ+VRH43iEt249?= =?us-ascii?Q?JZXoeOwLV7Pyhc6RspqoLYXxbR6nEBjdoukr5czSWhp0AQrgb8Q1PxTw8TXe?= =?us-ascii?Q?frlM6g=3D?= X-Microsoft-Exchange-Diagnostics-untrusted: 1; CY1PR03MB1485; 5:uHY6yVVYfvbFR1bvm4Pg1zbl9Cvks9n4uxgt0zAolOD6WIZciJWoisy2omgnydyiSerBk9GYXcKeFuuhC4+uXVLPBqC77P/hCr6EBjv+N+otSm8ikEsF/4EG/M5twhpVhW1v1FAF35wpK2mPI479dA==; 24:skeoHa2xcToLsaZyR/bDplvlLUSh0r/GX1vMou7GNJUNP6KeD4X2JRXkU6aiDnM+IzR0Nv2AfaRWgnC8GxVeyvkKpkSPDHXIyuf3hfq1SZY=; 20:gqkNVnT24X+thikWN30Jtgxznth2kf+Je8dOnZmZ2c/TMRZsdOgbs/Ep9YbZG8vJ1KjHs+OBfaiWl5nA81GZ27iQEBX4icdv/P746LjyRQnpWHCgDfXgaICHgTcwI7HQFFxiCzC7mHVyWE6mvcJ0ubTx8XCAsAKufYgibZxi6cs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1485 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1BFFO11FD019.protection.gbl X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD019; 1:LZjhNnLFBaz4AGePs1aRKOaHp7+6lLmwtK8JgHTcMEnaW/Ujr7CKvD25Jf7DhzefnhdJUY15cSU7mVQ6NscbTRW68AqqAdzcdIZKYUhewtFTepP/nlGpyaRKutFM9OMjYaqHqKuHm6ztkKS3Lwqtj66b38qgUV0EFaRtg1bSV2jNgGc1U0VtWIabXPLRdQVhMlDQN7mD0UuLY1R68M2mDL6bnSINomzsvNdUGIS6P+Y69gvVi59CMCDBihYnZItqbpP2bYkLJBsxhG4yIq18CQzCYIZPal8ATxr6F75mbp7x0I0t1ukLyjFK9cBslAaB7lmU/U2Benmyr8S5dfCOeVA/EL7Z8pKi2lN5e6xou+2IGXa5YkoodL6kf9YFAcitPQNCViu2+aAlXlN5gCdsvSBab/cmKe5Ifun/+K9p0FcyMulQnZDDIAd5viLTa/C5EatnGxdCQeurtfTrw+xDwg== X-Forefront-Antispam-Report: CIP:66.35.236.227; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5003940100001)(4001430100002)(77096005)(16796002)(85426001)(1220700001)(19580395003)(86152002)(2201001)(50466002)(586003)(19580405001)(50986999)(107886002)(189998001)(1096002)(86362001)(5001770100001)(2906002)(5001960100002)(48376002)(3720700001)(3846002)(6116002)(92566002)(50226001)(2876002)(49486002)(4326007)(47776003)(21840400001)(106466001)(33646002)(5004730100002)(105606002)(11100500001)(5008740100001)(122386002)(6806005)(66066001)(40100003)(229853001)(956001)(87936001)(7099028)(921003)(1121003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2025; H:sj-itexedge03.altera.priv.altera.com; FPR:; SPF:Fail; MLV:sfv; A:0; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2025; 2:LSGCEV7DXoCGaFWuJqXYKUTd9qvXYAWlGKGY35pVpl2QZa9pFCEq9CMQoZKCWhk8nNPKijECdbkOtzPe4Ea2m7X7QSNWnefOTzd/7ks2VzCnRg7nzgPv7OhE0wSgG+MoT4aa2xsy2i6+aMnFTtKUgR1JDv/7jcPOT6aOSD1kbstwXnxxemQyiWpePKcb644G; 3:NXpcEjTD5ZwUEoc1ogVuqC3TEC6qeFlNn/xFdQgZcbunaGrZSQTJXXl600jjm6BlwriamcqMU4HVGyLEfFVVOYD9L7QEo4W724DCfur0uakUVMbnVYeiOTVWnJcswRo9eK7476wLl2rCj+iyp1d0ao//UUyzFTAaHYUb8/pR1Iq2nxYOjTV78cTjfKbQf3NdIawcv1ijsIgbfw70qM8XIDGOzz1ubKqt56de+6H3L6b3zDo+atrE0wQw9grprp+2; 25:+pIdUDwRcDgsl9gB5m7bCRTQPBOf0SwOTFptwgRpgYQxesPh+CDBPahkOu/jb02hNcaYiucdU6uDI0jI9w+sqMnDlFSBYKBOW58MvjLu3DUG4a35x5/FnGfmePHoLcj4gUtUUxL1MltFpjPF2b3usKOyZyiGRwTU/VMeAPfK9VW0r7MjIetyMKW2sjLwO1p3O9VjK9rzdObSZm76oNj9KZFJchcB20USvR8nkWAynBSkbmNCXUu0hZz5u/z+08F28UnHnng1pDqzjMN0pcdAaeP3VAbRKhxTVgWbSg/GyrAqIgRV0jqL3Enxpq0gzq8v; 20:GkNmh8tZBtRgBRc8pzmVdEdhcQwssLrtsIPb7VqP7UhqZdg9+Pmei89PgAYIBcQi569yeO4CyZB3fHyEuV3bzCSzRmlp4r6zy106rQm+DXtazhYKrAAlU1G63yRcKhzEHzSKglFXIJayWIyYJ6Kq6UUpK5z5qrwNUsEUKY0rzRQ= X-DkimResult-Test: Passed X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(3001016); SRVR:CY1PR0301MB2025; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2025; 4:VTmAoiSjA0P48jyx3dJ2dDirmASkCNkiTK/ggCp6uLZpxRTXK7pND55e+XfDY6o8dBkQan//jAtiBHgQhiYMuYd0X4mf6UsAR+nV6FPjsv/7npWWMnk3wZP5gqoZ/mO7pZ/fq+XXfW2gSC3T3/m6GuE0IUq7YPJi7uczqyaFp13w/8t3VwvfgbGN1nwdyGN2v6LzpGBIRzrMBoVvZdHnpNz0hBtKjSKnpnE8OCmevjMnibsJcRUXgUHBsjaTaqkfpp0z9QJ2nptKcGD/CJk4UA4be3cz9h8uUwMEb7tRQ1TMN/37RCvQ2YAlBuW73CRtVbyDMR0kkEftTZyQTyOGKkCDLu/DxHdeWUWy8oZxxyYcjE7yUXe9cRXHnuesjtIkQ/jHbBYHxDWMrNGbEGVyXd9TTL2rtDDpPkl0oTDvJ+cbPcV2DGJf3SM2/fa0B5FyX8eSiEs/CStP6SLEqTPYIgDH9gCcLW/RX7zoU7flECrk1f4p65g/30UDZpagwbvv X-Forefront-PRVS: 0848C1A6AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2025; 23:DeMJ9SENrLVNKxmi2S/Tc9tTuZQH8ShcGi/rEBh?= =?us-ascii?Q?97bIRe5RHMgMRoEid/Neyhe9ttjAeH0xWGyIzorZLs5BMy/QH4k7dXsu77Vq?= =?us-ascii?Q?fiappa6uykGe8ScR9AYeqhADgdj30HPRC9W8m/+sdnFGRZpYRN+itGEw9KWp?= =?us-ascii?Q?LllU+zz0dj0sQccXF53uSqAOnaz7HpHTG5y3NUPXLtY7adV/PrfaGDlgxrHV?= =?us-ascii?Q?OsY5qfHpgKUpL/aBYN5QM5ONvvzOlbEKNtQQV2/HH3qPRfQado77+f8Ew3OR?= =?us-ascii?Q?LC9mx6NufEpZ1k+JSd7pdk/kYL6x6Oe3iPzfOhIrgA2u4WNLyNOWusvXoYj6?= =?us-ascii?Q?PvG7JcR24O/MwSxyEJaSB0Ex0eEipjOWukhHQjcX78h/q1sigENouO3tQuD1?= =?us-ascii?Q?Trpl6qp4ViLYBdhj3T0MZIJRzzov54XduNj5SlmcUt86v+j8fxna2ylsxYrm?= =?us-ascii?Q?h0vjyU+WkPHijejQJoqCyKPCSAXl68kySTaUJKwMuripl0tmpEzNzVH5cdsz?= =?us-ascii?Q?T6iRHZnZgdzohiBKBG8zk3twtuZoKYq3v7hmnAVXt1HZQ0pn+NPBLgsHH7bt?= =?us-ascii?Q?wF/GrMh4fRE51GfFgXz9CeqwTxVcbojAPmQYlX9HMjigd88uyRFoZpD61tC3?= =?us-ascii?Q?QAcrPbNqhNYrBxfxUZgQMhu2F1Lh5pD3zTg2jMbLJJq+qxO7X+6GQbGZgTz7?= =?us-ascii?Q?IWPEh9XsUHhJgx8LlGCrwEudPah1hjyvTQLlSy1mkY9rBIzb6+7SqMKGhIj5?= =?us-ascii?Q?hN367yamvIf0V4Akb3myQGmoI8kFetB2tdBzfcjH/Bi4grPei4upSvw5bud1?= =?us-ascii?Q?7g3RkAA4IE52FVLwPc9BZAWXG+U+nvgjsroWn4aRDODVRZrG7O4Wma/v2cYz?= =?us-ascii?Q?IZzTbIo9MdejzJoIeFxxHr3D46mCpRbpEunEpJ9PKLsQYC+YiG6lSjNhRuUY?= =?us-ascii?Q?EpvJDFZvxw44liNjvU9w+YT1QCJ5j/CDKZqRzSTsmYxHk+VPo1kc7/lBdRK0?= =?us-ascii?Q?SYftIUJpvrZ07QRuGyAtROABab1UhIVh4yWOYerSgqd1w/XYOwQxkUciz3bR?= =?us-ascii?Q?wUMw80fWQRDicpbwf+rW9aNVqUK31zIJfbbmWM7hKC1nPDq5+MCmIKCbOVMu?= =?us-ascii?Q?ohV0qqGLbe/FrC7X8Safh2hMP8LpwaNR4UwBX4O9PLaCIDKDvzF8nqPwnBye?= =?us-ascii?Q?usxBq3LzQsgE8sqHdEGCKCPP9Kbo3jv9JV2XLovV6zYNQvZJiHaxRm/D4C9x?= =?us-ascii?Q?A5rQFK63nrYFIp06ttt3hk6NhYEJNsnYMSol+s7X2jIeFbSef8h0AdhVxzZW?= =?us-ascii?Q?R+6KObXAQXbgPx5r8U1lbNRAXUvCEc0gIY4M3f5mNTzKmz6lHPH9gZJFhc5B?= =?us-ascii?Q?qNzB/+Oiho69JWb0mDbJS5dcSlXMGYfUc3g8VcoevLN8Qyej0?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2025; 5:afiU2cA8h8AouwbQobMvWeS9NK7n+f00QCedl/WR3LEj2KSWJ5WU8waYauE9oeCjQuKs2AkptlLDMpCyVGCnhQMQ6a0dpV891JZ0wszGS2MES9fOn6XS0jkfsjgszfYOr77XzNuSxzBYCNps7M1l3A==; 24:W8TI8lFMUavW1zqK5gQz+PocnGfMtkExf/EFixH76AiguqNGZoy0y6T38+09n2s/ikWNL4UeIOc8A2+2h2raTGM1q/kV98CCJ7v/RPA88l8=; 20:bXuutZVmV/FRShBeiMgnU6NmefaHf1/Y2jOOoU5frHHmK4vZzzI4YII+0h7yaEMmhvrMYc4EI5ZFODYxI6zPo47jz275228Qk/diOZh3mx7rAzb2wxMjbE7RWn5Pxrw+GUsbs1h+NVve0oadyTWfR5IFkmqJ32EZYlAyjEjr2IY= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2016 19:22:17.2563 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a; Ip=[66.35.236.227]; Helo=[sj-itexedge03.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB2025 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160210_112251_043181_C612DE3A X-CRM114-Status: UNSURE ( 4.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tthayer.linux@gmail.com, tthayer@opensource.altera.com, 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-Spam-Status: No, score=-4.3 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thor Thayer Adding L2 Cache and On-Chip RAM EDAC support for the Altera SoCs using the EDAC device model. The SDRAM controller is using the Memory Controller model. Each type of ECC is individually configurable. Signed-off-by: Thor Thayer --- v10: Changes noted by maintainer included: Fix tear-down of debugfs error path- remove specific device debugfs dirs. Addition of warning if neither IRQ triggered. Cleanup of comments. Better function naming. Cleaner alloc functions. v9: Improve device tree node release. Free managed resources on error path. Fix ocram memory leak. v8: Remove MASK from single bit mask names. s/altr,edac/altr,socfpga-ecc-manager Use debugfs instead of sysfs. Add chip family name to match string. Fix header year. Fix build dependencies & change commit accordingly. s/CONFIG_EDAC_ALTERA_MC/CONFIG_EDAC_ALTERA v7: s/of_get_named_gen_pool/of_gen_pool_get Remove #ifdef for EDAC_DEBUG Use -ENODEV instead of EPROBE_DEFER v6: Convert to nested EDAC in device tree. Force L2 cache on for L2Cache ECC & remove L2 cache syscon for checking enable bit. Update year in header. v5: No change. v4: Change mask defines to use BIT(). Fix comment style to agree with kernel coding style. Better printk description for read != write in trigger. Remove SysFS debugging message. Better dci->mod_name Move gen_pool pointer assignment to end of function. Invert logic to reduce indent in ocram depenency check. Change from dev_err() to edac_printk() Replace magic numbers with defines & comments. Improve error injection test. Change Makefile intermediary name to altr (from alt) v3: Move OCRAM and L2 cache EDAC functions into altera_edac.c instead of separate files. v2: Fix L2 dependency comments. --- drivers/edac/Kconfig | 26 ++- drivers/edac/Makefile | 2 +- drivers/edac/altera_edac.c | 492 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 512 insertions(+), 8 deletions(-) diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index ef25000..37755e6 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -367,14 +367,30 @@ config EDAC_OCTEON_PCI Support for error detection and correction on the Cavium Octeon family of SOCs. -config EDAC_ALTERA_MC - bool "Altera SDRAM Memory Controller EDAC" +config EDAC_ALTERA + bool "Altera SOCFPGA ECC" depends on EDAC_MM_EDAC=y && ARCH_SOCFPGA help Support for error detection and correction on the - Altera SDRAM memory controller. Note that the - preloader must initialize the SDRAM before loading - the kernel. + Altera SOCs. This must be selected for SDRAM ECC. + Note that the preloader must initialize the SDRAM + before loading the kernel. + +config EDAC_ALTERA_L2C + bool "Altera L2 Cache ECC" + depends on EDAC_ALTERA=y + select CACHE_L2X0 + help + Support for error detection and correction on the + Altera L2 cache Memory for Altera SoCs. This option + requires L2 cache so it will force that selection. + +config EDAC_ALTERA_OCRAM + bool "Altera On-Chip RAM ECC" + depends on EDAC_ALTERA=y && SRAM && GENERIC_ALLOCATOR + help + Support for error detection and correction on the + Altera On-Chip RAM Memory for Altera SoCs. config EDAC_SYNOPSYS tristate "Synopsys DDR Memory Controller" diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile index be163e2..f9e4a3e 100644 --- a/drivers/edac/Makefile +++ b/drivers/edac/Makefile @@ -67,6 +67,6 @@ obj-$(CONFIG_EDAC_OCTEON_L2C) += octeon_edac-l2c.o obj-$(CONFIG_EDAC_OCTEON_LMC) += octeon_edac-lmc.o obj-$(CONFIG_EDAC_OCTEON_PCI) += octeon_edac-pci.o -obj-$(CONFIG_EDAC_ALTERA_MC) += altera_edac.o +obj-$(CONFIG_EDAC_ALTERA) += altera_edac.o obj-$(CONFIG_EDAC_SYNOPSYS) += synopsys_edac.o obj-$(CONFIG_EDAC_XGENE) += xgene_edac.o diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 9296409..63e4209 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1,5 +1,5 @@ /* - * Copyright Altera Corporation (C) 2014-2015. All rights reserved. + * Copyright Altera Corporation (C) 2014-2016. All rights reserved. * Copyright 2011-2012 Calxeda, Inc. * * This program is free software; you can redistribute it and/or modify it @@ -17,8 +17,10 @@ * Adapted from the highbank_mc_edac driver. */ +#include #include #include +#include #include #include #include @@ -34,6 +36,7 @@ #define EDAC_MOD_STR "altera_edac" #define EDAC_VERSION "1" +#define EDAC_DEVICE "Altera" static const struct altr_sdram_prv_data c5_data = { .ecc_ctrl_offset = CV_CTLCFG_OFST, @@ -75,6 +78,31 @@ static const struct altr_sdram_prv_data a10_data = { .ue_set_mask = A10_DIAGINT_TDERRA_MASK, }; +/************************** EDAC Device Defines **************************/ + +/* OCRAM ECC Management Group Defines */ +#define ALTR_MAN_GRP_OCRAM_ECC_OFFSET 0x04 +#define ALTR_OCR_ECC_EN BIT(0) +#define ALTR_OCR_ECC_INJS BIT(1) +#define ALTR_OCR_ECC_INJD BIT(2) +#define ALTR_OCR_ECC_SERR BIT(3) +#define ALTR_OCR_ECC_DERR BIT(4) + +/* L2 ECC Management Group Defines */ +#define ALTR_MAN_GRP_L2_ECC_OFFSET 0x00 +#define ALTR_L2_ECC_EN BIT(0) +#define ALTR_L2_ECC_INJS BIT(1) +#define ALTR_L2_ECC_INJD BIT(2) + +#define ALTR_UE_TRIGGER_CHAR 'U' /* Trigger for UE */ +#define ALTR_TRIGGER_READ_WRD_CNT 32 /* Line size x 4 */ +#define ALTR_TRIG_OCRAM_BYTE_SIZE 128 /* Line size x 4 */ +#define ALTR_TRIG_L2C_BYTE_SIZE 4096 /* Full Page */ + +/*********************** EDAC Memory Controller Functions ****************/ + +/* The SDRAM controller uses the EDAC Memory Controller framework. */ + static irqreturn_t altr_sdram_mc_err_handler(int irq, void *dev_id) { struct mem_ctl_info *mci = dev_id; @@ -504,6 +532,466 @@ static struct platform_driver altr_sdram_edac_driver = { module_platform_driver(altr_sdram_edac_driver); +/************************* EDAC Parent Probe *************************/ + +static const struct of_device_id altr_edac_device_of_match[]; + +static const struct of_device_id altr_edac_of_match[] = { + { .compatible = "altr,socfpga-ecc-manager" }, + {}, +}; +MODULE_DEVICE_TABLE(of, altr_edac_of_match); + +static int altr_edac_probe(struct platform_device *pdev) +{ + of_platform_populate(pdev->dev.of_node, altr_edac_device_of_match, + NULL, &pdev->dev); + return 0; +} + +static struct platform_driver altr_edac_driver = { + .probe = altr_edac_probe, + .driver = { + .name = "socfpga_ecc_manager", + .of_match_table = altr_edac_of_match, + }, +}; +module_platform_driver(altr_edac_driver); + +/************************* EDAC Device Functions *************************/ + +/* + * EDAC Device Functions (shared between various IPs). + * The discrete memories use the EDAC Device framework. The probe + * and error handling functions are very similar between memories + * so they are shared. The memory allocation and freeing for EDAC + * trigger testing are different for each memory. + */ + +const struct edac_device_prv_data ocramecc_data; +const struct edac_device_prv_data l2ecc_data; + +struct edac_device_prv_data { + int (*setup)(struct platform_device *pdev, void __iomem *base); + int ce_clear_mask; + int ue_clear_mask; + char dbgfs_name[20]; + void * (*alloc_mem)(size_t size, void **other); + void (*free_mem)(void *p, size_t size, void *other); + int ecc_enable_mask; + int ce_set_mask; + int ue_set_mask; + int trig_alloc_sz; +}; + +struct altr_edac_device_dev { + void __iomem *base; + int sb_irq; + int db_irq; + const struct edac_device_prv_data *data; + struct dentry *debugfs_dir; + char *edac_dev_name; +}; + +static irqreturn_t altr_edac_device_handler(int irq, void *dev_id) +{ + irqreturn_t ret_value = IRQ_NONE; + struct edac_device_ctl_info *dci = dev_id; + struct altr_edac_device_dev *drvdata = dci->pvt_info; + const struct edac_device_prv_data *priv = drvdata->data; + + if (irq == drvdata->sb_irq) { + if (priv->ce_clear_mask) + writel(priv->ce_clear_mask, drvdata->base); + edac_device_handle_ce(dci, 0, 0, drvdata->edac_dev_name); + ret_value = IRQ_HANDLED; + } else if (irq == drvdata->db_irq) { + if (priv->ue_clear_mask) + writel(priv->ue_clear_mask, drvdata->base); + edac_device_handle_ue(dci, 0, 0, drvdata->edac_dev_name); + panic("\nEDAC:ECC_DEVICE[Uncorrectable errors]\n"); + ret_value = IRQ_HANDLED; + } else { + WARN_ON(1); + } + + return ret_value; +} + +static ssize_t altr_edac_device_trig(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) + +{ + u32 *ptemp, i, error_mask; + int result = 0; + u8 trig_type; + unsigned long flags; + struct edac_device_ctl_info *edac_dci = file->private_data; + struct altr_edac_device_dev *drvdata = edac_dci->pvt_info; + const struct edac_device_prv_data *priv = drvdata->data; + void *generic_ptr = edac_dci->dev; + + if (!user_buf || get_user(trig_type, user_buf)) + return -EFAULT; + + if (!priv->alloc_mem) + return -ENOMEM; + + /* + * Note that generic_ptr is initialized to the device * but in + * some alloc_functions, this is overridden and returns data. + */ + ptemp = priv->alloc_mem(priv->trig_alloc_sz, &generic_ptr); + if (!ptemp) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "Inject: Buffer Allocation error\n"); + return -ENOMEM; + } + + if (trig_type == ALTR_UE_TRIGGER_CHAR) + error_mask = priv->ue_set_mask; + else + error_mask = priv->ce_set_mask; + + edac_printk(KERN_ALERT, EDAC_DEVICE, + "Trigger Error Mask (0x%X)\n", error_mask); + + local_irq_save(flags); + /* write ECC corrupted data out. */ + for (i = 0; i < (priv->trig_alloc_sz / sizeof(*ptemp)); i++) { + /* Read data so we're in the correct state */ + rmb(); + if (ACCESS_ONCE(ptemp[i])) + result = -1; + /* Toggle Error bit (it is latched), leave ECC enabled */ + writel(error_mask, drvdata->base); + writel(priv->ecc_enable_mask, drvdata->base); + ptemp[i] = i; + } + /* Ensure it has been written out */ + wmb(); + local_irq_restore(flags); + + if (result) + edac_printk(KERN_ERR, EDAC_DEVICE, "Mem Not Cleared\n"); + + /* Read out written data. ECC error caused here */ + for (i = 0; i < ALTR_TRIGGER_READ_WRD_CNT; i++) + if (ACCESS_ONCE(ptemp[i]) != i) + edac_printk(KERN_ERR, EDAC_DEVICE, + "Read doesn't match written data\n"); + + if (priv->free_mem) + priv->free_mem(ptemp, priv->trig_alloc_sz, generic_ptr); + + return count; +} + +static const struct file_operations altr_edac_device_inject_fops = { + .open = simple_open, + .write = altr_edac_device_trig, + .llseek = generic_file_llseek, +}; + +static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci, + const struct edac_device_prv_data *priv) +{ + struct altr_edac_device_dev *drvdata = edac_dci->pvt_info; + + if (!IS_ENABLED(CONFIG_EDAC_DEBUG)) + return; + + drvdata->debugfs_dir = edac_debugfs_create_dir(drvdata->edac_dev_name); + if (!drvdata->debugfs_dir) + return; + + if (!edac_debugfs_create_file(priv->dbgfs_name, S_IWUSR, + drvdata->debugfs_dir, edac_dci, + &altr_edac_device_inject_fops)) + debugfs_remove_recursive(drvdata->debugfs_dir); +} + +static const struct of_device_id altr_edac_device_of_match[] = { +#ifdef CONFIG_EDAC_ALTERA_L2C + { .compatible = "altr,socfpga-l2-ecc", .data = (void *)&l2ecc_data }, +#endif +#ifdef CONFIG_EDAC_ALTERA_OCRAM + { .compatible = "altr,socfpga-ocram-ecc", + .data = (void *)&ocramecc_data }, +#endif + {}, +}; +MODULE_DEVICE_TABLE(of, altr_edac_device_of_match); + +/* + * altr_edac_device_probe() + * This is a generic EDAC device driver that will support + * various Altera memory devices such as the L2 cache ECC and + * OCRAM ECC as well as the memories for other peripherals. + * Module specific initialization is done by passing the + * function index in the device tree. + */ +static int altr_edac_device_probe(struct platform_device *pdev) +{ + struct edac_device_ctl_info *dci; + struct altr_edac_device_dev *drvdata; + struct resource *r; + int res = 0; + struct device_node *np = pdev->dev.of_node; + char *ecc_name = (char *)np->name; + static int dev_instance; + + if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "Unable to open devm\n"); + return -ENOMEM; + } + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!r) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "Unable to get mem resource\n"); + res = -ENODEV; + goto fail; + } + + if (!devm_request_mem_region(&pdev->dev, r->start, resource_size(r), + dev_name(&pdev->dev))) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "%s:Error requesting mem region\n", ecc_name); + res = -EBUSY; + goto fail; + } + + dci = edac_device_alloc_ctl_info(sizeof(*drvdata), ecc_name, + 1, ecc_name, 1, 0, NULL, 0, + dev_instance++); + + if (!dci) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "%s: Unable to allocate EDAC device\n", ecc_name); + res = -ENOMEM; + goto fail; + } + + drvdata = dci->pvt_info; + dci->dev = &pdev->dev; + platform_set_drvdata(pdev, dci); + drvdata->edac_dev_name = ecc_name; + + drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); + if (!drvdata->base) + goto fail1; + + /* Get driver specific data for this EDAC device */ + drvdata->data = of_match_node(altr_edac_device_of_match, np)->data; + + /* Check specific dependencies for the module */ + if (drvdata->data->setup) { + res = drvdata->data->setup(pdev, drvdata->base); + if (res) + goto fail1; + } + + drvdata->sb_irq = platform_get_irq(pdev, 0); + res = devm_request_irq(&pdev->dev, drvdata->sb_irq, + altr_edac_device_handler, + 0, dev_name(&pdev->dev), dci); + if (res) + goto fail1; + + drvdata->db_irq = platform_get_irq(pdev, 1); + res = devm_request_irq(&pdev->dev, drvdata->db_irq, + altr_edac_device_handler, + 0, dev_name(&pdev->dev), dci); + if (res) + goto fail1; + + dci->mod_name = "Altera ECC Manager"; + dci->dev_name = drvdata->edac_dev_name; + + res = edac_device_add_device(dci); + if (res) + goto fail1; + + altr_create_edacdev_dbgfs(dci, drvdata->data); + + devres_close_group(&pdev->dev, NULL); + + return 0; + +fail1: + edac_device_free_ctl_info(dci); +fail: + devres_release_group(&pdev->dev, NULL); + edac_printk(KERN_ERR, EDAC_DEVICE, + "%s:Error setting up EDAC device: %d\n", ecc_name, res); + + return res; +} + +static int altr_edac_device_remove(struct platform_device *pdev) +{ + struct edac_device_ctl_info *dci = platform_get_drvdata(pdev); + struct altr_edac_device_dev *drvdata = dci->pvt_info; + + debugfs_remove_recursive(drvdata->debugfs_dir); + edac_device_del_device(&pdev->dev); + edac_device_free_ctl_info(dci); + + return 0; +} + +static struct platform_driver altr_edac_device_driver = { + .probe = altr_edac_device_probe, + .remove = altr_edac_device_remove, + .driver = { + .name = "altr_edac_device", + .of_match_table = altr_edac_device_of_match, + }, +}; +module_platform_driver(altr_edac_device_driver); + +/*********************** OCRAM EDAC Device Functions *********************/ + +#ifdef CONFIG_EDAC_ALTERA_OCRAM + +static void *ocram_alloc_mem(size_t size, void **other) +{ + struct device_node *np; + struct gen_pool *gp; + void *sram_addr; + + np = of_find_compatible_node(NULL, NULL, "altr,socfpga-ocram-ecc"); + if (!np) + return NULL; + + gp = of_gen_pool_get(np, "iram", 0); + of_node_put(np); + if (!gp) + return NULL; + + sram_addr = (void *)gen_pool_alloc(gp, size); + if (!sram_addr) + return NULL; + + memset(sram_addr, 0, size); + /* Ensure data is written out */ + wmb(); + + /* Remember this handle for freeing later */ + *other = gp; + + return sram_addr; +} + +static void ocram_free_mem(void *p, size_t size, void *other) +{ + gen_pool_free((struct gen_pool *)other, (u32)p, size); +} + +/* + * altr_ocram_check_deps() + * Test for OCRAM cache ECC dependencies upon entry because + * platform specific startup should have initialized the + * On-Chip RAM memory and enabled the ECC. + * Can't turn on ECC here because accessing un-initialized + * memory will cause CE/UE errors possibly causing an ABORT. + */ +static int altr_ocram_check_deps(struct platform_device *pdev, + void __iomem *base) +{ + if (readl(base) & ALTR_OCR_ECC_EN) + return 0; + + edac_printk(KERN_ERR, EDAC_DEVICE, + "OCRAM: No ECC present or ECC disabled.\n"); + return -ENODEV; +} + +const struct edac_device_prv_data ocramecc_data = { + .setup = altr_ocram_check_deps, + .ce_clear_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_SERR), + .ue_clear_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_DERR), + .dbgfs_name = "altr_ocram_trigger", + .alloc_mem = ocram_alloc_mem, + .free_mem = ocram_free_mem, + .ecc_enable_mask = ALTR_OCR_ECC_EN, + .ce_set_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_INJS), + .ue_set_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_INJD), + .trig_alloc_sz = ALTR_TRIG_OCRAM_BYTE_SIZE, +}; + +#endif /* CONFIG_EDAC_ALTERA_OCRAM */ + +/********************* L2 Cache EDAC Device Functions ********************/ + +#ifdef CONFIG_EDAC_ALTERA_L2C + +static void *l2_alloc_mem(size_t size, void **other) +{ + struct device *dev = *other; + void *ptemp = devm_kzalloc(dev, size, GFP_KERNEL); + + if (!ptemp) + return NULL; + + /* Make sure everything is written out */ + wmb(); + + /* + * Clean all cache levels up to LoC (includes L2) + * This ensures the corrupted data is written into + * L2 cache for readback test (which causes ECC error). + */ + flush_cache_all(); + + return ptemp; +} + +static void l2_free_mem(void *p, size_t size, void *other) +{ + struct device *dev = other; + + if (dev && p) + devm_kfree(dev, p); +} + +/* + * altr_l2_check_deps() + * Test for L2 cache ECC dependencies upon entry because + * platform specific startup should have initialized the L2 + * memory and enabled the ECC. + * Bail if ECC is not enabled. + * Note that L2 Cache Enable is forced at build time. + */ +static int altr_l2_check_deps(struct platform_device *pdev, + void __iomem *base) +{ + if (readl(base) & ALTR_L2_ECC_EN) + return 0; + + edac_printk(KERN_ERR, EDAC_DEVICE, + "L2: No ECC present, or ECC disabled\n"); + return -ENODEV; +} + +const struct edac_device_prv_data l2ecc_data = { + .setup = altr_l2_check_deps, + .ce_clear_mask = 0, + .ue_clear_mask = 0, + .dbgfs_name = "altr_l2_trigger", + .alloc_mem = l2_alloc_mem, + .free_mem = l2_free_mem, + .ecc_enable_mask = ALTR_L2_ECC_EN, + .ce_set_mask = (ALTR_L2_ECC_EN | ALTR_L2_ECC_INJS), + .ue_set_mask = (ALTR_L2_ECC_EN | ALTR_L2_ECC_INJD), + .trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE, +}; + +#endif /* CONFIG_EDAC_ALTERA_L2C */ + MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Thor Thayer"); -MODULE_DESCRIPTION("EDAC Driver for Altera SDRAM Controller"); +MODULE_DESCRIPTION("EDAC Driver for Altera Memories");