plat: intel: Improve ECC scrubbing performance
authorTien Hock, Loh <tien.hock.loh@intel.com>
Thu, 7 Mar 2019 03:28:05 +0000 (11:28 +0800)
committerTien Hock, Loh <tien.hock.loh@intel.com>
Thu, 7 Mar 2019 03:28:05 +0000 (11:28 +0800)
We should be using zeromem to scrub memory instead of memset. This would
improve the performance by 200x

Signed-off-by: Tien Hock, Loh <tien.hock.loh@intel.com>
plat/intel/soc/stratix10/soc/s10_memory_controller.c

index 851fc59a2eeb66b89d8837bd535eba086e7893ca..ed06f5498f0218506dbb3ae4c6a57fdc0199b3f7 100644 (file)
@@ -8,6 +8,7 @@
 #include <arch_helpers.h>
 #include <errno.h>
 #include <lib/mmio.h>
+#include <lib/utils.h>
 #include <common/debug.h>
 #include <drivers/delay_timer.h>
 #include <platform_def.h>
@@ -403,7 +404,7 @@ void configure_hmc_adaptor_regs(void)
                INFO("Scrubbing ECC\n");
 
                /* ECC Scrubbing */
-               memset(DRAM_BASE, 0, DRAM_SIZE);
+               zeromem(DRAM_BASE, DRAM_SIZE);
        } else {
                INFO("ECC is disabled.\n");
        }