summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfirmware-fizz-10139.94.B-ORIGINALBrian Norris2021-09-112-10/+1
| | | | | | | | | | | | BUG=none TEST=none Change-Id: I0f03f432ada1064ffba9595be78ca7ab4d25ecd1 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155170 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* stm32: Fix manual interrupt clearing functionCraig Hesling2020-03-161-1/+3
| | | | | | | | | | | | | | | | | | | | | This fixes a bug in gpio_clear_pending_interrupt, where all pending interrupts are unintentionally cleared. This is not in the code path for normal gpio interrupt handlers, since the normal interrupt clearing occurs in gpio_interrupt (right below this function). BRANCH=none BUG=chromium:1059520 TEST=none Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I4d6fe7947f4d76cf3b57dfbf3bb926e41851c80c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101208 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> (cherry picked from commit c2c2c083fef813e3e3c70f8c13a1418717ba682d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106631
* Features: Add EXEC_IN_RAMDaisuke Nojiri2018-04-053-0/+9
| | | | | | | | | | | | | | | | This patch adds execution-in-ram, opposite of XIP: execution-in-place (a.k.a. XIP) to the EC features. It can be currently implied by CONFIG_EXTERNAL_STORAGE. BUG=b:77306460 BRANCH=none TEST=Verify ectool prints EXEC_IN_RAM on Fizz. Change-Id: I4a7fb3b267864debe59fd211956371eceac57613 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/995968 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/998763
* flash: Allow currently active regions to be modifiedDaisuke Nojiri2018-04-051-0/+4
| | | | | | | | | | | | | | | | | This patch allows chips which run code in RAM to erase or write regions even if they're active. BUG=b:77306460 BRANCH=none TEST=flashrom -p ec -w /tmp/ec.bin on Fizz Change-Id: Ib536b250dde78283513acb942507c67da0a6f622 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/997022 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 75e0015cc16d287724ef353c5d7f50c1287db2cb) Reviewed-on: https://chromium-review.googlesource.com/998974
* EFS: Clarify vboot_main entry logicDaisuke Nojiri2018-04-051-12/+17
| | | | | | | | | | | | | | | | This patch clarifies the logic which determines whether we perform EFS or not and print different messages for each case. BUG=none BRANCH=none TEST=buildall Change-Id: I5588018a3594be2bcad84a2f74f805b76a195f85 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/996398 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 660fb6a57022e0514c607633a5b0458aced026da) Reviewed-on: https://chromium-review.googlesource.com/998973
* USB-PD: Avoid discovering identity twice on bootDaisuke Nojiri2018-03-211-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some monitors do not like the same mode to be entered twice. They refuse to show any picture when it happens. This patch makes the TCPM check whether the port is a UFP or not before setting PD_FLAGS_CHECK_IDENTITY flag when transitioning from S5 to S3. If not (port is a DFP), it skips setting the flag. Key observations are: - Setting CHECK_IDENTITY there was useful for the following reasons: * In S5 we are in FORCE_SINK. So we might not be able to discover mode (due to the fact that we are a UFP initially when being a SINK). * Once we start, we want to discover the full capabilities. - The use case above is not true if we are a DFP (since we can discover mode immediately) - So it's useful IFF we are a UFP at transition. BUG=b:75958206 BRANCH=none TEST=Verified with a reworked Fizz on USB-C monitor/adapter (LG 27UD88, HP S240n, Dingdong, Hoho) as follows: 1. Plug-in boot 2. Manual recovery 3. Servo reset 4. EC reboot command 5. Warm reboot 6. Power button boot from S5 7. Suspend / resume Change-Id: I97a3fa671582552c029f7da140b55e7724b56ecc Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/963844
* Fizz: Log DP mode entry and exitDaisuke Nojiri2018-03-201-0/+4
| | | | | | | | | | | | | | | | | This helps us tell whether a monitor lost picture because the EC exited the DisplayPort mode or other reason. BUG=b:75288273 BRANCH=none TEST=boot Fizz Change-Id: I2da6a27c66f03ef780a0ed6f60a597a01f248942 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/966993 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit b5fddbbe26ed27f1ade7d89e6acbeebaf15b315e) Reviewed-on: https://chromium-review.googlesource.com/966892
* EFS: Perform EFS even if flash WP is enabledDaisuke Nojiri2018-03-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | This patch removes flash WP check in the EFS main. It means even if the SPI flash is not write protected, it performs EFS. This allows dogfood devices to boot just like normal devices. BUG=b:74983574 BRANCH=none TEST=Boot Fizz. Verify EFS works as expected. HW_WP=0, SW_WP=0: No EFS HW_WP=0, SW_WP=1: No EFS HW_WP=1, SW_WP=0: EFS is performed (Dogfood devices) HW_WP=1, SW_WP=1: EFS is performed (Normal devices) Change-Id: I33b39463d6bd16fe0fc398cd49f3c92c76fa5103 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/964740 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 39684f894620238c6ea08b54ad7bb23bb2025499) Reviewed-on: https://chromium-review.googlesource.com/965389
* CBI: Make cbi command dump EEPROM contentsDaisuke Nojiri2018-02-271-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, cbi console command dumps the buffered contents. This patch will make the command dump the entire EEPROM. BUG=b:70294260 BRANCH=none TEST=Run cbi command on Fizz: CBI_VERSION: 0x0000 TOTAL_SIZE: 18 BOARD_VERSION: 514 (0x202) OEM_ID: 2 (0x2) SKU_ID: 0 (0x0) 43 42 49 5c 00 00 12 00 00 02 02 02 02 01 00 01 01 02 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ... Change-Id: I39f3335a38eb72c95d53264ddc7386dd0910e946 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/930322 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 8a5a83aef357b23a274f45a4377c32b77624a5fc) Reviewed-on: https://chromium-review.googlesource.com/936122
* npcx/fan: Avoid turning on disabled fansDaisuke Nojiri2018-02-271-0/+3
| | | | | | | | | | | | | | Fan enable state is controlled in common/fan.c. This patch prevents npcx fan driver from enabling it. BUG=b:73127788 BRANCH=none TEST=Verify no 'Fan 0 stalled' is printed in S3 and S5. Verify the fan spins in S0. Change-Id: I549253a64c91d8a23bb793c3506b5daf1f7642be Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/938324
* npcx: Set ESPI_MAXFREQ based on FMCLK valueFurquan Shaikh2018-02-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to NPCX data sheets (NPCX5 and NPCX7), ESPI_MAXFREQ should be decided based on the value of FMCLK. Since we are setting FMCLK to 30MHz on NPCX5, eSPI_MAXFREQ needs to be set to 33MHz. This change sets ESPI_MAXFREQ_MAX depending upon the value of FMCLK. BUG=b:73504527 BRANCH=fizz? TEST=Verified that on soraka ESPI_MAXFREQ is set to 33MHz. Also, ran some reboot tests to ensure that there is no regression in boot time. Change-Id: Iaee89078741cf44c7ac232e2ee14d75384f68a35 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/925843 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 78a407f0a15d1bfc7fa098751e292bc7e7b190a3) Reviewed-on: https://chromium-review.googlesource.com/933144 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
* CBI: Update cbi-util printing formatDaisuke Nojiri2018-02-221-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | This patch makes cbi-util print the tag and the size of each field. It also fixes help message and adds indendation for readability. BUG=b:70294260 BRANCH=none TEST=Run the command as follows: $ cbi-util --show /tmp/cbi.bin CBI blob: /tmp/cbi2.bin TOTAL_SIZE: 18 CBI_VERSION: 0 Data Field: name: value (hex, tag, size) BOARD_VERSION: 514 (0x202, 0, 2) OEM_ID: 2 (0x2, 1, 1) SKU_ID: 3 (0x3, 2, 1) Data validated successfully Change-Id: I5f0fde4690c29c0ee58c798e8cc35bac3ed1b6f8 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/926781 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit f483d46b01992dfbaf274aaef4e382ca0091e407) Reviewed-on: https://chromium-review.googlesource.com/932521
* pd: retry DR_SWAP after a WAITVincent Palatin2018-02-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | If the other side answers our DR_SWAP request with a WAIT message (as bizarre as it might be), we want to retry later rather than giving up. Set again the PD_FLAGS_CHECK_DR_ROLE flag in order to do so. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=fizz BUG=chromium:814098 TEST=do repeated cold reset on Fizz connected to the 'interesting' USB-C screen and see the DP alternate mode negotiated. Change-Id: Icfb9fa209ce8cbe3c42c1e6946b43464544bdaea Reviewed-on: https://chromium-review.googlesource.com/921141 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> (cherry picked from commit 00ac58809990a041b0ffff442398008b4c4e0adf) Reviewed-on: https://chromium-review.googlesource.com/932522 Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
* EFS: Give RO chance to perform vbootDaisuke Nojiri2018-02-191-1/+12
| | | | | | | | | | | | | | | | | | When a user presses the power button in recovery screen, the system shuts down but EC stays in RO. In this state if a user presses the power button again, EC won't be given a chance to run EFS. This patch makes EC execute cold reboot when a power button is pressed in G3/S5. BUG=b:73609782 BRANCH=none TEST=Shut down system in recovery screen. Press power button and verify cold boot is executed. Change-Id: I64af0997beae707680792dcf9e656e036c2a9d8e Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/911828
* host_command: Count suppressed host commands individuallyDaisuke Nojiri2018-02-195-23/+63
| | | | | | | | | | | BUG=chromium:803955 BRANCH=none TEST=Verify counters are printed every hour and before sysjump as follows: [12.540051 HC Suppressed: 0x97=25 0x98=0 0x115=0] Change-Id: I1c1aecf316d233f967f1d2f6ee6c9c16cc59bece Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/912150
* CBI: Update cbi-util to support variable data offset & sizeDaisuke Nojiri2018-02-191-23/+72
| | | | | | | | | | | | | | | | | | | | | | | This patch makes cbi-util support variable data offset & size. BUG=b:70294260 BRANCH=none TEST=Run the command as follows: $ cbi-util --create /tmp/cbi.bin \ --board_version 0x202 --oem_id 2 --sku_id 3 --size 256 $ cbi-util --show /tmp/cbi.bin CBI blob: /tmp/cbi2.bin TOTAL_SIZE: 18 CBI_VERSION: 0 BOARD_VERSION: 514 (0x202) OEM_ID: 1 (0x1) SKU_ID: 2 (0x2) Data validated successfully Change-Id: Id290c33e8625223c8f3fa34fdf8a13ea9308c42e Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/922272 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* CBI: Make data offset and size variableDaisuke Nojiri2018-02-195-156/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently CBI data offset and size are fixed. This patch makes them variable. Each data item consists of <tag><size><value> where <tag> is a numeric value assigned to each data item, <size> is the number of bytes used for <value>. BUG=b:70294260 BRANCH=none TEST=Use 'ectool cbi set' to set board version, oem, sku. Verify the contents by cbi console command and ectool cbi get. 1. ectool cbi set 0 0x202 2 2 (Init CBI and write board ver. of size 2) 2. ectool cbi set 1 1 1 (write oem id of size 1) 3. ectool cbi set 2 2 1 (write sku id of size 1) 4. ectool cbi get 0 514 (0x202) 5. ectool cbi get 1 1 (0x1) 6. ectool cbi get 2 2 (0x2) 7. Run cbi console command: CBI_VERSION: 0x0000 TOTAL_SIZE: 18 BOARD_VERSION: 514 (0x202) OEM_ID: 1 (0x1) SKU_ID: 2 (0x2) 43 42 49 8c 00 00 12 00 00 02 02 02 01 01 01 02 01 02 Change-Id: I5a30a4076e3eb448f4808d2af8ec4ef4c016ae5e Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/920905 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* meowth_fp: update pins configurationVincent Palatin2018-02-192-2/+15
| | | | | | | | | | | | | | | | | Disable the system lock (ie ignore Write-protect) until we have fully defined our secure update scheme. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:73337313 TEST=On Meowth, run 'ectool --name=cros_fp gpioget WP' Change-Id: I3323f5d1e48debae9e2ca6e18f4439e2849a3683 Reviewed-on: https://chromium-review.googlesource.com/924125 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* fpsensor: add quality test capture typeVincent Palatin2018-02-193-18/+29
| | | | | | | | | | | | | | | | | | | Add support for an additional finger image capture type used for quality testing. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575, b:71770455 TEST=On Meowth, run 'ectool --name=cros_fp fpmode capture qual' then 'ectool --name=cros_fp fpframe raw > finger_mq.bin' Change-Id: I1b9525dc2adf0b91aef2f7124803c90d6a3bb0ca Reviewed-on: https://chromium-review.googlesource.com/924124 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
* grunt: Add power/battery LED supportSimon Glass2018-02-194-173/+58
| | | | | | | | | | | | | | | | | | | | | | | | Replace the current led code with an implementation that uses the new led_pwm interface. Grunt has a blue LED which we use for power and an amber LED which we use for battery. The colours used are documented in update_leds() in led_pwm.c BUG=b:71902053 BRANCH=none TEST=manual Check for the various states: * Solid Amber == Charging * Solid Blue == Charging (near full) * Fast Flash Amber == Charging error or battery not present Did not test low / critical battery Change-Id: Ie46075855ab17e6e7301025b62e57db2c596b2a4 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/919765 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* grunt: Add pull-up to EC_BATT_PRES_ODL GPIOEdward Hill2018-02-191-1/+1
| | | | | | | | | | | | | | | | The EC_BATT_PRES_ODL is an open drain signal. The SN74LVC1G07 IC which drives that signal is an open drain buffer. There is no external pull. Therefore, an internal pullup is required. BRANCH=none BUG=b:73286869 TEST=gpioget shows 0 with battery and 1 without Change-Id: I98e18f54b62ddd558bedd9cec65aa003589a0681 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/923102 Commit-Ready: Jett Rink <jettrink@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* lpc: Removing unnecessary register writesJett Rink2018-02-191-6/+1
| | | | | | | | | | | | | | | | | | | | According to Nuvoton datasheet, when SHM windows are in IO mode, only the bottom 16-bits of registers @ offset xF4 and xF8 are used. "This register is ignored when WRAM1_IO bit in WIN_CFG register is set to 1 (LPC / eSPI Peripheral Channel I/O access with 16-bit address). This register is set to its default value by Host Domain reset." BRANCH=none BUG=none TEST=boot grunt and verify host communication still works. Change-Id: I3e48ea1b09355eaf6967b9f7522bc3d35459b76b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/919006 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
* Fizz/CBI: Buid cbi-util as host-utilDaisuke Nojiri2018-02-192-33/+2
| | | | | | | | | | | | | | | This patch also removes make rules to stop producing CBI blobs. CBI blobs will be produced by another protage package. BUG=b:73123025,chromium:809250 BRANCH=none TEST=emerge-fizz chromeos-firmware-fizz and verify /build/fizz/firmware/cbi contains EEPROM images. Verify emerge ec-utils ec-devutils succeeds. Change-Id: I13744b0ab97675afa0247046bffa3edac3e62ceb Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/909692
* tpm: ccd: allow alternative commands when ap is held in resetVadim Bendebury2018-02-191-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A typical CCD use case is when the DUT is not fully functional, or even completely dead, including corrupted AP/EC firmware. We still want to be able to enable CCD in this case, but routing CCD commands through TPM task context (necessary to ensure the large stack size some CCD commands require) is blocked if TPM was not reset after startup. Let's allow both reset requests and alternative commands when AP is held in reset after reboot. The only situation when the alternative command arrives would be the CCD use case of the system not generating TPM reset pulse at startup and the operator is trying to execute a CCD or RMA reset command. BRANCH=cr50, cr50-mp BUG=b:73292631 TEST=on a reef device: destroyed AP firmware and observed that the 'ccd open' command indeed results in the hung Cr50 console after Cr50 is reset in this state. Loaded the new Cr50 image, (which caused another Cr50 reset), successfully took it through the 'ccd open' sequence resulting in enabling AP flash write access, restored the AP flash and observed the DUT boot into Chrome OS. Change-Id: I4413bc200f5b2be563ba666ff80dd2d889ae5790 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/920924 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* led_pwm: Add a few more features to the ledtest commandSimon Glass2018-02-191-5/+10
| | | | | | | | | | | | | | | | | | | Add a way to report the current state using this command. This is useful when debugging. BUG=b:71902053 BRANCH=none TEST=manually > ledtest 0 PWM LED 0: led_id=0, auto_control=1 > ledtest 0 enable amber > ledtest 0 PWM LED 0: led_id=0, auto_control=0 Change-Id: I478980d82573b60b536ea0f4dcf324b7ccfb6fdb Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/919764
* grunt: Remove pull-up on UART pins.Aseda Aboagye2018-02-191-1/+2
| | | | | | | | | | | | | | | BUG=b:73135908 BRANCH=None TEST=Flash grunt; verify EC UART still functional. Reboot Cr50 a bunch without servo connected, verify that Cr50 never reports servo as "connected". Change-Id: I1ec402b4e3d0e9debdbb2af3a1ba5e1c45aa655a Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/917182 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cr50: Convert spihash to TPM vendor commandRandall Spangler2018-02-192-128/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The console command now calls the vendor command to do the work. Otherwise, the same as before. BUG=chromium:804507 BRANCH=cr50 release (after testing) TEST=manual: # Sample sequence spihash ap -> requires physical presence; tap power button spihash 0 1024 -> gives a hash; compare with first 1KB of image.bin spihash dump 0 128 -> dumps first 128 bytes; compare with image.bin spihash 128 128 -> offset works spihash 0 0x100000 -> gives a hash; doesn't watchdog reset spihdev ec spihash 0 1024 -> compare with ec.bin spihash disable # Test timeout spihash ap # Wait 30 seconds spihash 0 1024 -> still works # Wait 60 seconds; goes back disabled automatically spihash 0 1024 -> fails because spihash is disabled # Presence not required when CCD opened ccd open spihash ap -> no PP required spihash 0 1024 -> works spihash disable # Possible for owner to disable via CCD config ccd -> HashFlash is "Always" ccd set HashFlash IfOpened ccd lock spihash ap -> access denied # Cleanup ccd open ccd reset ccd lock Change-Id: Ife9335a1e402a7596d99bf515ec89ff94e8a0044 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/910083 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* meowth: zoombini: enable CONFIG_CMD_PD_CONTROLCaveh Jalali2018-02-191-0/+2
| | | | | | | | | | | | | | | | we need to enable CONFIG_CMD_PD_CONTROL so the AP (depthcharge) can do TCPC firmware update. this was left disabled for bringup. BUG=b:69010531 BRANCH=none TEST=booted on meowth, was able to update TCPC firmware Change-Id: If383cff27c7b79f46f451c6380585d1300fc3413 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/910322 Commit-Ready: caveh jalali <caveh@chromium.org> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* npcx: set eSPI speed to max supported by hardwareCaveh Jalali2018-02-192-3/+12
| | | | | | | | | | | | | | | | | | the npcx7 can only run eSPI at (up to) 50MHz while the npcx5 can go up to 66MHz. so, set the max speed to whatever the hardware can actually do. the bit pattern for 66MHz is "reserved" on the npcx7, so let's not even define it in the npcx7 case. BUG=b:72838699, b:71859563 BRANCH=none TEST="make buildall" passes; boots on meowth Change-Id: I428caf72a41fe58008df4624c475dafadca4a0bc Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/910321 Commit-Ready: caveh jalali <caveh@chromium.org> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* meowth: zoombini: Remove internal pullups on UART.Aseda Aboagye2018-02-191-2/+2
| | | | | | | | | | | | | | | | | Cr50 requires no pullups on the EC UART pins. BUG=b:73135908 BRANCH=None TEST=Flash meowth; Reboot Cr50 a bunch, verify that servo is never seen as "connected". Change-Id: I88e4a2e510c1c795f2b240c3d742a7466acf696b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/917181 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* charger/rt946x: Disable charge timerPhilip Chen2018-02-192-0/+9
| | | | | | | | | | | | | | | | | If the charge timer expires, rt946x would stop charging. We don't need this function. BUG=b:72571372 BRANCH=scarlet TEST=read reg 0x12 and confirm TMR_EN == 0 Change-Id: I38137ac39c7e7dfd15f12342428708697f81922c Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/915501 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: David Schneider <dnschneid@chromium.org>
* signer: advance to new version number and erase new bit in the rollback mapVadim Bendebury2018-02-192-4/+4
| | | | | | | | | | | | | | | | | | | This will prevent earlier released images from running on the device unless Info1 is erased. BRANCH=cr50, cr50-mp BUG=b:70891959 TEST=verified that two bits in the rollback mask have been erased now: > sysinfo Reset flags: 0x00000800 (hard) [...] Rollback: 2/2/128 Change-Id: Ic345c79010fbe0e075e14e652ea1eba263226ab1 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/916737 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* cr50: move to prod RMA keyVadim Bendebury2018-02-191-6/+7
| | | | | | | | | | | | | | | The new key ID is set to zero. BRANCH=cr50, cr50-eve BUG=b:70891959 TEST=verified that prod server properly responds to the challenge generated by a CR50 running on Robo device. Change-Id: I1e0da4a2cebca7f985c5f2a6da509c850924a874 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/915503 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Michael Tang <ntang@chromium.org>
* npcx: do not power down eSPI when enabledCaveh Jalali2018-02-192-4/+11
| | | | | | | | | | | | | | | | | | | | if we're using eSPI for connectivity to the AP, we should never power it down... powering it down just causes transient errors on eSPI. BUG=b:72838699 BRANCH=none TEST=booted on meowth, no more eSPI bus errors. Change-Id: I737a03bb745868c7e8e02ffd5607db4d2da74c30 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/910320 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
* power_button_x86: Honor power_button_pulse setting on sysjumpFurquan Shaikh2018-02-191-2/+7
| | | | | | | | | | | | | | | | | | | On sysjump, if power button is held down, first check power_button_pulse_enabled setting to decide if powerbtn to pch should be asserted. This is important to prevent accidental shutdowns when user is attempting to do an EC reset with Vup+Pwr held down. BUG=b:73129177 BRANCH=None TEST=Verified following: 1. Reset EC by holding Vup+Pwr. 2. Keep holding Vup+Pwr until AP reaches depthcharge. 3. Ensure that AP does not shutdown. Change-Id: I0375fc8e8baabb40807dfdc6d4c9fa70c9b3b87d Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/912364 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* usb-pd: Apply Vconn before Vbus as per USB TypeC spec (v 1.3)Jett Rink2018-02-191-7/+16
| | | | | | | | | | | | | | | | | | According to table 4-25 in USB TypeC spec version 1.3, Vconn should be sourced before Vbus or within 2ms. On Grunt I am see tVconnON around 2.3 ms, which is out of spec. We can simply source Vconn first to comply with spec. BRANCH=none BUG=b:72811851 TEST=Grunt's tVonnOn is now <2ms Change-Id: I52ca6a52bf576487061b2c33f348edf58eb06ca0 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/911928 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* grunt: Disable system power (_A rails) in G3Edward Hill2018-02-192-34/+49
| | | | | | | | | | | | | | | | | | | | | | EN_PWR_A GPIO turns on PP1800_A, PP5000_A, PP3300_A, PP950_A. These should be off in G3 and on in S5 and higher. VGATE (S0 power) is pulled high in G3 when SPOK (system power, S5) is low because PP5000_A turns off, so add a check for this and only pass through high VGATE when SPOK is also high. Leave kahlee behavior unchanged (power stays on in G3). BUG=b:72744306 BRANCH=none TEST=power on and off SOC, see GPIO_EN_PWR_A go low in G3 Change-Id: I68a1ac10263ad84d5ee154613e5e248edb4d287c Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/904729 Commit-Ready: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* eve: Use PCH ACOK signal to control Deep Sleep entryDuncan Laurie2018-02-193-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deep Sleep states (DS3, DS5) are a special mode of the Intel PCH chipset that has very limited wake capabilities and breaks a number of common user expected behahviors. In particular, when in Deep S3 the USB ports are turned off and cannot continue to charge, wake the system, or maintain their internal state as they will lose 5V power. This is particularly painful with gnubby devices as they will need unlocked after every DS3 suspend/resume cycle. The only external signal that the PCH uses to determine whether or not to enter Deep Sx states is the ACPRESENT (aka ACOK) pin. Currently this pin is simply buffered from the charger and will be asserted whenever a charger is connected. This change extends the EC control over the pin to also assert ACPRESENT if either Type-C port is currently supplying VBUS. Now when a USB device is inserted the system will be enter S3 state, but not go into Deep S3 state. This allows the USB device to continue to charge, maintain it's internal state, and wake the system. BUG=b:64406191 BRANCH=eve TEST=verify GPIO_PCH_ACOK pin from the EC in different scenarios and test that system goes into S3 or DS3 state as expected: 1) no charger, no USB device: ACOK not asserted, DS3 enabled 2) charger but no USB device: ACOK asserted, DS3 disabled 3) no charger but USB device: ACOK asserted, DS3 disabled 4) charger and USB device: ACOK asserted, DS3 disabled Change-Id: I1cd132459194382e418970d29b1b195d8132cfad Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/896164 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* Nami: Enable hibernate using silegoElthan_Huang2018-02-195-12/+14
| | | | | | | | | | | | | | | | | | | | Nami EC has EC_HIBERNATE pin connected to a silego (U91). When this pin is asserted, U91 shuts down ROP_PMIC_ENVR3, which turns off the EC. Thus, we don't use the internal hibernate/wake-up feature in npcx. BUG=b:72641658 BRANCH=none TEST=Test system will shutdown and doesn't auto wake up when type hibernate in ec console. And wake up by AC plugin, LID open, or power button. Change-Id: Ib9e02f7e41087e5972eedf4855d88a4c45c75bb4 Signed-off-by: Elthan_Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/890569 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: Daisuke Nojiri <dnojiri@chromium.org>
* grunt: Turn PP1800_SENSOR off in S5Edward Hill2018-02-192-1/+19
| | | | | | | | | | | | | | | | | Disable sensor power (lid accel, gyro) in G3+S5. Enable it in S3+S0. We want it on in S3 for calculating the lid angle (needed on convertibles to disable resume from keyboard in tablet mode). BUG=b:72741289 BRANCH=none TEST=GPIO_EN_PP1800_SENSOR =0 in G3+S5 and =1 in S3+S0 Change-Id: I043b880b9fbd44242df0d2ac01c92a066d6b4377 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/912452 Reviewed-by: Lann Martin <lannm@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* chip/mchp: Default SPI image script verobse output to disabledScott Worley2018-02-192-44/+73
| | | | | | | | | | | | | | | | | Disable MCHP chip Python SPI image generator verbose output. Verbose output only enabled if V=1 passed on make command line. Implemented by importing print as function and overloading. BRANCH=none BUG=810731 TEST=Build mchpevb1 with command line V unset, V=0, and V=1. Change-Id: I3da02b97796a8fe95f5e54634b84c962e14a19bf Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/911749 Commit-Ready: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* usb-pd: Clear active contract bit before browning out systemJett Rink2018-02-191-1/+6
| | | | | | | | | | | | | | | | In the case where we are resetting Vbus and it is our only power source, then we will brown out before we set the active port to 0. BRANCH=none BUG=none TEST=Did a cold reset on grunt with no battery power. System booted as normal. Change-Id: I3823af6b0475e4cf8abbe12dd8ae4ceef26d1eab Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/911613 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* grunt: Making control of SCI and SMI interrupt pins more clearJett Rink2018-02-191-2/+5
| | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: I82d0a68f192fdc339af8682b99781cb16802ac32 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/911590 Reviewed-by: Edward Hill <ecgh@chromium.org>
* sn5s330: Disable vSafe0V interruptsEdward Hill2018-02-191-10/+11
| | | | | | | | | | | | | | | | | | | | | | | Turn off vSafe0V interrupts. They were not being handled or cleared causing the interrupt line to be stuck low after unplugging a USB device. Also don't use read-modify-write for INT_STATUS_REG4 since this would clear the dead battery mode bit before it has been checked. BUG=b:73076662 BRANCH=none TEST=unplug USB device, see USB_C1_SWCTL_INT_ODL=1 TEST=USB2 mouse can be connected multiple times, PPC VBUS detection works, BC1.2 chip turns on and off correctly (USB_C1_BC12_VBUS_ON_L). Change-Id: I96980ee330dd6e5f98e447e5e87f11dd60768a5d Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/909549 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* meowth_fp: put fingerprint code in RW onlyVincent Palatin2018-02-194-7/+70
| | | | | | | | | | | | | | | | | | | | | | | | | Configure the fingerprint to be compile only in the RW partition for size reason, and keep the RO for firmware update only. Enable the RW signature to jump automatically to RW. The dev key was generated with the following command: openssl genrsa -3 -out board/meowth_fp/dev_key.pem 3072 Enable the new STM32H7 internal flash support along the way. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575 TEST=run on ZerbleBarn and see the firmware jumping to RW, then run 'fptest' console command and get a proper capture. CQ-DEPEND=CL:*552559 Change-Id: Icc894b8a59b255b4c6a139f177e99d0fde7c4e19 Reviewed-on: https://chromium-review.googlesource.com/880955 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* scarlet: shutdown PP900_S0 power rail when S3Lin Huang2018-02-191-2/+2
| | | | | | | | | | | | | | | | | | | we need to shutdown PP900_S0 power rail when S3 to save power consumption, let's do it. BUG=b:62644399 BRANCH=none TEST=run suspend_stress_test, it pass 1000 cycles CQ-DEPEND=CL:890228 Change-Id: I366effe9d2a99cb608069dd5d599171d32a9b4ce Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/841902 Commit-Ready: Brian Norris <briannorris@chromium.org> Tested-by: Derek Basehore <dbasehore@chromium.org> Tested-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Derek Basehore <dbasehore@chromium.org> Reviewed-by: Brian Norris <briannorris@chromium.org>
* charge_state_v2: No base/lid power transfer in S0ix/S5Nicolas Boichat2018-02-191-0/+10
| | | | | | | | | | | | BRANCH=none BUG=b:71881017 TEST=Suspend system, see that base does not provide power to lid, and vice-versa. Change-Id: I54e26c9b8decff2afdebc34adb62d4f5cef18e37 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/882524 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* battery: Allow 2 batteries to be fetched via ACPINicolas Boichat2018-02-195-15/+159
| | | | | | | | | | | | | | | | | | | | | We share the same shared memory fields for both batteries. When the host wants to switch battery to read out: - The host sets EC_ACPI_MEM_BATTERY_INDEX to the required index - EC then swaps the data is the shared memory fields, then update EC_MEMMAP_BATT_INDEX - Host waits for EC_MEMMAP_BATT_INDEX to have the required value, then fetches the data BRANCH=none BUG=b:65697620 TEST=Boot lux, both /sys/class/power_supply/BAT0 and BAT1 are present, data is valid. TEST=Unplug base, BAT1 goes away, replug, BAT1 comes back. Change-Id: Icce12f9eef2f6f8cde9bae0a968a65e1703d0369 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/888382 Reviewed-by: Gwendal Grignou <gwendal@google.com>
* stm32: add internal flash support for STM32H7 familyVincent Palatin2018-02-196-8/+564
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The STM32H7 family has 2 banks of flash (with 2 hardware controllers able to do 2 parallel operations at the same time). Each bank of flash has 4 or 8 128-kB erase blocks (1MB and 2MB variants). The flash can only be written by 256-bit word (with an additional 10-bit ECC computed by the hardware). For the flash write-protection, we cannot use our 'classical' PSTATE scheme as the erase-blocks are too large (128-kB) to dedicate one to this and the embedded word in the RO partition would not work as the flash has ECC and triggers bus-fault when the ECC is incorrect (which includes the case where the 256-bit word is written a second time). So we will do the following: - use the RSS1 bit in the option bytes as the Write-Protect enabled bit. - if the WP GPIO is set, lock at startup the option bytes until next reboot. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=run flashinfo/flashwp/flashwrite/flasherase commands on the EC console. Change-Id: I823fce3bd42b4df212cf0b8ceceaca84109b78e6 Reviewed-on: https://chromium-review.googlesource.com/901423 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Fix shmalloc unit testVincent Palatin2018-02-192-2/+2
| | | | | | | | | | | | | | | | | | | | | We want to build the shmalloc common code in test mode *only* for the shmalloc test not for all test binaries (which are missing the helper functions). The previous version was broken for any board declaring CONFIG_SHMALLOC (but none were excepted cr50 which has tests disabled) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575 TEST=emerge-meowth chromeos-ec Change-Id: Ic89c74569fbadbc75d9090b084adab8f40ddfa5d Reviewed-on: https://chromium-review.googlesource.com/909210 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>