From: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/4] board: keymile: common: fix pnvramaddr and varaddr address calculation
Date: Wed, 13 Jan 2021 16:21:00 +0000 [thread overview]
Message-ID: <VI1PR06MB4029EC75BE4B4C253D514BD0D2A90@VI1PR06MB4029.eurprd06.prod.outlook.com> (raw)
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>
---
board/keymile/common/common.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index df507e2..e3e9c4a 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);
--
1.8.3.1
next reply other threads:[~2021-01-13 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 16:21 Aleksandar Gerasimovski [this message]
2021-01-19 6:52 ` [PATCH 3/4] board: keymile: common: fix pnvramaddr and varaddr address calculation Priyanka Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VI1PR06MB4029EC75BE4B4C253D514BD0D2A90@VI1PR06MB4029.eurprd06.prod.outlook.com \
--to=aleksandar.gerasimovski@hitachi-powergrids.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.