summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* atlas: enable active discharge on all railsCaveh Jalali2018-12-182-4/+22
| | | | | | | | | | | | | | | | this enables active discharge on all 12 power rails controlled by the ROHM ROP PMIC. BUG=b:120619543 BRANCH=none TEST=discharge behavior verified by sajedfarzam@ Change-Id: I842dbdcc1eab596230e12130dca272a1f449e268 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1371226 Commit-Ready: caveh jalali <caveh@chromium.org> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* cr50: clear confidential TPM Data on TPM disablingNamyoon Woo2018-12-181-0/+24
| | | | | | | | | | | | | | | | | | | | On TPM disabling, AUTH/SEED/PROOF data in TPM persistent data set and the loaded objects shall be cleared for better security. CQ-DEPEND=CL:1362203 BRANCH=cr50 BUG=b:119221935 TEST=Tested manually on eve-campfire dual boot dut. Checked S3 resume from short|long suspend on Windows. Checked Warm reboot from Windows to Chrome OS. Checked Warm reboot from Windows to Windows. Checked Chrome OS login info preserving. Change-Id: I8e03f6242cf04e7c824ee54cca99413eb809edea Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1372029 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* board/atlas_ish: remove CONFIG_ISH_30 flag in atlas_ish boardShine Liu2018-12-181-1/+0
| | | | | | | | | | | | | | | | As we have replaced all all CONFIG_ISH_xx flags in in chip/ish/* files with CHIP_FAMILY and CHIP_VARIANT, abandoning original CONFIG_ISH_xx flags. BRANCH=none BUG=b:112385410 TEST=Test host FW loading for main ISH FW. Change-Id: Ie0635a49585d456504bd1027406c5d6929dc5a8c Signed-off-by: Shine Liu <shine.liu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1367011 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com>
* chip/ish: replace CONFIG_ISH_xx flags with CHIP_FAMILY and CHIP_VARIANTShine Liu2018-12-184-19/+17
| | | | | | | | | | | | | | | | | Replace all CONFIG_ISH_xx flags in chip/ish/* files with CHIP_FAMILY and CHIP_VARIANT. Which provides more structural defines between ISH generations. BRANCH=none BUG=b:120295222 b:112385410 TEST=Test host FW loading for main ISH FW. Change-Id: Ica92eee11034447c9f0828aa986fb1736d20cf27 Signed-off-by: Shine Liu <shine.liu@intel.com> Signed-off-by: li feng <li1.feng@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1367010 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* board/atlas_ish: add CHIP_FAMILY and CHIP_VARIANT to atlas_ishShine Liu2018-12-181-0/+2
| | | | | | | | | | | | | | | | To accommodate the changes coming to ISH chip generations including CHIP_FAMILY and CHIP_VARIANT instead of current defines of CONFIG_ISH_xx. BRANCH=none BUG=b:120295222, b:112385410 TEST=Test host FW loading for main ISH FW. Change-Id: I03af74aa1b45cd4d1f030489a171506064721b3c Signed-off-by: Shine Liu <shine.liu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1367009 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* stm32mon: Add link to SPI protocolTom Hughes2018-12-171-1/+4
| | | | | | | | | | | | | Also fix misspelling. BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6e17407be36abd83567a2e09ae1c2684e1bc5090 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1378907 Reviewed-by: Jett Rink <jettrink@chromium.org>
* USB-PD: Don't make charge_manager save log if it's not presentDaisuke Nojiri2018-12-171-0/+2
| | | | | | | | | | | | | | | | | | Currently, pd_log assumes charge manager exists, thus, build fails if CONFIG_CHARGE_MANAGER is undefined because charge_manager_save_log is missing. This patch fixes it. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: I36156e7b376717a53e8a2cab7483b5150b4f2d61 Reviewed-on: https://chromium-review.googlesource.com/1300615 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* USB-PD: Debounce when trying try.srcDaisuke Nojiri2018-12-171-14/+13
| | | | | | | | | | | | | | | | | | | Currently, if try.src is enabled, the TCPM doesn't debounce for SNK connection. This patch makes the TCPM wait for tPDDebounce when detecting SNK connection after switching from SNK to SRC for try.src. BUG=b:115464001 BRANCH=none TEST=On Sona, verify picture is shown on HP s240.via USB-C TEST=On Sona, verify picture is shown on HP s240 via Hoho. Change-Id: I4f91bfca4f829f051d1c33f88f3664fad9b83e9f Reviewed-on: https://chromium-review.googlesource.com/1297035 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* charge_ramp: Allow USB-C power to be ramped by hardwareDaisuke Nojiri2018-12-171-7/+22
| | | | | | | | | | | | | | | | | | | | | Currently, hardware ramping (= voltage regulation) is automatically disabled for USB-C power supplier (HARGE_SUPPLIER_PD & _TYPEC). This patch allows USB-C suppliers to get voltage regulation. It prevents the input voltage of weak suppliers from drooping. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/80163913,b/120238339 BRANCH=none TEST=Verify Vayne get charged by PD and Type-C adapters. TEST=Verify on Vayne input current limit is set to adapters' limit. Change-Id: Ideecac911822ffca33be1755846febfcb822f734 Reviewed-on: https://chromium-review.googlesource.com/1377564 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Keyboard: Consolidate keyboard factory testsDaisuke Nojiri2018-12-175-198/+79
| | | | | | | | | | | | | | | | | This patch consolidates keyboard factory tests, which are currently duplicated under the chip directories. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: I1ab8bc96808e1c284d991d3c2f1f82a37329676e Reviewed-on: https://chromium-review.googlesource.com/1378654 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* keyboard: restore KBD_KSO2 after keyboard factory scan testingDevin Lu2018-12-173-3/+12
| | | | | | | | | | | | | | | | | This patch fix the keyboard malfucntion with KBD_KSO2 line after executed "ectool kbfactorytest". BUG=none BRANCH=octopus TEST=make sure keyboard works after executed "ectool kbfactorytest" on meep. Change-Id: I33c22e59a01884ff6c961161e189583a6c3673a3 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1373389 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* common/usb_pd_protocol: Fix TryWait.SNK to Unattached.SNK timeout valueRuibin Chang2018-12-141-2/+2
| | | | | | | | | | | | | | | | | When state transits from TryWait.SNK to Unattached.SNK, the timeout value is 10~20ms (tPDDebounce). This define in USB Type-C 1.3 spec Figure 4-16. BRANCH=None BUG=None TEST=GRL USBPD test Change-Id: If736daf1ef9e74f07a571a2f1adb12a928415c2b Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1333217 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* common: sensor: Add API to set sensor scaleGwendal Grignou2018-12-144-5/+96
| | | | | | | | | | | | | | | | Add option to scale the sensor data. Each axis can be scaled differently. If the sensor does not support setting scale, return an error. BUG=b:112957338 BRANCH=nocturne TEST=Compile, load, check setting calibscale returns an error. Change-Id: Ib6aac39f22ddcbff5f3e45830f8029811a4ed1ad Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1279185 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* nautilus,reef_mchp: Remove board_is_ramp_allowedDaisuke Nojiri2018-12-142-36/+0
| | | | | | | | | | | | | | | | | board_is_ramp_allowed is replaced by chg_ramp_allowed and no longer called. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: Iedf760567b4034ce7317a0d2479eb7ee937b4680 Reviewed-on: https://chromium-review.googlesource.com/1377342 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Makefiles: Set fuzz targets to use the correct CROSS_COMPILE.Allen Webb2018-12-142-3/+6
| | | | | | | | | | | | | | | | | This addresses a cross compilation bug for fuzzing targets where CROSS_COMPILE was always ''. BRANCH=None BUG=chromium:911310 TEST=USE="ubsan asan fuzzer" ./build_packages \ --board=amd64-generic --skip_chroot_upgrade chromeos-ec && (cd ../platform/ec && unset BOARD && make -j buildall) Change-Id: I1c0b99f4ecef1e6ddec489568ccb13a8e8f5fb85 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1363541 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* bmi160: exit IRQ loop if error during reg readJett Rink2018-12-141-2/+4
| | | | | | | | | | | | | | | | | | | | The IRQ handler for bmi160 continues to loop until all of the interrupt reasons are handled; however, if the read fails the interrupt variable will be in an unknown state. We can either return early if there was an error or we can set the interrupt variable to 0 before the read call. Either way the loop exits. BRANCH=none BUG=b:119093572 TEST=On Bobba360 with a solid repro case of the watchdog reset, this change avoids the watchdog reset. Change-Id: I482f074b6e9e7c183def8ce17157ed28ca96b1c9 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1378908 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Enrico Granata <egranata@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* usb_updater2: increase send timeout to 2sRuben Rodriguez Buchillon2018-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | To 'successfully' flash sweetberry the 1s timeout is not sufficient. Increase to 2s. BRANCH=None BUG=b:120449224 TEST=manual test sudo servo_updater --board sweetberry ... offset: writable at 0x40000 sending 0xb580 bytes to 0x40000 ------- update complete image updated ... Change-Id: I38bf8c852caf97069fcf67f4b77f9c0a30008235 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1369507 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* bmi160: do not overrun the amount of data read from the BMI FIFOEnrico Granata2018-12-131-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a race condition in the BMI160 driver w.r.t. reading from the FIFO. The previous code was reading the FIFO length, adding 1 byte to it and then reading that much data into a static buffer. This works well if no new samples are added to the FIFO between reading the length and reading the payload. But, if the BMI pushes a new sample in the FIFO, the read will not return an empty frame header, but instead fill in the first byte of the new sample, which is - however - incomplete and will be retransmitted. However, because the buffer we process is static, if things align just right, it is possible for that header to be parsed as a valid sample, since we do not clear the buffer and we assume the entire 64 bytes of it are valid and processable. Fix this issue by maintaining a pointer to the end of the read-in FIFO buffer and using that - instead of the static bp + sizeof - to calculate how much data we can actually process from the FIFO. BUG=b:120508077 BRANCH=poppy,octopus TEST=Starting from CL:1367013 and CL:1370689, adding an `msleep(2)` between reading last_interrupt_timestamp and calling load_fifo(), observe that the kernel sees more sensor events than should be present given the sample rate selected. Observe that some of those have repeated payload values. With this change, the number of samples seen at the kernel side is compatible with the chosen sample rate and no samples have incorrectly repeating payloads. It is possible to also make this more obvious by setting the buffer to contain an incorrect value before reading from the FIFO, and observing that no samples contain that incorrect value. Change-Id: I57124756d51b8acf04630020c1ffb934f471735f Signed-off-by: Enrico Granata <egranata@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1372027 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* it83xx/spi: rename spi.c to spi_master.ctim2018-12-133-2/+2
| | | | | | | | | | | | | | | | | In it83xx chip, the file of spi.c is renamed to spi_master.c, and the related config is renamed too. BUG=none BRANCH=none TEST=none Change-Id: Ia696e62afa2ff06da68a3e4af685615b1dbcc8e9 Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1372870 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* oz554: Move oz554 driver code to common directoryDaisuke Nojiri2018-12-138-27/+38
| | | | | | | | | | | | | | | | This patch moves oz554 LED driver code from Karma. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: Ia2808563b9c113e5ea3376f9327dff2578e20906 Reviewed-on: https://chromium-review.googlesource.com/1366015 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* kukui: Calibrate motion sensors.Yilun Lin2018-12-131-11/+10
| | | | | | | | | | | | | | | | | | | | Fix reference point according to the bmi160 and bmm150 datasheet and kukui p1 board file. Also, minor fix for typos and incorrect variable naming. TEST=1.) Run arc++ sensor apps. Run "ectool motionsense odr 2 10000" to enable magnetometer manually. See that the magnetometer is moved accordingly. 2.) Flip kukui and see that the UI also flips accordingly. BUG=b:120467401 BRANCH=None Change-Id: If4091366cde3a98bf08aec5b81f6f48595fdc8f5 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1369504 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cr50: VENDOR_CC_IMMEDIATE_RESET may have a delay argument.Namyoon Woo2018-12-132-6/+45
| | | | | | | | | | | | | | | | | VENDOR_CC_IMMEDIATE_RESET has either uint16_t argument or none. The argument is a time delay in millisecond unit. If it has no argument, then Cr50 resets H1 immediately without any delay. BUG=b:120485010 BRANCH=cr50 TEST=none Change-Id: I33aaacbb0a0532aa84f39a8cd51d0d54fa2d281a Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1361998 Commit-Ready: Joel Kitching <kitching@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* ISH3.0: Scaling timer from 12MHz to 1MHzSadashiva Rao Pv2018-12-123-4/+56
| | | | | | | | | | | | | | | | | | | | | | | -Added support to scale 12MHz to 1MHz -Fixes the timestamp issue -Changes under CONFIG_ISH_30 ISH 3.0 has 12MHz Main counter ISH 4.0 has 32KHz Main counter BUG=none BRANCH=master TEST=On Soraka board modified for ISH, ensure clock tick happens correctly. Ensure ISH probe and sensor info is seen in kernel logs Change-Id: Ib5d8a48bf99d1398a0424596399abd7df431e07a Signed-off-by: Naresh Solakni <naresh.solanki@intel.com> Signed-off-by: Sadashiva Rao Pv <sadashiva.rao.pv@intel.com> Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com> Reviewed-on: https://chromium-review.googlesource.com/686434 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Kyoung Il Kim <kyoung.il.kim@intel.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
* Octopus: add mux reset when applicableDiana Z2018-12-122-6/+13
| | | | | | | | | | | | | | | | | The ITE based octopus boards have a PS8751 acting as a USB mux on at least one port. Since these boards have GPIOs hooked up to the PS8751 reset pin(s), we should reset the chips on startup. This should help in rare error cases, for example if the chip is hung up. BUG=b:120087080 BRANCH=octopus TEST=loaded onto apel board version 0, ran several EC reboots and verified the DB USB-C and USB-A ports functioned well Change-Id: I04279e5e12996deedf4d22b2be2aa2f9909f4852 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1372028 Reviewed-by: Jett Rink <jettrink@chromium.org>
* nami_fp: Update flash_fp_mcu to ekko gpiosShelley Chen2018-12-121-0/+88
| | | | | | | | | | | | | | BUG=b:119565385 BRANCH=None TEST=flash_fp_mcu <bin> and make sure bin was updated with: ectools --name=cros_fp version Change-Id: I99673a3fff1e69845f0dd817ac5dfe41f4b85708 Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1370745 Commit-Ready: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
* motion_sense: Print motion sensors count for accelinfo commandVijay Hiremath2018-12-121-0/+2
| | | | | | | | | | | | | | | | | | For the accelinfo EC console command this code prints number of motion sensors count also. With this, we can get number of sensors connected on DUT before testing them individually by test scripts. BUG=none BRANCH=none TEST=Manually tested on Bobba convertible and clamp-shell, can get the correct number of sensors connected on the board. Change-Id: If1de15756db8718d7e95997fc83593ed55fa29a3 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1372508 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* chip/ish: change host command ready from 8 to 3Shine Liu2018-12-121-1/+1
| | | | | | | | | | | | | | | | To accomondate upcoming arcada_ish board, changing MNG_HC_FW_READY from 8 to 3 BRANCH=none BUG=b:120295222 TEST=Test host FW loading for main ISH FW. Change-Id: Ibee24cb01c6078177ba9ef1ad30c360a3157a84e Signed-off-by: Shine Liu <shine.liu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1367012 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* cheza: Disable pull-up on USB_C1_OC_ODL in S5Wai-Hong Tam2018-12-122-1/+18
| | | | | | | | | | | | | | | In S5, we disable the 5V, so the overcurrent detection is not needed. Disabling its pull-up prevents any current leak. BRANCH=none BUG=b:118342484 TEST=Checked the GPIO flag in S0 and S5. Can't verify on real hardware due to the wrong GPIO pin. Change-Id: Ib9a0c7abdc7bae820cbfa92f9c7a7e704079e077 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1370891 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* PRESUBMIT: enable kernel-doc check for include/ec_commands.hBrian Norris2018-12-121-0/+2
| | | | | | | | | | | | | | | ec_commands.h is often synced with the Linux sources, so it's nice to sanity-check it. CQ-DEPEND=CL:1336039 BRANCH=none BUG=chromium:621123 TEST=.../pre-upload.py Change-Id: I56645e613f8689c26ddf6ded1325e270be35da8a Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1330107 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Octopus: Increase task stacks on npcx boardsDiana Z2018-12-126-66/+66
| | | | | | | | | | | | | | | Based on task analysis for fleex, all npcx octopus boards are having their tasks increased to VENTI size, with the exception of the USB_CHG and KEYPROTO tasks, which appear to be doing well as-is. BUG=b:112309201 BRANCH=octopus TEST=builds, runs on fleex and phaser, fleex stack analysis looks better Change-Id: I68971cfe2e1dbaf8b83f9ef13bfeb4786b32dbc6 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1368009 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Nami: Support UK2 keyboardDaisuke Nojiri2018-12-122-0/+10
| | | | | | | | | | | | | | | | | | | | | | This patch swaps the forwardslash-pipe key (scancode=0x56) with the right control key (scancode=0xe014) if UK2 bit in SKU ID is enabled. evtest produces: type 1 (EV_KEY), code 86 (KEY_102ND), value 1 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:117827249 BRANCH=none TEST=Verify forwardslash key produces keycode=0x1d on Syndra with UK2. TEST=Verify '\' and '|' are printed on OS (with input method = UK). TEST=Run emerge-nami chromeos-ec Change-Id: Ibbaeccd12cfc09d913ecfe1172218297c3d7341a Reviewed-on: https://chromium-review.googlesource.com/1366307 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* bmi160: Keep timestamp and FIFO synchronizedEnrico Granata2018-12-121-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BMI160 will clear the FIFO watermark/full interrupt when the FIFO crosses the threshold condition - which happens upon reading from it in load_fifo(). As a result of this, and the fact that the soft IRQ handler for the BMI160 tries to loop until it has finished serving all interrupt causes, there are possibilities for a race condition such as the following to occur: read timestamp, value is t0 read interrupt cause: it's a watermark interrupt load fifo(t0): this clears the interrupt, allowing a new one to happen read timestamp, value is still t0 a watermark interrupt happens at t1 read interrupt cause: watermark load fifo(t0) At this point, the fifo will process events at t1 as-if they had happened at t0, which is bad and causes incorrect timestamps on the AP side. This changes moves reading the timestamp value as close as possible to load_fifo, and in a relative order where a new watermark interrupt cannot happen, which ensures the timestamp and the FIFO data for it are synchronized BUG=b:120508077 TEST=on Bobba and Nocturne, observe that no events happen where an identical "a" time matches two distinct (b,c) times BRANCH=nocturne,bobba Change-Id: I454b257366bccf2b9e4d78df5dc005a8ad7313a0 Signed-off-by: Enrico Granata <egranata@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1367013 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* nami_fp: remove flash_fp_mcu file soft linkShelley Chen2018-12-121-1/+0
| | | | | | | | | | | | | | | | | | | We need to change this soft link to a new file. Somehow it's not working when I try to do it in one go, so have a separate CL where we remove the soft link with a follow up CL where we add the new file. When I view the CL with gitk, I see the proper diffs, but seems like there's a bug in gerrit that prevents the diffs from showing up. BUG=b:119565385 BRANCH=None TEST=None Change-Id: I89a3978d1b081e7912d52c1688df5e18e45b1a85 Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1372093 Commit-Ready: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org> Reviewed-by: YH Lin <yueherngl@chromium.org>
* kukui: Increase PD_C0 stack size from LARGER to VENTINicolas Boichat2018-12-121-1/+1
| | | | | | | | | | | | | | | | We'll audit all these task sizes when we come closer to branching FW. BRANCH=none BUG=b:120164830 TEST=Flash kukui, plug/unplug USB-C a few times, no more crashes. taskinfo shows that we now have some margin: 8 PD_C0 00000000 0.042883 640/768 Change-Id: Iea5ea9a43e183aad4b31d9a9750e0e1b42113250 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1369505 Reviewed-by: Yilun Lin <yllin@chromium.org>
* Makefiles: Add support for MSAN and UBSAN.Allen Webb2018-12-113-2/+17
| | | | | | | | | | | | | | | | | | This adds support for building fuzz targets with memory and undefined behavior sanitizers. BRANCH=None BUG=chromium:911310 TEST=USE="ubsan fuzzer" ./build_packages \ --board=amd64-generic --skip_chroot_upgrade chromeos-ec && (cd ../platform/ec && unset BOARD && make -j buildall buildfuzztests) Change-Id: Ic7f4c1d7fcc1f6347f091b98567167066787cb9c Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1364326 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* nami_fp: branching nocturne_fp to cope with variationsYH Lin2018-12-118-1/+7
| | | | | | | | | | | BRANCH=none BUG=b:117297043 TEST=make BOARD=nami_fp -j Change-Id: I05ad15c621876185a0908ce7599578e7ebcff7df Signed-off-by: YH Lin <yueherngl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1369586 Reviewed-by: Shelley Chen <shchen@chromium.org>
* Nami: Add fan min/start/max definition for SyndraDaisuke Nojiri2018-12-111-1/+10
| | | | | | | | | | | | | | | | This patch adds fan RPM definitions for Syndra. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:120113410 BRANCH=none TEST=buildall Change-Id: I3bbdc98713c2dd8b0ed824a8576ffb2f597240ae Reviewed-on: https://chromium-review.googlesource.com/1363670 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* octopus: remove unused TCPC re-driver power codeJett Rink2018-12-101-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | We had a hardware revision that used GPIO03 from the PS8751 as the enable signal for the TypeA USB re-driver power regulator. This prove to not work especially when the TCPC came back from low power mode. The hardware change has been reverted and now we are removing the firmware support for this change. BRANCH=octopus BUG=b:111406013,b:117656946 TEST=builds. Version 2.24 (released 10/30) of sub-board schematics mark the stuffing options to have the TCPC control the power as DNS. Version 2.2 was never officially released that had the faulty hardware circuit. Only a single spin of sub-boards had this circuit and they have been reworked. Change-Id: Ib7f5a369af26a83fb71ef7e27f52086a4aed9c0c Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1366295 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Tom Sliva <tsliva@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* core/minute-ia: Setup GDTRushikesh S Kadam2018-12-101-0/+29
| | | | | | | | | | | | | | | Setup GDT for main ISH FW BRANCH=none BUG=b:120051488 TEST=Verify that main ISH FW runs fine when loaded through host FW load flow. Change-Id: I8101de6c2482abb09ccc8fdc36321fa562e521d7 Signed-off-by: Rushikesh S Kadam <rushikesh.s.kadam@intel.com> Signed-off-by: Sadashiva Rao Pv <sadashiva.rao.pv@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1316700 Commit-Ready: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com>
* Fleex: add stack analysis annotationsDiana Z2018-12-101-0/+278
| | | | | | | | | | | | | | | | | | | | Stack analysis notations for this specific revision of fleex. Note that these annotations will not be valid for long, as the file line numbers referenced here will quickly become outdated with new changes. These notations may be somewhat transferrable to other octopus boards, depending on what sensors they use and how far the line numbers have drifted. BRANCH=octopus BUG=b:112309201 TEST=make -j BOARD=fleex analyzestack SECTION=RO Change-Id: Ib925eb8c308315e6eea18ec6e57ad16801a7184a Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1366305 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cheza: Wait power button release before actually boot APWai-Hong Tam2018-12-101-22/+17
| | | | | | | | | | | | | | | | | | | | | The power button hold may be a recovery boot trigger, i.e. long holding the key combination: power button + volume up + volume down. We don't want AP up during the long-hold. BRANCH=none BUG=b:119628964 TEST=Holding Power button 8s to shutdown; holding the combo Power + VolUp + VolDn and saw: * power state machine staying at S5S3 (AP still down) * after 8s, H1 issuing EC reboot and EC waiting VolDn release * releasing VolDn and EC boot continue * power state machine staying at S5S3 (AP still down) * releasing VolUp and Power button to boot into S0 Change-Id: I637fe54ad9e51050df5d950647c1f00c6da72c52 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1355369 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* headers: remove duplicate defineTom Hughes2018-12-101-2/+0
| | | | | | | | | | | | | EC_VER_FLASH_WRITE is already defined a few lines up in the file BRANCH=None BUG=None TEST=make buildall -j Change-Id: I40ad43b624029e0ce4044f1a8048572b9e4c2629 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1368572 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util: Add macro to swap two variablesDaisuke Nojiri2018-12-102-0/+35
| | | | | | | | | | | | | | | | | | | This patch adds swap(a,b), which swaps the values in two variables. It requires c99 for typeof. Swapping composites (e.g. a+b, x++) doesn't make sense. So, <a> and <b> can only be a variable (x) or a pointer reference (*x) without an operator. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: Id656e173d372dfff759d9aee9314a008a6d91786 Reviewed-on: https://chromium-review.googlesource.com/1366306 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* it83xx: force filling cache if the last two 4KB blocks of 512KB flash are ↵Dino Li2018-12-103-3/+38
| | | | | | | | | | | | | | | | | | | modified After immu reset, we will fill the immu cache with 8KB data that are outside address 0x7e000 ~ 0x7ffff. When CPU tries to fetch contents from address 0x7e000 ~ 0x7ffff, immu will re-fetch the missing contents inside 0x7e000 ~ 0x7ffff. BUG=b:111808417, b:119799561 BRANCH=none TEST=use console "flasherase" and "flashwrite" commands to erase/write last two 4KB blocks(0x7e000 ~ 0x7ffff), no error message occurred. Change-Id: Ia97c814f20d602c591c39040b964b122edd50205 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1365372 Reviewed-by: Diana Z <dzigterman@chromium.org>
* flapjack: add initial content for the buildYH Lin2018-12-103-1/+4
| | | | | | | | | | | | | | | | | Initial content of flapjack is taken after kukui. It will need to be revised later. BUG=b:120704238 TEST=build_packages --board=flapjack BRANCH=none CQ-DEPEND=CL:1368583,CL:1368475,CL:*727368 Signed-off-by: YH Lin <yueherngl@chromium.org> Change-Id: Id2ccb43af46ef0b498112ecc2b9995227cbb9bc6 Reviewed-on: https://chromium-review.googlesource.com/1369384 Commit-Ready: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* Kalista: Write panel settings to OZ554Tino Liu2018-12-094-1/+117
| | | | | | | | | | | | | | | | GPIO44 is used for panel backlight enable interrupt. If EC receive rising interrupt, write panel settings to OZ554. BUG=b:120237453 BRANCH=none TEST=make buildall pass, panel can show screen properly Change-Id: I45cd12b5b334db39fa989ab435240d272dc39d7c Signed-off-by: Tino Liu <tino.liu@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1351909 Commit-Ready: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Tested-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cheza: Make chipset_reset do a warm resetWai-Hong Tam2018-12-093-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the chipset_reset function do a warm reset to match the expectation of what AP-initiated reset does, which is also a warm reset but triggered by PS_HOLD. The warm reset is done by sending a low pulse to the PMIC RESIN_L pin, which requires PMIC registers being reprogrammed that makes it as a warm reset trigger. If the PMIC registers not reprogrammed properly, it falls back to do a cold reset power sequence. It is done by EC monitoring the AP_RST_L signal, which is already one of the power signals. BRANCH=none BUG=b:117941911 TEST=Typed "apreset" just after "reboot" (PMIC registers not programmed), checked the transition S0 -> S5 -> S0. TEST=Typed "apreset" when AP booted into userspace (PMIC registers programmed), checked a warm reset happened, AP_RST_L toggled. Change-Id: Ia1c5c7a8fd56a9e4867d4dd4c8bf2333c083c616 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1330117 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* cheza: When warm_reset-toggling finished, issue a request to resetWai-Hong Tam2018-12-091-25/+10
| | | | | | | | | | | | | | | | | | When warm_reset-toggling finished, don't call the chipset_reset() function, which will be changed to do a warm reset, do issue a request to initiate a reset sequence. BRANCH=none BUG=b:117941911 TEST=Tried "dut-control warm_reset:on" and "dut-control warm_reset:off" during firmware (PMIC registers not programmed) and userspace (PMIC registers reprogrammed). Checked doing S0 -> S5 -> S0 transition. Change-Id: I6011fa6bfc9c5b60807bcbef6326b13a2983b37f Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1330116 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* cheza: Make apreset and apshutdown calls follow the state machineWai-Hong Tam2018-12-091-24/+24
| | | | | | | | | | | | | | | | | | | | | The console command 'apreset' and 'apshutdown' now just set flags which trigger state transition in the power state machine. They no longer call the power-off sequence directly. So the hooks should be triggered properly. BRANCH=none BUG=b:119050865 TEST=Ran "apshutdown" and checked the state transition from S0 -> S5. TEST=Ran "apreset" and checked the state transition from S0 -> S5 -> S0. TEST=Call "dut-control warm_reset:on sleep:0.2 warm_reset:off" and checked the state transition from S0 -> S5 -> S0. Change-Id: Idb5af2021273d32ec7f718abf18e43c43b752c7e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1325173 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* meowth: remove meowth/zoombini overlays and repositoriesBob Moragues2018-12-0821-2343/+3
| | | | | | | | | | | | | | BRANCH=none BUG=b:118494679 TEST=Verify PreCQ build Signed-off-by: Bob Moragues <moragues@chromium.org> Change-Id: Id6889d922a2b4d812cc92ddbb35b2581d881459d Reviewed-on: https://chromium-review.googlesource.com/1354316 Commit-Ready: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>