summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* morphius: add ppc_id for ppc optionZick Wei2020-08-212-2/+6
| | | | | | | | | | | | | | | | | This pathc use external gpio as ppc id for different ppc: 1:nx20p3483 0:aoz1380 BUG=b:150278507 BRANCH=none TEST=make BOARD=morphius Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I32c26f86a35bd18bd23689a53ab2c44174a01e34 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2348739 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* drawcia: enable stylus chargingDevin Lu2020-08-212-1/+11
| | | | | | | | | | | | | | | Drawcia has garage stylus, this patch enables stylus charging when stylus present. BUG=b:163146414 BRANCH=none TEST=Make sure EN_PP5000_PEN turn on when stylus detected. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I53f181ae381a33a87d7c2c312f7528cddccf49e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2364344 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* trembyle: correctly pass USB-C1 HPD to the MST hubPeter Marheine2020-08-214-7/+38
| | | | | | | | | | | | | | | | | | | | | | | The RTD2141 MST hub on some daughterboard options requires the EC to drive its HPD input because HPD comes over USB-PD, but the MST hub then drives the AP's HPD input. The EC was incorrectly driving nothing, causing DP outputs on port C1 to not be detected. Because the MST's HPD input is connected to an IO expander on current hardware, configure the USB-C and Trembyle-specific HPD twiddling code to support regular or expander GPIOs. Experience says IO expanders tend to be too slow for reliable HPD, but this should allow some (possibly flaky) HPD support until hardware changes are completed to put the output directly on an EC GPIO. BUG=b:159051013,b:165622386 TEST=still builds (I have no v3 hardware to test against) BRANCH=None Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I9e041ab7c222927a11b8972920b7e978ab30d751 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366456 Reviewed-by: Edward Hill <ecgh@chromium.org>
* gpio: add a gpio_or_ioex_get_level function to match the setterPeter Marheine2020-08-212-0/+18
| | | | | | | | | | | | | | Code that wants to work with either regular or IO expander GPIOs may also wish to read the current value; this function permits it. BUG=b:159051013,b:165622386 TEST=buildall BRANCH=None Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I677617621ae4964f568ad87512b372ce8a9830a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366455 Reviewed-by: Edward Hill <ecgh@chromium.org>
* Revert "util: add gen_bmi_config utility"stabilize-13421.53.B-masterstabilize-13421.42.B-masterKeith Short2020-08-214-308/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f137f2493db5b5ee27ffc784538b766d5192704d. Reason for revert: Compression of BMI260 config no longer needed. Original change's description: > util: add gen_bmi_config utility > > Add the gen_bmi_config utility used to generate a compressed version > of the configuration file required by the BMI260 IMU sensor. > > This is expected to be a temporary solution until the 8 KiB BMI > configuration file can be moved out of the EC code. > > BUG=b:160330682 > BRANCH=none > TEST=make utils > TEST=run "gen_bmi_config compress BMI260_main.tbin > bmi260_compressed.bin" > TEST=run "gen_bmi_config decrompress bmi260_compressed.bin > bmi260_uncompressed.bin", verify uncompressed file matches original > file. BUG=b:160330682 BRANCH=none TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I2bfe8d7bef2a35f43b96cc0cd07209bef534ed63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2354195 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* bmi260: back out support for compressed config fileKeith Short2020-08-212-175/+6
| | | | | | | | | | | | | | | | | Now that the BMI260 config file can be moved to the .init_rom section, the simple compression scheme is no longer needed. BUG=b:160330682 BRANCH=none TEST=make buildall TEST=Verify BMI260 operation on both volteer and volteer_tcpmv1 builds using "ectool motionsense lid_angle". Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I83bbaadcd3dade2d585b771b6b9ebae7e9fdc0cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2354194 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* TCPMv2: SRC->SNK PR Swap enable AutoDischarge after VbusDenis Brockus2020-08-211-15/+37
| | | | | | | | | | | | | | | | | | | A debounce was added to allow for the TCPC to get a valid Vbus but AutoDischargeDisconnect was enabled as soon as we set for the debounce. Since Vbus had a good chance of not being valid, we would get a FAULT from the TCPC indicating an Auto Discharge Disconnect failure. BUG=b:165797061 BRANCH=none TEST=DUT-DUT PR_Swap Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I897d682e405d7f2fcda4b4a36a3c1b333e8f7913 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2365253 Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: PR_Swap SRC->SNK should send PS_RDY in current AMSDenis Brockus2020-08-211-6/+16
| | | | | | | | | | | | | | | | | | The SRC->SNK PR_Swap is currently starting a new AMS for the SNK PS_RDY and this causes the partner to disconnect from the bus instead of continuing with the swap. BUG=b:165794652 BRANCH=none TEST=DUT-DUT PR_Swap Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Id953a9b6f78057777617d06f518eb17b061b6f92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2365057 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Do not send GetSnkCap if FRS is not enabledDenis Brockus2020-08-211-1/+10
| | | | | | | | | | | | | | | GetSnkCap is only needed for FastRoleSwap BUG=none BRANCH=none TEST=PR_Swap DUT-DUT testing Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I51973dfbfbfe855d1027c3b1cec35a2ba06a7b65 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2367283 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* dirinboz: add LED behaviorZick Wei2020-08-203-67/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | dirinboz have two charging leds on left side and right side. each side have two colors amber and white. The led behavior define as following: Charging led: led on with charging port active, other port is off. Charging: Amber. Discharging: Off. Battery Error: Blinking white (0.4 sec on, 0.4 sec off) Fuel < 10%: Blinking white on right side port (1 sec on, 1 sec off) Force idle for factory: Blinking amber (1 sec on, 1 sec off) System suspend with non-charging state: Blinking both side LED white (1 sec on, 1 sec off) BUG=none BRANCH=none TEST=make sure led behavior intended. make sure ectool led left white/amber/off/auto work correctly. make sure ectool led right white/amber/off/auto work correctly. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I3a182b1608554cf82fdb3b76917c01321d8d473d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2331983 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Zork: Add command to print temps periodicallyEdward Hill2020-08-204-6/+56
| | | | | | | | | | | BUG=b:162907613 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Iddbba7d7955f252cacf666528195bbfc7d9718e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2365633 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* bmi260: move BMI260 init file into .init.rom sectionKeith Short2020-08-205-19/+75
| | | | | | | | | | | | | | | | | | | | | Increases Volteer RO and RW flash spaces by 7088 bytes each. This is the net gain after including the init_rom layer. BUG=b:160330682 BRANCH=none TEST=make buildall TEST=On volteer run "ectool motionsense" and "ectool motionsense lid_angle". Verify both RO and RW images. TEST=Program RO image with predecessor CL:2311268. Program this CL into AP firmware image and verify EC software sync updates to RW image. TEST=Verify BMI260 operation with CONFIG_CHIP_INIT_ROM_REGION disabled using volteer_tcpmv1 board. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I6849b6c9e96756266528b39ab5e53268dce2a13c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311756 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* EC: Fix presubmit message to avoid unbounded parallel makeAndrew McRae2020-08-201-2/+5
| | | | | | | | | | | | | | | | | | | | The presubmit message that checks for 'make buildall' having been run suggests using 'make buildall -j', which can cause an unbounded number of processes to be started, especially as the number of EC targets have increased. Suggest a more reasonable value. BUG=none TEST=Check presubmit output. BRANCH=none Change-Id: Ie35a545dc1c4d58a3ad9d0ed0233c62ab5a92464 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366324 Reviewed-by: Andrew McRae <amcrae@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org> Tested-by: Andrew McRae <amcrae@chromium.org> Auto-Submit: Andrew McRae <amcrae@chromium.org>
* riscv-rv32i: Enable FPU extension only if CONFIG_FPU is enabledDino Li2020-08-201-1/+3
| | | | | | | | | | | | | | | | | | | At default, CONFIG_FPU option isn't enabled. But currently, FPU extension is always enabled when building FW image. This will cause problem if hardware doesn't support the extension and floating-point instructions are generated. So we fix it. BUG=none BRANCH=none TEST=Floating-point instructions are used for floating point operation if CONFIG_FPU is enabled. Otherwise, library routines are used. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Ifb77bd0cca1158ca7f6637fa9ec025ac8712bbfd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2227779 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Dood: set SYV682X HV_ILIM to 5.5AYu-An Chen2020-08-201-0/+3
| | | | | | | | | | | | | | | | | Set CONFIG_SYV682X_HV_ILIM to 5.5A on Dood. BUG=b:161965761 BRANCH=octopus TEST=make BOARD=dood TEST=Use ppc_dump <port> to check the setting correct. Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I582b122f72511a60136380efdfb7e8a61e4be38a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366322 Tested-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Tested-by: Henry Sun <henrysun@google.com> Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
* Puff: Enable AP reset command handlerAndrew McRae2020-08-201-0/+4
| | | | | | | | | | | | | | | | | | | | Description taken from crrev/2337430: TPMs with old firmware version cannot detect AP initiated reset eg. AP gets reset when CSE Lite SKU jumps from RO to RW. Enable AP reset command handler so that AP can request EC to perform the reset. This will lead to TPM detecting the AP reset. BUG=b:162290856 TEST=FAFT EC tests BRANCH=puff Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I2c3b805b2099e6cc5fff8dc945b575a89ef04465 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366313 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* ampton: increase tasks stackDino Li2020-08-201-3/+3
| | | | | | | | | | | | | | Increased stack size for these tasks: CHIPSET, PD_C0, and PD_C1 BUG=none BRANCH=none TEST=No panic of stack overflow on ampton. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Ibb40661f2e4abbd1dd0ac9a99ace271ea87c4b6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2362380 Reviewed-by: Diana Z <dzigterman@chromium.org>
* BB retimer: Remove FORCE_PWR GPIO from EC driverVijay Hiremath2020-08-1920-40/+59
| | | | | | | | | | | | | | | | | | FORCE_PWR GPIO is used for keeping the BB retimer in active state during f/w updating. On TGLRVP, control to enable the FORCE_PWR GPIO was given to EC to support the I2C based F/W updating. I2C based f/w updating is deprecated and the LSx interface is POR hence the FORCE_PWR GPIO control is given to AP now. Thus, removing the FORCE_PWR GPIO from EC driver. BUG=b:165214747 BRANCH=none TEST=make buildall -j Change-Id: If9bb7199a68c93f704f698552e5594a58bd68f7c Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363334 Reviewed-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* usbc: wake task on every state transitionJett Rink2020-08-196-26/+25
| | | | | | | | | | | | | | | | | | Whenever we change state, we should continue to wake the USB statemachine task up until is settles into a steady state were it is waiting/polling on a timer or event. BRANCH=none BUG=b:163152687 TEST=Ran GRL PD3.0 test on Trembyle and did not see any regressions. It did make a few tests pass that were failing before due to timing issues. Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Idc3c1ae8d92a0f6a5cd4b82f9db6d7138d143f77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2356954 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* cleanup: update formatting for clarityJett Rink2020-08-191-11/+10
| | | | | | | | | | | | | | | Make it clear that there are multiple function calls happening instead of a single statement with multiple parameters. BRANCH=none BUG=none TEST=builds. No actual code change Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I1c01a40794e0c2dc08be205ac953f42bdc9298be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363465 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* TCPM common: Store number of Identity VDOsDiana Z2020-08-192-0/+3
| | | | | | | | | | | | | | Store the number of valid identity VDOs that were received for use later. BRANCH=None BUG=b:165264379 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I54f991c862c4b6589edff2476a79b5c3a8b69b4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363416 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* todor: modify gpio for mb/db typec FRS_ENDavid Huang2020-08-191-0/+2
| | | | | | | | | | | | | Add FRS_EN default low for mb/db typec port. BUG=b:163167407 BRANCH=master TEST=Check system can power on with AC only. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I4ddf88811be214247908ba370718311ed6e5f576 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359626 Reviewed-by: Keith Short <keithshort@chromium.org>
* mt6360: revise vbus presence detection logicTing Shen2020-08-192-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | In Asurada rev1, BC1.2 detection enable pin (EN_USB_C0_BC12_DET) is connected directly to VBUS. Thus, two thing changed in software side: 1. Don't need CONFIG_MT6360_BC12_GPIO anymore. The config is still kept to support rev0. 2. VBUS detach won't trigger BC1.2 detection. Driver implementation for rev0 board triggers BC1.2 detection even if we already know charger is removed. And wait for MT6360 return "no charger" result to update charge manager. This CL changes its behavior to skip BC1.2 detection when possible. BUG=b:159583342 TEST=manually BRANCH=master Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ifa5366a592bc7199df85ea5489eab5010322448f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2294533 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* pompom: detect lid angle in S3AlvinCC_Hsu2020-08-191-0/+4
| | | | | | | | | | | | | | This patch add a configuration of BASE_ACCEL to read BASE_ACCEL values in S3 BUG=b:160750560 BRANCH=none TEST=execute accelread in ec console Signed-off-by: AlvinCC_Hsu <alvincc_hsu@compal.corp-partner.google.com> Change-Id: Iac83ea448297c15d49c0e8df43e26194905bb65a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359627 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* todor: Remove LED_SIDESEL_4_L function and config.David Huang2020-08-194-39/+1
| | | | | | | | | | | | | | Remove LED_SIDESEL_4_L function and config. BUG=b:163167407 BRANCH=master TEST=make buildall success. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I5fe952668543f3671c91da2b138e416a8f8e671c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359625 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* it83xx/spi: change configuration to IS_ENABLED() styletim2020-08-191-69/+67
| | | | | | | | | | | BUG=none BRANCH=none TEST=No error on the command of get EC protocol info. Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I08d87bd20e60520c891f1b99d78ff91c1e89b2cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359613 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util: uut: add npcx7m7fc to the device-to-flash_size mapping tableCHLin2020-08-191-5/+12
| | | | | | | | | | | | | | | | | | | | | uut maintains a mapping table to look up the internal flash size with the device id (chip variant.) This CL adds a new entry in the table for npcx7m7fc. BRANCH=none BUG=b:163910671 TEST=pass "make buildall" TEST="./build/npcx7_evb/util/uartupdatetool --port=pts/15 --baudrate=115200 --read-flash --file=<file_name>" "diff ./build/npcx7_evb/ec.bin <file_name>" Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: I09d8763f5f54d364ecafd17135d8ea00de89da30 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2355158 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* npcx7_evb: add support for npcx7m7fc to npcx7_evbCHLin2020-08-192-6/+9
| | | | | | | | | | | | | | | | | BRANCH=none BUG=b:163910671 TEST=pass "make buildall". TEST=with related CLs, switch to different chip variant in build.mk; build and flash the image; make sure each EC image can boot up on the internal testing board of different chip variant. Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: I6575b23bbeda2a4a7912352c15f1537aba4c93bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2355157 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* npcx7: introduce new chip variant npcx7m7fcCHLin2020-08-194-10/+23
| | | | | | | | | | | | | | | | | | | | | | | Add the following changes: 1. add CHIP_VARIANT_NPCX7M7WC in the npcx7 chip configuration files to define what (RAM, flash, features...) are supported in npcx7m7fc. 2. add the chip id and chip revision id of npcx7m7fc BRANCH=none BUG=b:163910671 TEST=pass "make buildall" TEST=with related CLs, change CHIP_VARIANT to npcx7m7fc in board/npcx7_evb/build.mk; flash image and run on the internal testing board of npcx7m7fc; make sure the EC can boot up; check the chip ID and chip revision ID are correct by console command "version". Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: Ibef17148eeba71bbbb63145064a5fa398c0118dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2355156 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* burnet: add power ledTommy Chung2020-08-192-13/+41
| | | | | | | | | | | | | | BUG=none BRANCH=firmware-kukui-12573.B TEST=make sure battery led is showing battery state on system S3. make sure power led is showing white on S0. make sure power led is blinking white on S3. make sure power led is OFF on S5/G3. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ia257a8adc923dd87be304d6070d18550147e4fef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359614 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* intelrvp: Enable apreset host command needed for CSE LiteVijay Hiremath2020-08-191-0/+2
| | | | | | | | | | | | | | | | | This CL is derived from CL published on Volteer. Change-Id: Iff6fa572c5660b67152f9930b9bad9f82ff6c6ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360454 BUG=none BRANCH=none TEST='etool apreset' resets the AP Change-Id: Ie2dd1fcd55dfdc42bd75a8c9b6846bce2f149b98 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2361103 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Sooraj Govindan <sooraj.govindan@intel.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* waddledoo: Configure unused GPIOs as inputsBrian J. Nemec2020-08-191-0/+12
| | | | | | | | | | | | | | | | | Configure unused GPIOs as inputs to save power in deep sleep states. BUG=b:162318932 BRANCH=none TEST=make buildall TEST=flash waddledoo put device into S0iX or other low power state measure system and EC power consumption Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: Ie29c15d1c4947fe3d6665c66df476ac6b9ed943d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2358903 Reviewed-by: Evan Green <evgreen@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* sm5803: Enable end of charge interrupts for logsAseda Aboagye2020-08-181-0/+15
| | | | | | | | | | | | | | | | | | | Currently, it seems that charging is terminated for some reason. This commit simply enables the end of charge interrupts such that we can log when this event occurs on the EC console. BUG=b:160918663 BRANCH=None TEST=Build and flash waddledee; verify that the EOC interrupts are detected and that the log prints are emitted when they fire. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I113133146f678748071b94511521baf35e818e0d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2358902 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* common: gyro_cal: Implement gyroscope calibrationYuval Peress2020-08-1811-18/+1904
| | | | | | | | | | | | | | Implement the calibration code for the gyroscope which is ported over from AOSP's https://android.googlesource.com/device/google/contexthub/+/refs/heads/master/firmware/os/algos/calibration/gyroscope/ BUG=b:138303429,b:137204366,chromium:1023858 TEST=Added unit tests BRANCH=None Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic1ab2efb66565cda0a96c9c06722136fb184df77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2244934 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "power: Don't boot after waking up from hibernation"Daisuke Nojiri2020-08-181-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8db6eb89540a0ca72e29633ffbfd1eac10d6ad6a. Reason for revert: See chromium:1073960 Original change's description: > power: Don't boot after waking up from hibernation > > When a device shuts down and is idle for 60 mins (configurable), EC > enters hibernation. When an AC adapter is plugged, the system boots. > This is not expected behavior and not consistent with the behavior > that the system stays off on AC plug-in before hibernation. > > This patch fixes the above inconsistency by storing AP_OFF flag before > entering hibernation after 60 mins idle in S5. > > Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> > > BUG=chromium:1073960 > BRANCH=none > TEST=Verified Bloog stays off after waking up from hibernation on > AC plug-in. > > Change-Id: I097bee97164284dd4c35f8bf9389c76319fd676a > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2176555 > Reviewed-by: Gwendal Grignou <gwendal@chromium.org> > Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> > Tested-by: Daisuke Nojiri <dnojiri@chromium.org> > Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Bug: chromium:1073960 Change-Id: I2792dd6d868118ffcba533a3cdb5195cc7d71b76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363099 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* Revert "system: Clear AP_IDLE when waking up from hibernation by AC"Daisuke Nojiri2020-08-182-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4aacf83506fd959d1341e29b664f6e4fe97824cb. Reason for revert: See chromium:1073960 Original change's description: > system: Clear AP_IDLE when waking up from hibernation by AC > > Currently, AP_IDLE is set when EC is left idle in G3. This makes the AP > stay off after EC wakes up from hibernation (for any wake-up source). > This makes a board require another power button press to boot the > system from hibernation. > > This change makes RO clear AP_IDLE unless AC is present. When AC is > present, EC doesn't hibernate. So, AC presence infers the EC woke > up from hibernation by AC. That is, if the system wakes up by a power > button press, AP_IDLE is cleared and AP will be turned on (unless it's > overwritten by AP_OFF). > > Tested as follows on Trembyle: > 1. Put DUT in hibernation. > 2. Wake up DUT and observe: > a. When waking up by power button, AP is turned on. > b. When waking up by lid open, AP is turned on. > c. When waking up by AC, AP is left idle. > > BUG=b:157077589, chromium:1073960 > BRANCH=none > TEST=See above. > > Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> > Change-Id: Ie5020bbe50ad489f4e3010820681cc57ff51b941 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2236589 Bug: b:157077589 Bug: chromium:1073960 Change-Id: Id92d0d3657a622338581cb111d3925cbc11bf168 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363080 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* TCPMv2: Debounce VBUS on SRC to SNK swapKeith Short2020-08-181-2/+21
| | | | | | | | | | | | | | | | | Copying TCPMv1 behavior, debounce VBUS at the completion of a SRC to SNK swap to allow the TCPC/PPC to update the VBUS state following receipt of the PS_RDY message from the partner. BUG=b:162347811 BRANCH=none TEST=make buildall TEST=Force power role swaps and observe no false disconnects. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ia0644cde64d14044b7e291bf582b68ac4278af0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363411 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* sc7180: Increase the timeout of waiting enough powerWai-Hong Tam2020-08-181-1/+1
| | | | | | | | | | | | | | | | In a device without battery plugged, EC has to wait PD to negotiate to at least 7.5W. Some charger takes a bit longer to negotiate a PD contract and misses the timeout. AP won't autoboot. This CL increases the timeout. BRANCH=None BUG=b:165027088, b:150240129 TEST=Unplugged the battery, plugged a PD charger, and AP booted up. Change-Id: I775f87c2a7c25a3c160bd97d09bbbc1d617095b4 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360435 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* endeavour: add pse host commandJeff Chase2020-08-182-7/+116
| | | | | | | | | | | | | This will allow userspace to turn PoE ports off and on. BUG=b:163786867 TEST=manual BRANCH=none Change-Id: Ib9716c5ebc6806f79c8cf85843b93d8c1ff0cba3 Signed-off-by: Jeff Chase <jnchase@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2354544 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* burnet: add IMU sensorsDevin Lu2020-08-183-30/+166
| | | | | | | | | | | | | | * BMI160 Base ACC+Gyro * BMA253 in the LID BUG=none BRANCH=firmware-kukui-12573.B TEST=ectool motionsense to make sure sensors work. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Iab6dcee5b4226750c649b6a61126ec188ff3a960 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2348733 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* esche: Add batteries supportDevin Lu2020-08-182-12/+128
| | | | | | | | | | | | | | | | | | | This patch adds battery parameter as following: 1. DynaPack ATL 2. DynaPack COSMX 3. SIMPLO COSMX 4. SIMPLO HIGHPOWER 5. SAMSUNG SDI 6. COSMX BUG=none BRANCH=firmware-kukui-12573.B TEST=make sure battery charging, battery cutoff works. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I70a1668f612e45b852406e60e3196a25e032d625 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359615 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* burnet: Add batteries supportDevin Lu2020-08-182-11/+127
| | | | | | | | | | | | | | | | | | | This patch adds battery parameter as following: 1. DynaPack ATL 2. DynaPack COSMX 3. SIMPLO COSMX 4. SIMPLO HIGHPOWER 5. SAMSUNG SDI 6. COSMX BUG=none BRANCH=firmware-kukui-12573.B TEST=make sure battery charging, battery cutoff works. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ifc3fa4dfdeebb21460ee46572bb9475d607b58de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2348735 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* util: ecst: add support for chip variant npcx7m7fcCHLin2020-08-182-114/+77
| | | | | | | | | | | | | | | | | | | | Allow ecst tool to compose the correct firmware header for npcx7m7fc. BRANCH:none BUG=b:163910671 TEST=pass "make buildall" TEST=with the related CLs, change CHIP_VARIANT to npcx7m7fc in board/npcx7_evb/build.mk; "BOARD=npcx7_evb make"; check the image can be built and the image header is correct. Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: If1eb6bc34e53c1ddd9e8f049414dc1e307e6d2c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2355155 Tested-by: CH Lin <chlin56@nuvoton.com> Tested-by: Keith Short <keithshort@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* voxel: modify motion sensors configBen Chen2020-08-184-30/+29
| | | | | | | | | | | | | | | | change motion sensor base accel and gyro config, and rotations matrices of lid accel and base. BUG=b:162940877 BRANCH=none TEST=Using ectool 'motionsense' verified lid angle now goes from 0 to 360 and swtiches to tablet mode after crossing 200 threshold. Change-Id: I2073ed7d64604d4c3a53ee5d9d11ab930840d0dd Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352965 Reviewed-by: Keith Short <keithshort@chromium.org>
* cortex-m: Fix flash size calculation boards without flashKeith Short2020-08-181-25/+25
| | | | | | | | | | | | | | | | | | CL:2334389 broke the make debug output for the kukui_scp and flapjack_scp boards. The actual EC image was not affected. This change also cleans up the #ifdef usage to consolidate assignment of the output sections into one place. BUG=b:164696005 BRANCH=none TEST=make buildall TEST=Run "util/compare_board.sh -b cortex-m" Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If69cb492e2aa5f1181e27be24ee66f63cc74ff62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359492 Reviewed-by: caveh jalali <caveh@chromium.org>
* config: Require battery >5% to enable PD Try.SRCWai-Hong Tam2020-08-183-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Align the CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC to the value of BATTERY_LEVEL_CRITICAL, which is 5%. The BATTERY_LEVEL_CRITICAL is 5% that means EC will send battery- critical host event when the battery level <= 5%. CrOS PD policies state that the system doesn't source power to any external USB devices when AP is shutdown. So the current CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC 1% default has no point. When the battery level is <= 5%, AP should be shutdown soon and the system should not be a source, so should not enable Try.SRC. Also change the comparison from soc >= CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC to soc > CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC as the battery critical check is soc <= BATTERY_LEVEL_CRITICAL. BRANCH=None BUG=b:165057418 TEST=Plugging a PD charger to a board with the battery level very low, the system boots up (was failed), Change-Id: If6b11feacd62fd003e13b1756eb5c33d2f9bbce4 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360543 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Dedede: Lower EEPROM i2c speedDiana Z2020-08-171-1/+1
| | | | | | | | | | | | | | | | For ITE variants of dedede, lower the EEPROM i2c speed to 400 kHz. This allows more options for EEPROM parts, but still gives a good speed for flashing the EC. BRANCH=None BUG=b:163846709 TEST=on drawlat, flash and verify CBI can still be read from the EC Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Id7d8190c80e7ff7b75ac0a25af12e7b137ddaaca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360457 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* volteer: Add support for EC_CMD_AP_RESET host commandTim Wawrzynczak2020-08-171-0/+9
| | | | | | | | | | | | | | | This command is needed so that the EC can perform an SoC-level cold reset after the CSE Lite jumps from its RO to its RW image. BUG=b:162977697 BRANCH=none TEST=`ectool apreset` works Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: Iff6fa572c5660b67152f9930b9bad9f82ff6c6ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360454 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* sm5803: Fix linear mode enableAseda Aboagye2020-08-171-2/+3
| | | | | | | | | | | | | | | | | This commit fixes up an error where two parameters were swapped when enabling linear mode. BUG=b:155224387 BRANCH=None TEST=Build and flash waddledee, verify that linear mode is enabled. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Id8d28dfafe1ce6f676e0662c1f5de481237fea76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2358901 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* Dalboz/Dirinboz: Consolidate retimer power control functionsJosie Nordrum2020-08-172-24/+24
| | | | | | | | | | | | | | | | Add USBA retimer power control to HDMI retimer power control function to turn retimers off in S3. BUG=b:162747874 BRANCH=None TEST=None Signed-off-by: Josie Nordrum <josienordrum@google.com> Change-Id: I449322726f9d5d59c9281359ebdbb890c5931f8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352420 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>