diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2018-02-26 12:57:20 +0100 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-01 16:13:10 -0800 |
commit | 045aef2cda7284dae0afc04957a42320f0497149 (patch) | |
tree | 98e48aac93a97b736ceba2d48baef7a7ea4ab145 | |
parent | 2e9ea7bf8510dcb8f915fc080564c520249711aa (diff) | |
download | chrome-ec-045aef2cda7284dae0afc04957a42320f0497149.tar.gz |
make EC_FEATURE_RWSIG definition more useful
Also define the EC_FEATURE_RWSIG feature bit if the RO firmware contains
the RWSIG task but not the RW.
Given the RWSIG verification task is not terribly useful in RW
(where it is never executed), it can be skipped there but the host
program trying to detect RWSIG usage (e.g. flashrom) still wants to be
able to detect it.
In order to be able to do so, add the HAS_TASK_xXx_RO and
HAS_TASK_xXx_RW flags which define the tasks defined in the other
partition (at compilation-time you might still run a frankeinstein combo).
Fix ectool 'inventory' to avoid segfaulting on missing feature string
definition.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=b:36125319
TEST=on ZerbleBarn, run 'ectool inventory', also uses flashrom to
re-flash the RW partition.
Change-Id: I224a6cc4aef956204792a2cc04ad12aaed5abf47
Reviewed-on: https://chromium-review.googlesource.com/937262
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | common/ec_features.c | 2 | ||||
-rw-r--r-- | util/ectool.c | 1 |
3 files changed, 6 insertions, 3 deletions
@@ -105,8 +105,10 @@ _tsk_cfg:= $(filter $(_tsk_cfg_ro), $(_tsk_cfg_rw)) _tsk_cfg_ro:= $(filter-out $(_tsk_cfg), $(_tsk_cfg_ro)) _tsk_cfg_rw:= $(filter-out $(_tsk_cfg), $(_tsk_cfg_rw)) -CPPFLAGS_RO+=$(foreach t,$(_tsk_cfg_ro),-D$(t)) -CPPFLAGS_RW+=$(foreach t,$(_tsk_cfg_rw),-D$(t)) +CPPFLAGS_RO+=$(foreach t,$(_tsk_cfg_ro),-D$(t)) \ + $(foreach t,$(_tsk_cfg_rw),-D$(t)_RW) +CPPFLAGS_RW+=$(foreach t,$(_tsk_cfg_rw),-D$(t)) \ + $(foreach t,$(_tsk_cfg_ro),-D$(t)_RO) CPPFLAGS+=$(foreach t,$(_tsk_cfg),-D$(t)) _flag_cfg_ro:=$(shell $(CPP) $(CPPFLAGS) -P -dM -Ichip/$(CHIP) \ diff --git a/common/ec_features.c b/common/ec_features.c index 49d5db4f63..cab83df503 100644 --- a/common/ec_features.c +++ b/common/ec_features.c @@ -100,7 +100,7 @@ uint32_t get_feature_flags0(void) #ifdef HAS_TASK_CENTROIDING | EC_FEATURE_MASK_0(EC_FEATURE_TOUCHPAD) #endif -#ifdef HAS_TASK_RWSIG +#if defined(HAS_TASK_RWSIG) || defined(HAS_TASK_RWSIG_RO) | EC_FEATURE_MASK_0(EC_FEATURE_RWSIG) #endif #ifdef CONFIG_DEVICE_EVENT diff --git a/util/ectool.c b/util/ectool.c index ea1a580067..8b774f5649 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -555,6 +555,7 @@ int cmd_inventory(int argc, char *argv[]) for (j = 0; j < 32; j++, idx++) { if (r.flags[i] & (1 << j)) { if (idx >= ARRAY_SIZE(ec_feature_names) || + !ec_feature_names[idx] || strlen(ec_feature_names[idx]) == 0) printf("%-4d: Unknown feature\n", idx); else |