[PATCH] board/km: fix setting of pram variable
Holger Brunck
holger.brunck at hitachi-powergrids.com
Fri Feb 5 10:55:09 CET 2021
The pram variable is evaluated in common/board_r.c as a unsigned long
and not as a string using a hex formataion. This incorrect setting
leads to a wrong calculation of preserved RAM for u-boot. This is fixed
now. The pram variable is now a unsigned long specifying the amount of
kB of preserved RAM.
Signed-off-by: Holger Brunck <holger.brunck at hitachi-powergrids.com>
CC: Stefan Roese <sr at denx.de>
---
board/keymile/common/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index df507e2..7343d47 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -60,7 +60,7 @@ int set_km_env(void)
strict_strtoul(p, 16, &rootfssize);
pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM +
CONFIG_KM_PNVRAM) / 0x400;
- sprintf((char *)buf, "0x%x", pram);
+ sprintf((char *)buf, "%u", pram);
env_set("pram", (char *)buf);
varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
--
1.8.3.1
More information about the U-Boot
mailing list