summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZick Wei <zick.wei@quanta.corp-partner.google.com>2021-12-10 10:18:21 +0800
committerCommit Bot <commit-bot@chromium.org>2021-12-21 02:55:11 +0000
commit0a83bc5d1a6af6023aad690a3075f0c272d38e13 (patch)
treedef3e6949fc5cca69758eb58348856cd661828d3
parent4a3a3f8bca6de22dd69a8242eef3b592666f0851 (diff)
downloadchrome-ec-0a83bc5d1a6af6023aad690a3075f0c272d38e13.tar.gz
dooly: add ssfc led field
Dooly need add ssfc led field for second source led ic. BUG=b:208722790 BRANCH=puff TEST=make BOARD=dooly Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I501710c2d92bba484a4848dee6f43cfc6f428e26 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3329182 Reviewed-by: Andrew McRae <amcrae@google.com> (cherry picked from commit bb144c51ff198ea1907b65068e33dd4f90c6aa7c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3347357
-rw-r--r--board/dooly/board.c13
-rw-r--r--board/dooly/board.h12
2 files changed, 23 insertions, 2 deletions
diff --git a/board/dooly/board.c b/board/dooly/board.c
index 40deb6cb0f..08d1b4d601 100644
--- a/board/dooly/board.c
+++ b/board/dooly/board.c
@@ -701,6 +701,7 @@ const unsigned int ina3221_count = ARRAY_SIZE(ina3221);
static uint16_t board_version;
static uint32_t sku_id;
static uint32_t fw_config;
+static uint32_t ssfc;
static void cbi_init(void)
{
@@ -718,8 +719,11 @@ static void cbi_init(void)
sku_id = val;
if (cbi_get_fw_config(&val) == EC_SUCCESS)
fw_config = val;
- CPRINTS("Board Version: %d, SKU ID: 0x%08x, F/W config: 0x%08x",
- board_version, sku_id, fw_config);
+ if (cbi_get_ssfc(&val) == EC_SUCCESS)
+ ssfc = val;
+ CPRINTS("Board Version: %d, SKU ID: 0x%08x, "
+ "F/W config: 0x%08x, SSFC: 0x%08x ",
+ board_version, sku_id, fw_config, ssfc);
}
DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1);
@@ -960,6 +964,11 @@ unsigned int ec_config_get_thermal_solution(void)
return (fw_config & EC_CFG_THERMAL_MASK) >> EC_CFG_THERMAL_L;
}
+unsigned int ec_ssfc_get_led_ic(void)
+{
+ return (ssfc & EC_SSFC_LED_MASK) >> EC_SSFC_LED_L;
+}
+
/*
* Power monitoring and management.
*
diff --git a/board/dooly/board.h b/board/dooly/board.h
index 447dcfcd5e..399410aaed 100644
--- a/board/dooly/board.h
+++ b/board/dooly/board.h
@@ -313,8 +313,20 @@ void show_critical_error(void);
#define EC_CFG_THERMAL_H 7
#define EC_CFG_THERMAL_MASK GENMASK(EC_CFG_THERMAL_H, EC_CFG_THERMAL_L)
+/*
+ * Second Source Factory Cache (SSFC) CBI field
+ */
+/*
+ * Led driver IC (2 bits).
+ */
+#define EC_SSFC_LED_L 0
+#define EC_SSFC_LED_H 1
+#define EC_SSFC_LED_MASK GENMASK(EC_SSFC_LED_H, EC_SSFC_LED_L)
+
+
unsigned int ec_config_get_bj_power(void);
unsigned int ec_config_get_thermal_solution(void);
+unsigned int ec_ssfc_get_led_ic(void);
#endif /* !__ASSEMBLER__ */