summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* all hatch variants: Make sure EC_RST_ODL is GPIO_LOCKEDShelley Chen2019-11-225-0/+55
| | | | | | | | | | | | | BUG=b:144886704 BRANCH=hatch TEST=make buildall Change-Id: I0d520a5c375a2b47c55a335da91f556ccfd59c29 Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928422 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org>
* all hatch variants: Assign SYS_RST_ODL to GPIOC5Shelley Chen2019-11-225-4/+5
| | | | | | | | | | | | | | | | | There is an error where SYS_RST_ODL is assigned to GPIO02 where it is actually assigned to GPIOC5 in the schematics. This should cause AP reset to fail from the ec console. BUG=b:141476349 BRANCH=hatch TEST=None (I don't have a hatch board to test this out on) Change-Id: I855a65489ce974ee92be4bf51a83d5af40e4e2da Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928421 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org>
* Ensure CEC bus pin is not driven lowFelix Ekblom2019-11-221-0/+3
| | | | | | | | | | | | | | | | | | We have seen cases where after a cold EC reboot the pin is low until the first CEC message is sent by AP (after which the bus is left in a well defined state again) This is a follow up to https://crrev.com/c/1346990 which initializes the pull up in case not done by the RO FW. BRANCH=none BUG=b:144548408 TEST=CEC pin only goes low for ~40ms instead of 30s. Signed-off-by: Felix Ekblom <felixe@chromium.org> Change-Id: I3c98f8858f407279ad1bd086210969d69df2230b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928993 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* gsctool: delay RO update for old cr50 imagesMary Ruthven2019-11-221-0/+35
| | | | | | | | | | | | | | | | If Cr50 is running older than 0.3.20, delay the RO update 1 minute after the RW update, so Cr50 doesn't reject the RO blocks because their offsets are less than the RW offsets. BUG=b:144873413 BRANCH=none TEST=update board running RO 0.0.10 RW 0.3.18 to the RO 0.0.11 RW 0.3.22 image. Change-Id: I0179cc235c692133b08cd3430d71069b2f94bf69 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1929481 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Dratini/Jinlon: Add support for TEMP_SENSOR3Devin Lu2019-11-226-10/+28
| | | | | | | | | | | | | | A new temperature sensor is added to Dratini/Jinlon boards, close to the CPU. It is used to support the fan control. BUG=none BRANCH=hatch TEST=temp command in EC console Change-Id: Icd5974133da5e1aec81f2201f87e1b83b79c6169 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925802 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* battery : Define CONFIG_BATTERY_DEAD_UNTIL_VALUEYongBeum Ha2019-11-223-0/+15
| | | | | | | | | | | | | | | | It takes 850ms~950ms to get valid RSOC after battery wake-up. Sometimes battery FG returns garbage data(1%) as RSOC and 0 value of desired current / voltage. Add CONFIG_BATTERY_DEAD_UNTIL_VALUE to continue charging. BUG=b:138413964 BRANCH=None TEST=build & flash, check battery charging with dead battery Change-Id: I0cbe30aa973499b0c27faf9b6da03a0344ad1065 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918985 Reviewed-by: Jett Rink <jettrink@chromium.org>
* jinlon: change TCPC port 0 from ANX7447 to PS8751Devin Lu2019-11-223-9/+8
| | | | | | | | | | | | | | | | | This patch chagnes TCPC port 0 from ANX7447 to PS8751, It includes the gpio name, function name and reset signal. BUG=none BRANCH=hatch TEST=make sure tcpc port 0 is workable. Change-Id: I698d70750727080f46cffdc136ffd8a54967ca89 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918984 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* Trogdor: Initial board commitWai-Hong Tam2019-11-2211-0/+2530
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is an initial commit for Trogdor. Use Cheza as a baseline. Make the change according to the schematic, e.g. * Reflect the GPIO change * Reflect the TCPC/PPC part change * Update the USB topology, e.g. no device mode support * Remove the detachable related code * Add keyboard support * Support keyboard backlight * Update the battery characteristic * Add initial support of muxing DP path * Support a single USB-A port * Change sensors from lid to base * Minor code style improvement BRANCH=None BUG=b:143616352 TEST=BOARD=trogdor make Change-Id: Ia9bb0adfcb8d347e6335fd3ae1e565b0f9d1a025 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847204 Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* cleanup: Segregate ioexpander related drivers in ioexpander folderVijay Hiremath2019-11-2216-12/+12
| | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: I7fe9ab23254dbd8515936d10ad6782305e76236c Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925173 Reviewed-by: Jett Rink <jettrink@chromium.org>
* doc: document USB_PID strategyJett Rink2019-11-221-1/+8
| | | | | | | | | | | | | | | | We want to have a single USB VID/PID per platform. If we need further granularity within a platform, then we can use the HW version field within the AMA VDO. BRANCH=none BUG=none TEST=none Change-Id: Ia32f8c2b41efc04e570c8f6d92b3e1307948863a Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1910451 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* flash_ec: Fix servo micro boot0 for fpmcu/usbpdCraig Hesling2019-11-221-0/+4
| | | | | | | | | | | | | | | | | This CL fixes servo micro flashing for fpmcu and usbpd. This broke after crrev.com/c/1884252. The error seen was the following: ./util/flash_ec: line 496: servo_micro_usbpd_boot0: command not found BRANCH=nocturne,hatch BUG=none TEST=./util/flash_ec --board=dartmonkey --image=./build/nocturne_fp/ec.bin Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ic98fb31e29ee25d5397d38d5e742727a909994e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924990 Reviewed-by: Jett Rink <jettrink@chromium.org>
* TCPMv2: Enable TCPC low power when port is looking for a connectionSam Hurst2019-11-219-256/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the port is in a state where it is looking for a connection, to save power, we should put the TCPC in its low power mode and enable auto toggling. Low power mode can happen when DRP auto toggling, acting as a SNK only, or acting as a SRC only. BUG=chromium:1022217 BRANCH=none TEST=make -j buildall manual tests: 1: (S0) Nothing plugged in, port is drp and low power mode 2: (S5/S3/S0ix) Port is SNK only, and low power with nothing plugged in 3: (S3/S0ix) If TypeC sink was previously plugged in, port remains powered 4: (S5/S3/S0ix) TypeC source is recognized 5: (S3->S0) TypeC sink plugged in, port is powered when S0 is reached Low power exit test: Using this command from the AP console: ectool i2cread 8 2 0x16 0x0d Transfer failed with status=0x1 # This means the TCPC was asleep. On the EC console: 2019-11-21 09:50:24 [315.235538 TCPC p1 init ready] 2019-11-21 09:50:24 [315.236048 TCPC p1 Exit Low Power Mode] 2019-11-21 09:50:24 [315.242837 TCPC p1 init ready] 2019-11-21 09:50:24 [315.243229 C1: DRPAutoToggle] 2019-11-21 09:50:24 [315.246471 C1: Unattached.SNK] 2019-11-21 09:50:24 [315.252504 C1: DRPAutoToggle] 2019-11-21 09:50:24 [315.362878 C1: LowPowerMode] 2019-11-21 09:50:24 [315.363314 TCPC p1 Enter Low Power Mode] Change-Id: I7e853d05e0ece1f6b3031f17a18fcbf0d9a15a51 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1904974 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: add enter_low_power_mode for retimer muxDenis Brockus2019-11-213-6/+62
| | | | | | | | | | BUG=b:139428185 BRANCH=none TEST=verify mode is set correctly when switching devices Change-Id: I3e40e0321cb1026180b7edc0bfe99439c13acafb Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922062
* TCPMv1: Improve jitter based collision avoidanceAseda Aboagye2019-11-211-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | For the holdoff timer, we were using the system timestamp as a source of adding jitter. However, it seems that there are certain cases that can cause a periodic collision with the jitter only varying by ~1-2ms. This leads to many repeated collisions until the jitter slides just out of the collision window. This commit changes the jitter calculation to use more of the bits that are changing to reduce the number of collisions. BUG=b:144676183, chromium:925618 BRANCH=hatch,atlas,nocturne,grunt,octopus,rammus,kukui TEST=Flash kohaku, plug some peripherals known for collisions, verify that if a collision is encountered, it's only encountered once (no cycles). TEST=Add debugging prints for the jitter, verify that the jitter is varied and appears non-deterministic. Change-Id: I6c27880551dd35b78993f7130d1ce4eb81aa10ef Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922751 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* volteer: disable CONFIG_BRINGUPKeith Short2019-11-212-6/+5
| | | | | | | | | | | | | | | | Disable CONFIG_BRINGUP option now that the AP power up sequence is working. Also change the default console mask to disable CC_HOSTCMD, which is flooded with motion sense requests (0x60) from the kernel. BUG=b:142409811 BRANCH=none TEST=make buildall TEST=verify Volteer boots to OS automatically. Change-Id: I58f850188ca3981373af06369eb70c5887c7da31 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1919402 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* testing: remove incorrect testing assertJett Rink2019-11-211-1/+7
| | | | | | | | | | | | | | | | | When we go through the suspend code path, we disabled RX monitoring, and we have done that for a 4+ years. We have not had a unit test for that ever. One is come that needs this BRANCH=none BUG=b:144369187 TEST=See that disabling RX in set_state no longer causes assertion failures in tests that it shouldn't. Change-Id: Iab4b44d3f5fdd1fe8657b23ac59df247a384ee32 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925667 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cleanup: fixing warnings and formattingJett Rink2019-11-212-2/+2
| | | | | | | | | | | | BRANCH=none BUG=none TEST=builds Change-Id: Idf4b7363ce08a638fcca3407355c8f232100496d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924786 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* cr50: update ownersVadim Sukhomlinov2019-11-211-0/+1
| | | | | | | | | | | | | | | | | Updated cr50 owners to reflect current status. BUG=none TEST=none BRANCH=cr50 Change-Id: Iac77303a0192af3a40fda598392cbd774f5f3270 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924781 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* charger/rt946x: fix mt6370 IEOC inaccuracyYilun Lin2019-11-211-8/+63
| | | | | | | | | | | | | | | | mt6370's IEOC is inaccurate when charging current < 900mA; the power path only partially turned on under such situation. Hence, we have to raise the IEOC setting if the current is under 900mA to compensate the IEOC original setting. BUG=b:144532905 BRANCH=kukui TEST=ensure IEOC is raised when Ichg < 900mA. Change-Id: I9f1575bb707bc91e428c06a93c4682dde22d90fc Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924167 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* ish: Use lsm6dsm polling mode on tgl rvp platformLeifu Zhao2019-11-211-16/+0
| | | | | | | | | | | | | | | | | Need to use polling mode for lsm6dsm on tgl rvp. BUG=b:141519691 BRANCH=none TEST=tested on tgl rvp Signed-off-by: Leifu Zhao <leifu.zhao@intel.com> Change-Id: I1161e0c38c81f8205e28ae2428224a9e6552e820 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916680 Tested-by: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Auto-Submit: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com>
* driver: lsm6dsm: Allow building without CONFIG_ACCEL_FIFOYuval Peress2019-11-2113-48/+79
| | | | | | | | | | | | | | | | This change refactors the lsm6dsm to allow building without the use of the FIFO or sensor interrupts. BUG=None BRANCH=None TEST=make buildall Change-Id: I5b338d81061f25fd1c8209b4555f63ea4d8b2dbc Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916679 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Auto-Submit: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* cr50: drop unused definition of CONFIG_FLASH_READOUT_PROTECTIONVadim Bendebury2019-11-211-1/+0
| | | | | | | | | | | | | | | No code depending on this define is relevant for Cr50, it was added to this board file by mistake. BRANCH=cr50, cr50-mp BUG=none TEST=size of the generated Cr50 image remains the same before and after this patch. Change-Id: I31d5bffdc9b5109f1d4bb929dea66834a3bfa660 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925681 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cr50: switch to new dev keyVadim Bendebury2019-11-213-9/+9
| | | | | | | | | | | | | | | The new RO has a new dev key, modify the dev manifest to match the new RO expectations. BUG=b:74100307 BRANCH=cr50, cr50-mp TEST=built a node locked image for ro 0.0.11 and observed it boot and run Change-Id: I3ce9ca8d23be6b2d959d4457ea6d08afa05376ac Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866173 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50: remove flash nonvolatile counter spaceVadim Bendebury2019-11-214-23/+9
| | | | | | | | | | | | | | Counter implementation has been moved to the AP, no need to keep space for it in the flash. BUG=b:65253310 BRANCH=cr50, cr50-mp TEST=generated image uses 2048 bytes less than before this patch. Change-Id: I8225e9923932ce06ca0a4333c06508cf7d7c70d8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753677 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50: Add support for ACVP tests of HMAC SHA-256 DRBGVadim Sukhomlinov2019-11-215-6/+239
| | | | | | | | | | | | | | | | | | | HMAC DRBG is used for U2F key generation, and as such is subject for ACVP tests. Expose DRBG Init, Generate and Seed commands for automated testing with externally provided test vectors. BUG=b:138578319 BRANCH=cr50 TEST=make CRYPTO_TEST=1 BOARD=cr50 -j && test/tpm_test/tpmtest.py Change-Id: I50a6750864d3cd9a304a9b8a8524ef29cec04410 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1912662 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* kappa: fix charge/discharge control setting orderDevin Lu2019-11-211-3/+3
| | | | | | | | | | | | | Clone form CL:1916160 BUG=none BRANCH=none TEST=make BOARD=kappa Change-Id: I18905f7ace402debf1fad93e72b8a86ee27d1f50 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918986 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* volteer: enable EC controlled fanKeith Short2019-11-212-0/+18
| | | | | | | | | | | | | | | | Enable simple GPIO control of the fan. Still need to add PWM controls once a smart fan is available. BUG=b:140582490 BRANCH=none TEST=make buildall TEST=verify fan turns on when exiting G3 and turns off before entering G3. Change-Id: I3ec5b36fd5c7ca607f03efa9a76f8dc2efacbb22 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924503 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* volteer: Add USB-C policyVijay Hiremath2019-11-215-12/+194
| | | | | | | | | | | BUG=b:140578872 BRANCH=none TEST=USB2.0 & USB3.0 device detected over Type-C port 0 Change-Id: I44790aac3543589c32dcd60f84e4e67d5d76cdab Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922752 Reviewed-by: Keith Short <keithshort@chromium.org>
* tcpmv2: Make battery handling optional.Andrew McRae2019-11-211-0/+8
| | | | | | | | | | | | | | | | Some systems like puff do not have a battery, so conditionally compile the battery handling portion of the Type C PD module. BRANCH=none BUG=b:144390300 TEST=EC buildall runtests Change-Id: I72fc41d64820d450161273902eaf99476bf0dfce Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916763 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org>
* docs: Add Fingerprint Authentication Design DocTom Hughes2019-11-202-0/+763
| | | | | | | | | | | | | BRANCH=none BUG=b:139532396 TEST=view in gitiles Change-Id: I3d215bd27ad80f91e9ded54b1f3dc5e54439ed55 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1919651 Reviewed-by: Yicheng Li <yichengli@chromium.org> Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org>
* Drallion: Fix Upside/down orientation when portrait modeantony_wang2019-11-201-1/+1
| | | | | | | | | | | | | | | | | Fix Matrix to rotate lid sensor into standard reference frame BUG=b:144569069 make BOARD=drallion_ish and copy ec.bin to /lib/firmware/intel/drallion_ish.bin Verify by rotate DUT. Make sure correct direction. Change-Id: I703317aa71c44f24e28cba7eb7714d69513b654a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1923631 Reviewed-by: Selma Bensaid <selma.bensaid@intel.corp-partner.google.com> Reviewed-by: Mathew King <mathewk@chromium.org> Reviewed-by: Antony Wang <antony_wang@compal.corp-partner.google.com> Tested-by: Mathew King <mathewk@chromium.org> Tested-by: Antony Wang <antony_wang@compal.corp-partner.google.com>
* PRESUBMIT: enable signoff_checkTom Hughes2019-11-201-0/+1
| | | | | | | | | | | | | | | The default in pre-upload.py was changed to warn about Signed-Off-By lines: https://crrev.com/c/1917972. BRANCH=none BUG=none TEST=repo upload --cbr . Change-Id: I61b2ff47f1bb25ed5499c1d02fc085f9d291a827 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925708 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* docs: Removing battery disables HW write protectionTom Hughes2019-11-191-0/+3
| | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: Ic8f5a4378ce7b02e21518921c7a29edfaa031bf4 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922064 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* cr50: Add support for testing SHA-384, SHA-512 with CRYPTO_TEST=1Vadim Sukhomlinov2019-11-191-3/+10
| | | | | | | | | | | | | | | | | | | | Added support for SHA-384 and SHA-512 testing by providing direct access to algorithms using TPM extension commands enbaled with CRYPTO_TEST=1. This is used by ACVP tests for completness of SHA2 coverage. ACVP tests to be added separately. BUG=none BRANCH=cr50 TEST=make BOARD=cr50 CRYPTO_TEST=1 -j Change-Id: I3152d5186a5488793f6487ec5d50acdec2813c77 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1910525 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: Add TRNG_TEST command to download entropy samples for NIST testsVadim Sukhomlinov2019-11-196-2/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | NIST 800-90B Entropy assesment tests requires 1M of 8-bit samples for statistical tests. While it's possible to use TPM2_GetRandom command to get entropy on cr50 (there is no software postprocessing), this command is not available when compiled with CRYPTO_TEST=1 due to lack of space in firmware. Adding vendor command which is available with CRYPTO_TEST=1 to get raw entropy from TRNG. Added support script to save entropy in file for further analysis. Since downloading entropy takes a long time, new option'-t' added to tpmtest.py which only invokes download of TRNG samples BUG=b:138577834 BRANCH=cr50 TEST=make BOARD=cr50 CRYPTO_TEST=1 && test/tpm_test/tpmtest.py -t To run NIST tests: nist_entropy.sh Change-Id: I237a4581332a6e2c0332fe6ecf40731ab0be3355 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1919640 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* driver: lsm6dso: Fix build issue and align to motion sense fifo apiMario Tesi2019-11-191-1/+5
| | | | | | | | | | | | | | | | | Fix build issue, replaced motion_sense_fifo_add_data with motion_sense_fifo_stage_data and motion_sense_fifo_commit_data fifo api. BUG=none BRANCH=master TEST=Fixed build issue. Tested on discovery target BOARD with LSM6DSO connected to EC i2c master bus and motion sense task running. Change-Id: I7e4e81f1b6fe95b33ef6a4bfc5fdd509273c6f7b Signed-off-by: Mario Tesi <mario.tesi@st.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1903129 Reviewed-by: Yuval Peress <peress@chromium.org>
* servo_micro: shutdown HW module at sysjumpJett Rink2019-11-192-2/+28
| | | | | | | | | | | | | | | | | | | | | | | Some servo micros will fail to jump to RW if we leave the USART hardware modules active during the RW jump and the RW jump tries to change the gpio flags to anything other than alternate in gpio.inc. We would like the state transition from RO to RW to be as clean as possible, so shutdown the hardware modules that RW will reinitialize in board_init right after the jump BRANCH=servo BUG=b:144356961 TEST=flash this image on a bad servo micro, the remove then change GPIO_ALTERNATE to GPIO_INPUT and reflash and see that it sauce's fully flashes from then on Change-Id: I81fcbbcda9f63761a719f6e0cb6bb4cf6962f18f Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922240 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* jacuzzi: Add keyboard functionalityAlexandru M Stan2019-11-194-1/+30
| | | | | | | | | | | | | | | Added IT8801 io expander (which includes keyboard controller) and the keyscan task. BUG=b:133200075 TEST="it8801_dump" should check presence of the IT8801 chip TEST="ksstate on", press keys, see keyboard log things being printed on console BRANCH=master Change-Id: I08e7312cec59b6d293c01daf40b2f784a10b7e72 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1693863 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* driver/ioexpander_it8801: add I/O expander driver for keyboardtim2019-11-194-0/+279
| | | | | | | | | | | | | | IT8801 is an I/O expander with a keyboard matrix controller. BUG=b:133200075 BRANCH=none TEST=Press any key on keyboard and the console command "ksstate on" can print keyboard scan state. Change-Id: I6903aad1eacfdfb6a7c6c04e6954a14e8c8caaac Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1677976
* keyscan: decouple keyboard_raw functionality from the presence of TASK_KEYSCANAlexandru M Stan2019-11-199-0/+24
| | | | | | | | | | | | | | | | | | | | | | With the addition of external i2c keyboard controllers, chips that don't necessarly have gpios going to a keyboard can now still have a TASK_KEYSCAN. Therefore it's wrong to assume we want the chip/*/keyboard_raw code included. There was no easy way to make an ways on option (eg: CONFIG_KEYBOARD_RAW) that could get #undefd in strategic places. The place that would always define it would be in include/config.h but I don't believe that executes before the build.mk rules. BUG=b:135895590 TEST=Other boards with keyboards still happy. TEST=No compile errors (regarding missing keyboard GPIOS) when declaring TASK_KEYSCAN on a fresh stm32 board. BRANCH=master Change-Id: I061812a6941a11784950280648912edd5844bd79 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1693862 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* fpsensor: Make fpcapture and fpenroll restrictedCraig Hesling2019-11-181-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should be no functional difference to fpcapture or fpenroll, since the restricted console command feature is implemented in a similar manor. The only noticeable difference is that the list of commands provided by the "help" command should denote when these commands are restricted. Note, each board requires a configuration, similar to crrev.com/c/1867388, in order to activate restricted console commands. Otherwise, this restricted flag has no restricting effect. BRANCH=nocturne BRANCH=hatch BUG=b:142559996, b:142505927 TEST=# Test on nocturne_fp make BOARD=nocturne_fp scp build/nocturne_fp/ec.bin dut1:~/ ssh dut1 flash_fp_mcu ./ec.bin # From FPMCU UART console version # Ensure that version is custom based on workstation help # Ensure that fpcapture and fpenroll are not prefixed # with "-" help list # Ensure that a "Flags" column exists and that # fpcapture and fpenroll both have a 1 in the column. fpcapture fpenroll # Ensure that both commands above succeed in their # own operations syslock fpcapture fpenroll # Ensure that both commands above fail with "Access Denied" help # Ensure that fpcapture and fpenroll are now prefixed # with "-" in the help message Change-Id: Icbb74a1afece66db9ebd071de0770650d42bd553 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869400 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* docs/fingerprint: Add details on types of keysTom Hughes2019-11-181-9/+22
| | | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: I2c0b404ddfbd8e35fcc7455d93c1830167baa564 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922229 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* docs/fingerprint: Clarify flash_fp_mcu behaviorTom Hughes2019-11-181-3/+4
| | | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: I9305add05965579e5cc4ffed54704a17da27e275 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922228 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* puff: use cometlake-discrete power driverPeter Marheine2019-11-182-18/+15
| | | | | | | | | | | BUG=b:143188569 TEST=make buildall still succeeds BRANCH=none Change-Id: I9193878c65b20293fad5914af88ea4e49be369a8 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1913939 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* kohaku : change battery discharging max temperatureYongBeum.Ha2019-11-181-1/+1
| | | | | | | | | | | | | Change battery discharging max temperature from 60 to 70. BUG=b:143910072 BRANCH=master TEST=flash EC and check battery charging. Change-Id: Ia5a6a7c565e96e880715c6a03727c51a70dcab7c Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1806175 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* driver/it83xx: Don't set cc when set message header power roleRuibin Chang2019-11-181-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | When driver's setting pd message header function is called from TCPM, driver shouldn't set cc resistance. We should follow the comment just setting header defined in set_msg_header. The message header power role equal our cc resistance Rp/Rd state in mostly case. But there is an exception, like power role swap from SNK to SRC, there is a temporal transition state that both port cc assert Rd and GoodCRC power role field is swapped for response original SRC PS_RDY, so we shouldn't assert cc in set_msg_header function. [refer]: PD3.0 spec v2 ch8.3.2.6 BUG=none BRANCH=none TEST=connect to dongle, adapter, DRP on board ampton 1.Power role swap successfully 2.PD state to SRC_RDY or SNK_RDY Change-Id: Ibad3d8fcfcaa382fef4c8ef8ed26e920c63730b5 Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916759 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Create cometlake-discrete power driverPeter Marheine2019-11-185-0/+281
| | | | | | | | | | | | | | This sets up the driver (mostly copied from cometlake for now), to be used by puff. BUG=b:143188569 TEST=make buildall still succeeds BRANCH=none Change-Id: I4a4b70dd8ba58c070e2c6ad5941911bab16bafe6 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1906391 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* Add OWNERS for Cr50 specific directoriesVadim Bendebury2019-11-162-0/+9
| | | | | | | | | | | | | | | Let's make sure any change to files used explicitly in Cr50 are approved by relevant persons. BRANCH=none BUG=none TEST=none Change-Id: If6affd837063311e3215e7596a3a424dc56c7603 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1919649 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* kohaku: enable CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITSPaul Fagerburg2019-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS option so that when charging stops due to battery overtemperature, the battery LED will be green regardless of the state of charge of the battery. BUG=b:140596424 BRANCH=None TEST=`make -j BOARD=kohaku && ./util/flash_ec --board=kohaku` Ensure battery is not fully charged LED is blue Plug in AC adapter LED is still blue Close lid LED turns red Access EC console > batttempfake 3300 This overrides the normal temperature read and forces the value to 330.0 K, which is 56.9 C. The Kohaku battery has a maximum charge temperature of 55 C, and a maximum discharge temperature of 60 C, so this temperature is hot enough to stop charging, but not so hot that the system will shut down. LED turns green Unplug the power adapter LED turns off Plug in the power adapter LED turns green > batttempfake -1 LED turns red Unplug the power adapter LED turns off Plug in the power adapter LED turns red Unplug the power adapter LED turns off > batttempfake 3300 Plug in the power adapter LED turns green Change-Id: Ie9f5032fbb5666b02bec86d3f7f474d30e759338 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1919401 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* chgstv2: stop charging when battery temp exceeds specsPaul Fagerburg2019-11-152-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a check for the battery temperature in the safe range to charge the battery, and if it isn't, stop charging. The battery information defines minimum and maximum temperatures for discharge and for charge. The state machine already checks if the battery temperature is outside of the range for discharge (as part of is_battery_critical) and will shut down the system completely if the battery temperature is out of range. However, the temperature range for charging is usually tigheter than for discharging, and it can be safe to discharge, but unsafe to charge. For example, Kohaku specifies a maximum charge temperature of 55 C, and a maximum discharge temperature of 60 C. If the battery is at 57 C, we don't want to charge, but it's still OK to use the system. The check is enabled by CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS. BUG=b:140596424 BRANCH=None TEST=`make buildall -j` builds with no errors. No boards have enabled CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS, so no effect. Change-Id: I3b76eab942ca3ef3871f0909395e91634db5640e Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1914510 Reviewed-by: Scott Collyer <scollyer@chromium.org>