aboutsummaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
authorAleksandar Gerasimovski2021-01-19 10:41:00 +0000
committerPriyanka Jain2021-02-08 14:01:17 +0530
commite081d9441e070f781e6a5bd693ce9a6a5a21aba7 (patch)
tree5d801fd07a894f6d8556c2d1b49aa977f50a5f96 /board/keymile
parentd141f4b298de23019405c68ccfb2a0de059e5565 (diff)
board/km/common: fix pnvramaddr and varaddr
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>
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/common/common.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index df507e27907..e3e9c4a3994 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -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);