diff options
author | Bhanu Prakash Maiya <bhanumaiya@google.com> | 2021-08-23 14:43:52 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-24 00:42:22 +0000 |
commit | 02d8502be09282c3abe5902830ffd91a05b6e88f (patch) | |
tree | 82ad18dac3e17b669e1cd69e29a57e4ec926c5dd /board/dewatt/board_fw_config.c | |
parent | 14d1cd8c83e7b6f1329688ad76dbb35b07f40654 (diff) | |
download | chrome-ec-02d8502be09282c3abe5902830ffd91a05b6e88f.tar.gz |
dewatt: Initial EC image
Create the initial EC image for the dewatt variant by copying the
guybrush reference board EC files into a new directory named for
the variant.
(Auto-Generated by create_initial_ec_image.sh version 1.5.0).
BUG=b:196460993
BRANCH=None
TEST=make BOARD=dewatt
Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
Change-Id: Ie4c683e10f15054c137784547aa535932ca77800
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3114048
Commit-Queue: Rob Barnes <robbarnes@google.com>
Reviewed-by: Rob Barnes <robbarnes@google.com>
Diffstat (limited to 'board/dewatt/board_fw_config.c')
-rw-r--r-- | board/dewatt/board_fw_config.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/board/dewatt/board_fw_config.c b/board/dewatt/board_fw_config.c new file mode 100644 index 0000000000..c919d82851 --- /dev/null +++ b/board/dewatt/board_fw_config.c @@ -0,0 +1,42 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "base_fw_config.h" +#include "board_fw_config.h" + +bool board_is_convertible(void) +{ + return (get_fw_config_field(FW_CONFIG_FORM_FACTOR_OFFSET, + FW_CONFIG_FORM_FACTOR_WIDTH) + == FW_CONFIG_FORM_FACTOR_CONVERTIBLE); +} + +bool board_has_kblight(void) +{ + return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET, + FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES); +} + +enum board_usb_c1_mux board_get_usb_c1_mux(void) +{ + int usb_db = get_fw_config_field(FW_CONFIG_USB_DB_OFFSET, + FW_CONFIG_USB_DB_WIDTH); + if (usb_db == FW_CONFIG_USB_DB_A1_PS8811_C1_PS8818) + return USB_C1_MUX_PS8818; + if (usb_db == FW_CONFIG_USB_DB_A1_ANX7491_C1_ANX7451) + return USB_C1_MUX_ANX7451; + return USB_C1_MUX_UNKNOWN; +}; + +enum board_usb_a1_retimer board_get_usb_a1_retimer(void) +{ + int usb_db = get_fw_config_field(FW_CONFIG_USB_DB_OFFSET, + FW_CONFIG_USB_DB_WIDTH); + if (usb_db == FW_CONFIG_USB_DB_A1_PS8811_C1_PS8818) + return USB_A1_RETIMER_PS8811; + if (usb_db == FW_CONFIG_USB_DB_A1_ANX7491_C1_ANX7451) + return USB_A1_RETIMER_ANX7491; + return USB_A1_RETIMER_UNKNOWN; +}; |