]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
keymile: common: fix hexadecimal env variable format
authorAleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Fri, 4 Jun 2021 09:25:00 +0000 (09:25 +0000)
committerPriyanka Jain <priyanka.jain@nxp.com>
Thu, 17 Jun 2021 06:16:11 +0000 (11:46 +0530)
Commit df86d32 breaks linux kernel and product application boot.

Linux kernel and our product application scripts are expecting 0x prefix
for hexadecimal values, while env_set_hex writes them without a prefix.

This patch partially revert env_set_hex usage for affected env variables.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
board/keymile/common/common.c

index 2ce7462c56f54ccccc8caa4348b657142dd3e87a..016806a2a6c249073f1e21fad4cf09f7b0585f64 100644 (file)
@@ -46,12 +46,14 @@ int set_km_env(void)
        unsigned int pram;
        unsigned int varaddr;
        unsigned int kernelmem;
-       char *p;
        unsigned long rootfssize = 0;
+       char envval[16];
+       char *p;
 
        pnvramaddr = CONFIG_SYS_SDRAM_BASE + gd->ram_size -
                CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM - CONFIG_KM_PNVRAM;
-       env_set_hex("pnvramaddr", pnvramaddr);
+       sprintf(envval, "0x%x", pnvramaddr);
+       env_set("pnvramaddr", envval);
 
        /* try to read rootfssize (ram image) from environment */
        p = env_get("rootfssize");
@@ -64,9 +66,12 @@ int set_km_env(void)
        varaddr = CONFIG_SYS_SDRAM_BASE + gd->ram_size -
                CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
        env_set_hex("varaddr", varaddr);
+       sprintf(envval, "0x%x", varaddr);
+       env_set("varaddr", envval);
 
        kernelmem = gd->ram_size - 0x400 * pram;
-       env_set_hex("kernelmem", kernelmem);
+       sprintf(envval, "0x%x", kernelmem);
+       env_set("kernelmem", envval);
 
        return 0;
 }