summaryrefslogtreecommitdiff
path: root/board/gingerbread
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-03-16 07:22:25 -0700
committerCommit Bot <commit-bot@chromium.org>2021-04-15 18:24:31 +0000
commite721551bbbdf0eb0edf107f57efd49577a6f8d88 (patch)
tree5f824fc4641528b54dd85480503328b118f28261 /board/gingerbread
parent654e8de3ae38ba76bbec24167899f9f90c1f1fab (diff)
downloadchrome-ec-e721551bbbdf0eb0edf107f57efd49577a6f8d88.tar.gz
honeybuns: Allow for board specific mf preference
This CL enables a given board to have its own policy regarding the mf preference bit which is used by a UFP to signal its preferred pin configuration in the DP Status message. BUG=b:175434634 BRANCH=None TEST=Verfied that the mf bit in the DP status message follows the board preference. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ied7cdb72d1e302aab25dd5531856b1c7c148e64f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765422 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/gingerbread')
-rw-r--r--board/gingerbread/board.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/gingerbread/board.c b/board/gingerbread/board.c
index a3cc78598f..4672ba0886 100644
--- a/board/gingerbread/board.c
+++ b/board/gingerbread/board.c
@@ -6,6 +6,7 @@
/* Gingerbread board-specific configuration */
#include "common.h"
+#include "cros_board_info.h"
#include "driver/ppc/sn5s330.h"
#include "driver/tcpm/ps8xxx.h"
#include "driver/tcpm/stm32gx.h"
@@ -290,6 +291,25 @@ void board_overcurrent_event(int port, int is_overcurrented)
{
/* TODO: b/ - check correct operation for honeybuns */
}
+
+int dock_get_mf_preference(void)
+{
+ int rv;
+ uint32_t fw_config;
+ int mf = MF_OFF;
+
+ /*
+ * MF (multi function) preferece is indicated by bit 0 of the fw_config
+ * data field. If this data field does not exist, then default to 4 lane
+ * mode.
+ */
+ rv = cbi_get_fw_config(&fw_config);
+ if (!rv)
+ mf = CBI_FW_MF_PREFERENCE(fw_config);
+
+ return mf;
+}
+
#endif /* SECTION_IS_RW */
static void board_init(void)