[U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
Prabhakar Kushwaha
prabhakar.kushwaha at nxp.com
Thu Aug 16 06:48:30 UTC 2018
It is not necessary for MC memory to be always clean. It may have
garbage
value causing indeterministic behavior during MC initialization and run.
So memset memory reserved for MC before any usage.
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
---
drivers/net/fsl-mc/mc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 940025a467..38afcf9222 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2014 Freescale Semiconductor, Inc.
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
*/
#include <common.h>
#include <errno.h>
@@ -810,6 +810,8 @@ u64 mc_get_dram_addr(void)
{
size_t mc_ram_size = mc_get_dram_block_size();
+ memset((void *)gd->arch.resv_ram, 0, mc_ram_size);
+
return (gd->arch.resv_ram + mc_ram_size - 1) &
MC_RAM_BASE_ADDR_ALIGNMENT_MASK;
}
--
2.14.1
More information about the U-Boot
mailing list