summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* phaser: enable tablet mode and lid anglestabilize-nocturne.10828.BPaul Ma2018-06-293-6/+54
| | | | | | | | | | | | | | | | | | | | | Enable CONFIG_DYNAMIC_MOTION_SENSOR_COUNT so that clamshell skus and convertible skus get different sensor number. Enable lid angle function to make peripherals get correct state on convertible skus. Enable tablet mode for convertible skus as well. Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> BRANCH=none BUG=b:110604678 TEST=boot phaser360 sku, test keyboard function when hinge is at 135, 180, 270, 360 degree. test tablet mode when 360 degree. Change-Id: I8f15a2d3ea3ae7d0cf5d60333e079d1ffd8e906b Reviewed-on: https://chromium-review.googlesource.com/1114667 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>
* yorp: add internal PUs for unused pins to prevent leakage current.Mulin Chao2018-06-281-0/+7
| | | | | | | | | | | | | | | | | | | This CL adds internal PUs for unused pins on yorp in gpio.inc to prevent leakage current. Please notice the test platform is yorp proto 1. Beside PUs for strap-pins, the configuration of other pins might need to change on yorp proto 2. BRANCH=none BUG=b:110170824 TEST=No build errors for npcx7 series. Adding PUs on strap-pins saves ~0.4mA at S0ix. Adding PUs on the other unused pin saves ~0.2mA at S0ix. Change-Id: If2406f9fca12f7b3456301435f8ec25cb264ed3a Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/1092391 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* npcx: adc: only enable ADC during conversion for power consumption.Mulin Chao2018-06-282-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | For better power consumption in npcx series ec, this CL only turns on ADC module before starting conversion and turns it off after the conversion is done. If ec enters deep sleep when ADC conversion is ongoing, the conveting process is suspended until next time ec wakes up from the deep sleep. Considering the frequency of ADC's source clock is up to 15MHz, it's more efficient to forbid ec enter deep sleep when the conversion is proceeding. (Each conversion time of ADC channel is ~200us based on this condition.) Forbidding ec enter deep sleep should have no harm. BRANCH=none BUG=b:110170824 TEST=No build errors for npcx7 series. The current of AVCC is reduced from 0.4mA to ~0.01mA on yorp if this patch is applied. Change-Id: Ie9226e942eeefaadbca7c17e45f0b9ee9a2364e9 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/1090603 Commit-Ready: Jett Rink <jettrink@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Nami: Support battery_check_disconnect for TI and Renesas gaugeDaisuke Nojiri2018-06-281-4/+71
| | | | | | | | | | | | | | | | | | | | | This patch adds functions which check CFET and DFET status for TI BQ40Z50 and Renesas RAJ240. They are used to check battery's disconnect status. These two gauges are identified by get_gauge_ic. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:109876962,b:110411979 BRANCH=none TEST=Verify Renesas and TI gauges return BATTERY_NOT_DISCONNECTED. Verify battery icon is shown in taskbar. Change-Id: Ib3e62bac0d342074c78d095788882a2ec1016b7e Reviewed-on: https://chromium-review.googlesource.com/1092795 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* motion_sense: Provide option to defer resume actions.Jonathan Brandmeyer2018-06-283-7/+13
| | | | | | | | | | | | | | | | | | | See also crrev.com/c/433338. Grunt requires a delay on startup to account for the slew rate on the sensor power rails. Similar to the delay option for suspend actions, also provide a delay option for resume actions. BUG=b:79159777, b:35550738 TEST=KX022 init on S5->S3->S0 succeeds on both grunt clamshell and grunt convertible SKUs. BRANCH=none Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: I061c4c148c5c31c09b8d0c1d40aef1ba1e3d344b Reviewed-on: https://chromium-review.googlesource.com/1091211 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* careena, grunt: Enable pullup for the lid switch.Jonathan Brandmeyer2018-06-282-2/+2
| | | | | | | | | | | | | | | | | | | | | In the case that the lid switch becomes loose/disconnected, default to the 'lid open' state by pulling up the GPIO. Grunt is not affected, but we want to demonstrate best practices for the grunt family with its configuration. BUG=b:110836185 BRANCH=none TEST=disconnected lid switch on careena and observed lid state remained open and stable. Reconnected lid switch and observed lid state followed physical lid position. Change-Id: I951594ed7f6d98cf1b5258a894d0b95b6ca98ecc Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1115859 Commit-Ready: Martin Roth <martinroth@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* iteflash: retry the special waveform sequence without delayDonald Huang2018-06-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | On the special case,if you set the I2C pin as GPIO output low status. It can't flash after booting. You can press Reset Button before flash EC FW to do the operation successfully. BUG=none BRANCH=none TEST=1.Set GLK-RVP-ITE board I2C Channel setting as gpio output low (GPIO PIN A4 A5) 2.Flash FW => Fail Flash FW + Press Reset Button => OK Change-Id: I98d650da0792eeb194f5b155805adca25b876319 Signed-off-by: Donald Huang <donald.huang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1114659 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Donald Huang <cguwinds@gmail.com> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* bip: implement charging LEDDiana Z2018-06-284-2/+75
| | | | | | | | | | | | | | | | Enable the LED common code for bip. Set up bip's charging LED, which currently shares similar behavior to the yorp charging LED. Since we are not using the PWM on bip, set to just use GPIO pins. BRANCH=none BUG=b:110121794 TEST=verified LED behavior with board charging, fully charged, discharging, discharging in S0ix, and with battery unplugged Change-Id: If874d0d841a77a8816cdcd0f618ab267123cfa17 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1117312 Reviewed-by: Jett Rink <jettrink@chromium.org>
* flash_ec: respect SERVOD_PORTRaul E Rangel2018-06-281-1/+3
| | | | | | | | | | | | | | If the SERVOD_PORT variable is set, servod will use it as its default port. This makes flash_ec also respect the variable. BUG=none TEST=SERVOD_PORT=9000 flash_ec --board=grunt BRANCH=none Change-Id: Ic4ae28b3632faa326b81be85bf807c39dac1cf7c Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116865 Reviewed-by: Jett Rink <jettrink@chromium.org>
* host_command: Fix response_size to match data that was copiedNicolas Boichat2018-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both host_command_read_test and host_command_test_protocol write back an incorrect response_size, that does not match the number of bytes that were actually copied. This is easily noticed when fuzzing with verbose host command printing, as host_command_debug_request attempts to print the whole response, reading the response buffer out of bounds. BRANCH=none BUG=chromium:854975 TEST= #define FUZZ_HOSTCMD_VERBOSE in test/test_config.h echo AwoAAAAALADvDAE= | base64 -d > crash Request: cmd=0013 data=03df1300007f0b000000007f00007f7f7f7f06 or echo AwMAAEpK | base64 -d > crash Request: cmd=0003 data=03650300004a01004a make buildfuzztests -j ASAN_OPTIONS="log_path=stderr" \ build/host/host_command_fuzz/host_command_fuzz.exe crash Change-Id: Ibc8fe958cf6fae38fbfecec558c37ed3d676a51b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116199 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* ec: Make it possible to run tests with AddressSanitizer enabledNicolas Boichat2018-06-289-16/+55
| | | | | | | | | | | | | | | | | | | Automatically use CC=clang if TEST_ASAN is specified. Also, add a __no_sanitize_address attribute macro to prevent ASan from adding guards around host_command, mkbp_event, and hook "arrays" that are generated at link-time. Also, set ASAN_OPTIONS env variable in run_host_test. BRANCH=none BUG=chromium:854924 TEST=make TEST_ASAN=y runtests -j Change-Id: Iaf0ec405022760d757a8a9d62a5022460d1b16e1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109661 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* ec: Make it possible to build tests using clangNicolas Boichat2018-06-289-26/+41
| | | | | | | | | | | | | | | | | | We might want to try out address sanitizer/fuzzer on some host tests: make it possible to build host tests using clang. Board builds are broken, and there is no intention to fix them, at least for now. BRANCH=none BUG=chromium:854924 TEST=make buildall -j TEST=make CC=clang runtests -j Change-Id: Id49a1b8537bc403d53437a2245f4fab6ceae89ac Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1107522 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Makefile.toolchain: Switch from cpp to $(CC) -ENicolas Boichat2018-06-283-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it more straightforward to switch to clang preprocessor later on. This requires a few other modifications in the Makefiles (gcc -E does not read from stdin by default, and does not process files that do not end in .c/.h). BRANCH=none BUG=chromium:854924 TEST=make buildall -j TEST=Before and after the change, all ec.bin binaries are identical: git checkout m/master make REAL_SIGNER=dummy buildall -j mv build build-master find build-master -type d | sed -e 's/-master//' | \ xargs -I{} mkdir -p {} find build-master -name ec_version.h | sed -e 's|build-master/||' | \ xargs -I{} cp build-master/{} build/{} git checkout this-cl => comment out .PHONY: $(out)/ec_version.h in Makefiles.rules make REAL_SIGNER=dummy buildall -j find build-master -name ec.bin | sed -e 's|build-master/||' | \ xargs -I{} diff build-master/{} build/{} => No difference Change-Id: If07f033dc7e9a73245499c656562bb906dcd4130 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1117721 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* common/printf: snprintf: Return number of bytes on successNicolas Boichat2018-06-282-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | As indicated in the man page: """ Upon successful return, these functions return the number of characters printed (excluding the null byte used to end output to strings). """ There are no users of the return value currently in the EC code, but this matters when doing fuzzing, as libFuzzer calls std::to_string, which expects the correct return value. BRANCH=none BUG=chromium:854975 TEST=make buildfuzztests -j && ASAN_OPTIONS="log_path=stderr" \ build/host/usb_pd_fuzz/usb_pd_fuzz.exe -jobs=10 actually creates 10 output files. TEST=make run-utils_str -j Change-Id: If6a040f690dd847f4c88c3b8566554afdfbabc32 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116625 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* nocturne_fp: update flash_fp_mcu for the new power controlVincent Palatin2018-06-281-4/+15
| | | | | | | | | | | | | | | | | | | | On Nocturne, the cros-ec-spi kernel driver controls the FPMCU power (PCH_FP_PWR_EN) through the ACPI power resource. Update the flashing script to take it into account: - when cros-ec-spi driver is unloaded, it normally cuts power. - cros-ec-spi might pulse reset on binding. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=poppy BUG=b:79666174 b:79902391 TEST=On Nocturne with up-to-date coreboot, run './flash_fp_mcu ec.bin'. Change-Id: I91aee95df640c7e89b2497fc3a8d8eb92a4d64a5 Reviewed-on: https://chromium-review.googlesource.com/1114743 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
* nocturne: Add on-board temperature sensorsSumeet Pawnikar2018-06-282-0/+30
| | | | | | | | | | | | | | | This patch adds on-board temeprature sensors. BUG=None BRANCH=master TEST=`temps` on EC console shows temperature of sensors. Change-Id: Ia61b695a6892b2aa042915a427b0d224d09e698e Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1112896 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* host_command: read_test/memmap: Fix response buffer overflowNicolas Boichat2018-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | host_command_read_test/memmap expect to have at least 128 bytes available in response buffer, _after_ ec_host_response header. However, in the fuzzing test, we only use a 128 bytes response buffer, and set response_max to 128, correctly. host_packet_receive correctly computes the response payload size (i.e. 120 bytes): args0.response_max = pkt->response_max - sizeof(struct ec_host_response); But then host_command_read_test/memmap ignore response_max, and overflows that response buffer. BRANCH=none BUG=chromium:855972 TEST=make buildfuzztests -j echo AwMAAAMLxv0AgA== | base64 -d > crash ASAN_OPTIONS="log_path=stderr" \ build/host/host_command_fuzz/host_command_fuzz.exe ./crash echo AwcAAAAAeg== | base64 -d > crash Call fuzzer again. Change-Id: I1344842764a07f09546f3b0533b3ce154eff2732 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116200 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Nami: Set GPIO42 to high Z for older boardsDaisuke Nojiri2018-06-271-0/+4
| | | | | | | | | | | | | | | | | | | | On board version before 0x300, GPIO42 are connected to TP_INT_CONN. Setting this to output causes the trackpad to stop working. This patch configures GPIO42 to GPIO_INPUT for previous boards to fix the issue. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:110817459 BRANCH=none TEST=make BOARD=nami Change-Id: Ib9774b64732704b85a34531a55bf673db72bc601 Reviewed-on: https://chromium-review.googlesource.com/1116419 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* phaser: fix lis2de resolution and sensor value outputPaul Ma2018-06-275-7/+34
| | | | | | | | | | | | | | | | | | | | | | lis2de only support 8-bit resolution. This is what is different from lis2dh. This patch add two defines (CONFIG_ACCEL_LIS2DH and CONFIG_ACCEL_LIS2DE) to defferientiate them. For calculate_lid_angle() reliable calculation, code asks for 16 bits sensor value output, this patch fix that as well. Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> BRANCH=none BUG=b:110604678 TEST=boot phaser360 board, use 'accelinfo on' to watch lid output and angle output, lid axis value should be 16 bit range and angle is correct. Change-Id: If77954ecf477736b9168b3a3b6805396a3201a57 Reviewed-on: https://chromium-review.googlesource.com/1111775 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>
* flash: Fix flash_range_okNicolas Boichat2018-06-271-0/+2
| | | | | | | | | | | | | | | | | | With parameter offset=0x7f000000 size_req=7f7f0000, flash_range_ok fails to notice that the offset/size is invalid, as offset+size overflows and becomes negative. BRANCH=none BUG=chromium:855951 TEST=make buildfuzztests -j echo AxMAAH8AAAB/AAB/f39/Bg== | base64 -d > crash ASAN_OPTIONS="log_path=stderr" \ build/host/host_command_fuzz/host_command_fuzz.exe ./crash Change-Id: I9e4c752bee2695a87e69c2ff8494af4e9bffc9a4 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116198 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* DragonEgg: Initial skeleton for DragonEggScott Collyer2018-06-279-0/+171
| | | | | | | | | | | | | | | | | | This CL adds DragonEgg in /board and /baseboard. Only minimal gpio signals are defined to allow successful build. The /baseboard files are currently empty, but the plan is to use baseboard for functions that will be common for ite EC and ILK. BRANCH=none BUG=b:110880394 TEST=make buildall Change-Id: Ia018692f277efaceef85a060b6585accc82fddfd Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1117133 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* core/host/task: Fix task_set_eventNicolas Boichat2018-06-271-4/+4
| | | | | | | | | | | | | | | | task_set_event is expected to _add_ the event bit to the current mask, not reset the whole mask. Also, fix all operations to use atomics. BRANCH=none BUG=chromium:854975 TEST=No more timeouts when running usb_pd fuzzing tests. Change-Id: Id17428e15f6fb8b52891bed33281f866fbc2be8f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116624 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* core/host: Fall back to udelay when task is invalidNicolas Boichat2018-06-272-2/+3
| | | | | | | | | | | | | | | | | | | When running fuzzing tests, the sanitizer library may call usleep from the main thread, and our implementation thinks that usleep is called from idle task (task_id == 0), and just waits for an event that will never arrive. Make sure the default task id is invalid, and fall back to udelay if we are in an invalid task. BRANCH=none BUG=chromium:854975 TEST=Fuzzing tests do not fail with strange errors. Change-Id: Icc3fdce30b54dfb06913a3d6cbabaa07e1266ba6 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1116623 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* nocturne: Remove internal pulls on PD interrupts.Aseda Aboagye2018-06-271-0/+13
| | | | | | | | | | | | | | | | | | | | | | On early revisions of nocturne, on board pullups were missing, therefore the EC configured some internal pullups on the Type C interrupt pins. On newer revisions, this has been fixed and external pullups are stuffed. This commit simply adds a board_quirks() function to remove the internal pull up resistors on newer boards. BUG=b:109937217 BRANCH=None TEST=Change check to match current board revision, flash nocturne, verify that internal pull ups were disabled. Change-Id: I9a23b9c5b7a5d855368ab1a99cf0303b06b33596 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1115966 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* Nami: Lock ECDaisuke Nojiri2018-06-271-6/+1
| | | | | | | | | | | | | | | | | | This patch undefines CONFIG_SYSTEM_UNLOCKED to lock the system and defines CONFIG_USB_PD_COMM_LOCKED to enables PD only if EC is in RW. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:73250070 BRANCH=none TEST=make BOARD=nami Change-Id: I5877d2ff2f537b5db7e99c846f7fdb2232b88187 Reviewed-on: https://chromium-review.googlesource.com/1069215 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* nocturne: Update LED settings.Aseda Aboagye2018-06-272-5/+11
| | | | | | | | | | | | | | | | | - Enable active charge port feature. - Change battery full colour to white. - Slightly tweak colours. BUG=b:69138917, b:74601646 BRANCH=None TEST=Flash nocturne; verify LEDs conform to new behaviour. Change-Id: I9e9d234e94f3d8b5b18a8041da574fd4dabae04d Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1109033 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* led_pwm: Add CONFIG_LED_PWM_ACTIVE_CHARGE_PORT_ONLY.Aseda Aboagye2018-06-272-26/+99
| | | | | | | | | | | | | | | | | | This commit adds support for a feature for the common PWM controlled LED behaviour to only show the charge state instead of including chipset state and low battery state as well. Additionally, this feature will only illuminate the LED of the active charge port. BUG=b:69138917 BRANCH=None TEST=Enable option on nocturne and verify behavior is as expected. Change-Id: Ie6a767084c9102ff9b7bdad9288fcebf2ed9706f Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1109032 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* wheatley: remove wheatley board driver since running out of code space.Mulin Chao2018-06-279-1739/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the results of "make buildall" on ToT, wheatley is also running out of code space on npcx5m5g. And we ran out of code space on wheatley in CL 1098864. The following is the result of "make buildall". ======= building wheatley make --no-print-directory BOARD=wheatley V= skip.. 1/usr/x86_64-pc-linux-gnu/arm-none-eabi/binutils-bin/2.27.0/ld.bfd.real: No room left in the flash collect2: error: ld returned 1 exit status make[2]: *** [Makefile.rules:391: build/wheatley/RO/ec.RO.elf] Error 1 make[1]: *** [Makefile.rules:191: proj-wheatley] Error 2 make[1]: Leaving directory '/mnt/host/source/src/platform/ec' make: *** [Makefile.rules:148: build_boards] Error 2 In order to prevent it blocks the development of nuvoton ec drivers (wheatley is used for Nuvoton testing only.), this CL removes it from ToT and the following is the result of "make buildall". Test x25519 passed! (0.546 seconds) make[1]: Leaving directory '/mnt/host/source/src/platform/ec' buildall completed successfully! Tightest boards' RW images, bytes left: zinger : 1164 minimuffin: 1172 glados : 1960 BRANCH=none BUG=b:110708808 TEST=Passed "make buildall". Change-Id: I900edb475b71bb63edd1522e7b9331bfb41df1d0 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/1111741 Commit-Ready: Jett Rink <jettrink@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ectool: remove fpcheckpixels from help messageNicolas Norvez2018-06-271-2/+0
| | | | | | | | | | | | | | fpcheckpixels (checkerboard tests) is no longer implemented in ectool, update the help message. BUG=None TEST=None BRANCH=None Change-Id: Ib9d0e3760ed9c838c84f67b3900b22b5a5be5679 Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1114679 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* phaser: Add volume buttons.nickchen2018-06-273-0/+7
| | | | | | | | | | | | | | | | | Add feature of volume up and down for phaser. BUG=b:110013537 BRANCH=none TEST= Press volume buttons, verified by OEM. Change-Id: I4668281b163823a62fc39802f15245cd6e5b6b12 Signed-off-by: nickchen <nickchen@ami.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1114660 Commit-Ready: Nick Chen <nickchen@ami.corp-partner.google.com> Tested-by: Nick Chen <nickchen@ami.corp-partner.google.com> Tested-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-by: Chao Ding <chao.ding@bitland.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* nocturne: Turn off sensor interrupts in S5.Aseda Aboagye2018-06-261-4/+21
| | | | | | | | | | | | | | | | | | | | | To save power, in the next board revisions, the sensors will be disabled in S5. This would cause the interrupt lines to be low which would be a problem since they are active low. This commit disables the sensor interrupts when entering S5 and then enables them when entering S0. BUG=b:109934082 BRANCH=None TEST=Flash nocturne; power on AP, verify that sensors still work. Power cycle AP, verify that sensors still work. Change-Id: Id1700dca280b06f4cff26c02c308311e0809d559 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1115905 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* octopus npcx: ensure EC enters deep sleep when AP in S0Diana Z2018-06-261-0/+3
| | | | | | | | | | | | | | | | | | This change enables EC deep sleep in S0, which should give a power savings of about 20 mW when the system is idle. BRANCH=none BUG=b:78225493 TEST=with yorp: ran "ectool version" 50k times with feature enabled and saw no errors, plugged board into keyboard, trackpad, and screen to ensure no apparent lag or keystroke loss occurred, ran faft_ec suite and verified pass/fail rate was the same as without feature Change-Id: Ib943ea098acf47d989f6b0d229c72b4982ffc4cb Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1115466 Reviewed-by: Jett Rink <jettrink@chromium.org>
* 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>