diff options
author | Patryk Duda <pdk@semihalf.com> | 2022-10-04 18:25:56 +0200 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-05 09:00:22 +0000 |
commit | 473521f2b6d3de6a6b9420e6faf471506a3878df (patch) | |
tree | e792f1b2ee866ae4dc93116e7a7016ff70d5c86a | |
parent | bd016f00de3a69f32cf971cfc3dcaa6bff02ae4b (diff) | |
download | chrome-ec-473521f2b6d3de6a6b9420e6faf471506a3878df.tar.gz |
shim/src/system: Don't refer to BBRAM region if it's not defined
There are boards (e.g. FPMCU) that doesn't define some BBRAM regions
(e.g. power delivery), so we shouldn't refer to them in bbram_lookup()
BUG=b:239712345
BRANCH=none
TEST=make buildall -j
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: Ieccf6ac2ddb864b51c6bd4b67efdcb958f622cd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3932160
Tested-by: Patryk Duda <patrykd@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Bobby Casey <bobbycasey@google.com>
Commit-Queue: Patryk Duda <patrykd@google.com>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r-- | zephyr/shim/src/system.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/zephyr/shim/src/system.c b/zephyr/shim/src/system.c index b20607de59..c2182e92c5 100644 --- a/zephyr/shim/src/system.c +++ b/zephyr/shim/src/system.c @@ -40,22 +40,30 @@ static int bbram_lookup(enum system_bbram_idx idx, int *offset_out, int *size_out) { switch (idx) { +#if DT_NODE_EXISTS(BBRAM_REGION_PD0) case SYSTEM_BBRAM_IDX_PD0: *offset_out = DT_PROP(BBRAM_REGION_PD0, offset); *size_out = DT_PROP(BBRAM_REGION_PD0, size); break; +#endif +#if DT_NODE_EXISTS(BBRAM_REGION_PD1) case SYSTEM_BBRAM_IDX_PD1: *offset_out = DT_PROP(BBRAM_REGION_PD1, offset); *size_out = DT_PROP(BBRAM_REGION_PD1, size); break; +#endif +#if DT_NODE_EXISTS(BBRAM_REGION_PD2) case SYSTEM_BBRAM_IDX_PD2: *offset_out = DT_PROP(BBRAM_REGION_PD2, offset); *size_out = DT_PROP(BBRAM_REGION_PD2, size); break; +#endif +#if DT_NODE_EXISTS(BBRAM_REGION_TRY_SLOT) case SYSTEM_BBRAM_IDX_TRY_SLOT: *offset_out = DT_PROP(BBRAM_REGION_TRY_SLOT, offset); *size_out = DT_PROP(BBRAM_REGION_TRY_SLOT, size); break; +#endif default: return EC_ERROR_INVAL; } |