From f11c1f3b205fa593c1f9eda87dad6a45439ec93d Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Mon, 14 Jun 2021 11:09:12 +0200 Subject: 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 Change-Id: If777261a5582071822a998e796973ec5b8cb3cac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2960174 Reviewed-by: Yuval Peress --- common/system.c | 12 ++++++++++-- 1 file 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)); } -- cgit v1.2.1