summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* atlas: force keyboard backlight on at 100%stabilize-atlas.10819.BCaveh Jalali2018-07-252-1/+9
| | | | | | | | | | | | | | | | | | | | *** do not merge to master *** this is a hack to force-enable the keyboard backlight at full brightness for testing. BUG=none BRANCH=stabilize-atlas.10819.B TEST=keyboard LEDs come on at full brightness. they go off on suspend and turn back on on resume. Change-Id: I16ca841fe65cb418522630b38209edf683342f75 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1148008 Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Trybot-Ready: Caveh Jalali <caveh@google.com>
* Revert "atlas: do not fake power-on as reset-pin"Caveh Jalali2018-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fc1496d1bb84f74d539bc11a205d90926dc79740. this change prevented us from entering recovery mode using the 3-finger salute. the keyboard_scan.c:check_boot_key() depends the reset pin being asserted as a prerequisite to checking the refresh key has been pressed. this means we never get as far as checking for the 3-finger salute key combo. BUG=b:75070158,b:111577561 BRANCH=stabilize-atlas.10819.B TEST=3-finger salute now gets us into recovery Change-Id: I669721a11192602588bec4b5dbb31eaf76f666f3 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1141436 Commit-Queue: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Trybot-Ready: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com>
* atlas: tune MP2949 PMIC on bootCaveh Jalali2018-07-032-0/+244
| | | | | | | | | | | | | | | | | | | | we need to tune some of the MP2949 PMIC parameters for stability. we can do this from the EC when we boot the AP. at this point we always check to see if the desired values are programmed and apply them if necessary. eventually, the PMIC will be pre-programmed and we won't have to do this any more. BUG=b:110890675 BRANCH=none TEST=verified settings are being applied Change-Id: Ia814a362934f9cb9eb5c28dc0588f7425b3ab79e Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1124219 Commit-Queue: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com> Trybot-Ready: Caveh Jalali <caveh@google.com>
* atlas: enable ALS pollingCaveh Jalali2018-06-291-0/+3
| | | | | | | | | | | | | | | | | | | it looks like we were missing a config option on the EC to poll the ALS for readings, so just turn it on like on other platforms. BUG=b:110955363 BRANCH=none TEST="accelinfo on 100" on the EC console now reports non-zero ALS values. on linux, /sys/bus/iio/devices/iio:device1/in_illuminance_raw reads plausible values. Change-Id: Id4be964154efcbf021c3b781ff5dc5ba43e432db Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1121476 Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Trybot-Ready: Caveh Jalali <caveh@google.com>
* atlas: enable charge status LEDsCaveh Jalali2018-06-224-9/+108
| | | | | | | | | | | | | | | | | | | this enables the charge status LEDs. this is largely taken from the nocturne config. the color_map is tweaked to produce reasonable colors on atlas - at least as a 1st order approximation. BUG=b:110505328 BRANCH=none TEST=verified LEDs on a reworked board. color pattern is the same as nocturne. Change-Id: I4be4847e7a7d41ab83df8ab173bb3dba83297212 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1111576 Commit-Ready: caveh jalali <caveh@chromium.org> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* atlas: update GPIO config for new LED PWM channelsCaveh Jalali2018-06-221-4/+2
| | | | | | | | | | | | | | | | | this reconfigures 2 unused pins to be LED PWM channels. we'll use these on the next version of the board. BUG=b:110505328 BRANCH=none TEST=none Change-Id: I2a25cc5c4e07865b38cc41ef4fa96fc7a41e2664 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1108885 Commit-Ready: caveh jalali <caveh@chromium.org> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com> Reviewed-by: caveh jalali <caveh@chromium.org>
* Nami: Set fan speed to CONFIG_FAN_INIT_SPEED on resumeDaisuke Nojiri2018-06-221-1/+3
| | | | | | | | | | | | | | | | | | This patch sets the target RPM to CONFIG_FAN_INIT_SPEED on chipset resume. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:80152440 BRANCH=none TEST=Verify target RPM is set to the value derived from CONFIG_FAN_INIT_SPEED in recovery mode on Akali. Change-Id: Ide0d6b8a0c895479af8afff0ba40a7b502bbbbbf Reviewed-on: https://chromium-review.googlesource.com/1110349 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Nami: Make LED pulse in S3/S0ix every 2 seconds for VayneDaisuke Nojiri2018-06-221-1/+1
| | | | | | | | | | | | | | | | | | Currently, Vayne's LED pulse every 4 seconds when the system is discharging in S3/S0ix. This patch makes it every 2 seconds. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:78779583 BRANCH=none TEST=make BOARD=nami Change-Id: I7921f02d2f3d91b929ca5263535b095ee50661c3 Reviewed-on: https://chromium-review.googlesource.com/1106481 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Nami: Disable blinking LED on battery error for PantheonDaisuke Nojiri2018-06-221-0/+2
| | | | | | | | | | | | | | | | | Currently, the battery LED blinks when battery error is detected. This patch disables it for Pantheon. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:110451156 BRANCH=none TEST=make BOARD=nami Change-Id: Iaeeca989a78312cb0e92226a7be0d3cd8dee6707 Reviewed-on: https://chromium-review.googlesource.com/1108244 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* nvmem_vars: Make sure tuple structure is within boundsNicolas Boichat2018-06-221-4/+9
| | | | | | | | | | | | | | | The code uses a 0-byte to mark the end of the nvmem variables (which corresponds to tuple->key_len), check for that explicitly, then check if struct tuple fits within the nvmem. BRANCH=none BUG=chromium:854924 TEST=make TEST_ASAN=y run-nvmem_vars -j Change-Id: I7a974c64dec26c72de955f673d69a0712b023cb2 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109616 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* FIXUP: fix lsm6dsm driver specific data type declarationPaul Ma2018-06-225-7/+45
| | | | | | | | | | | | | | | | | | accelgyro_lsm6dsm driver use lsm6dsm_data as its driver specific data type rather than stprivate_data. Wrong data type will lead to random corrupted runtime data. Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> BRANCH=none BUG=b:110013316 TEST=make buildall -j Change-Id: I50e0da293921c2662e97aa6f47c83519609186b5 Reviewed-on: https://chromium-review.googlesource.com/1105797 Commit-Ready: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* test/rma_auth: Pad authcode before passing it to rma_try_authcodeNicolas Boichat2018-06-222-6/+22
| | | | | | | | | | | | | | | rma_try_authcode expects a buffer that is at least RMA_AUTHCODE_CHARS long, so copy the input string to a buffer before calling the function, else AddressSanitizer will complain. BRANCH=none BUG=chromium:854924 TEST=make TEST_ASAN=y run-rma_auth -j Change-Id: Iff2b195a7c7b01b925df6d9f53e0055f98f59ded Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109658 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* kevin/gru: remove board almost completelyJett Rink2018-06-2114-2064/+18
| | | | | | | | | | | | | | | | Kevin/Gru are running out of space and we already have another ARM board on ToT for development. Remove maintenance burden of keeping them around. BRANCH=none BUG=chromium:851512 TEST=build_packages --board=kevin works with dependent CLs. CQ-DEPEND=CL:1102565,CL:*640973,CL:*640974 Change-Id: Ie7c65c7799acc9f4d266e40b29b37240fec345c6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1100011 Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* nocturne: Support new base USB fault protection IC.Aseda Aboagye2018-06-212-4/+18
| | | | | | | | | | | | | | | | | | There is a new protection IC being introduced that will indicate a fault on the data lines. This commit adds support for that new fault pin which will follow the same behaviour as the other base power fault pin. The EC should disable pogo power when this goes off. BUG=b:110204244 BRANCH=None TEST=make -j BOARD=nocturne Change-Id: Ia29bbe7109abf22a372e4d50870d870b8bbde4c7 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1110940 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* gsctool: support for enabling/disabling TPM.Namyoon Woo2018-06-212-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces '-m' or '--tpm_mode' flag, which either enables or disables TPM. (chroot) gsctool -m enable open_device 18d1:5014 found interface 3 endpoint 4, chunk_len 64 READY ------- (chroot) gsctool --tpm_mode disable open_device 18d1:5014 found interface 3 endpoint 4, chunk_len 64 READY ------- BUG=b:77543596 BRANCH=gsctool TEST=manually Signed-off-by: Namyoon Woo <namyoon@google.com> Change-Id: I2feb8c51d4343a49f2f5d43291c304e3ad140057 Reviewed-on: https://chromium-review.googlesource.com/1106295 Commit-Ready: Namyoon Woo <namyoon@chromium.org> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* nocturne: Disable HC debug by defaultGwendal Grignou2018-06-211-0/+8
| | | | | | | | | | | | | | | | | | | | When sensors are in use, host queries EC often. BUG=b:110143516 BRANCH=none TEST=Check EC is free of output like: [4453.301662 ACPI query = 27] [4453.302686 HC 0x67] [4453.303954 HC 0x2b] [4453.340550 event set 0x0000000004000000] [4453.341458 event clear 0x0000000004000000] Change-Id: Ie144c3ba60e4016c56bbf9438a6e8adc0a87b283 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1107481 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Gwendal Grignou <gwendal@google.com> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Nami: Change rotation for accels and gyro for AkaliDaisuke Nojiri2018-06-211-6/+8
| | | | | | | | | | | | | | | | | | | This sets the rotations for the lid and base accels and the gyro for Akali to match the new orientations. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:109710669 BRANCH=none TEST=Verify angle readings on EC console follow lid positions on Akali360 (ver. 0x101). Change-Id: Ie5fc7e1731a4db0e4fbd1267df91a9658949eb93 Reviewed-on: https://chromium-review.googlesource.com/1109413 Commit-Ready: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Tested-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Reviewed-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Reviewed-by: Gwendal Grignou <gwendal@google.com>
* Nami: Enable USB2_ID when data role is UFPDaisuke Nojiri2018-06-212-4/+7
| | | | | | | | | | | | | | | | | This patch also moves USB2_ID from GPIO57 to GPIO42 because GPIO57 cannot be configured as a GPIO. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:110443393,b:110385436 BRANCH=none TEST=make BOARD=nami Change-Id: I228d02df2ba5c9731a0aa17732ce8a7bfbe299e9 Reviewed-on: https://chromium-review.googlesource.com/1108564 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* phaser: enable phaser motion sensor driversPaul Ma2018-06-218-209/+179
| | | | | | | | | | | | | | | | | | | | | This patch add phaser base and lid accel sensor support. Lid sensor type is lis2de, it has the same register interface as lis2dh, so they share the same driver. Since it has a very small fifo, use it in forced mode. Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> BRANCH=none BUG=b:110013316 TEST=boot phaser board, base and lid sensor can be inititalized successfully. use console command "accelinfo on", both sensors has valid output. Change-Id: Ie8514ea449fec41c6b1e0b6be1f2ae88458d119c Reviewed-on: https://chromium-review.googlesource.com/1105688 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* it83xx: gpio: set input voltage 1.8v by pinDino Li2018-06-212-57/+47
| | | | | | | | | | | | | | | At the original implementation, we would miss 1.8V configuration if the param 'mask' includes two or more bits. So we fix it. BRANCH=none BUG=none TEST=on bip, the settings of input voltage 1.8v selection register and the declarations of GPIO signal in gpio.inc are matched. Change-Id: Ife199a3150d29714ddcda2aa15b7a64ed9d130c9 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1107677 Reviewed-by: Jett Rink <jettrink@chromium.org>
* test/sha256: Fix parameter to memcmpNicolas Boichat2018-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | clang spots an issue with the parameter, we really want to compare the whole SHA256 digest. test/sha256.c:167:33: error: 'memcmp' call operates on objects of type 'const uint8_t' (aka 'const unsigned char') while the size is based on a different type 'const uint8_t *' (aka 'const unsigned char *') [-Werror,-Wsizeof-pointer-memaccess] if (memcmp(tmp, output, sizeof(output)) != 0) { ~~~~~~ ^~~~~~ test/sha256.c:167:33: note: did you mean to provide an explicit length? if (memcmp(tmp, output, sizeof(output)) != 0) { BRANCH=none BUG=chromium:854924 TEST=make CC=clang run-sha256 -j Change-Id: I7ca875a3981f987b60d62a12be7a4ca8b870b376 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109659 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* test/flash: Switch to EC_CMD_FLASH_INFO version 1 commandNicolas Boichat2018-06-211-2/+2
| | | | | | | | | | | | | | | test_flash_info: the response to EC_CMD_FLASH_INFO is now, by default, a ec_response_flash_info_1 structure, not just ec_response_flash_info (version 0). BRANCH=none BUG=chromium:854924 TEST=make TEST_ASAN=y run-flash -j Change-Id: Iebe8d90c3bdee70c481e31d41f173bf1b9a094ad Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109657 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* chip/host/system: Fix parameter to scanfNicolas Boichat2018-06-211-1/+1
| | | | | | | | | | | | | value is an integer, so we should use %u, not %lu. BRANCH=none BUG=chromium:854924 TEST=make CC=clang run-flash -j (issue only shows up with clang) Change-Id: Ifc13792dfed548f897c451790c73ad47aa8496ba Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109660 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* chip/host/gpio.c: Fix out of bounds accessNicolas Boichat2018-06-211-1/+3
| | | | | | | | | | | | | | Check if signal is within bounds before accessing gpio_irq_handlers[signal]. BRANCH=none BUG=chromium:854924 TEST=make TEST_ASAN=y runtests -j Change-Id: Ia1ff9b34943ff596d27b2c746937f31623f58f96 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109615 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* test/host_command: Do not overflow req_bufNicolas Boichat2018-06-211-5/+8
| | | | | | | | | | | | | | The test attempts to access req_buf outside of its bounds during test_hostcmd_too_long, let's increase the buffer size. BRANCH=none BUG=chromium:854924 TEST=make V=1 TEST_ASAN=y run-host_command -j Change-Id: Ibacc080c9e961ad4eb56c17908e704796404a9ca Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109614 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* bip: Increase UART transmit buffer sizetim2018-06-211-0/+3
| | | | | | | | | | | | | | | | | | | With this patch, we can get the completed messages during system boot. If the size of tx buffer is too small, the messages will print overwritten. BUG=none BRANCH=none TEST=The serial console can check message during system reboot. Change-Id: I37902096baeeb678b696d9a4acce1e048d2105a6 Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1098740 Commit-Ready: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Tested-by: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* it83xx: gpio: disable default pull-down of USB controllerDino Li2018-06-212-1/+14
| | | | | | | | | | | | | | | | | | At default, there is a 15K pull-down resistor on both D-/D+ pins(GPH5/GPH6). We disable these two pull-down resistors so these two pins will work properly in GPIO mode. BRANCH=none BUG=b:110237505 TEST=on EVB, add a 100K pull-up resistor on GPH5 and measuring the voltage is around 3.3V if this pin is configured as input. Change-Id: I5fe3599eff3ea458cd964c95386f922cf2d3bcee Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1105689 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* cheza: Don't defer the VBUS detection interrupt handlerWai-Hong Tam2018-06-211-14/+2
| | | | | | | | | | | | | | | | | | | The VBUS detection interrupt handler was moved to the deferred context because some check requires I2C communication. Now the check result is cached locally and doesn't need any I2C communication, per the fix: https://chromium-review.googlesource.com/1086115 So the interrupt handler should not be deferred. BRANCH=none BUG=b:74395451 TEST=Plug charger to P0 and/or P1, check the state change correctly. TEST=Plug device to P0 and/or P1, check sourcing VBUS correctly. Change-Id: I3ee762b5f1c9a00037da510df83b593c45a4e95a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1108740 Reviewed-by: Jett Rink <jettrink@chromium.org>
* cr50: Disabling TPM or enabling TPM.Namyoon Woo2018-06-217-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new firmware status, TPM mode along with a new TPM vendor command VENDOR_CC_TPM_MODE. TPM mode indicates whether TPM is enabled or disabled. Initially, this value shall be TPM_MODE_ENABLED_TENTATIVE, which means TPM is enabled but can be changed. VENDOR_CC_TPM_MODE changes this value either as TPM_MODE_ENABLED or TPM_MODE_DISABLED. This is for one time use only until next TPM reset event. Once TPM is disabled, any subsequent TPM commands shall fail. TPM_MODE_TPM_MODE command may be issued with input size as zero, which would not change TPM mode value. Either with the valid input value or without any input value, it returns the current TPM mode value in uint8_t type. This adds 160 bytes in binary. BUG=b:77543596 BRANCH=cr50 TEST=manually (chroot) ./extra/usb_updater/gsctool -h Usage: gsctool [options] [<binary image>] Options: -m,--tpm_mode [enable|disable] Query or control tpm mode (dut) gsctool -a -i Board ID space: XXXXXXXX:XXXXXXXX:XXXXXXXX (chroot) ./extra/usb_updater/gsctool -m enable (dut) gsctool -a -i Board ID space: XXXXXXXX:XXXXXXXX:XXXXXXXX (chroot) gsctool -m enable Error 7 in enabling TPM. (dut) gsctool -a -i Board ID space: XXXXXXXX:XXXXXXXX:XXXXXXXX (dut) reboot (chroot) ./extra/usb_updater/gsctool -m disable (dut) gsctool -a -i Problems reading from TPM, got 10 bytes Error: Failed to send vendor command 25 (dut) tpm_version [ERROR:... TRUNKS_RC_WRITE_ERROR (dut) tpm-manager [INFO:tpm_manager_v2.cc(51)] Initializing TPM. [tpm_manager.TakeOwnershipReply] { status:STATUS_NOT_AVAILABLE } (dut) reboot (chroot) ./extra/usb_updater/gsctool -m TPM Mode: enabled (0) (dut) gsctool -a -i Board ID space: XXXXXXXX:XXXXXXXX:XXXXXXXX (dut) tpm_version TPM2.0 Version Info: ... (dut) tpm-manager [INFO:tpm_manager_v2.cc(51)] Initializing TPM. [INFO:tpm_manager_v2.cc(66)] TPM initialization successful (21 ms). Change-Id: I1453d1a8d03f13cc7fc203863cbc50bf84c9dd8c Signed-off-by: Namyoon Woo <namyoon@google.com> Reviewed-on: https://chromium-review.googlesource.com/1105614 Commit-Ready: Namyoon Woo <namyoon@chromium.org> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* careena: Fix power-on with cut-off batteryEdward Hill2018-06-205-92/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Overwrite keyboard backlight support by SKUIDDevin Lu2018-06-202-0/+22
| | | | | | | | | | | | | | | | Allow overwrite the keyboard backlight support of ec feature with different SKUID for careena. BUG=b:110065836 BRANCH=none TEST=Verify ectool inventory that showning Keyboard backlight support by SKUID. Verify keyboard backlight hotkey can up/down the britghness. Change-Id: Icde99af1f0e4356c0788fd31a8575290c845d3d2 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1096794 Reviewed-by: Edward Hill <ecgh@chromium.org>
* ec/google: Add command to fetch keyboard ID from ECparis_yeh2018-06-205-7/+99
| | | | | | | | | | | | | | | | | Sort k-prefix host commands and descriptions in alphabetical order BRANCH=master BUG=b:80168723 TEST=Check 'ectool kbid' on a reworked DUT using keyboard samples Change-Id: If2ad654e5ef269d03365db7c3286c2281aa9d9ef Signed-off-by: paris_yeh <pyeh@google.com> Reviewed-on: https://chromium-review.googlesource.com/1097997 Commit-Ready: Paris Yeh <pyeh@chromium.org> Tested-by: Paris Yeh <pyeh@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Paris Yeh <pyeh@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* atlas: config CPU_PROCHOT polarityCaveh Jalali2018-06-202-1/+2
| | | | | | | | | | | | | | | | | | | atlas's CPU_PROCHOT signal is active low which is inverted compared with previous designs. we recently added support for configuring PROCHOT polarity, so we can now configure this pin correctly. BUG=b:79266467 BRANCH=none TEST=prochot pin reads back correctly on EC and CPU is not throttled. explicitly asserting PROCHOT gpio on EC throttles CPU. Change-Id: Ie44352855d36f43f5767a99684dd17a509826190 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1107121 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* power/mt8183: Remove use of GPIO_PP1800_S0_EN.Yilun Lin2018-06-201-2/+0
| | | | | | | | | | | | | TEST=make BOARD=kukui BUG=None BRANCH=None Change-Id: I09b8efb1215abfc53904a8ceb8273d88ef9fbbb1 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1105804 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* bip: ensure AP is off during EC flashJett Rink2018-06-191-0/+3
| | | | | | | | | | | | | Hard reset the system right before flashing the EC to ensure that AP is off while we are flashing the EC. BRANCH=none BUG=b:110410722 TEST=flash bip and verify that AP console is unresponsive. Change-Id: I297f230c260ae5c3c1a8de8f0ea7c55a87606691 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1106655
* ppc: sn5s330: Set VCONN ILIM to 0.6A (min).Aseda Aboagye2018-06-192-4/+7
| | | | | | | | | | | | | | | | | | | | | It seems that several charge through hubs have inrush currents that exceed 350mA when VCONN is applied. This in turn causes the SN5S330 to latch off VCONN due to the overcurrent condition. This commit simply sets the VCONN current limit to the 600mA (min) setting. BUG=b:110370179 BRANCH=None TEST=Flash nocturne; Use a variety of charge through hubs, verify that VCONN is not latched off. Change-Id: I7a0e5d1aa7c42d22b43a596520790debee47163b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1105309 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Script to convert board file to servod config .py file.Ravi Chandra Sadineni2018-06-191-0/+85
| | | | | | | | | | | | | Script to convert .board file (input to powerlog.py) into .py file which can be used to generate .xml configuration file for servod. BUG=none BRANCH=none TEST= convert a .board file to .py file and verify it works. Change-Id: Ia67d1552c048895efee10d7a92830cfa25a51984 Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1105479 Reviewed-by: Puthikorn Voravootivat <puthik@google.com>
* yorp: Program PWM3 alternate function based on board versionFurquan Shaikh2018-06-192-1/+13
| | | | | | | | | | | | | | | | | | | | GPIO80 is used for ENTERING_RW signal on V0 whereas it is used as an alternate function for KB_BL_PWM on V1+. Configuring the alternate function in gpio.inc breaks V0 boards w.r.t. ENTERING_RW signal. This change moves the configuration of alternate function for PWM3 to update_drivers_from_board_id. BUG=b:110084012 BRANCH=None TEST=Verified that firmware_DevMode passes. Change-Id: I82bf5df685d40981b70767008dafbe76ccb20ddf Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1106289 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* yorp: Fix GPIO PIN for ENTERING_RW_V0Furquan Shaikh2018-06-191-1/+1
| | | | | | | | | | | | | | | | | | ENTERING_RW_V0 is GPIO80 on yorp V0. This change fixes the pin configuration in gpio.inc BUG=b:110084012 BRANCH=None TEST=Verified that firmware_DevMode test passes along with the other set of CLs. Change-Id: I77c80c5b6926003cc678e4a0d2a1f11bef140f92 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1106288 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* charger/mt6370: add Mediatek mt6370 charger driver.Yilun Lin2018-06-194-9/+145
| | | | | | | | | | | | | | | | BRANCH=none BUG=b:80160408 TEST=1) add MT6370 config to kukui and build the code 2) hook up mt6370 eval board with dummy load 3) verify the i2c traffic: set voltage, set current, and get device id Change-Id: I47461530f9cc490a9dc2da74eede1297ebc4443e Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1100365 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* atlas: enable hibernate wake sources using PSLCaveh Jalali2018-06-191-4/+5
| | | | | | | | | | | | | | | | | this enables the PSL (power switch logic) on the EC to wake the system from hibernate. BUG=b:110237370,b:110062739 BRANCH=none TEST=verified atlas wakes up on AC-in Change-Id: Ifc0f5a73aeaca8f988afcc0f831fb062a92d8b28 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1098530 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* atlas: power down system at PMIC on hibernateCaveh Jalali2018-06-192-1/+27
| | | | | | | | | | | | | | | | this turns off most of the power rails at the PMIC in response to a system hibernate request. BUG=b:110237370 BRANCH=none TEST=verified both the AP and EC power down Change-Id: Ica830e15dfd2f80a3392afe29a079faa5e4d6ec9 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1096485 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com>
* util: correct unpack_ftbBob Moragues2018-06-191-2/+2
| | | | | | | | | | | | | | unpack_ftb is used as a build tool to convert ST toucpad .ftb file to .bin BUG=b:109719787 TEST=verify that unpack_ftb is present and executable Change-Id: I91f541f7c030adc7979043ad48cdedc1f9f58da6 Reviewed-on: https://chromium-review.googlesource.com/1104979 Commit-Ready: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* Nami: Reduce buck-boost mode switching frequency of isl9238Daisuke Nojiri2018-06-182-2/+17
| | | | | | | | | | | | | | | | | This patch reduces buck-boost mode switching frequency of isl9238 to half. This should reduce the heat generated from the charger. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:80448805 BRANCH=none TEST=make BOARD=nami Change-Id: I38a12d60f562d828a7d186e43791a8b6aedc2500 Reviewed-on: https://chromium-review.googlesource.com/1095429 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Nami: Set initial fan duty to 50%Daisuke Nojiri2018-06-181-0/+2
| | | | | | | | | | | | | | Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:80152440 BRANCH=none TEST=Verify fan starts at 50% duty on Nami. Change-Id: I9b75ce95f40b86d0b89a685ff1bb22abf1fcf3f4 Reviewed-on: https://chromium-review.googlesource.com/1100963 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* bd99992: add top level header file for PMICCaveh Jalali2018-06-181-0/+16
| | | | | | | | | | | | | | | | | | | | this introduces a top-level header file for the bd99992 PMIC.the temp sensor portion of this chip already has an established header file, so we can just include it. at this point, we only need one new register definition - the SDWNCTRL (shutdown control) register. BUG=b:110237370 BRANCH=none TEST=it compiles Change-Id: I324df08ed37d6d6d85520e1217135657b18a23a0 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1096484 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* cr50: Fix in vendor commands return values.Namyoon Woo2018-06-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Vendor command wrap function returned always VENDOR_RC_SUCCESS regardless the wrapped function returned an error. BUG=b:79983505 BRANCH=cr50_vendor_cmd TEST=manual Issued vendor commands that were supposed to be ignored if they were from USB, expecting to have VENDOR_RC_NO_SUCH_COMMAND (127). (chroot) gsctool -w open_device 18d1:5014 found interface 3 endpoint 4, chunk_len 64 READY ------- Getting WP Error 127 getting write protect Change-Id: Ic07e81d278565005a50e5456e2bb4e436ebd5f96 Signed-off-by: Namyoon Woo <namyoon@google.com> Reviewed-on: https://chromium-review.googlesource.com/1103454 Commit-Ready: Namyoon Woo <namyoon@chromium.org> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* cheza: Fix USB peripheral mode when using a Type-C to std-A male cableWai-Hong Tam2018-06-181-1/+0
| | | | | | | | | | | | | | | | | | | | In the PD state machine, the decision is that if the data is DFP, then connect the mux, but if the data role is UFP, then disconnect the mux. To make the Type-C to std-A male cable work, the UFP should also connect, need to disable the CONFIG_USBC_SS_MUX_DFP_ONLY. BRANCH=none BUG=b:110265762 TEST=Used an image enabling USB peripheral mode and USB gadget zero, typed EC command to mux the port-1 HS to AP, plugged a Type-C to std-A male cable, the host side can enumerate the gadget zero device and the dmesg log shows the detection too. Change-Id: I532e53bd0832c50a86a91d1c8d84fd55af543eca Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1102985 Tested-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* grunt: Enable tablet mode for convertible SKUs.Jonathan Brandmeyer2018-06-183-11/+45
| | | | | | | | | | | | | BUG=b:79159777 BRANCH=none TEST=EC functional test 1.2.18 on grunt convertible. Verified that a grunt clamshell wthat does not have a populated lid accelerometer works as expected. Change-Id: Ic9059d7d8f4f353475517ad3b8ef049ed653e9e4 Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1093255 Reviewed-by: Edward Hill <ecgh@chromium.org>
* nocturne_fp: update flash_fp_mcuVincent Palatin2018-06-181-13/+22
| | | | | | | | | | | | | | | | | | | | Update the board-specific parameters for the new Nocturne board. Add both configurations in the script, so it's convenient to carry around. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:79666174 TEST=On Nocturne, run './flash_fp_mcu ec.bin'. TEST=On Meowth, run './flash_fp_mcu ec.bin'. Change-Id: Ic84f679c02cc03266a6469fbe898c47e4c66c11c Reviewed-on: https://chromium-review.googlesource.com/1071787 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>