summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhuohao Lee <zhuohao@chromium.org>2021-02-25 17:16:21 +0800
committerCommit Bot <commit-bot@chromium.org>2021-03-04 06:54:33 +0000
commit1f841a5d48bd07277e6639f86c7cbc66cf9bb2c0 (patch)
tree2ad3e357c1833956bf35bb28800a54844f62b2c8 /include
parent2cbb8138fc7cecf24a12add9acb9a6f330589e59 (diff)
downloadchrome-ec-1f841a5d48bd07277e6639f86c7cbc66cf9bb2c0.tar.gz
cbi: Add CONFIG_BYPASS_CBI_EEPROM_WP_CHECK
In some projects, we modify the cbi eeprom write protection via the hardware design. So, the gpio pin GPIO_WP is decoupled from the cbi eeprom write protection status. With this change, we can update the cbi eeprom data on the fly for the dogfood device during the development. In order to bypass the cbi eeprom write protection check, we add a CONFIG_BYPASS_CBI_EEPROM_WP_CHECK to skip the gpio value. Since this modification is only for the developing device, we add the CONFIG_SYSTEM_UNLOCKED check to avoid someone mis-use this config. BUG=b:169034911 BRANCH=volteer TEST=`ectool cbi set` is working in drobit/copano Change-Id: I3f35159883f75965b1009c45c25ac2cd1c6e7c0d Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2719724 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index e695e965d8..a7669cfb74 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3582,6 +3582,12 @@
* Also, this will enable PD in RO for TCPMv2.
*/
#undef CONFIG_SYSTEM_UNLOCKED
+/*
+ * Some systems decouple the CBI eeprom write protection from the
+ * H1_FLASH_WP_ODL via the hardware change. Adds this config to
+ * bypass the cbi eeprom write protection check.
+ */
+#undef CONFIG_BYPASS_CBI_EEPROM_WP_CHECK
/*
* Device can be a tablet as well as a clamshell.
@@ -6149,4 +6155,10 @@
#define ALS_COUNT 0
#endif /* CONFIG_ALS */
+#if defined(CONFIG_BYPASS_CBI_EEPROM_WP_CHECK) && \
+ !defined(CONFIG_SYSTEM_UNLOCKED)
+#error "CONFIG_BYPASS_CBI_EEPROM_WP_CHECK is only permitted " \
+ "when CONFIG_SYSTEM_UNLOCK is also enabled."
+#endif /* CONFIG_BYPASS_CBI_EEPROM_WP_CHECK && !CONFIG_SYSTEM_UNLOCK */
+
#endif /* __CROS_EC_CONFIG_H */