diff options
author | Tien Fong Chee <tfchee@pg-interactive1.altera.com> | 2016-03-07 19:24:07 +0800 |
---|---|---|
committer | Tien Fong Chee <tfchee@pg-interactive1.altera.com> | 2016-03-17 15:32:36 +0800 |
commit | 1528f6dfb63956b25c7023cb0e374d8ca3f6b5e0 (patch) | |
tree | 7bab61fbb854e9d79e2271526c2d106972bc895b | |
parent | 8efe20ce968f684c02ea6a167ea4642ea5c46b03 (diff) | |
download | u-boot-socfpga-1528f6dfb63956b25c7023cb0e374d8ca3f6b5e0.tar.gz |
FogBugz #361051-5: Setting the OCRAM ECC counter into the U-boot envrel_socfpga_v2014.10_arria10_bringup_16.04.01_prACDS16.0_REL_A10_GSRD_RC7ACDS16.0_REL_A10_GSRD_RC6ACDS16.0_REL_A10_GSRD_RC5ACDS16.0_REL_A10_GSRD_PR
This patch enables the OCRAM ECC counter setting into the U-boot
environment.
Signed-off-by: Tien Fong Chee <tfchee@altera.com>
-rwxr-xr-x | arch/arm/cpu/armv7/socfpga_arria10/ecc_ram.c | 8 | ||||
-rwxr-xr-x | arch/arm/include/asm/arch-socfpga_arria10/ecc_ram.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/cpu/armv7/socfpga_arria10/ecc_ram.c b/arch/arm/cpu/armv7/socfpga_arria10/ecc_ram.c index af4cbb4324..297fa7ad1e 100755 --- a/arch/arm/cpu/armv7/socfpga_arria10/ecc_ram.c +++ b/arch/arm/cpu/armv7/socfpga_arria10/ecc_ram.c @@ -11,8 +11,7 @@ DECLARE_GLOBAL_DATA_PTR; -unsigned long irq_cnt_ecc_ocram_corrected; -unsigned long irq_cnt_ecc_ocram_uncorrected; +unsigned long irq_cnt_ecc_ocram_corrected = 0; static const struct socfpga_ecc *ecc_ocram_base = (void *)SOCFPGA_ECC_OCRAM_ADDRESS; @@ -26,6 +25,9 @@ static void irq_handler_ecc_ocram_corrected(void) printf("IRQ triggered: Corrected OCRAM ECC @ 0x%08x\n", readl(&ecc_ocram_base->serraddra)); irq_cnt_ecc_ocram_corrected++; +#ifndef CONFIG_ENV_IS_NOWHERE + setenv_ulong("ocram_ecc_sbe", irq_cnt_ecc_ocram_corrected); +#endif /* write 1 to clear the ECC */ writel(ALT_ECC_INTSTAT_SERRPENA_SET_MSK, &ecc_ocram_base->intstat); } @@ -34,7 +36,7 @@ static void irq_handler_ecc_ocram_uncorrected(void) { printf("IRQ triggered: Un-corrected OCRAM ECC @ 0x%08x\n", readl(&ecc_ocram_base->derraddra)); - irq_cnt_ecc_ocram_uncorrected++; + /* write 1 to clear the ECC */ writel(ALT_ECC_INTSTAT_DERRPENA_SET_MSK, &ecc_ocram_base->intstat); hang(); diff --git a/arch/arm/include/asm/arch-socfpga_arria10/ecc_ram.h b/arch/arm/include/asm/arch-socfpga_arria10/ecc_ram.h index 154b0429fc..25c8bf5d59 100755 --- a/arch/arm/include/asm/arch-socfpga_arria10/ecc_ram.h +++ b/arch/arm/include/asm/arch-socfpga_arria10/ecc_ram.h @@ -11,7 +11,6 @@ #define IRQ_ECC_OCRAM_UNCORRECTED 211 extern unsigned long irq_cnt_ecc_ocram_corrected; -extern unsigned long irq_cnt_ecc_ocram_uncorrected; #ifndef __ASSEMBLY__ |