From patchwork Thu Aug 4 22:58:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 9264499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 07C6160754 for ; Thu, 4 Aug 2016 23:03:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E855128401 for ; Thu, 4 Aug 2016 23:03:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8FA728424; Thu, 4 Aug 2016 23:03:03 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 3470D28401 for ; Thu, 4 Aug 2016 23:03:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bVRcx-0002X8-Nf; Thu, 04 Aug 2016 23:00:35 +0000 Received: from mail-cys01nam02on0086.outbound.protection.outlook.com ([104.47.37.86] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bVRcs-0001bH-UJ for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2016 23:00:33 +0000 Received: from BN3PR0301CA0035.namprd03.prod.outlook.com (10.160.180.173) by BY2PR0301MB0693.namprd03.prod.outlook.com (10.160.63.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Thu, 4 Aug 2016 23:00:07 +0000 Received: from BN1AFFO11FD053.protection.gbl (2a01:111:f400:7c10::194) by BN3PR0301CA0035.outlook.office365.com (2a01:111:e400:4000::45) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15 via Frontend Transport; Thu, 4 Aug 2016 23:00:07 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD053.mail.protection.outlook.com (10.58.53.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.557.8 via Frontend Transport; Thu, 4 Aug 2016 23:00:07 +0000 Received: from oslab-l16.am.freescale.net ([10.213.171.63]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u74Mweea009612; Thu, 4 Aug 2016 16:00:04 -0700 From: York Sun To: Subject: [Patch v3 10/11] driver/edac/layerscape_edac: Add Layerscape EDAC support Date: Thu, 4 Aug 2016 15:58:35 -0700 Message-ID: <1470351518-22404-11-git-send-email-york.sun@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470351518-22404-1-git-send-email-york.sun@nxp.com> References: <1470351518-22404-1-git-send-email-york.sun@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131148252080806669; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(54534003)(199003)(189002)(97736004)(11100500001)(105606002)(8666005)(85426001)(76176999)(50986999)(2950100001)(229853001)(33646002)(106466001)(36756003)(87936001)(5003940100001)(19580395003)(2351001)(189998001)(68736007)(8676002)(81156014)(104016004)(7846002)(50466002)(2906002)(305945005)(47776003)(19580405001)(356003)(81166006)(4326007)(77096005)(110136002)(8936002)(86362001)(48376002)(586003)(50226002)(7416002)(92566002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0693; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD053; 1:SLIoSeqmIdNN7QOLVUpP6WYPEtc/RdyJDHU/VDvFFtB8qv0gtdPUQBkk08f4N2rvWKld/rc9d42H7Vmk/4IG+WrnLG77KFiVzFPdObyzWt5tf0V7Cub9NTXNBIuEJSvpwDd+1B0AxouXjSp1a4k7mvkobTAKclBDryoao+qldaeaUg6Lvv4W3KAFwgNZXjYPD9vTCFHfRWIe5gmjTy3fUEaFXj/+MvZzkEfAxdL0gpO/hJaxBlI+KYRCTEgWtKLh8Bfsqdmr8iHv1pE79RwSp+E4PZWHqnajc2/R9bavh50bZpnzsZ98dVSH2jskLVH8jZVjIj4SlUgMiGVyhvUare9hij6zJpBchfRE4hGkt2+oFca267osR8gXECb/MKtVLAfnZ2pgPc4WlEiIECckODFAJSs8/i7HWOFWD3V9Lz592Bn56zw1+03UmCc5aTj6FNt7z2KKDENnza+KpROKgEsPRotxJ+ls99fGkmW55SfsXuDIAYjBCBFqOtP0xpUNUMB5VR0/Q11m1o+A6/hkng1mUeBVh9PrxpFTreiLF+fl+2GwxuGUkeD6G32QwcJ1EjF062QxVdtWHB7zns84kLy0tSqn4p/sL2Lfam+PTA+iiG/9p97hM0etDq3UkeUb MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 90db2352-f27e-405a-39cc-08d3bcbb14a5 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0693; 2:ytcrSZRmoUlHKf3pQZDUZWT7+e++O6xetTWaopQ0PrcNu1weCgFtSDfKZEOlajn9uYbxMvDJSQQobvhqSDpbQdHN3PfIbGEpD+PjlfHribPpG46zFCHK/NCsCaFHDzZCIsRQkRrSy9s2n2r9XR28Pm6f8lWw1SZx8jYyRx4qQh5CKlkvvEDmT7ZvSo2hP4fv; 3:VKTI4H2bXIx0zPNHvkA3Dtm/Kx3q8pMcluhiNLgVwsbzhWMpgr8yTVI/+NNfRqThASEAKtY7WxOERbBZHmb1l9TWp+lA4zDcgDSay2GwnUui4ty0YY21E0+Q2AsMhQE6rbB/j0sv+y/uo4RNw77/C2W5rOzm7dN4m6EeNq2oagcgZTW5LKon/Edx8AGHRf0o2pgsodIDHiKD4IEvj9lViKwsRV/meHQ8P7h1+3TLcYc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0693; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0693; 25:xM7+Y2Zm77x4RGTtXZsWNooF3SIuxjglKHQcSZ+wYHC7Ji1elKTpG/Vp9tPqnhAPBTRvcd6Dkz2QLtlLCKLiQb/xiHNhko4GmDM2/elqGHKYpgMt2/S0IIk9tE08oac7WP5RhhrYC1tn9uCfa3mxnOlZmmpPgDThZj2TRIyqES2+r9IiLNUNPB/bRT0Ryuwwt883xBUKC2WeKFornG4Kt2G6FRXaUjMeDwOCxQiPqOg+P//Wj+t9sI6mSXi8ODXgZmFDs//33af3u7QuEoKx7IrgH+sI0u015c+ubIf5CKccU5P25eRljRXKlhSfQRwe37rL2Jcd/0MTPCVP4y1FCVj0ZZkDQtP3UC9N/NPbIo2bWtWQk2HrOs7FP8U6TABcrCnqxPmjYQ02/NW/5NAQqxuGtcr5Lj6mGWo8iR49sOgoFOXRD20rAoAtg0eieM9a+LgjRu+elPg09DPgIDWmzGCAqLI+p9b8YVJL7ey2FFG1ExvkkzFQOvtptFv3LGNokztlQN1PQ1OV+MqydD1m4W2NSG1FuJq5pYd1jfKoUK3mxt9nka8HBV4E3kBYN7HkoeZCqBbfh6vyINXlSrShYm09/b78oKg1SSaBlGixrTzydGQa6onNsq/gS0Vl0JUKJnquoY1mBnJmW3p5nLUkU+p9Qm26AI6Uw74aTVrUWZ5ISvB6uZXAQkmbQ6A83kcbXqlc0PoggE87ZqxP1KnAvw==; 31:+gG2v+lDfkc6kbPnaIZdZShtFt0/gakN9jgQal4K+Qljvjah54CzwYIi/tKJNX24+JPJzMdZpPyfMjinbue8vAcLKWApj/Jp0S/Ry2N1TRb3CcMlLjLxAltM/RpZdcRI4/OlJT5EkZ4hb0rB3AdJOjMYBsKk/8Tm4MrLKpzdpnxP+jWhUG+W5l+bejA5c4cXENhpdDrqn6omlEFsQQvUKXUCgOsTWkGNk1MKe7Ssw3M= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(8121501046)(13017025)(5005006)(13018025)(13024025)(13015025)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB0693; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0693; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0693; 4:uRyLwvy2zB9YppQ1J1X6h8RcQgVaZjCmOobvHZtU5hvwwXA9r0FTTr5PLIqOTISOfSsXi8+qAD22y5HdDvI2JBjnbNIYZa0lTiqHTA6pTosVB4y+tMd8hiXjdSWrBNgpk4W9xpQChD4XLD6KAwbqZ72IEvEWVZFjWcfoqWy7oKM18fkFfq2PvR8i3J9dCmu3Lo/XhS9BbSqvWwJCt5hDhdSqhfxUB35Wev25cDoJ20f8fxQ2zg8dM4h7VaoVLAe5bus+fy3Mb7RGA6F6cZAyTUWaKMQYJoD61ocBb7bpkJMm8J6oP9keGs2R9cJIv3gXPf4yVMSs6eaKyA+kkiMV7eKkuoGmy4m/3bWcK0K20f9ocu32wivTI+/thca9JrXeag+R7aP1BDtRATR0he6UqQsqvh8eC+XKszEA5PIDFXy4DZnrMFaN3eU6MwchwIh7n2coL/631PhfFQhKb9Pt7JZozFjKDyXHdy5oDEC+KwopWRTjsKckrjRx2PBSQIsUlSiqYPX2wzmka4Cr3Wrhdi9h9uxdLgZA4zw5OoV/vqOFn6OKbVEGHtvpCxsgc3mr X-Forefront-PRVS: 00246AB517 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0693; 23:ivrKWr2NH23sSNW33K0uV4VBaHGtESeLyrim/W5?= =?us-ascii?Q?WHgPp8TVW/c1ZfE/lpwkp2l5zLpMLk1gqHYoXYSHFgN3grBjST3Kb/QDXeOH?= =?us-ascii?Q?Xj44MWlivUCguF10z6YOxklr5XQupDCEB2pwLDBqhs2uNbj+SRPKW/bh0JDH?= =?us-ascii?Q?YqlqtuzS57CW+DXmjkTlzj8IhqrBCQ9FxFrZjBYnKPj9ehmh8mlvOl+ULtTs?= =?us-ascii?Q?RR5H260n108cWIUAWyma9DvlRNjdwi04GK4FyggbovAfqUZQpnOJIneCZz1g?= =?us-ascii?Q?msUBjmA5C9/7hcPrUk/1GvscvB9HHV5vxP9Azhd1LnFipJKwV8tHM5wS3qxB?= =?us-ascii?Q?iklGQOCHCyOeXlT3aMA9Yh5h450bBmNWQ9h9pwu3cU9zXgEWehlSF71KVZXv?= =?us-ascii?Q?qX3GzowNjPTLARpjkNGTs6A10ktq2WxhFht8ggOEJS3ksF8+/G8blcTE4n2c?= =?us-ascii?Q?vgKQ1+y0BLMbp8deBKLO0qHKtCai2Fn2teSuufET/iYUu9eYeKWEo15sOUx2?= =?us-ascii?Q?0cfduULPxY4bj/cixoGp6X0BW/BG8NkNK5k/M1EIDVK3oZxSyLm72PPl2ByQ?= =?us-ascii?Q?0ueQtMRlQ9yHafhqjoagyNB08vDoIgHhn5cgfm2BW39ILR1N+6ENNdbreU95?= =?us-ascii?Q?LSviviEVziBHRKp1lL6MYlszp73CdLE3wiicB07k0Xx/jJp/HuEPWTKw13jg?= =?us-ascii?Q?Rpc8Jl81icxU1NJd8U/Y0FJkrtQSHIm1vdORqA/r0T8Jjy+/qitCRA1+qk74?= =?us-ascii?Q?/359FeCvvD2Ug/Loo4eIyaV41FLKyTJ7P/xR9zwF63yv0dkDToN9GFjuTZyY?= =?us-ascii?Q?DNOih+Mae0KrH93oKzQoW2I/onC3Hi1eSIOpixngtnSTo0xDfxfvRnMOxdYq?= =?us-ascii?Q?liYEjLs/9mw7ikrXnivrBm1Uhpf7UC5nbRtnAAKDOxnJukLhjRGgravUqtcA?= =?us-ascii?Q?3GQXteWCbGMMrDpogoLtmVhlikf4puCPGUCsgUSeDmsyrJf+LlSrIFLqcwPP?= =?us-ascii?Q?l/RVLJVID3LgCVII0FwnZOGFFUeeShX5cDytjaovmJH8U1jo5Oezth6histp?= =?us-ascii?Q?qPkhMTeFbFCGg2bHBoMsDcJ7O7GWCi2Fuo4l4IoYxRsDWze3FbyM4vohrx2j?= =?us-ascii?Q?KZCXZMHn6sG4yNykYK88Jd6AYhZ4/nUN3gfF5ef86FMJP3IrFGT+ErBlMNMY?= =?us-ascii?Q?QFlJE5oMyWRDjSrg=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0693; 6:XFxE600ALnlrxkgJ0ctH02jCcoyJKYBJazA9BLTIIOIRtPxjkcCnVjaql7fEjBDKBTeEg+LsdUN+buMh/VJ2GrXMDl2zdki2Uft9UrDVDWwCVaKVdoMSxYPPZ9Bs8nMzTq+C2QxEE0uDpT3jOJYOiOKkMJ89PFmh8s4ePVUuQsDO5/QE+q3TfLpcGMAo/FTKEC80p6FqAAkmpY/esreJbhr32obr3I7xYGtGP3WHUFCkVcAjmLdOFKgJ1qQ3AXhxLHY99D6hBRMBoHdNYLqCGJ4mBABJaHNY+7pKAWFnkio=; 5:KjOkvikQ3tZ2JvA9yfiT0wqBibgp3PIM5HNwipUe54R8JwRZYbsNkxx+RprjHYs5BQS83UppN4zSmMxrhD+SyU5xw4pcPMH4XMBMBZcdKIjuHsrD27bvZ7xRnOCaHoFNv73UCBR+JTOdfWXE3Qf+u7x+U0I+nE/HdROCP/pxXaw=; 24:bRuxssiIfYa7YxUXvX/myyS9qV17K/6873pbdHYQLlV6hue1VvPb5PvaU+QqPWoyb6ppd3NtYO36dzGuCgYlx5o9ijn4BldvA1yjVWeq9JE=; 7:qIItefi9J9TbWQLLiCox3T8GIA/78mRHgThcf+zkrvHr4Xe8RYJFeZ9G/OCCu8M1XbZ5aoSy9pHxkCbw5ZSWoHzgmzj2kwPnLykQR3N6MGouydBNBfQ4us6ClCyWvgO1yOBzcEZOsfwrVCK6hkPIyETmL/SIu6RbpQTQJc7mH0keYunjdSsTJkHEn8qmsoVm0FQ7bZe31ZrLSCgYjRSlH1QhW6L0nUcdr+s7MNFIB7n8Pexnhlu5mMrxc/Q2rk2D SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2016 23:00:07.8311 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0693 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160804_160031_191232_CE2C9109 X-CRM114-Status: GOOD ( 23.13 ) 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: morbidrsa@gmail.com, linux-kernel@vger.kernel.org, Marc Zyngier , Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , stuart.yoder@nxp.com, Russell King , oss@buserror.net, AKASHI Takahiro , bp@alien8.de, Doug Thompson , James Morse , York Sun , mchehab@kernel.org, Boris Ostrovsky , linux-arm-kernel@lists.infradead.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 DDR EDAC for ARM-based compatible controllers. Both big-endian and little-endian are supported. Signed-off-by: York Sun --- Change log v3: no change v2: Create new driver using shared DDR object arch/arm64/Kconfig.platforms | 1 + arch/{arm => arm64}/include/asm/edac.h | 21 +++++------ arch/arm64/include/asm/irq.h | 4 ++ drivers/edac/Kconfig | 7 ++++ drivers/edac/Makefile | 3 ++ drivers/edac/fsl_ddr_edac.c | 1 + drivers/edac/layerscape_edac.c | 67 ++++++++++++++++++++++++++++++++++ 7 files changed, 92 insertions(+), 12 deletions(-) copy arch/{arm => arm64}/include/asm/edac.h (79%) create mode 100644 drivers/edac/layerscape_edac.c diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 7ef1d05..185a215 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -41,6 +41,7 @@ config ARCH_EXYNOS config ARCH_LAYERSCAPE bool "ARMv8 based Freescale Layerscape SoC family" + select EDAC_SUPPORT help This enables support for the Freescale Layerscape SoC family. diff --git a/arch/arm/include/asm/edac.h b/arch/arm64/include/asm/edac.h similarity index 79% copy from arch/arm/include/asm/edac.h copy to arch/arm64/include/asm/edac.h index 5189fa8..36a226c 100644 --- a/arch/arm/include/asm/edac.h +++ b/arch/arm64/include/asm/edac.h @@ -18,16 +18,15 @@ #define ASM_EDAC_H /* * ECC atomic, DMA, SMP and interrupt safe scrub function. - * Implements the per arch edac_atomic_scrub() that EDAC use for software + * Implements the per arch atomic_scrub() that EDAC use for software * ECC scrubbing. It reads memory and then writes back the original * value, allowing the hardware to detect and correct memory errors. */ - -static inline void edac_atomic_scrub(void *va, u32 size) +static inline void atomic_scrub(void *va, u32 size) { -#if __LINUX_ARM_ARCH__ >= 6 - unsigned int *virt_addr = va; - unsigned int temp, temp2; + unsigned long *virt_addr = va; + unsigned long temp; + unsigned int temp2; unsigned int i; for (i = 0; i < size / sizeof(*virt_addr); i++, virt_addr++) { @@ -35,15 +34,13 @@ static inline void edac_atomic_scrub(void *va, u32 size) * so we are interrupt, DMA and SMP safe. */ __asm__ __volatile__("\n" - "1: ldrex %0, [%2]\n" - " strex %1, %0, [%2]\n" - " teq %1, #0\n" - " bne 1b\n" + "1: ldxr %0, [%2]\n" + " stxr %w1, %0, [%2]\n" + " cbnz %w1, 1b\n" : "=&r"(temp), "=&r"(temp2) : "r"(virt_addr) - : "cc"); + : "memory"); } -#endif } #endif diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h index b77197d..d09c008 100644 --- a/arch/arm64/include/asm/irq.h +++ b/arch/arm64/include/asm/irq.h @@ -11,6 +11,10 @@ #include #include +#ifndef NO_IRQ +#define NO_IRQ ((unsigned int)(-1)) +#endif + struct pt_regs; DECLARE_PER_CPU(unsigned long [IRQ_STACK_SIZE/sizeof(long)], irq_stack); diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 6ca7474..f1ac4e2 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -258,6 +258,13 @@ config EDAC_MPC85XX Support for error detection and correction on the Freescale MPC8349, MPC8560, MPC8540, MPC8548, T4240 +config EDAC_LAYERSCAPE + tristate "Freescale Layerscape DDR" + depends on EDAC_MM_EDAC && ARCH_LAYERSCAPE + help + Support for error detection and correction on Freescale memory + controllers on Layerscape SoCs. + config EDAC_MV64X60 tristate "Marvell MV64x60" depends on EDAC_MM_EDAC && MV64X60 diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile index ee047a4..910dc83 100644 --- a/drivers/edac/Makefile +++ b/drivers/edac/Makefile @@ -54,6 +54,9 @@ obj-$(CONFIG_EDAC_PASEMI) += pasemi_edac.o mpc85xx_edac_mod-y := fsl_ddr_edac.o mpc85xx_edac.o obj-$(CONFIG_EDAC_MPC85XX) += mpc85xx_edac_mod.o +layerscape_edac_mod-y := fsl_ddr_edac.o layerscape_edac.o +obj-$(CONFIG_EDAC_LAYERSCAPE) += layerscape_edac_mod.o + obj-$(CONFIG_EDAC_MV64X60) += mv64x60_edac.o obj-$(CONFIG_EDAC_CELL) += cell_edac.o obj-$(CONFIG_EDAC_PPC4XX) += ppc4xx_edac.o diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index a3fc8fe..d4b910d 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -22,6 +22,7 @@ #include #include +#include #include "edac_module.h" #include "edac_core.h" #include "fsl_ddr_edac.h" diff --git a/drivers/edac/layerscape_edac.c b/drivers/edac/layerscape_edac.c new file mode 100644 index 0000000..6935e22 --- /dev/null +++ b/drivers/edac/layerscape_edac.c @@ -0,0 +1,67 @@ +/* + * Freescale Memory Controller kernel module + * + * Derived from mpc85xx_edac.c + * Author: Dave Jiang + * + * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. + */ + +#include "edac_core.h" +#include "fsl_ddr_edac.h" + +static const struct of_device_id fsl_ddr_mc_err_of_match[] = { + { .compatible = "fsl,qoriq-memory-controller", }, + {}, +}; +MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match); + +static struct platform_driver fsl_ddr_mc_err_driver = { + .probe = fsl_ddr_mc_err_probe, + .remove = fsl_ddr_mc_err_remove, + .driver = { + .name = "fsl_ddr_mc_err", + .of_match_table = fsl_ddr_mc_err_of_match, + }, +}; + +static int __init fsl_ddr_mc_init(void) +{ + int res = 0; + + /* make sure error reporting method is sane */ + switch (edac_op_state) { + case EDAC_OPSTATE_POLL: + case EDAC_OPSTATE_INT: + break; + default: + edac_op_state = EDAC_OPSTATE_INT; + break; + } + + res = platform_driver_register(&fsl_ddr_mc_err_driver); + if (res) { + pr_err("Layerscape EDAC: MC fails to register\n"); + return res; + } + + return 0; +} + +module_init(fsl_ddr_mc_init); + +static void __exit fsl_ddr_mc_exit(void) +{ + platform_driver_unregister(&fsl_ddr_mc_err_driver); +} + +module_exit(fsl_ddr_mc_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Montavista Software, Inc."); +module_param(edac_op_state, int, 0444); +MODULE_PARM_DESC(edac_op_state, + "EDAC Error Reporting state: 0=Poll, 2=Interrupt");