summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-03-22 19:13:39 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-03-23 19:03:57 -0700
commit32d670a054811370cae9100c5a01efcdb6c49412 (patch)
tree7231eb9f59bc4ef58827cc785d11094d223610a3
parent9a37f21fd227bf2e10f1a4a11b549dd6f22f6846 (diff)
downloadchrome-ec-32d670a054811370cae9100c5a01efcdb6c49412.tar.gz
bd9995x: Disable IADP
This patch disables IADP immediately after the EC boots. We observed noise on IADP/RESET pin causing SEL_ILIM_VAL to randomly change. This seems the cause of b:35648317. We enabled IADP to fix b:35647661 initially and also followed the vendor's recommendation. However, the issue is only reproducible on the particular board which was used for power measurement and we did not see the issue on other boards with IADP disabled. Also the vendor assumed our EC doesn't control IBUS_LIM_SET and ICC_LIM_SET. (I think they assumed like other thier customers our EC controls ILIM by DAC connected to IADP/RESET pin.) If ILIM is not set by EC and IADP is disabled, the system would brownout because ILIM stays at 128mA. Therefore, it was (mistakenly) recommended that our EC should keep IADP enabled. Cros EC configures IBUS_LIM_SET and ICC_LIM_SET dynamically thus the above concern does not apply. We also found that we have too much noise on IADP/RESET pin. The noise is not big enough to cause the chip to reset but it's big enough to cause ILIM to fall in 128mA zone. We think this is why the boards fail to boot from battery cutoff or no battery. (Contrary to the vendor's explanation, it seems IADP/RESET pin continusouly affects ILIM not only in the early chip power-up period.) BUG=b:35648317 BRANCH=none TEST=Booted two Electro and two Snappy from 1) dead battery 2) no battery 3) battery cutoff. Change-Id: Ic675f1354b9ef222ceec8ce112b19713812d2752 Reviewed-on: https://chromium-review.googlesource.com/458676 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--driver/charger/bd9995x.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/driver/charger/bd9995x.c b/driver/charger/bd9995x.c
index af8b0cc082..d74e0cd635 100644
--- a/driver/charger/bd9995x.c
+++ b/driver/charger/bd9995x.c
@@ -798,6 +798,16 @@ static void bd9995x_init(void)
ch_raw_write16(BD9995X_CMD_CHGOP_SET2, reg,
BD9995X_EXTENDED_COMMAND);
+ /*
+ * We disable IADP (here before setting IBUS_LIM_SET and ICC_LIM_SET)
+ * to prevent voltage on IADP/RESET pin from affecting SEL_ILIM_VAL.
+ */
+ if (ch_raw_read16(BD9995X_CMD_VM_CTRL_SET, &reg,
+ BD9995X_EXTENDED_COMMAND))
+ return;
+ reg &= ~BD9995X_CMD_VM_CTRL_SET_EXTIADPEN;
+ ch_raw_write16(BD9995X_CMD_VM_CTRL_SET, reg, BD9995X_EXTENDED_COMMAND);
+
/* Define battery charging profile */
bd9995x_battery_charging_profile_settings();