EDAC/altera: Add SDRAM ECC check for U-Boot
authorRabara Niravkumar L <niravkumar.l.rabara@intel.com>
Sat, 5 Mar 2022 01:41:18 +0000 (09:41 +0800)
committerBorislav Petkov <bp@suse.de>
Wed, 16 Mar 2022 08:56:39 +0000 (09:56 +0100)
commite1bca853dddcb57cbf084acbf35e3654cef6fc75
treef72231843fdc138fb9c6cb261e5775bb0482ee05
parentb0596da1a019c092ca5ab64d6999f5e28d52865e
EDAC/altera: Add SDRAM ECC check for U-Boot

A bug in legacy U-Boot causes a crash during SDRAM boot if ECC is not
enabled in the bitstream but enabled in the Linux config.

Memory mapped read of the ECC Enabled bit was only enabled if U-Boot
determined ECC was enabled in the bitstream.

The Linux driver checks the ECC enable bit using a memory map read.
In the ECC disabled bitstream case, U-Boot didn't enable ECC register
memory map reads and since they are not allowed this results in a crash.

Always read the ECC Enable register through a SMC call which is always
allowed and it works with legacy and current U-Boot.

  [ bp: Massage commit message. ]

Signed-off-by: Rabara Niravkumar L <niravkumar.l.rabara@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
Link: https://lore.kernel.org/r/20220305014118.4794-1-niravkumar.l.rabara@intel.com
drivers/edac/altera_edac.c