summaryrefslogtreecommitdiff
path: root/baseboard/dragonegg
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-07-24 18:34:57 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-01 00:05:07 -0700
commitc0f72a7a6b069634dbebf228ffbec305cde51473 (patch)
treec886940a0384cc533e1a73d7cdc1599e07d34213 /baseboard/dragonegg
parent60881d6546a1b8833ff7e5e675bb901112d89c42 (diff)
downloadchrome-ec-c0f72a7a6b069634dbebf228ffbec305cde51473.tar.gz
DragonEgg: Workaround for EC_BATT_PRES_ODL being incorrect
The signal EC_BATT_PRES_ODL reads high unless the battery is connected and a cold reset is applied to the board. The signal is floating at ~2V and that issue is being investigated. To enable the battery to be charged, this CL replaces reading the GPIO signal with the ability to read the Operation Status register. BUG=b:111704193 BRANCH=none TEST=Verified that when connected the battery is recognized and can be charged. > battery Status: 0x0080 INIT Param flags:00000003 Temp: 0x0bd4 = 302.8 K (29.7 C) V: 0x21cc = 8652 mV V-desired: 0x2260 = 8800 mV I: 0x0beb = 3051 mA(CHG) I-desired: 0x103e = 4158 mA Charging: Allowed Also tested that after issuing cutoff command, the battery wakes up when I connect AC. Change-Id: Id591329071396bd33ade5d773c77ed584979802a Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1149503 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard/dragonegg')
-rw-r--r--baseboard/dragonegg/baseboard.h3
-rw-r--r--baseboard/dragonegg/battery.c17
2 files changed, 19 insertions, 1 deletions
diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h
index 565fab7707..dc97cabc28 100644
--- a/baseboard/dragonegg/baseboard.h
+++ b/baseboard/dragonegg/baseboard.h
@@ -8,6 +8,9 @@
#ifndef __CROS_EC_BASEBOARD_H
#define __CROS_EC_BASEBOARD_H
+/* EC console commands */
+#define CONFIG_CMD_BATT_MFG_ACCESS
+
#define CONFIG_CHIPSET_ICELAKE
#define CONFIG_CHIPSET_RESET_HOOK
#define CONFIG_EXTPOWER_GPIO
diff --git a/baseboard/dragonegg/battery.c b/baseboard/dragonegg/battery.c
index c5f5c97a36..088bd27f6c 100644
--- a/baseboard/dragonegg/battery.c
+++ b/baseboard/dragonegg/battery.c
@@ -6,6 +6,7 @@
*/
#include "battery.h"
+#include "battery_fuel_gauge.h"
#include "battery_smart.h"
#include "gpio.h"
@@ -14,7 +15,21 @@ static enum battery_present batt_pres_prev = BP_NOT_SURE;
enum battery_present battery_hw_present(void)
{
/* The GPIO is low when the battery is physically present */
- return gpio_get_level(GPIO_EC_BATT_PRES_ODL) ? BP_NO : BP_YES;
+ /*
+ * TODO(b/111704193): The signal GPIO_EC_BATT_PRES_ODL has an issue
+ * where it's floating (?) at ~2V when it should be low when the battery
+ * is connected. The signal will read correctly following a cold reset
+ * and the battery is connected, but following a warm reboot, it reads
+ * high. In order to allow charging to work, replacing this with the a
+ * check that the Operation Status register can be read. Once the HW
+ * issue is resolved then change this back to checking the physical
+ * presence pin.
+ *
+ */
+ /* return gpio_get_level(GPIO_EC_BATT_PRES_ODL) ? BP_NO : BP_YES; */
+
+ return (battery_get_disconnect_state() == BATTERY_DISCONNECT_ERROR) ?
+ BP_NO : BP_YES;
}
static int battery_init(void)