summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ss-mux: remove unused port_addr initializationv2.0.0Jett Rink2018-09-1724-46/+8
| | | | | | | | | | | | | | | | | | | We do not need to set the port_addr variable most places because the SS-MUX is also the TCPC and the tcpc_config_t information is used instead. Remove unused variable setting to avoid confusion. BRANCH=none BUG=none TEST=buildall. phaser USB-C communication (and muxs) still work which is a nominal case for all of these changes. Change-Id: I72ee5da251956eb133091974e8dce5ac7f8787c6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1200064 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Edward Hill <ecgh@chromium.org>
* Reland "meowth_fp: Enable CONFIG_ROLLBACK_MPU_PROTECT"Daisuke Nojiri2018-09-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8661ac5938ed9b96750cac5c6f6bf4edd1009d08. Reason for revert: b:112740263 has been fixed by cl:1214864. Original change's description: > Revert "meowth_fp: Enable CONFIG_ROLLBACK_MPU_PROTECT" > > This reverts commit 331eaf99ce5376332442f2f1d83d277c6104bbb6, as it > breaks flashrom. > > We'll want to reenable this after we fix flashrom. > > BRANCH=none > BUG=b:111330723 > BUG=b:112740263 > TEST=/usr/sbin/fp_updater.sh works > > Change-Id: I3b1fc54a5f60f76f7d39481b1d7b90587c794c01 > Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/1180789 > Reviewed-by: Nicolas Norvez <norvez@chromium.org> CQ-DEPEND=CL:*674690 Bug: b:111330723, b:112740263 Change-Id: I4c304c6fb49d0ac948d878a78d85f41961206c4c Reviewed-on: https://chromium-review.googlesource.com/1226916 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* octopus: enable PSL for all NPCX variantsJett Rink2018-09-177-15/+24
| | | | | | | | | | | | | | | | | All NPCX variants support PSL mode in hardware now; enable this at the baseboard level. This is adding support for Bobba; other boards are unaffected BRANCH=none BUG=b:115677776 TEST=bobba goes into PSL Change-Id: I38974371b101c42841e4f11ba72b466415c754d9 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1227050 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* yorp: increase TCPC i2c speedDiana Z2018-09-171-2/+2
| | | | | | | | | | | | | | | | | Yorp and other NPCX octopus variants should be able to use 400k speeds on their TCPC i2c ports with the recent changes that went into the nxp driver. BRANCH=None BUG=b:78554726 TEST=Loaded onto yorp proto 2 and confirmed that charging and display on ports 0 and 1 work with 400k speed Change-Id: I73f4e175184c9d4f791ea5b84dc91ba6821ce8a7 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1185890 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* gsctool: refactor USB interfaceVadim Bendebury2018-09-175-171/+235
| | | | | | | | | | | | | | | | | | | | | | | | Communications with Cr50 exposed USB endpoints could be needed by other utilities, in particular, ./util/iteflash when it is extended to operate over Cr50. This patch moves USB interface functions into a separate file in the ./util directory and makes USB endpoint coordinates run time variables, so that the user of the interface can connect to various endpoints. Some refactoring is required to allow using the generic USB transfer function. BRANCH=none BUG=b:75976718 TEST=verified that gsctool still operates properly - updated a Cr50, read Cr50 version number, etc. Change-Id: I3d77a93932f5395fff0f5823f0dd79e1d1d670c8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1198345 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* isl923x: initially disable autonomous chargingJett Rink2018-09-172-0/+14
| | | | | | | | | | | | | | | | | | | We do not use autonomous charging since it is automatically disabled when ever we set the current limits manually (which we always do). Allowing autonomous charging for the short period during initialization can cause current over protection events on devices with 2S batteries. BRANCH=none BUG=b:114318779 TEST=meep can boot without battery from daughter board USB-C port without boot looping Change-Id: Id50517d7e34bb5be171fe8b781b3ccf835db1f88 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1227411 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* usb-c: add high priority tasks for interruptsJett Rink2018-09-1718-16/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To all boards that have space, add the PD tasks that handle interrupts in parallel. This is the last change for go/usb-pd-slow-response-time. BRANCH=none BUG=b:112088135 TEST=buildall. This works on grunt and octopus. This CL is more of a clean up for ToT to ensure that newly copied boards use the correct paradigm. Below is the space taken up by this change: build/atlas/RW/space_free_flash shrank by 212 bytes: (64796 to 64584) build/atlas/RW/space_free_ram shrank by 1408 bytes: (33568 to 32160) build/cheza/RW/space_free_flash shrank by 200 bytes: (205716 to 205516) build/cheza/RW/space_free_ram shrank by 1408 bytes: (38208 to 36800) build/coral/RW/space_free_flash shrank by 212 bytes: (87980 to 87768) build/coral/RW/space_free_ram shrank by 1400 bytes: (2564 to 1164) build/dragonegg/RW/space_free_flash shrank by 276 bytes: (142136 to 141860) build/dragonegg/RW/space_free_ram shrank by 1640 bytes: (24704 to 23064) build/elm/RW/space_free_flash shrank by 204 bytes: (24644 to 24440) build/elm/RW/space_free_ram shrank by 528 bytes: (8972 to 8444) build/eve/RW/space_free_flash shrank by 216 bytes: (83748 to 83532) build/eve/RW/space_free_ram shrank by 1408 bytes: (1824 to 416) build/fizz/RW/space_free_flash shrank by 184 bytes: (17576 to 17392) build/fizz/RW/space_free_ram shrank by 736 bytes: (11648 to 10912) build/glkrvp/RW/space_free_flash shrank by 248 bytes: (92432 to 92184) build/glkrvp/RW/space_free_ram shrank by 1408 bytes: (45088 to 43680) build/kukui/RW/space_free_flash shrank by 160 bytes: (32364 to 32204) build/kukui/RW/space_free_ram shrank by 520 bytes: (11260 to 10740) build/meowth/RW/space_free_flash shrank by 240 bytes: (72232 to 71992) build/meowth/RW/space_free_ram shrank by 1408 bytes: (34496 to 33088) build/nami/RW/space_free_flash shrank by 360 bytes: (82016 to 81656) build/nami/RW/space_free_ram shrank by 1408 bytes: (2656 to 1248) build/nocturne/RW/space_free_flash shrank by 216 bytes: (62756 to 62540) build/nocturne/RW/space_free_ram shrank by 1408 bytes: (34368 to 32960) build/rainier/RW/space_free_flash shrank by 180 bytes: (45468 to 45288) build/rainier/RW/space_free_ram shrank by 528 bytes: (13516 to 12988) build/rammus/RW/space_free_flash shrank by 200 bytes: (91284 to 91084) build/rammus/RW/space_free_ram shrank by 1408 bytes: (1920 to 512) build/reef_mchp/RW/space_free_flash shrank by 212 bytes: (51048 to 50836) build/reef_mchp/RW/space_free_ram shrank by 2120 bytes: (27420 to 25300) build/reef/RW/space_free_flash shrank by 224 bytes: (84564 to 84340) build/reef/RW/space_free_ram shrank by 1408 bytes: (2208 to 800) build/rowan/RW/space_free_flash shrank by 204 bytes: (29668 to 29464) build/rowan/RW/space_free_ram shrank by 528 bytes: (9300 to 8772) build/scarlet/RW/space_free_flash shrank by 156 bytes: (29464 to 29308) build/scarlet/RW/space_free_ram shrank by 520 bytes: (11100 to 10580) build/zoombini/RW/space_free_flash shrank by 276 bytes: (66816 to 66540) build/zoombini/RW/space_free_ram shrank by 2112 bytes: (37376 to 35264) Compared 208 of 208 files. 38 files changed. Total size change: -27484 bytes. Average size change: -723 bytes. Change-Id: Ifbea67ee4d460fb197a1601d0951169f2f2b5b3b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1220667 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
* pd: Check for dual-role partner when TOGGLE_OFF/FORCE_SINKEdward Hill2018-09-171-29/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Charging via hub with the ANX3429 TCPC sometimes fails when the system is in S5/G3. Both the hub and the ANX3429 are auto-toggling, so source and sink roles depend on the timing of the connection. Charging will fail when the hub expects the ANX3429 to be a source, but the drp_state in S5/G3 is TOGGLE_OFF/FORCE_SINK. Ideally we wouldn't use auto-toggle when drp_state is TOGGLE_OFF/FORCE_SINK, but with the ANX3429 TCPC, auto-toggle can't be prevented in low power mode. To fix this, try being a sink in case the connected device is dual-role. 100 ms is enough time for a dual-role partner to switch from sink to source. If the connected device is sink-only, then we will attempt SNK_DISCONNECTED twice (due to debounce time), then return to low power mode (and stay there). After 200 ms, reset ready for a new connection. Move the next_state selection out into a function since things were getting very narrow inside PD_STATE_DRP_AUTO_TOGGLE. BRANCH=none BUG=b:72007056 TEST=sink device + ANX3429: low power mode TEST=sink device + PS8751: low power mode TEST=charger via hub + ANX3429: starts charging (20/20 tries) TEST=charger via hub + PS8751: starts charging (all tests with Grunt in G3) Change-Id: I097dcace96bc6e6e9cfab279bcbded50ef9951e3 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194678 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Don't auto toggle when DRP state is not dual role.Edward Hill2018-09-172-39/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When in PD_STATE_DRP_AUTO_TOGGLE, we were always enabling DRP auto-toggle, even when drp_state is PD_DRP_TOGGLE_OFF or PD_DRP_FORCE_SINK, which prevents us from acting as source. This caused an infinite loop of entering and exiting low power mode when a sink-only device was plugged into a PS8751 port when the system is in S5/G3. To fix this, only enable DRP auto-toggle when drp_state allows us to be dual-role. One problem with doing this is that the ANX3429 doesn't support low power mode with auto-toggle disabled. Luckily, the ANX3429 will stay in low power mode when a sink-only device is connected. BRANCH=none BUG=b:72007056,b:111663127 TEST=sink device + ANX3429: low power mode [1] TEST=sink device + PS8751: low power mode [1] TEST=charger via hub + ANX3429: 50% chance fail to charge [2] TEST=charger via hub + PS8751: starts charging (all tests with Grunt in G3) [1] dut-control pp3300_tcpc_mw -> 3.5 [2] b/72007056 still remains to be fixed. Change-Id: Id190a3daa78847871288e66d8f229a485a6522e3 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194352 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Ensure TCPC exits low power modeEdward Hill2018-09-172-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure the TCPC is awake when leaving PD_STATE_DRP_AUTO_TOGGLE and when there is a new PD event to handle. Move the exit_low_power_mode() call from the PD_STATE_DRP_AUTO_TOGGLE case statement into set_state(), to catch all possible paths that exit the state. Add a new exit_low_power_mode() call to the top of the main task loop if there is a new event to handle. This allows the exit_low_power_mode() call to be removed from pd_update_dual_role_config() (since PD_EVENT_UPDATE_DUAL_ROLE is included in PD_EXIT_LOW_POWER_EVENT_MASK). Clear PD_FLAGS_LPM_REQUESTED when PD_FLAGS_LPM_ENGAGED is cleared in handle_device_access() and wake the PD task to ensure we will make another pass through the main task loop (and check the CC lines) before deciding to enter low power mode again. BRANCH=none BUG=b:111663127,b:112039224 TEST=PD and TCPC low power still work on Grunt Change-Id: I99063ce0d02af65de74f4c6f73f7a15600d2eac9 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1225352 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Change tcpm_set_drp_toggle() to tcpm_enable_drp_toggle()Edward Hill2018-09-176-18/+9
| | | | | | | | | | | | | | | Change tcpm_set_drp_toggle() to tcpm_enable_drp_toggle(), since enable=0 was unused. BRANCH=none BUG=b:111663127 TEST=PD and TCPC low power still work on Grunt Change-Id: I760a067b11984a579261deac856419d46400497b Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194353 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Add PD_FLAGS_LPM_TRANSITIONEdward Hill2018-09-173-26/+21
| | | | | | | | | | | | | | | Add PD_FLAGS_LPM_TRANSITION and use this to allow the PD task to call tcpc_read/tcpc_write from tcpm_enter_low_power_mode() and tcpm_init(). BRANCH=none BUG=b:111663127 TEST=PD and TCPC low power still work on Grunt Change-Id: I12ddb58667c171068e1be6d136f22f2062959c8c Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194351 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Cleanup lpm_debounce_deadlines and tasks_waiting_on_resetEdward Hill2018-09-171-9/+14
| | | | | | | | | | | | | | | Move lpm_debounce_deadlines and tasks_waiting_on_reset into struct pd_protocol. BRANCH=none BUG=b:111663127 TEST=PD and TCPC low power still work on Grunt Change-Id: Ied7777175f0b9a8efbda42ecbc4b9147d5564649 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194350 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Cleanup request_low_power_mode() and pd_set_drp_toggle()Edward Hill2018-09-171-26/+4
| | | | | | | | | | | | | | | Replace request_low_power_mode() with set/clear of PD_FLAGS_LPM_REQUESTED. Remove pd_set_drp_toggle() since it was only called from one place. BRANCH=none BUG=b:111663127 TEST=PD and TCPC low power still work on Grunt Change-Id: I7692d9101f2ba44ad395a8b71b62f63bc00b8404 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194349 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Replace pd_set_drp_toggle() with exit_low_power_mode()Edward Hill2018-09-171-6/+16
| | | | | | | | | | | | | | | Replace pd_set_drp_toggle(port, 0) with exit_low_power_mode() that calls reset_device_and_notify() to ensure TCPC is out of standby. BRANCH=none BUG=b:111663127 TEST=PD and TCPC low power still work on Grunt Change-Id: I1a8f858040514e138e5bc712a998d1e8fc28e21f Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1194348 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* it83xx/fpu: fix floating-point multiplication issue for DX version.Dino Li2018-09-172-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Floating-point multiplication single-precision is failed on DX version, so we use the formula "A/(1/B)" to replace a multiplication operation (A*B = A/(1/B)). BUG=b:112452221 BRANCH=none TEST=add a console command and test different scenarios by changing variable a and b. static int it83xx_fpu_mul(int argc, char **argv) { volatile float a = 1.23f; volatile float b = 4.56f; volatile float c; c = a * b; ccprintf("__mulsf3: (%d)\n", PRINTF_FLOAT(c)); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(mul, it83xx_fpu_mul, "", ""); Change-Id: I9e7d8477cf517b8df2975df9abb02a6387dc659b Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1201640 Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
* octopus: correct base sensor lifetimeJett Rink2018-09-173-3/+3
| | | | | | | | | | | | | | | | | All base sensor are off during S5 and turn on in S4. Update the active mask to reflect this which also ensure that the sensor is getting initialized at the correct time. BRANCH=none BUG=b:115278651 TEST=fleex base sensor now works. Change-Id: Id4b30fbab02dadf55ed0809fefef3938474fe818 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1222091 Commit-Ready: Matt Wang <matt_wang@compal.corp-partner.google.com> Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* touchpad_st: "dump_memory" can be enabled via console commandWei-Han Chen2018-09-161-4/+14
| | | | | | | | | | | | | | | | | | | | | Previously, dump_memory can only be enabled at compile time (through local build). Make this runtime configurable. Currently, it is default off, since dump_memory is very slow and might not be useful to enable for all users. The dump log through USB interface doesn't look good for now. We revisit the default value in the future. BRANCH=nocturne BUG=b:112877237 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I422a5a23392298301995df4fbf8101b7a18a62ba Reviewed-on: https://chromium-review.googlesource.com/1212665 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* touchpad_st: handle severe errorsWei-Han Chen2018-09-161-17/+165
| | | | | | | | | | | | | | | | | For errors that are noted as "FW shall halt" in spec, we should reset the touchpad, so it won't keep generating the same error and cause EC watchdog reboot the entire system. BRANCH=nocturne BUG=b:112877237 TEST=tested on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ie3c0a9930628caf1e55a243bd017f233756152a6 Reviewed-on: https://chromium-review.googlesource.com/1203351 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* ppc: Increase deglitch time on SN5S330Jonathan Brandmeyer2018-09-142-0/+28
| | | | | | | | | | | | | | | | | | | The default deglitch time is short enough to trip the current limit with some commercially available USB-C -> HDMI adapters. Increase the deglitch timeout to improve compatibility with those adapters. BUG=b:113777138, b:113365815 BRANCH=none TEST=Insert 7 different USB-C to HDMI adapters, including both single-function and multifunction devices, and observe that a Careena clamshell will extend the screen to include the attached monitor on both USB-C ports 0 and 1. Brands tested include SIIG, StarTech, Amazon basics, iogear, Apple, and an unlabeled device. Change-Id: I403e4a65e90c85bdaa8078230751d611d04c9c67 Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1225354 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Ampton: create initial EC imageDiana Z2018-09-146-0/+417
| | | | | | | | | | | | | | | This image is based on bip from current ToT and the most recent ampton schematics. Bugs have been created and put into TODO statements for the future work needed on this EC image. BRANCH=None BUG=b:111498206 TEST=builds Change-Id: Idff972b9ce5231524dd4865a87953ebcd5310c62 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1225350 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* flash: Add CONFIG_FLASH_READOUT_PROTECTION config optionNicolas Boichat2018-09-1410-2/+14
| | | | | | | | | | | | | | Instead of tying together CONFIG_WP_ALWAYS and RDP protection, separate the options. BRANCH=nocturne BUG=b:111330723 TEST=make buildall -j Change-Id: I905b573a900ef4dd0431666c525c951582143e09 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1222093 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* npcx7: Report PSL_CTS on wake from hibernateFurquan Shaikh2018-09-141-0/+14
| | | | | | | | | | | | | | | | This is useful when debugging random wake issues from PSL hibernate to identify the actual cause of wake. BUG=b:115664415 BRANCH=None TEST=make -j buildall Change-Id: Id35be96aef2d73426781d0bf88bf5f6268bc3b6b Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1225353 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* fleex: Enable PSLFurquan Shaikh2018-09-142-0/+23
| | | | | | | | | | | | | | | | | | This change enables PSL hibernate mode on fleex by: 1. Selecting CONFIG_HIBERNATE_PSL 2. Configure alternate mode on PSL pins 3. Configuring EC_RST_ODL for wake BUG=b:115660922 BRANCH=None TEST=make -j buildall Change-Id: Ic0e31f7fd1cc18061a819a61a5d5a8badcaed2ab Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1225351 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cheza: Enable RTC EC/host commandPhilip Chen2018-09-131-0/+4
| | | | | | | | | | | | | BUG=b:115281114 BRANCH=none TEST='rtc' command in ec console and 'ectool rtcget' in ap console Change-Id: Id659b873fa24696cc2b883832f85e0d3202158ad Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1218583 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* temp_sensor: Add (basic) support for TI TMP468 Temperature SensorMoritz Fischer2018-09-134-1/+228
| | | | | | | | | | | | | | | Add (basic) support for TI TMP468 a 8 Remote + 1 Local channel temperature sensor. BUG=none BRANCH=master TEST=Hook up EVM to I2C port of a STM32F072, read temperatures Change-Id: I6d6644825af04391841847c060f8ffaeff620094 Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-on: https://chromium-review.googlesource.com/1213554 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* keyboard: display keycap label in key status debug messagesNamyoon Woo2018-09-134-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current debug message in keyboard_8042.c displays a tuple of row, column, and press status. Additionally, this CL displays a keycap label for better readability. For keycap label mapping table can be adjustable under "CONFIG_KEYBOARD_SCANCODE_MUTABLE" condition as scancode_set2[] is. For coral board, Enabling CONFIG_KEYBOARD_DEBUG (w/o this CL) occupies 652 bytes in flash, and this CL occupies another 312 bytes. BUG=b:111060830 TEST=manually tested by pressing keyboards and check the EC console screen. BRANCH=kblog Signed-off-by: Namyoon Woo <namyoon@chromium.org> Changes to be committed: modified: board/eve/board.c modified: common/keyboard_8042.c modified: common/keyboard_8042_sharedlib.c modified: include/keyboard_8042_sharedlib.h Change-Id: Idd71a5475b1ee313f99e087be9143dcfb6f81550 Reviewed-on: https://chromium-review.googlesource.com/1214543 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* base_detect: Expose console command to force state.RaviChandra Sadineni2018-09-1314-20/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an effort to test wake sources on any given platform, this CL exposes console command to set the base state. This console command can then be invoked by autottests from the uart interface. We have two implementations for managing base status. One is interrupt driven while the other is a polling via a task. Boards current implementations then are: interrupts: lux, soraka, cheza polling task: nocturne, zoombini For forcing base connect and disconnect, interrupts: Disable interrupts and set forced base state. polling task: Stop periodic task and set forced base state. On reset, interrupts: Schedule deferred task immediately and enable interrupts. polling task: Clear forced base state and begin rescheduling periodic task. Signed-off-by: RaviChandra Sadineni <ravisadineni@google.com> BRANCH=poppy,nocturne BUG=chromium:820668, b:37223093 TEST=Tested on lux, soraka and nocturne basestate a : attaches the lid, reflected in ui. basestate d : detaches the lid, reflected in ui. basestate r : resets to the correct state. Wakes the device up on lux and nocturne and soraka. Change-Id: Iab698e103a50b8d22bf216a6f816998cb158e38a Reviewed-on: https://chromium-review.googlesource.com/1184172 Commit-Ready: Ravi Chandra Sadineni <ravisadineni@chromium.org> Tested-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* ectool: Allow usbpdpower command to take port #Daisuke Nojiri2018-09-131-4/+21
| | | | | | | | | | | | | | | | | | | | | | | Currently, usbpdpower command enumerates all USB-C ports found on the board. Since barrel jack adapters are not recognized as a USB-C port, they're not handled by the command. This patch allows the command to take a port number as a new parameter. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:841944 BRANCH=none TEST=Verify ectool usbpdpower 1 return 'Port 1: Disconnected' and 'Port 1: SNK (not charging)' without and with a BJ adapter connected respectively on Fizz. Change-Id: If3437c8f3f9952a4cc6004614ccff7bb6bbb4de5 Reviewed-on: https://chromium-review.googlesource.com/1217606 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* charge_manager: Use enum for CHARGE_SUPPLIER_NONEDaisuke Nojiri2018-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently, CHARGE_SUPPLIER_NONE is defined as a macro. This causes the compiler to allocate uint8_t to enum charge_supplier. When -1 passed to or returned from a function, it's cast to 0xff. This patch defines CHARGE_SUPPLIER_NONE in enum charge_supplier. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=Verify ectool usbpdpower 1 return 'Port 1: Disconnected' and 'Port 1: SNK (not charging)' without and with a BJ adapter connected respectively on Fizz. Change-Id: I31bfa33efa91f60c6667f3b0de9cbdf9c6b3e8bf Reviewed-on: https://chromium-review.googlesource.com/1217605 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* DragonEgg: Add support for port 2 Type CScott Collyer2018-09-136-6/+84
| | | | | | | | | | | | | | | | | This CL adds support for Type C port 2 which uses the TI USB422 TCPC and NX20P3481 PPC. BUG=b:111281797 BRANCH=none TEST=Verifed that port 2 works as a sink and source. Change-Id: I7ad200768d81fd95aee625e5871b2350412a4f79 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1178997 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ite: Add support for 3rd Type C port in bbramScott Collyer2018-09-132-2/+5
| | | | | | | | | | | | | | | | | DragonEgg has 3 Type C ports and needs BRAM_IDX_PD2 as only 2 ports were supproted previously. BUG=b:111281797 BRANCH=none TEST=Verfied that error messages from invalid bram_idx went away. Change-Id: I242850a89413f0a573155e5e325f4e0a540d33e6 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1178996 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ppc: Add support for nx20p3481Scott Collyer2018-09-134-14/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL is an incremental change to the nx20p348x driver to add support for the nx20p3481 ppc. Sink/source modes are controlled via the switch control register instead of gpio signals. Another difference is that the values of mode in register 0x1 are slightly different between the 3481 and 3483. The 3481 needs to use the switch status register to verify whether it's in sink or source mode. This register is now checked for both the 3483 and 3481. A delay is required for the switch status register to reflect the control setting just applied. In addition, the nx20p3481 supports Fast Role Swap (FRS). For FRS, only the detection is supported, and it's assumed that it's caused by the removal of an external charger, not an actual FRS event. BUG=b:111281797 BRANCH=none TEST=Verified on DragonEgg that port acts correctly as a sink. Have not been able to verify source operation. Change-Id: I2fb4200a5d9c3ce460e9b913a5b09441e458bb7e Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1178995 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* cheza: Config the SPI flash size to 1MBWai-Hong Tam2018-09-131-1/+1
| | | | | | | | | | | | | | The NPCX7M7WB has 1MB internal SPI flash. Config it correctly. BRANCH=none BUG=b:114686845 TEST=Checked the EC image size is 1MB. Ran flashrom to flash EC. Change-Id: Ie0ed27f72019790cfeb283349ae28fd05dc9693a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215882 Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* rammus: Implement touch pad enable controlmichael_chen2018-09-131-0/+14
| | | | | | | | | | | | | | | | | | | Implement touch pad enable control. Enable touch pad when system from S5 to S3. Disable touch pad when system form S3 to S5. BUG=None BRANCH=ToT TEST=Manual. Check touch pad can work under S0. Check touch pad can wake up system under suspend. Change-Id: Iccb06c3afeb458ea4504d4de971a49b1ab7bbe8d Signed-off-by: michael_chen <michael5_chen@pegatroncorp.com> Reviewed-on: https://chromium-review.googlesource.com/1198906 Commit-Ready: michael chen <michael5_chen@pegatroncorp.com> Tested-by: michael chen <michael5_chen@pegatroncorp.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* type: Rename matrix_3x3_t to mat33_fp_tYilun Lin2018-09-1331-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I51d88d44252184e4b7b3564236833b0b892edc39 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215449 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename mat44_t to mat44_float_t.Yilun Lin2018-09-134-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I188305fc2f4fcff6ec4343f68e1aa1d2d185f6cf Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215448 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename mat33_t to mat33_float_tYilun Lin2018-09-133-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: Ia601bfc9f9fb311f6ca91bfa2e8fa34259ed6c5b Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215447 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename size3_t to sizev3_tYilun Lin2018-09-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I4fea3bb2c1781a91f1c12ad66f25382cc0be3611 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215446 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename size4_t to sizev4_tYilun Lin2018-09-133-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I3b63b4b1eb4c9ca4166ad207a5646e0c307cd418 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215445 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename vec4_t to floatv4_tYilun Lin2018-09-135-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: Ia61493b9f7303c720fba50d6f481316c6d75cc79 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215444 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename vec3_t to floatv3_t.Yilun Lin2018-09-135-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I8cac6a7c0abe3d462326291b76b1ed44ce6c9a9c Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215443 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* type: Rename vector_3_t to intv3_t.Yilun Lin2018-09-1327-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I865aa3ecbab6cb97f8585a081a679adf00febe1d Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215442 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* chocodile: flash_ec support for chocodileNick Sanders2018-09-131-2/+14
| | | | | | | | | | | | | | | | | | Add support for chocodile. BUG=None TEST=flash_ec chocodile_bec and chocodile_vpdmcu. BRANCH=none Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I9bdffdc1c89c4d802f738dbd045dbc6e4d73917a Reviewed-on: https://chromium-review.googlesource.com/1147083 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* cr50_fuzz: Add missing include and define.Allen Webb2018-09-121-0/+2
| | | | | | | | | | | | | A change in a parent commit broke the build for this commit. Adding an include for cstring and #define HIDE_EC_STDLIB resolves the header conflict. BUG=chromium:883080 TEST=make -j buildfuzztests Change-Id: Icf584a6050519c7a3b8f7defb7685c9c64f7a145 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1220390 Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
* Bobba: Add support to read adapter voltage dataTino Liu2018-09-113-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to read motherboard's adapter voltage data via ADC9. Add support to read sub-board's adapter voltage data via ADC4. BUG=b:112870300 BRANCH=none TEST=check log output of `ectool usbpdpower` for 4 cases are all correct case1. Adapter plugged in only port0 (motherboard): Port 0: SNK Charger PD 14987mV Port 1: Disconnected case2. Adapter plugged in only port1 (sub-board): Port 0: Disconnected Port 1: SNK Charger PD 14740mV case3. Adapter plugged in both two ports (port0 first, then port1): Port 0: SNK Charger PD 15042mV Port 1: SNK (not charging) Charger PD 5000mV case4. Adapter plugged in both two ports (port1 first, then port0): Port 0: SNK (not charging) Charger Unknown 5000mV Port 1: SNK Charger PD 14740mV Change-Id: Ia1202a26f452c13864b4f8340e5f0c671fc74f7d Signed-off-by: Tino Liu <tino.liu@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1206110 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* meep: Disable accel, gyro sensors and tablet mode switch for clamshellsstabilize-jetstream-11056.BDevin Lu2018-09-112-3/+38
| | | | | | | | | | | | | | | | | | | | meep and mimrock both share with the same board, but mimrock is unstuff accel, gyro sensors and using hall sensor instead of GMR, so we don't need to initial those sensors and disable tablet mode. BUG=b:111823716,b:113962628 BRANCH=none TEST=make buildall -j. make sure no initial event occurs with mimrock. make sure tablet mode was disabled with mimrock. Change-Id: I8141ad8160807288d7a886488b98e93ed9a257b9 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1193103 Commit-Ready: Zick Wei <zick.wei@quanta.corp-partner.google.com> Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* bobba: do not disable keyboard for clamshellJett Rink2018-09-101-2/+2
| | | | | | | | | | | | | | Like other octopus boards, do not disable keyboard for clamshell SKUs BRANCH=none BUG=none TEST=build Change-Id: I260ae76da9c5c0ab9989cf284141ca86816a6511 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1204690 Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* octopus: disable tablet mode switch for clamshellsJett Rink2018-09-103-16/+29
| | | | | | | | | | BRANCH=none BUG=b:113837268 TEST=verified that free magnet cannot put a clamshell SKU into tablet mode Change-Id: I5d69ede2da04cb5d067b6ae5a483323054b584ab Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1204452
* it83xx/fpu: restore ALU at the beginning of exception handlerDino Li2018-09-101-11/+11
| | | | | | | | | | | | | | | | | | | This change prevents CPU might execute a arithmetic instruction before ALU is restored in the exception handler (Apply to floating point division by zero). We also make the change to use GP register to set system DLMB register, so we can save R4 properly and print the correct panic information. BUG=b:112452221 BRANCH=none TEST=get a panic information if we do a floating point division and divide by zero. Change-Id: I20cb20500569c004af0336d1358ab0dd4b9452b9 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1201641 Reviewed-by: Jett Rink <jettrink@chromium.org>