summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2021-01-26 11:01:26 +0100
committerCommit Bot <commit-bot@chromium.org>2021-01-28 09:29:32 +0000
commit4e950b9fde9e5d7197d2558f7a36bc809e193a49 (patch)
treeca0f78c3e6e7c28da3bf9ae17af531bbed3e9cd6
parentd6df35e977a68ed7f58e761eb2550609f343208a (diff)
downloadchrome-ec-4e950b9fde9e5d7197d2558f7a36bc809e193a49.tar.gz
zork: add a LTE present bit in fw_config
The up-to-date program/zork/program.star has a new LTE_PRESENT bit in the fw_config. Define it, so we can use it to steer the USB 3 mux for the LTE modem. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:178457388 BUG=b:177389383 BRANCH=zork TEST=On a vilboz360 LTE, program the CBI as for the next production batch (e.g. 'sudo ectool cbi set 6 0x20099200 4') then run with the next CL and see the LTE modem enumerated as USB 3. Change-Id: I7834aa5bc8a7ba45debbc1f5c20d82f04de8d84b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648108 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--baseboard/zork/cbi_ec_fw_config.c9
-rw-r--r--baseboard/zork/cbi_ec_fw_config.h16
2 files changed, 25 insertions, 0 deletions
diff --git a/baseboard/zork/cbi_ec_fw_config.c b/baseboard/zork/cbi_ec_fw_config.c
index d8101855f7..0eebc188f4 100644
--- a/baseboard/zork/cbi_ec_fw_config.c
+++ b/baseboard/zork/cbi_ec_fw_config.c
@@ -78,3 +78,12 @@ enum ec_cfg_lid_angle_tablet_mode_type ec_config_has_lid_angle_tablet_mode(
return ((get_cbi_fw_config() & EC_CFG_LID_ANGLE_TABLET_MODE_MASK)
>> EC_CFG_LID_ANGLE_TABLET_MODE_L);
}
+
+/*
+ * ec_config_lte_present() will return 1 if present else 0.
+ */
+enum ec_cfg_lte_present_type ec_config_lte_present(void)
+{
+ return ((get_cbi_fw_config() & EC_CFG_LTE_PRESENT_MASK)
+ >> EC_CFG_LTE_PRESENT_L);
+}
diff --git a/baseboard/zork/cbi_ec_fw_config.h b/baseboard/zork/cbi_ec_fw_config.h
index 90940b1019..38c4c2bda2 100644
--- a/baseboard/zork/cbi_ec_fw_config.h
+++ b/baseboard/zork/cbi_ec_fw_config.h
@@ -98,6 +98,21 @@ enum ec_cfg_lid_angle_tablet_mode_type {
GENMASK(EC_CFG_LID_ANGLE_TABLET_MODE_H,\
EC_CFG_LID_ANGLE_TABLET_MODE_L)
+/*
+ * LTE Modem Present (1 bit)
+ *
+ * ec_config_lte_present() will return 1 if present else 0.
+ */
+enum ec_cfg_lte_present_type {
+ LTE_NONE = 0,
+ LTE_PRESENT = 1,
+};
+#define EC_CFG_LTE_PRESENT_L 29
+#define EC_CFG_LTE_PRESENT_H 29
+#define EC_CFG_LTE_PRESENT_MASK \
+ GENMASK(EC_CFG_LTE_PRESENT_H,\
+ EC_CFG_LTE_PRESENT_L)
+
uint32_t get_cbi_fw_config(void);
enum ec_cfg_usb_db_type ec_config_get_usb_db(void);
@@ -108,5 +123,6 @@ enum ec_cfg_pwm_keyboard_backlight_type ec_config_has_pwm_keyboard_backlight(
void);
enum ec_cfg_lid_angle_tablet_mode_type ec_config_has_lid_angle_tablet_mode(
void);
+enum ec_cfg_lte_present_type ec_config_lte_present(void);
#endif /* _ZORK_CBI_EC_FW_CONFIG__H_ */