]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board/km/common: fix pnvramaddr and varaddr
authorAleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Tue, 19 Jan 2021 10:41:00 +0000 (10:41 +0000)
committerPriyanka Jain <priyanka.jain@nxp.com>
Mon, 8 Feb 2021 08:31:17 +0000 (14:01 +0530)
Take into account SDRAM_BASE address when calculating pnvramaddr and
varaddr offsets.
Up to now Keymile designs had SDRAM_BASE equal to zero and the offsets
where calculated correctly, this fix is for the upcoming designs that
have SDRAM_BASE different then zero.

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

index df507e27907e0d6fe0bf8ab9ba6a1686fe394ac1..e3e9c4a39941011ddb5b21f32a14dc43931330cb 100644 (file)
@@ -49,8 +49,8 @@ int set_km_env(void)
        char *p;
        unsigned long rootfssize = 0;
 
-       pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM
-                       - CONFIG_KM_PNVRAM;
+       pnvramaddr = CONFIG_SYS_SDRAM_BASE + gd->ram_size -
+               CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM - CONFIG_KM_PNVRAM;
        sprintf((char *)buf, "0x%x", pnvramaddr);
        env_set("pnvramaddr", (char *)buf);
 
@@ -63,7 +63,8 @@ int set_km_env(void)
        sprintf((char *)buf, "0x%x", pram);
        env_set("pram", (char *)buf);
 
-       varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
+       varaddr = CONFIG_SYS_SDRAM_BASE + gd->ram_size -
+               CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
        sprintf((char *)buf, "0x%x", varaddr);
        env_set("varaddr", (char *)buf);