OCPC: Add explicit precharge phase
OCPC: Add explicit precharge phase

This commit adds an explicit precharge phase to the OCPC algorithm.
This allows the OCPC module to take advantage of the linear charging
feature available on the supported charger ICs. With linear charging,
the charger IC can control the BFET in the linear region to provide
low precharge currents while maintaining a high VSYS in order to
prevent brownounts in the system.

The precharge phase is active when the battery voltage is less than
the minimum battery voltage, or the voltage is less than the nominal
voltage and the desired charge current is less than or equal to the
defined precharge current.

BUG=b:174683659
BRANCH=dedede
TEST=Build and flash drawcia. Drain battery until DFET is disabled.
Plug in a charger on the sub board, verify that battery is able to be
revived, battery is able to charge at precharge current limits without
exceeding, and battery is able to transition to the fast charge
portion of the charge curve without excessively exceeding the target
current limit.
TEST=Cutoff battyey, plug in charger, verify that battery is able to
be revived from the sub board.

Signed-off-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@google.com>
Change-Id: I59b119bac8ed9266889aace63d58d5da63e382f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570939
Commit-Queue: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>
Tested-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>
Reviewed-by: Diana Z <cb2016afc7183e5356c690dc63b4ba817470501a@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec