EDAC, altera: Add register offset for ECC Enable
authorThor Thayer <tthayer@opensource.altera.com>
Thu, 31 Mar 2016 18:48:02 +0000 (13:48 -0500)
committerBorislav Petkov <bp@suse.de>
Sat, 2 Apr 2016 11:38:57 +0000 (13:38 +0200)
In preparation for the Arria10 peripheral ECCs, add a register offset
from the ECC base to index to the ECC enable register.

Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
Cc: devicetree@vger.kernel.org
Cc: dinguyen@opensource.altera.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux@arm.linux.org.uk
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/1459450087-24792-3-git-send-email-tthayer@opensource.altera.com
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/altera_edac.c
drivers/edac/altera_edac.h

index fb6fe568d0dcffdad5cef0f0102bdd43774cb678..f0a6de748faeee8acbb7d577d68b007b404b4598 100644 (file)
@@ -866,7 +866,7 @@ static int altr_ocram_check_deps(struct altr_edac_device_dev *device)
        void __iomem  *base = device->base;
        const struct edac_device_prv_data *prv = device->data;
 
-       if (readl(base) & prv->ecc_enable_mask)
+       if (readl(base + prv->ecc_en_ofst) & prv->ecc_enable_mask)
                return 0;
 
        edac_printk(KERN_ERR, EDAC_DEVICE,
@@ -882,6 +882,7 @@ const struct edac_device_prv_data ocramecc_data = {
        .alloc_mem = ocram_alloc_mem,
        .free_mem = ocram_free_mem,
        .ecc_enable_mask = ALTR_OCR_ECC_EN,
+       .ecc_en_ofst = ALTR_OCR_ECC_REG_OFFSET,
        .ce_set_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_INJS),
        .ue_set_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_INJD),
        .set_err_ofst = ALTR_OCR_ECC_REG_OFFSET,
index c995388b415bf5e269bfe3db683726929720ddb6..cb6b2b9079e8b496624939ae2cc7007f1786dacb 100644 (file)
@@ -256,6 +256,7 @@ struct edac_device_prv_data {
        void * (*alloc_mem)(size_t size, void **other);
        void (*free_mem)(void *p, size_t size, void *other);
        int ecc_enable_mask;
+       int ecc_en_ofst;
        int ce_set_mask;
        int ue_set_mask;
        int set_err_ofst;