summaryrefslogtreecommitdiff
path: root/board/careena
Commit message (Collapse)AuthorAgeFilesLines
* careena: add simplo batteriesDevin Lu2018-08-152-0/+62
| | | | | | | | | | | | | | | | | This patch add two simplo batteries for careena, one is coslight pack, another one is ATL pack. BUG=b:111288497,b:111287943 BRANCH=none TEST=Check DUT can recognize this two batteries. Check software battery cutoff and hardware battery cutoff could be woke up after charger attached. Change-Id: If22be1e84c0dee28e4d12dc64c3102b7d80dacc4 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1174145 Commit-Ready: Devin Lu <devin.lu@quanta.corp-partner.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org>
* battery: Optionally prevent boot at low SOC with cell imbalance.Jonathan Brandmeyer2018-08-082-4/+11
| | | | | | | | | | | | | | | | | | | | Measure the cell imbalance with method dispatch to a per-battery method, such that families with a plurality of configurable batteries can support them all. By default, cell imbalance is taken to be 'zero' in case we don't support that battery's management IC. Provide a driver for reading cell voltages for the TI BQ4050 family. This IC is quite popular, but by no means universal. BUG=b:111214767 BRANCH=none TEST=Boot on Careena with a custom debug print statement, showing that we can measure the typical battery voltages during and after the boot at the battery status polling interval. Change-Id: I235389b252ac9c373aa9706dbd1066f7c0bbce71 Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1162663 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* grunt family: Provide pu/pd for port 1 BC1.2Jonathan Brandmeyer2018-07-311-2/+2
| | | | | | | | | | | | | | | | | | | Port 1 is provided by a daughterboard. In the event that the daughterboard is disconnected, these pins are floating. Pull them in the appropriate direction for their logic when the board is disconnected. BUG=b:111942717 BRANCH=none TEST=make -j buildall; Test startup on Careena hardware both with and without port 1 connected to the mainboard. Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: Ica06ea16c2c76c624c542ba9b803197a4fd852bd Reviewed-on: https://chromium-review.googlesource.com/1155713 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* careena: Correct baseboard IMU orientation.Jonathan Brandmeyer2018-07-311-0/+7
| | | | | | | | | | | | | | | | | | | | The Careena baseboard IMU principle axes are rotated relative to the Grunt reference design for manufacturability. Also, refactor common/spi_flash_reg.c to avoid a name collision with axis definitions in math_util. BRANCH=none BUG=b:111983307 TEST=make -j buldall; Observe `accelread 1` output with the base in orientations: flat, perturbed by rotation about +y, and perturbed by rotation about +x. Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: Ib85d657ef47a89aaa63134b2bdf43920caf6c06e Reviewed-on: https://chromium-review.googlesource.com/1155628 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* careena: Correct GPIO_SYS_RESET_L pin definition.Jonathan Brandmeyer2018-07-191-2/+1
| | | | | | | | | | | | | | | | | | Caveat: Careena early generation hardware was reworked to a state which does not map SYS_RESET_L to any pin on the EC. This change updates the config to the next hardware gen. TEST=make -j buildall, schematic review BRANCH=none BUG=b:111593365, b:109874594 Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: Icb1ca7ccbacd98f960e4f44041281d1b2ca94e6e Reviewed-on: https://chromium-review.googlesource.com/1142236 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* careena: enable keyboard factory scanningDevin Lu2018-07-192-0/+24
| | | | | | | | | | | | | | This patch is referring to CL:332322. BUG=none BRANCH=none TEST=Short keyboard pins and make sure "ectool kbfactorytest" works. Change-Id: Ic943753c8cec8dde79842de48e5d21ff4dc01c00 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1114400 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* grunt, careena: Clean up GPIO alternate functions.Jonathan Brandmeyer2018-07-131-13/+13
| | | | | | | | | | | | | | | | The NPCX only supports two modes per pin: Peripheral function or GPIO. The chip and its driver do not support alternate peripheral functions. TEST=buildall -j BRANCH=none BUG=b:79686781 Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: Ib5d7ba81b5224ed9c121887d664dac659962b2c2 Reviewed-on: https://chromium-review.googlesource.com/1136942 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* careena, grunt: Enable pullup for the lid switch.Jonathan Brandmeyer2018-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | In the case that the lid switch becomes loose/disconnected, default to the 'lid open' state by pulling up the GPIO. Grunt is not affected, but we want to demonstrate best practices for the grunt family with its configuration. BUG=b:110836185 BRANCH=none TEST=disconnected lid switch on careena and observed lid state remained open and stable. Reconnected lid switch and observed lid state followed physical lid position. Change-Id: I951594ed7f6d98cf1b5258a894d0b95b6ca98ecc Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1115859 Commit-Ready: Martin Roth <martinroth@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* careena: Fix power-on with cut-off batteryEdward Hill2018-06-201-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove CONFIG_BATTERY_HW_PRESENT_CUSTOM, CONFIG_BATTERY_PRESENT_CUSTOM, and associated code in battery.c, and delay in board_tcpc_init. Add CONFIG_BATTERY_PRESENT_GPIO. This allows CONFIG_BATTERY_REVIVE_DISCONNECT to work correctly to revive a cut-off battery, using battery_get_disconnect_state(). Before this change, the call to battery_get_disconnect_state() in the main loop of charge_state_v2's charger_task would not be reached with cut-off battery, due to the earlier: "if (curr.batt.is_present == BP_NO) goto wait_for_it;" With this change, curr.batt.is_present changes to BP_YES based on the simple test of GPIO_EC_BATT_PRES_L. This allows charger_task to "try to wake battery", then call battery_get_disconnect_state() and "found battery in disconnect state". This succeeds in getting the battery out of the disconnect state. The delay in board_tcpc_init() is removed because TCPC init doesn't disturb the AC power supply. If it did, powering on with AC only (no battery) would fail. BUG=b:109894491 BRANCH=none TEST=these combinations on grunt and careena: grunt, unplug AC, cutoff battery, on AC plug: pass (AP boots) grunt, unplug AC, normal battery, on EC reboot: pass (AP boots) grunt, unplug AC, unplug battery, on AC plug: pass (AP boots) grunt, unplug AC, discharge battery to cutoff, on AC plug: pass (AP boots) careena, unplug AC, cutoff battery, on AC plug: pass (AP boots) careena, unplug AC, normal battery, on EC reboot: pass (AP boots) careena, unplug AC, unplug battery, on AC plug: pass (AP boots) careena, unplug AC, discharge battery to cutoff, on AC plug: pass (AP boots) Change-Id: Ieceaa51535b9fcabc8b42681472689bfa9d0e498 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1105338 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* careena: Add batteries configurationDevin Lu2018-06-072-19/+110
| | | | | | | | | | | | | | | This patch add batteries configuration for careena. BUG=b:109638172 BRANCH=none TEST=Verified battery charging and discharging and that 'cutoff' EC console command works. Change-Id: Ia338efa5730e5039d9a2b1a0873ca90d13ff85fa Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1088273 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Edward Hill <ecgh@chromium.org>
* stoney: Rename GPIO_PCH_RCIN_L to GPIO_SYS_RESET_LJonathan Brandmeyer2018-06-051-1/+1
| | | | | | | | | | | | | | Pin rename only; no functional changes. See also b/72426192 for earlier functional changes. BUG=b:77301519 TEST=make -j buildall BRANCH=none Change-Id: I18e71118e584a5b36ba001bac24951929d2c93ff Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1087207 Reviewed-by: Edward Hill <ecgh@chromium.org>
* battery: Move fuel gauge code to commonEdward Hill2018-06-011-1/+1
| | | | | | | | | | | | | | | | | Move fuel gauge code to common to avoid duplication in octopus and grunt baseboards. BUG=b:79704826,b:74018100 BRANCH=none TEST=make -j buildall Change-Id: I58a615c9ed7906cb19b49c2baa36aaa619838cf1 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1072637 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* grunt: Board specific battery infoEdward Hill2018-06-014-1/+72
| | | | | | | | | | | | | | | | | | | Split battery info between baseboard and board, following the Octopus example. This will allow Grunt and Careena to define their own lists of supported battery types. This also adds CONFIG_BATTERY_REVIVE_DISCONNECT support, and checks the charge/discharge FET status. BUG=b:79704826,b:74018100 BRANCH=none TEST=Grunt still boots ok. Change-Id: I6e82ac5e48f9aabf59b63add253108513f0a6b60 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1072039 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* careena: Change LED colorsEdward Hill2018-05-254-52/+147
| | | | | | | | | | | | | Careena has non-PWM White/Orange LEDs. BUG=b:79704826,b:79894166 BRANCH=none TEST=make -j buildall Change-Id: Ie85de84fbd6e4ac4c6139d8407a7a25b5f6d5e7e Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1072898 Reviewed-by: Jett Rink <jettrink@chromium.org>
* careena: Make GPIOs match hardwareEdward Hill2018-05-253-67/+14
| | | | | | | | | | | | | Update GPIO definitions for Careena to match hardware. BUG=b:79704826 BRANCH=none TEST=make BOARD=careena Change-Id: I755e5fd8123eefdfa8d30ca2314435c28340e488 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1070989 Reviewed-by: Jett Rink <jettrink@chromium.org>
* grunt: Move common code to baseboardEdward Hill2018-05-256-0/+563
Move code that will be common to Grunt and Careena to baseboard to avoid duplication when creating the Careena board. Add Careena board files. These are currently just a copy of Grunt and will be modified for Careena next. BUG=b:79704826 BRANCH=none TEST=Grunt still boots ok. Change-Id: I6dd0035bdd62e92a7f3664120fc6ac3f23a0af4d Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1070988