[U-Boot] [PATCH] driver: net: fsl-mc: Use base 16 in simple_strtoul

Prabhakar Kushwaha prabhakar.kushwaha at nxp.com
Thu Nov 9 09:15:41 UTC 2017


Value provided in MC_MEM_SIZE_ENV_VAR is in hex.

So provide 16 as base in simple_strtoul.

Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 | 2 +-
 drivers/net/fsl-mc/mc.c                            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3
index 7867c37..c5e3acf 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3
@@ -118,7 +118,7 @@ Environment Variables
 mcboottimeout:	MC boot timeout in milliseconds. If this variable is not defined
 		the value CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS will be assumed.
 
-mcmemsize:	MC DRAM block size. If this variable is not defined, the value
+mcmemsize:	MC DRAM block size in hex. If this variable is not defined, the value
 		CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE will be assumed.
 
 mcinitcmd:	This environment variable is defined to initiate MC and DPL deployment
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index be2b611..c76f582 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -826,7 +826,7 @@ unsigned long mc_get_dram_block_size(void)
 
 	if (dram_block_size_env_var) {
 		dram_block_size = simple_strtoul(dram_block_size_env_var, NULL,
-						 10);
+						 16);
 
 		if (dram_block_size < CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE) {
 			printf("fsl-mc: WARNING: Invalid value for \'"
-- 
2.7.4



More information about the U-Boot mailing list