summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-08-16 11:21:27 -0700
committerCommit Bot <commit-bot@chromium.org>2021-08-26 19:46:26 +0000
commited193ca2912e2e5a310cca4f87ce552b8832b5c3 (patch)
tree303a3c69cea3dba0fcd6e2dcb9283fd05798b147
parent4335737cac492f467ee270ad2040bd7822e0b97a (diff)
downloadchrome-ec-ed193ca2912e2e5a310cca4f87ce552b8832b5c3.tar.gz
honeybuns: fix check for fw_config from CBI
This CL fixes a logic error where CBI FW_CONFIG field was being checked. In addition, the CBI config option to bypass the write protection check was added as the CBI is only being used to store the dock_mf preference and doesn't need to be write protected. BUG=b:164157329 BRANCH=quiche TEST=Verified on Gingerbread that the status LED color matches with the dock's MF preference. In addition, verified that following a power cycle, the MF preference is read properly from the CBI. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ie3d5b8d4af73b1d09b3f58f1a990b7c77cb4a6fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116666 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
-rw-r--r--baseboard/honeybuns/baseboard.c7
-rw-r--r--baseboard/honeybuns/baseboard.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/baseboard/honeybuns/baseboard.c b/baseboard/honeybuns/baseboard.c
index f32e6bed02..df56697fbf 100644
--- a/baseboard/honeybuns/baseboard.c
+++ b/baseboard/honeybuns/baseboard.c
@@ -210,9 +210,14 @@ static void baseboard_init(void)
* field of the CBI. If this value is programmed, then make sure the
* MST_LANE_CONTROL gpio matches the mf bit.
*/
- if (cbi_get_fw_config(&fw_config)) {
+ if (!cbi_get_fw_config(&fw_config)) {
dock_mf = CBI_FW_MF_PREFERENCE(fw_config);
baseboard_set_mst_lane_control(dock_mf);
+ } else {
+ dock_mf = dock_get_mf_preference();
+ cbi_set_fw_config(dock_mf);
+ CPRINTS("cbi: setting default result = %s",
+ cbi_get_fw_config(&fw_config) ? "pass" : "fail");
}
#ifdef GPIO_USBC_UF_ATTACHED_SRC
diff --git a/baseboard/honeybuns/baseboard.h b/baseboard/honeybuns/baseboard.h
index 9d05440145..0618318048 100644
--- a/baseboard/honeybuns/baseboard.h
+++ b/baseboard/honeybuns/baseboard.h
@@ -84,6 +84,7 @@
#define CONFIG_CBI_EEPROM
#define CONFIG_BOARD_VERSION_CBI
#define CONFIG_CMD_CBI
+#define CONFIG_BYPASS_CBI_EEPROM_WP_CHECK
#define CBI_FW_MF_MASK BIT(0)
#define CBI_FW_MF_PREFERENCE(val) (val & (CBI_FW_MF_MASK))