Skip to content

Commit 723315a

Browse files
committed
HSD #15017937880: EDAC/altera: Fix OCRAM ECC init for the warm reset
OCRAM is initialize by Secure Device Manager(SDM). For the warm reset, SDM do not perform the OCRAM wipe. So OCRAM ECC INITCOMPLETEA bit is not set and ECC_EN bit of CTRL register is required to enable after the warm reset. Signed-off-by: Niravkumar L Rabara <nirav.rabara@altera.com>
1 parent ecf4f4e commit 723315a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/edac/altera_edac.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,14 @@ altr_check_ocram_deps_init(struct altr_edac_device_dev *device)
12541254

12551255
/* Verify OCRAM has been initialized */
12561256
if (!ecc_test_bits(ALTR_A10_ECC_INITCOMPLETEA,
1257-
(base + ALTR_A10_ECC_INITSTAT_OFST)))
1258-
return -ENODEV;
1257+
(base + ALTR_A10_ECC_INITSTAT_OFST))) {
1258+
if (!ecc_test_bits(ALTR_A10_ECC_EN,
1259+
(base + ALTR_A10_ECC_CTRL_OFST)))
1260+
ecc_set_bits(ALTR_A10_ECC_EN,
1261+
(base + ALTR_A10_ECC_CTRL_OFST));
1262+
else
1263+
return -ENODEV;
1264+
}
12591265

12601266
/* Enable IRQ on Single Bit Error */
12611267
writel(ALTR_A10_ECC_SERRINTEN, (base + ALTR_A10_ECC_ERRINTENS_OFST));

0 commit comments

Comments
 (0)