summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* mag_cal: Support fixed-point calculation.Yilun Lin2018-10-0414-162/+554
| | | | | | | | | | | | | | | | | | | | | | | | | | Modified from floating point version. This includes changes to vec3, vec4, mat33, mat44, and mag_cal. Now fixed-point type (fp_*) functions is a function wrapper for both fixed-point and floating point version operations: * define CONFIG_FPU to use floating version mag_cal * undef CONFIG_FPU to use fixed-point version mag_cal Also, add tests for both float and fp types operations. TEST=define CONFIG_FPU; flash on reef; See ARC++ magnetmeter app moving. TEST=undef CONFIG_FPU; flash on reef; See ARC++ magnetmeter app moving. TEST=make runtests -j TEST=make buildalltests -j BUG=b:113364863 BRANCH=None Change-Id: Ie695945acb666912babb2a603e09c602a0624d44 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1260704 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* math_util: Support fp_div_dbz which handling division-by-zero error.Yilun Lin2018-10-041-0/+24
| | | | | | | | | | | | | | | | | | | | | | Fixed-point numbers has limited value range. It is very easy to be trapped in a division-by-zero error especially when doing magnetometer calculation. We only use fixed-point operations for motion sensors now, so the precision and correctness for these operations is not the most important point to consider. Here we just let divided-by-zero result becomes INT32_MAX, to prevent the system failure. TEST=undef CONFIG_FPU, build, flash on reef, and test magnetometer, and see the system doesn't crash. BUG=b:113364863 BRANCH=None Change-Id: I0ab657b2132666eefa9f3a04043ce29f0096d238 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1248421 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* touchpad_st: error event info is little endianWei-Han Chen2018-10-041-2/+2
| | | | | | | | | | | | | BRANCH=nocturne BUG=None TEST=manual on device Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I141c73e4c9736332b05bd1713dd40111148c6b66 Reviewed-on: https://chromium-review.googlesource.com/1256307 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* mt8183: Hold power button 10s for hard shutdown.Yilun Lin2018-10-041-2/+2
| | | | | | | | | | | | | | | | Hard shutdown rules for tablet is 10 sec. go/crosdebug TEST=press pwr btn for 10s, and see chipset_force_shutdown in console BUG=b:117243957 BRANCH=None Change-Id: I44fed345f71b503a0d502c5566f4fcba54f80fb9 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1260722 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Tony Lin <tonycwlin@google.com> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* rma: when processing 'RMA open' do not reboot the deviceVadim Bendebury2018-10-045-19/+56
| | | | | | | | | | | | | | | | | | | | | | | | | Once RMA open is processed and CCD state is updated, the AP still might require to perform some operations, even if TPM is not available any more. With this patch enable_ccd_factory_mode() does not trigger device reset, if invoked by the RMA open handler. Another modification is that WP is disabled immediately when factory mode is enabled, there is no need to reset the H1 for WP status to change. BRANCH=cr50, cr50-mp BUG=b:115495431 TEST=verified that running 'gsctool -a -r <authcode>' sets to 'Y' all CCD properties, disables write protection, but does not reboot the device. Change-Id: I834a9e4b5ebbe4aaaf1caafad9c82424087d01f7 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1250037 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* g: update test RO to allow self-signed RWs.Marius Schilder2018-10-043-55/+18
| | | | | | | | | | | | | | | | | Instead of hard-coded embedded public keys, use public key from header. Also accommodate padding checks for both 3071 and 2048 signatures. BUG=none BRANCH=none TEST="make board=cr50;vhaven build/cr50/ec.hex --sku 2 --debug_rom" now successfully boots to console. Signed-off-by: mschilder@google.com Change-Id: I493d4832d4b78c734949fe980ef5c9de2d3e4fa1 Reviewed-on: https://chromium-review.googlesource.com/1256058 Commit-Ready: Marius Schilder <mschilder@chromium.org> Tested-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* grunt: Reduce PD turn off delayEdward Hill2018-10-041-4/+2
| | | | | | | | | | | | | | | | | | Reduce PD_POWER_SUPPLY_TURN_OFF_DELAY to 30 milliseconds. Thanks to PPC VBUS discharge, VBUS drops below 0.8V (vSafe0V) in well under 10 milliseconds. Also remove TODO comments for adjusting PD values, since these all appear correct now. BUG=b:69683108,b:69683178 BRANCH=grunt TEST=check VBUS rise and fall on scope Change-Id: I506851e13850dddda97ae9582a5c0aa7d66882c3 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1259385 Reviewed-by: Jett Rink <jettrink@chromium.org>
* octopus: remove CONFIG_SYSTEM_UNLOCKED optionJett Rink2018-10-045-15/+0
| | | | | | | | | | | | | | | | | | | | For all NPCX boards, remove the CONFIG_SYSTEM_UNLOCKED option. The main affect of this will be to prevent PD communication in RO. We are starting to get into factory test that want to verify this behavior. As a developer, one must remember to jump to RW before PD will negotiate. BRANCH=none BUG=b:117109816 TEST=flash on fleex and RO did not negotiate (when WP was asserted) but RW did. Change-Id: I2df575baad95a334a4a57a9f81600fc039157fd5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1258568 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* Fleex:Add define OCTOPUS_BATT_FUEL_LOW_LEDmatt_wang2018-10-042-0/+3
| | | | | | | | | | | | | | | | | | Flash amber led when the battery critical low and discharge. BUG=b:109872754 BRANCH=none TEST=Verify on Fleex will flash amber led when the battery critical low and discharge. Change-Id: Ia883ca179e868ef825879c6abe3681f1f7471288 Signed-off-by: matt_wang <matt_wang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1247722 Commit-Ready: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* grunt: Move KSI03 HW bug work around out of baseboardEdward Hill2018-10-042-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_KEYBOARD_REFRESH_ROW3 and CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI3 were needed to work around a KSI03 bug on Grunt HW. The HW has been fixed for Careena and later, so move these out of baseboard. Grunt enter recovery (short power): [0.045400 KB init state: -- 02 08 -- -- -- -- -- -- -- -- -- --] Grunt enter recovery (hold power): [0.045387 KB init state: 08 0a 08 08 08 -- 08 -- 08 08 -- 08 08] Careena enter recovery (short power): [0.077781 KB init state: -- 02 -- -- -- -- -- -- -- -- -- -- --] Careena enter recovery (hold power): [0.046569 KB init state: -- 02 -- -- -- -- -- -- -- -- -- -- --] BUG=b:79758966 BRANCH=grunt TEST=Esc+Refresh+Power gives recovery screen on Careena Change-Id: I2660385c2f77ff84ac6fb71b8ae6a3569895ec2b Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1257643 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* DragonEgg: Correct initial value of EC_PCH_RSMRST_LScott Collyer2018-10-041-1/+1
| | | | | | | | | | | | | | | | This signal had been set as GPIO_OUT_HIGH, but it should be initialized as GPIO_OUT_LOW to prevent glitching this signal. BUG=b:111901516 BRANCH=none TEST=make -j BOARD=dragonegg Change-Id: Ief5e100a7b0ecc6448c7259ee60875561d47d4a7 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1257788 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>
* DragonEgg: Change USB_A_HIGH_POWER to push-pullScott Collyer2018-10-042-2/+2
| | | | | | | | | | | | | | | | This signal was set to be ODR, but needed to be a push-pull output. This CL corrects this error. BUG=b:113038733 BRANCH=none TEST=make -j BOARD=dragonegg Change-Id: I8445d65bfd93a9656ae8c93e81eb68e984c889ba Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1257787 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>
* touchpad_st: scale major & minorWei-Han Chen2018-10-041-2/+2
| | | | | | | | | | | | | | | | Pressure, major, minor values are adjusted in v25.0 firmware. This should reduce the chance of dropping a tap. BRANCH=nocturne BUG=b:116321493 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ia9345f7a624e7db9b73926ee29e5e5631d63998a Reviewed-on: https://chromium-review.googlesource.com/1256306 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: new error types: 0xf1, 0xf2, 0xf3Wei-Han Chen2018-10-041-6/+7
| | | | | | | | | | | | | | | | 0xf1, 0xf2, 0xf3 are introduced since version 25.0. The suggested action is touchpad reset. BRANCH=nocturne BUG=b:113315759 TEST=manual on device Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I92842e28d6dc28fc1141e6232143f26f652971ac Reviewed-on: https://chromium-review.googlesource.com/1256305 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: memory corruption detectionWei-Han Chen2018-10-041-25/+121
| | | | | | | | | | | | | | | | | | | | The touchpad firmware will send out a beacon every second. Therefore, if there is no events (touch event / error event / beacon event) for more than 3 seconds, we should assume that touchpad hangs, and we should reset the touchpad. This requires touchpad FW >= v25.0. BRANCH=nocturne BUG=b:113315759 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I6dc57705ebb8ef9f9d0ffde3c3243704b7ff88ee Reviewed-on: https://chromium-review.googlesource.com/1238753 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cheza: Change GPIO for the rev-3 boardWai-Hong Tam2018-10-031-13/+11
| | | | | | | | | | | | | | | Reflect the changes on the rev-3 board. Move port-1 LED pins to PWM, remove DA9313 GPIO1 and EC_SELF_RST. Empty KSO pins. BRANCH=none BUG=b:112080059, b:111519662, b:111391913 TEST=Verified the GPIO functions on a r3 board. Change-Id: Ieeed097a3f1d5892c9360125d0234ca7d977b154 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1194344
* cheza: Enable low power idle modeRaviChandra Sadineni2018-10-031-0/+1
| | | | | | | | | | | | | | | | Cheza should be able to use the low power idle mode for the npcx EC to get lower power in S3, and in S5 before we enter hibernate BUG=b:117222355 BRANCH=none TEST=build and boot on Cheza, Enter S5. See power consumption go down by 3mw. Change-Id: Ica011c10b9771695c85b738f45878ae96bba5c5f Reviewed-on: https://chromium-review.googlesource.com/1258575 Commit-Ready: Ravi Chandra Sadineni <ravisadineni@chromium.org> Tested-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* cheza: Fix bmi160 interrupt pin settingPhilip Chen2018-10-031-1/+1
| | | | | | | | | | | | | | | BRANCH=none BUG=b:113778474 TEST=confirm bmi160_interrupt is regularly triggered and 'ectool motionsense' reports updated accel measurement Change-Id: I65f4d9003480284619649507d7a9964ff8702f51 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1259388 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* FIXUP: sensor: Add flag for tight timestampingGwendal Grignou2018-10-031-0/+2
| | | | | | | | | | | | | | Add description for tight timestamp in ectool inventory. BUG=b:111079027,b:109786990 BRANCH=none TEST=ectool does not print "Unknown feature" anymore. Change-Id: Id51beb3c9bbd80be6c651b68960c61c9f0708cda Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1256049 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Enrico Granata <egranata@chromium.org>
* cheza: Enable host commands flashspiinfo and uptimeinfoWai-Hong Tam2018-10-031-0/+2
| | | | | | | | | | | | | | | | Enable ectool to get: * SPI flash info; * uptime and reset info (for bringup, will be disabled on release). BRANCH=none BUG=b:116841576 TEST=ectool flashspiinfo TEST=ectool uptimeinfo Change-Id: I8975cfb0c9f53b03a13c2b5be4632c8f656e5a92 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1257652 Reviewed-by: Philip Chen <philipchen@chromium.org>
* Aleena: Add GPIO-controlled tables for LED statusBen Chen2018-10-034-71/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The LEDs status defined as below a lookup table. Charge Amber on (S3/S4/S5) Full charge Blue on (S0/S3/S5) Discharging in S3 Amber on 1sec off 3 sec Discharging in S5 off Error Amber on 1sec off 1sec Discharging in S0 Blue on Factory mode Blue on 2sec Amber on 2sec BUG=b:113611642 BRANCH=master TEST=manual Check charge led Amber on (S3/S4/S5) when battery is charging Check charge led Blue on (S0/S3/S5) when battery is full Check charge led Amber on 1sec off 3 sec when discharging on S3 check charge led is off when battery discharging on S5 Check charge led is Amber on 1sec off 1sec when battery error Check charge led is blue when battery is discharhing on S0 Check charge led is blue on 2sec Amber on 2sec when factory testing Change-Id: Id45390ca0f5bb173fe16485eae6f605d1191b8e4 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1253371 Reviewed-by: Edward Hill <ecgh@chromium.org>
* touchpad_st: show status report from STWei-Han Chen2018-10-032-1/+28
| | | | | | | | | | | | | BRANCH=nocturne BUG=b:113315759 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ie1547d5cadcb6876b6e6ea25504aabd84d21b0c9 Reviewed-on: https://chromium-review.googlesource.com/1256304 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* octopus: motion_sense: provide option to defer the sensor resume actionsHarry Pan2018-10-031-0/+5
| | | | | | | | | | | | | | | | | | | | | It is observed that the lid accelerator not apprears on the i2c bus which causes the i2c master got NACK in multiple retries during the S5 (and G3) to S0 power sequence. (i.e. [10106.692955 Lid Accel: 0: init failed: 1]) Learnt from the CL:1091211, refer to the CL:433338 as well, the patch is similar to the delay option for suspend actions, provide a delay option for the resume actions as well. BRANCH=master BUG=b:116170194 TEST=Examining EC console for KX022 init succeeds in S5->S3->S0 path on octopus child boards w/ KX022. (i.e. [10039.971601 Lid Accel: MS Done Init type:0x0 range:4]) Change-Id: Iae4f0fd1e6c46c1b7e12a202a517d8f3b3d82c40 Signed-off-by: Harry Pan <harry.pan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1239974 Reviewed-by: Jett Rink <jettrink@chromium.org>
* grunt: Remove no longer needed GPIO_EN_PP5000Edward Hill2018-10-024-12/+0
| | | | | | | | | | | | | | | The BQ24392 driver was renamed to MAX14637 (CL:1250031) and no longer requires GPIO_EN_PP5000 to be defined (CL:1250032), so this can be removed from grunt-family gpio.inc. BUG=none BRANCH=grunt TEST=make -j buildall Change-Id: I186ece073e544760d487489f874659226c820bd8 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1257644 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* cheza: Enable CONFIG_VBOOT_HASHWai-Hong Tam2018-10-021-0/+2
| | | | | | | | | | | | | | | | | | | Enable this config to calculate EC hash for EC software sync. BRANCH=none BUG=b:116688392 TEST=Checked the hash calculation using ectool: $ ectool echash status: done type: SHA-256 offset: 0x00080000 size: 0x0001da9c hash: 9a378c62a3e66124766fcec03d8cd58ddca1d11f1fd78c7182c31bc2e3413ad6 Change-Id: I1f430f7398ee3de606d6b4de0f6613ee30e440dc Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1257645 Reviewed-by: Julius Werner <jwerner@chromium.org>
* FIXUP: driver: bmi160: harden interrupt and fifo processingGwendal Grignou2018-10-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | Actually 5ms is needed to reset interrupt of activity like significant motion. When processing FIFO, the interrupt will go down once the FIFO is processed, but for activity, there is no easy way for the bit to go down. See https://electronics.stackexchange.com/questions/299188/how-to-program-bmi160-inertial-measuremen-unit-to-latch-detection-flags BUG=b:73557414,b:80284952 BRANCH=scarlet,poppy,nocturne TEST=Without this change, the interrupt bitfield in the the interrupt routine never goes back to 0. Check the sensor is not getting stuck. Change-Id: I986547787183377938ab08afe52fb2871d5c7c71 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1205203 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit 61b1806c0db895487ee9e687f365d844f5931732) Reviewed-on: https://chromium-review.googlesource.com/1252449
* fpsensor: FP_INFO reports the template versionNicolas Norvez2018-10-023-3/+6
| | | | | | | | | | | | | | | | | | | Add a field to the ec_response_fp_info structure to report the version of the template format supported by the hardware. We'd normally uprev the structure version, but given there are only 2 clients of that API (ectool and biod), we'll rather synchronise the submission of the CLs to avoid unnecessary complexity. BRANCH=nocturne BUG=b:116979455 TEST=ectool --name=cros_fp fpinfo TEST=start biod, log shows the format version Change-Id: Ibbf2a3603d4f28c7550523f785aeb7fb740ac9ea Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1252459 Reviewed-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* pd: prevent incorrect LPM flag useJett Rink2018-10-022-0/+4
| | | | | | | | | | | | | | | | Only define PD_FLAGS_LPM_* with the CONFIG_USB_PD_TCPC_LOW_POWER option is defined. This prevents us from using the flags when we shouldn't. BRANCH=none BUG=b:116269457 TEST=buildall works for all boards. Change-Id: I6837819a7ce5d8216e98c92c95275f297d88f911 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1254922 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* fpsensor: add user_id to key derivationNicolas Norvez2018-10-021-2/+20
| | | | | | | | | | | | | | | | | | | | | Derive the key with HKDF, with 1 expand step to add the user_id to the key derivation process. This requires that the size of user_id is exactly SHA256_DIGEST_SIZE, which is enforced by a BUILD_ASSERT(). Also bump the template format to 2. BRANCH=nocturne BUG=b:116875889 BUG=b:73337313 TEST=enroll/unlock works as expected TEST=templates with format version 1 are rejected TEST=manually copy v2 templates between a user and another one. biod attempts to load them and they are rejected by the fpcmu as expected. Change-Id: Ie72d7c6233acb1d7e077599181b3848773783364 Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1252458 Reviewed-by: Adam Langley <agl@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* DragonEgg: Add support for 3 color RGB ledScott Collyer2018-10-025-1/+102
| | | | | | | | | | | | | | | This CL adds support required to enable CONFIG_LED_PWM. BUG=b:116753847 BRANCH=none TEST=Verified colors using EC console command ledtest Change-Id: I9982e2d8c5208e65782bd5dfffccb43ec0e0b5fc Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1247921 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* max17055: Invalidate all batt info when batt not present.Yilun Lin2018-10-021-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=b:117061273 TEST=on kukui, remove batt, connect pd, see battery output in console > battery Status: 0x0000 Param flags:000007fc Temp: 0x0000 = 0.0 K (-273.1 C) V: 0x0000 = 0 mV V-desired: 0x0000 = 0 mV I: 0x0000 = 0 mA I-desired: 0x0000 = 0 mA Charging: Not Allowed Charge: 0 % Manuf: <unkn> Device: <BATT> Chem: <unkn> Serial: 0xffffffff V-design: 0x0f14 = 3860 mV Mode: (unsupported) Abs charge:(unsupported) Remaining: 6334 mAh Cap-full: 6910 mAh Design: 6910 mAh Time-full: 0h:0 Empty: 102h:23 TEST=on connect batt, connect pd, see battery output in console BRANCH=None Change-Id: Ied338266fa0f7713da408438460bc97d4db01e6f Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1253372 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* mkbp: add support for board-specific host notificationEnrico Granata2018-10-022-7/+26
| | | | | | | | | | | | | | | | | | | | On Nocturne, we want to be able to decide whether MKBP events should be notified to the AP via host_set_single_event or gpio_set_level based upon runtime board-version detection instead of a static compile-time flag. Add support for this by marking the function that raises the actual IRQ to the host as weak, so that individual boards can override it with their own version. BRANCH=None BUG=b:112366846, b:112112483, b:112111610 TEST=see CL:1161546 for details Signed-off-by: Enrico Granata <egranata@chromium.org> Change-Id: Ide5ec12fbc6fea3cf23069f376066f225e1887b3 Reviewed-on: https://chromium-review.googlesource.com/1247000 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* fpsensor: Clear reset bit only after reset completesPrashant Malani2018-10-021-1/+1
| | | | | | | | | | | BUG=b:110805729 BRANCH=nocturne TEST=Build, check that boot works. Change-Id: If54978429431149f5aabcc9b2e531f5a80432c60 Signed-off-by: Prashant Malani <pmalani@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1256054 Reviewed-by: Nicolas Norvez <norvez@chromium.org>
* fpsensor: Add support for sensor reset commandPrashant Malani2018-10-023-2/+23
| | | | | | | | | | | | | | | | | | | Update the "reset_sensor" option of the FP_MODE EC command to actually reset the FP sensor. A reset_sensor is essentially the same as performing a re-initialization of the sensor, so this amounts to calling fp_sensor_init() again. BUG=b:110805729 BRANCH=nocturne TEST=Run updated biod and inspect cros_fp.log to ensure that the sensor reinitialization code runs after login. Change-Id: Ib639b64089368b38db154da4a99d4def70c48229 Signed-off-by: Prashant Malani <pmalani@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1239623 Commit-Ready: Nicolas Norvez <norvez@chromium.org> Tested-by: Nicolas Norvez <norvez@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
* DragonEgg: Add support for BC 1.2 detectionScott Collyer2018-10-024-2/+37
| | | | | | | | | | | | | | | | This CL adds board specific support for BC 1.2 detection. BUG=b:113267982 BRANCH=none TEST=Tested on DragonEgg with both USB DCP and SDP chargers. Verified HW ramp set charge level when attaching suzyq cable. Change-Id: Ic610d3cea62883325a02a7fc9f244764842e424d Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1208523 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* syv682x: Support USB changer when VBUS status changesScott Collyer2018-10-021-0/+11
| | | | | | | | | | | | | | | | | | When VBUS changes, the USB charger task needs to be notified. This CL adds a flag to track the value of vbus so when it's checked, a change in status can be determined. BUG=b:113267982 BRANCH=none TEST=Verfied that when external USB charger is connected/removed the USB charger task gets notified with the new current state. Change-Id: I85025586768e68972129fb3438c7e078373c13f4 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1208522 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* bq25710: Fix issue with HW ramp supportScott Collyer2018-10-022-1/+3
| | | | | | | | | | | | | | | | The HW ramp code was not being built previously. This CL fixes a macro name and adds the 2 .h files needed so it will build correctly. BUG=b:113267982 BRANCH=none TEST=make -j BOARD=dragonegg Change-Id: I3f074acea89b08f534b660e9f45019a716659272 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1208521 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* bc12: max14637: Remove PP5000_EN assumptionScott Collyer2018-10-021-6/+2
| | | | | | | | | | | | | | | | | | | | | | | Some boards need to turn on the PP5000 power rail before starting BC 1.2 detection, but others (such as DragonEgg) don't need PP5000 rail control tied to BC 1.2 detection. Previously, either CONFIG_POWER_PP5000_CONTROL had to be defined, or GPIO_PP5000_EN needed to exist in gpio.inc for this driver. This CL removes the PP5000_EN assumption. If PP5000 rail control is required for BC 1.2 detection, then CONFIG_POWER_PP5000_CONTROL must be defined. BUG=b:113267982 BRANCH=none TEST=make -j buildall Change-Id: I65d8d1b1a6f6caf6862d3ff4a3f5469bc827b2c8 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1250032 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* bc12: rename bq24392 driver to max14637Scott Collyer2018-10-0221-49/+41
| | | | | | | | | | | | | | | | | | | | The MAX14637 BC 1.2 USB charger detection chip is functionally similar to the bq24392 and can use the same driver. Rather than have 2 copies of the same driver, or a generic named driver than can be used for both chips, rename the existing bq24392 driver to max14637 as that's the BC 1.2 chip that our current designs are using. BUG=b:113267982 BRANCH=none TEST=make -j buildall Change-Id: I03cfb4918513d756c2a41341001a8162652a29b6 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1250031 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Fix auto-toggle set PD_FLAGS_LPM_REQUESTED when not in LPM.Yilun Lin2018-10-011-0/+2
| | | | | | | | | | | | | | | | | | CL:1194349 sets the PD_FLAGS_LPM_REQUESTED while doing clean-up. The flag setting should be guarded by CONFIG_USB_PD_TCPC_LOW_POWER. TEST=on kukui: plug charger, unplug charger, and see tcpc auto-toggling TEST=on kukui: plug sink device, and see it is powered. BUG=b:111663127, b:116269457 BRANCH=None Change-Id: I788e439f5f82e1a3127de412606ef9f1b741e2c8 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1253366 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Octopus: Add CCD_MODE_ODL to GPIO listDiana Z2018-10-015-0/+15
| | | | | | | | | | | | | | | This change adds CCD_MODE_ODL as an input for all octopus boards so it will be present in the "gpioget" output for debugging. BRANCH=None BUG=b:116849648 TEST=builds, confirmed net showed up on bip and yorp proto 2 Change-Id: I0da194e433444f160f10573c27e5e463694adf38 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1254923 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* it83xx(iteflash): disable watchdog before programming sequenceDino Li2018-10-011-25/+38
| | | | | | | | | | | | | | | | | With this patch, the watchdog reset won't break programming sequence. BUG=b:75976718 BRANCH=none TEST=flashing is done and no watchdog reset. Change-Id: I10b6e000aa872078f047f2a254d99a18092060bd Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Signed-off-by: Donald Huang <donald.huang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1247961 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Donald Huang <cguwinds@gmail.com> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* i2c: Elide vestigial commentJonathan Brandmeyer2018-09-281-3/+1
| | | | | | | | | | | TEST=buildall BRANCH=none BUG=none Change-Id: Ifd211a9e37cbb0f2a613a5a5573a7ee8b9315604 Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1252327 Reviewed-by: Edward Hill <ecgh@chromium.org>
* usb-pd: debounce vbus detection after PR_SWAPJett Rink2018-09-281-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | Vbus is supposed to be present when the PS_RDY PD command is sent by the new source, but if an external TCPC debounces the Vbus detection (which is worth while) and does not debounce the RX messages (debounce isn't needed), then it looks like we get PS_RDY before Vbus is presence which cause the PD state machine to disconnect (which is also the proper thing to do when acting as a SNK and VBus isn't present). Add a Vbus debounce time that allows us to ignore the absence of Vbus for a small window after receiving the PD_RDY packet from the new SRC after performing a Power Role SWAP (PR_SWAP). BRANCH=none BUG=b:112451526 TEST=Tested with a monitor that sends PS_RDY and asserts Vbus within 1ms of each other; this caused issue before and now it connects. Change-Id: I0ebfe04d97a15298ca3a5e7e5a3b23b4ab2edfbf Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1238081 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Nitin Kolluru <nkolluru@google.com>
* anx3429: mark that version 1.6V is requiredJett Rink2018-09-281-0/+9
| | | | | | | | | | | | | | | | | | | | Due to SOP' false detection issues, anyone using ANX3429 should upgrade the firmware to version 1.6 This new field will be used by factory/automated tests to ensure new boards (and existing board that cherry pick these changes) remember to upgrade the TCPC FW thus avoiding discovering the same bugs in each project. BRANCH=none BUG=b:64752060,b:116255749 TEST=tested ps8751 path with is the same as ANX. I don't have a device with ANX3429 right now. Change-Id: Id4df192aca30f82baee3021189aef72a62deee4e Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1246266 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* ps8751: set 0x39 as min version if vbus detectJett Rink2018-09-281-0/+9
| | | | | | | | | | | | | | We know that the PS8751 TCPC needs to have firmware version 0x39 or higher to support properly detecting Vbus presence. BRANCH=none BUG=b:116068318 TEST=min version for ps8751 is reported correctly Change-Id: I83c7587c5b9792659ecb876039e6c460f242d432 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1246265 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* pdchipinfo: add min firmware version to pdchipinfoJett Rink2018-09-2812-59/+102
| | | | | | | | | | | | | | | | Add a new field to the pdchipinfo host command that exposes the minimum required firmware version that we know about. This will allow factory tests or automated test to compare this version to the current version and fail. BRANCH=none BUG=b:116068318 TEST=with corresponding ectool change, min value is reported correctly Change-Id: Idf338795c3fd6f9f95e51471d0f6a7a422901d52 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1240457 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* usb_hid_touchpad: set confidence bit on finger leaveWei-Han Chen2018-09-282-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | When finger is leaving, the confidence should be '1', since it is not a plam. Some background: Since CL:617811, Linux kernel treats a finger whose confidence equal to 0 as a "palm", and override its width and height with max value. Therefore, when we are reporting a finger leaving event, if the confidence is 0, the finger will quickly become a fat finger (max width and heigh, locates at top-left corner), and then leave. This will confuse gesture library, and might cause unintended behaviors. BRANCH=nocturne BUG=b:116321493 TEST=manually on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I30be0e5efeb6c2215795565dce8c2da23892939f Reviewed-on: https://chromium-review.googlesource.com/1250584 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
* Make ADCs on STM32F4 workMoritz Fischer2018-09-284-8/+26
| | | | | | | | | | | | | | | | | | Make ADCs on STM32F4 chips work by reusing most of the STM32F3 code with the addition of SWSTART=1 bit in adc_read_channel. The SWSTART=1 is most likely also required for the F3, but could not be tested on actual hardware. BUG=none BRANCH=master TEST=Build for nucleo-411RE and check measurements Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Change-Id: Iea4f961b22119b5f2c1ee71295ec3ef1b7b7232c Reviewed-on: https://chromium-review.googlesource.com/1217603 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* rammus: Implement the EC battery codemichael_chen2018-09-281-27/+17
| | | | | | | | | | | | | | | | | | | | Implement the EC battery code. BUG=b:111815315 BRANCH=ToT TEST=Manual. Check DC power on system. Check battery can charging under AC mode. Check battery discharging under DC mode. Check battery cut off function. Check battery XDSG/XCHG status Change-Id: Ia9add6518948b30fbdb136f0b3c4104abd80a735 Signed-off-by: michael_chen <michael5_chen@pegatroncorp.com> Reviewed-on: https://chromium-review.googlesource.com/1198903 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: michael chen <michael5_chen@pegatroncorp.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>