diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2021-06-14 11:09:12 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-15 07:11:56 +0000 |
commit | f11c1f3b205fa593c1f9eda87dad6a45439ec93d (patch) | |
tree | a8d1466b48463727a06c8d603eb98639e2a957eb /common/system.c | |
parent | ada8db32a3578cab97257af6cbe783187bfdda2c (diff) | |
download | chrome-ec-f11c1f3b205fa593c1f9eda87dad6a45439ec93d.tar.gz |
zephyr: fix jdata pointer
Zephyr stores the panic date not at the end of RAM, thus the pointer to
the jump data has to be calculated in a different way.
With the change, the function system_usable_ram_end returns a correct
value which is used to calculate the SharedMem size.
BUG=b:178011288
BRANCH=none
TEST=run firmware_ECSharedMem test on Lazor
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: If777261a5582071822a998e796973ec5b8cb3cac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2960174
Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r-- | common/system.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/common/system.c b/common/system.c index 6da5b538c7..22467efd0f 100644 --- a/common/system.c +++ b/common/system.c @@ -313,9 +313,17 @@ struct jump_data *get_jump_data(void) * Put the jump data before the panic data, or at the end of RAM if * panic data is not present. */ - addr = get_panic_data_start(); - if (!addr) + if (IS_ENABLED(CONFIG_ZEPHYR)) { + /* + * For Zephyr, the panic data is not at the end of RAM so + * the jump data is always at the end of RAM. + */ addr = CONFIG_RAM_BASE + CONFIG_RAM_SIZE; + } else { + addr = get_panic_data_start(); + if (!addr) + addr = CONFIG_RAM_BASE + CONFIG_RAM_SIZE; + } return (struct jump_data *)(addr - sizeof(struct jump_data)); } |