summaryrefslogtreecommitdiff
path: root/board/eve/battery.c
Commit message (Collapse)AuthorAgeFilesLines
* battery: Check physical battery presence before inhibiting powerScott Collyer2017-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to satisfy factory testing requirements we need to boot a bare board with just an AC adapter without requiring a power button. However we also don't want to always allow booting of the battery is present but cut-off (which will indicate BP_NO so we can't use the existing battery_is_present function) or has critically low level as it may not immediately boot. To accomplish this add a function that allows the board to specify a custom "hardware presence" for the battery that is separate from the battery presence check. This CL is taking a change done for Eve and pulling into TOT so it can be used for other projects that have the same requirements. https://chromium-review.googlesource.com/c/582544 BUG=b:63957122 BRANCH=none TEST=manual Change-Id: Ib1dc4f659adbf0eebd3dc8c3c61b39b8fa36cb4a Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/627113 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* eve: Update static battery parameters for Simplo/LG packsScott Collyer2017-07-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The Simplo_a50 battery had voltage_max = 8750 mV, which is not correct and it should be 8800. Since the voltage_max parameter is used with -0.5% margin, the 8750 mV value resulted in a charger setting of 8704 and does not provide enough of a voltage delta between the charger and the battery to fully charge packs that exceed the design capacity. In addition, had the tables for both battery types reviewed by the HW team and updated some of the temperature parameters. BUG=b:62483321 BRANCH=eve TEST=Tested with a dogood unit that was failing to reach 100% charge and showing very long "time to full" values as the battery charge approached 90%. After adjusting the voltage_max param, tested and verified that the battery reached 100% charge. In addition, verified the bd9995x 0x1A register had the correct voltage setting. Change-Id: I40e7bc111b048986e824fcb7843e57433a1def84 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/570380 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* eve: Disable discharge-on-ac with board 5+Duncan Laurie2017-06-051-1/+1
| | | | | | | | | | | | | | | | Board version 5+ has BD99954 charger which does not have audible noise when battery is full and charger is at 20V. Disable the discharge-on-ac workaround for these boards. BUG=b:37228827 BRANCH=none TEST=tested on board version 5 that discharge-on-ac is not enabled when the battery is full. Change-Id: I72e6870e06328d84a802c2f736659677de1f9a08 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/524222 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* eve: Add Simplo battery and change precharge current to 256 mAScott Collyer2017-05-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | EVT introduced the Simplo A50 battery pack so need to add this to the list of possible Eve battery types. The precharge current level of the battery type is used to set both the trickle charge and precharge current levels on the Rohm bd9995x charger. Rohm is advising that this value be set to 256 mA. What we observe is that when the charge has to operate in buck mode, that the previous setting of 64 mA is too low. The value of 88 mA was required for the Lishen P1 pack to no trip it's overcurrent limit in precharge mode. BUG=b:37291519 BRANCH=none TEST=Manual With battery pack at low (~4.2 V), connect blackcat charger and verified that the battery begins to charge. Without the precharge current level change, the battery would never charge unless VBUS was set to 5V. Change-Id: Iad155de63c6ad4b342791d7024c44fa208b76ab8 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/494080 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
* eve: discharge on AC when no charger is insertedDuncan Laurie2017-03-091-0/+49
| | | | | | | | | | | | | | | | | To prevent in rush current from the charger when attached, enable discharge on AC until the charger is detected. This required enabling charger profile override which was previously not getting called, so discharging was never disabled. BUG=b:36024657 BRANCH=none TEST=build and boot on eve, ensure battery charges with AC attached Change-Id: Ie5912c1d4981d894366f36f31607d5f66a04c346 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/450951 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* eve: Reduce max battery charge voltage for 0.5% marginDuncan Laurie2017-03-091-2/+2
| | | | | | | | | | | | | | | | Limit battery charge voltage to prevent battery over-charge due to regulation inaccuracy. (ported from reef board) BUG=b:36024657 BRANCH=none TEST=build and boot on reef and ensure charging is still functional Change-Id: I90dd8bda3d67a6c50aa39bbd096239565c73b7c5 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/450950 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* eve: Add support for LISHEN batteryScott2017-02-141-4/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are two batteries being evaludated for Eve and there needs to be a batteery_info struct for each one for situations where the gas gauge can't be read and the charge state machine uses these parameters. BUG=chrome-os-partner:62711 BRANCH=none TEST=Verifed that battery_type is read correctly for both LG and LISHEN battery units. On Lishen unit Drain battery completely, then reconnect type C charger. Verified that battery is now charging. Prior to this CL, the LISHEN bat would not charge because the internal overcurrent protection mode would not tolerate the 256 mA precharge current that's specified for the LG battery. Tested that both Lishen and LG recovered after forcing a battery disconnect. Change-Id: I201eaf61ad03d3dc0d199ab441b07c371bceddde Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/440514 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* eve: Updates from P1 buildDuncan Laurie2017-01-181-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | - revert the change for issue 61431 as main build systems have updated resistor values - enable CONFIG_CHARGER_BD9995X_CHGEN, with the necessary changes in battery.c to support the custom battery present functions - enable CONFIG_CHARGER_MAINTAIN_VBAT - enable CONFIG_CHARGE_MANAGER_EXTERNAL_POWER_LIMIT for testing - set pre-charge current to 256mA to better wake up batteries - set voltage-min to 6.1V to account for charger inaccuracies since the battery expects >= 6V to wake up - enable CONFIG_BACKLIGHT_LID to enforce backlight off with lid closed - put all CONFIG_CMD enables in the same place - make PCH_ACOK open drain (pull-up to be enabled on PCH) BUG=chrome-os-partner:61431,chrome-os-partner:61676 BRANCH=none TEST=manual testing on P1 boards at the factory Change-Id: Ib20693c8200d253819873d03b54f91e12bda8270 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/428902 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* smart_battery: Cleanup smart battery & SB users codeVijay Hiremath2017-01-021-14/+6
| | | | | | | | | | | | | BUG=chrome-os-partner:61173 BRANCH=none TEST=Manually tested on Reef. Battery info works. Change-Id: I6e867eee38885186f8e63a934f52e826f0cf72fd Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/422998 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* eve: Add new boardDuncan Laurie2016-10-261-0/+139
Add support for eve P0 board with: - chip: npcx - pmic: bd999992GW - charger: bd99956 - tcpc: 2x anx3429 BUG=chrome-os-partner:58666 BRANCH=none TEST=build and boot on eve board Change-Id: I69ff246e9f8197d5d50241e6a8fa4796f4c9bfda Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/400638