summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lindar: Configure temperature sensorsAbe Levkoy2020-10-231-0/+4
| | | | | | | | | | | | | | Enable the ADC alternate function to reduce power usage. BUG=b:155882590 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I65d2b2cd353fdb7d082971848f21ec53f556a5ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493407 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* halvor: Configure temperature sensorsAbe Levkoy2020-10-231-0/+3
| | | | | | | | | | | | | | Enable the ADC alternate function to reduce power usage. BUG=b:155882590 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Iafb169df1b50b0331f87dafab9438b46e109d385 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493406 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* elemi: Configure temperature sensorsAbe Levkoy2020-10-231-0/+3
| | | | | | | | | | | | | | Enable the ADC alternate function to reduce power usage. BUG=b:155882590 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I2d76a8478bbe4fc7b1d4960edc29a7cede16cfdc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493405 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* eldrid: Configure temperature sensorsAbe Levkoy2020-10-231-0/+3
| | | | | | | | | | | | | | Enable the ADC alternate function to reduce power usage. BUG=b:155882590 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ia5a980247182a6eb076a477b8f99111cc6c89ce6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493404 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* delbin: Configure temperature sensorsAbe Levkoy2020-10-231-0/+3
| | | | | | | | | | | | | | Enable the ADC alternate function to reduce power usage. BUG=b:155882590 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I034f4027c11b6be03533fe216df58f8391dc3e96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493403 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* boldar: Configure temperature sensorsAbe Levkoy2020-10-231-0/+3
| | | | | | | | | | | | | | Enable the ADC alternate function to reduce power usage. BUG=b:155882590 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I29ce0b79c7165212d7089eb4f459c16587204b14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493402 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* ps8xxx: Fix the check of entering low power modeWai-Hong Tam2020-10-231-1/+1
| | | | | | | | | | | | | | | | | | The existing check uses IS_ENABLED(CONFIG_USB_PD_TCPM_PS8751) that is wrong if CONFIG_USB_PD_TCPM_MULTI_PS8XXX is used. Multiple CONFIGs are defined, like defining PS8751; however, the board may not use PS8751 actually. Should check the board_get_ps8xxx_product_id() result which is stored in product_id[]. BRANCH=None BUG=b:171446429 TEST=On Lazor board which uses PS8805, enabled i2ctrace and checked the I2CIDLE command was issued when entering low power mode. Change-Id: I9e4a2b7ef905084a30845fbbfc4474a6182096e0 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2493790 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Cerise/Stern: Update Led BehaviorMike Lee2020-10-233-7/+81
| | | | | | | | | | | | | | | | | | | | 1. According to EC_SKU_ID to distinguish Cerise and Stern to execute different Battery Led behavior 2. Modify Power Led 2s on, 2s off in S3 3. Add Battery low Led behavior BUG=b:170654166 BRANCH=firmware-kukui-12573.B TEST=make buildall verified LED behavior and result is OK Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Iac86abc1bd86731acba363cd0da3d83a25896a4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2467597 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Coachz: initial g-sensor supportSimon Zhou2020-10-231-5/+6
| | | | | | | | | | | | | | | update lid accel matrixes modify motion_sensors data struct BUG=b:170288119 TEST=make BOARD=coachz -j flash ec and ectool motionsense return values BRANCH=master Change-Id: Ida746f6885007f7e396953eef9254879a0ee2963 Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492180 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* test: Allow EC unit test to use Ztest APIPaul Fagerburg2020-10-233-22/+159
| | | | | | | | | | | | | | | | | | | | | | | | Provide a translation layer in test_utils.h for the Zephyr zassert macros to map onto EC's TEST_ASSERT macros. With a little bit of duplicated-but-not-quite-duplicated code (test_main vs. run_test) and some extra macros for the return type of the test cases, the tests can build for either the EC framework (by default) or the Zephyr Ztest framework (#ifdef CONFIG_ZEPHYR). Update the unit test documentation to explain why (and a brief "how") developers should use the Ztest API for new unit tests. BUG=b:168032590 BRANCH=none TEST=`TEST_LIST_HOST=base32 make runhosttests` Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: I26e60788c1468e44fed565dd31162759c7587ea6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492527 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* servo_v4p1: Disable UART DMA to save flash space.Matthew Blecker2020-10-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | This also explicitly enables console on USART1 (PA9 + PA10), instead of relying on chip/stm32/config_chip.h default. Disabling DMA saves flash space. Before: *** 28588 bytes in flash and 1036 bytes in RAM still available on servo_v4p1 RO **** *** 256 bytes in flash and 4200 bytes in RAM still available on servo_v4p1 RW **** After: *** 28652 bytes in flash and 1036 bytes in RAM still available on servo_v4p1 RO **** *** 280 bytes in flash and 4200 bytes in RAM still available on servo_v4p1 RW **** BRANCH=none BUG=b:144116746 TEST=servo_v4p1 RS232 console port continues to work (using 115200 baud 8N1) Change-Id: I66b3dd6a9137fc2b179e1e87d3315d4acd7e9ea6 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488935 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* Add shim for system.c (implementing jump data functions)Yuval Peress2020-10-224-1/+234
| | | | | | | | | | | | | | | This change adds the system.h/system.c shim layer to import jump data passing between images. BRANCH=none BUG=b:167392037 TEST=Added tests in zephyr-chrome/tests/ Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I8c6ae2cf579be063c5b3f7219c440aadad3eefa1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2491430 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Allow zephyr/ CONFIG_ options not found in include/config.hYuval Peress2020-10-221-2/+9
| | | | | | | | | | | | | | | | This is needed because Zephyr defines a lot of configs using Kconfig. As such, shims defined under the zephyr/ directory will reference these config values which are not defined under platform/ec BRANCH=none BUG=none TEST=manually tested different config values Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I8e6fa242921d30dfcdf79172b14c215b00e8d08e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2491431 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Trogdor: Deprecate PMIC_FAULT_L signalWai-Hong Tam2020-10-227-11/+4
| | | | | | | | | | | | | | This signal is no longer connected to PMIC on recent hardware revisions. It is unused. Deprecate it. BRANCH=None BUG=b:171245607 TEST=Built the affected Trogdor images. Change-Id: I75562f1aa9e411df38afd321ab63b51e91e7d4f7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488660 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Coachz: Define unused GPIOsWai-Hong Tam2020-10-221-2/+41
| | | | | | | | | | | | | | | For the GPIOs connecting to nothing, define them. The unused GPIOs are configured as input with pull-up to save power. BRANCH=None BUG=b:169595541 TEST=Checked EC booted up correctly. Should be no change except power numbers. Change-Id: I6e23a791b7aa23c1545f195ea169332a57666ba5 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488215 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Pompom: Define unused GPIOsWai-Hong Tam2020-10-221-6/+27
| | | | | | | | | | | | | | | For the GPIOs connecting to nothing, define them. The unused GPIOs are configured as input with pull-up to save power. BRANCH=None BUG=b:169595541 TEST=Checked EC booted up correctly. Should be no change except power numbers. Change-Id: I425a120c0944342f5f12707bfc03df65d191995d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486292 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Lazor: Define unused GPIOsWai-Hong Tam2020-10-221-4/+25
| | | | | | | | | | | | | | | For the GPIOs connecting to nothing, define them. The unused GPIOs are configured as input with pull-up to save power. BRANCH=None BUG=b:169595541 TEST=Checked EC booted up correctly. Should be no change except power numbers. Change-Id: I33a2bb3f9cc9df7fc8e271fca603d2476270d588 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486291 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* TCPMv2: Add typeccontrol enter-mode subcommandAbe Levkoy2020-10-227-25/+182
| | | | | | | | | | | | | | | | | | Define and implement TYPEC_CONTROL_COMMAND_ENTER_MODE. Allow DPM state to be accessed asynchronously by host commands. Add support for this command to ectool. BUG=b:168030639 TEST=Attach DP dongle; discovers but does not enter TEST=ectool typeccontrol 1 2 0; enters DP TEST=Attach TBT dock and TBT active cable; discovers but does not enter TEST=ectool typeccontrol 1 2 1; enters TBT BRANCH=none Change-Id: I218c4b9a92004ef1efe9a27b2a920031961b33f3 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2454538 Reviewed-by: Diana Z <dzigterman@chromium.org>
* various: Fix spellingAbe Levkoy2020-10-223-4/+4
| | | | | | | | | | | | | weather -> whether BUG=none TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I600571f289f01bdc474f8dd02787ad0afab19134 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2490723 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Octopus: Add SSFC field for ChargerYongBeum.Ha2020-10-222-0/+17
| | | | | | | | | | | | | | Casta need to support 2 chargers(ISL9238 & BQ25710) BUG=b:168122776 BRANCH=firmware-octopus-11297.B TEST=None Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I6fdc7fefd5923ee1b168e6f0ec9defa19de7cb81 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2428350 Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* casta : remove rev0 configurationYongBeum.Ha2020-10-221-11/+0
| | | | | | | | | | | | casta doesn't support rev0 board. BUG=None BRANCH=firmware-octopus-11297.B TEST=None Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I41fd8bbb6b4d26f0d5f633db8c37b5c46cce6422 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2455016 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* npcx: Configure unused GPIOs as INPUT with PU to save powerWai-Hong Tam2020-10-221-0/+6
| | | | | | | | | | | | | | | | | According to Power Consumption Investigation Guide, by Nuvoton, setting the disconnected/unused pins as input with an internal pull-up gets better power number. Do it automically for all GPIOs defined through the UNUSED() macro. BRANCH=None BUG=b:169595541 TEST=make buildall -j Change-Id: I929c139e73d8253c79e0b9a3445217a300dc98cb Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488214 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Lazor: Remove some of the bring-up featuresWai-Hong Tam2020-10-221-2/+0
| | | | | | | | | | | | | | | | | | Remove the CONFIG_BRINGUP and CONFIG_SYSTEM_UNLOCKED, to align the behaviors to the shipping devices, like disabling PD in RO. The remaining bring-up features have no behavior difference with the shipping devices. They just add some debug commands. We can keep them for a while. BRANCH=None BUG=None TEST=Build Lazor image and it booted correctly. Change-Id: I8e4d7a3f2937e6ce07a46eb9555ad00c50e6b667 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415379 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* usb-pd: svdm_dp_attention used bit & instead of logical &&Denis Brockus2020-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | The code works the same but it is not clear why the && was not chosen and no comments to give a reason. Since both variables are always 0 or 1, the code will do exactly the same thing but this is really what is happening when you think about the logic behind this comparison. BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I4daf780e370978b468a5d1c22536b904a591e089 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2490733 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Create charge allow_list and add devicesDenis Brockus2020-10-222-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The charge allow_list is for partner devices that do not advertise Unconstrained Power in their SRC_Caps but we should still charge from them if they are the SRC. The allow_list should be constrained to partners that perform dual role and do not present Unconstrained Power in their SRC_Caps. It is preferred for the partner to send this correctly but for products that are already out in the wild, it may be a really bad user experience for this to fail. BUG=b:170644500,b:170848849,b:170970249 BRANCH=zork TEST=connect E24d monitor and verify it charges DUT Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ib4f2c62af3bb2c1ed066ea4353ec26cd536a4c26 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2490729 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: don't set PD_PROCESS_INTERRUPT event to idle taskRuibin Chang2020-10-221-1/+7
| | | | | | | | | | | | | | | | | | | | On drawcia, port 1 has PD INT task (port 0 doesn't have), so CONFIG_HAS_TASK_PD_INT is defined. When we initial port 0 pd task, we'll set PD_PROCESS_INTERRUPT event to idle task in schedule_deferred_pd_interrupt(), because pd_int_task_id [0] value is 0. So I add condition to check PD INT task id before set the event. BUG=none BRANCH=none TEST=On drawcia, confirm idle task event is 0x0000 by "taskinfo" cmd Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I821008255723815ab96aa5bf025243051fe2ca1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2474055 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
* zephyr: add initial gpio shimJett Rink2020-10-217-16/+232
| | | | | | | | | | | | | | | | | Add the gpioget and gpioset commands to zephyr build. This requires a minimum set of platform/ec gpio_ API functions. Add the minimum set of gpio_ functions. More can be added later depending on future uses BRANCH=none BUG=b:169935802 TEST=verify gpioget and gpioset console command work on volteer TEST=verify that posix-ec compiles without any named_gpios in DT Change-Id: Ie6f0b4505aa17c50c01b71fc4ea5b59393f39fce Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488141 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* metaknight: Initial EC imageYu-An Chen2020-10-218-0/+1179
| | | | | | | | | | | | | | | | | | | Create the initial EC image for the metaknight variant by copying the waddledoo reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.2.0). BUG=b:169813211 BRANCH=none TEST=make BOARD=metaknight Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I25cf60b45dfdfb50ec7a3e2c057e71eb7cbcaf5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488951 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* servo_updater: Add timeout on the pty flushBrian J. Nemec2020-10-211-2/+8
| | | | | | | | | | | | | | | | | | | If the servo is in a loop where it sends output on a continuous basis, the flush operation needs to eventually timeout. If the servo sends commands out faster than the timeout provided to the expects() call, it would never advance. This blocked the servo_updater from advancing. BUG=b:162628581 TEST=Connect Servo_v4p1 to DUT validate servo_updater works TEST=Modify Servo firmware to generate many console messages in a loop. Validate that the flush operation succeeds and servo updater still works. Change-Id: I8c0e65a0733b4d4ee25a9f9c866aa2b863cb0e5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2487256 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* TCPMv2: Correct Enter Mode TBT payloadAyushee2020-10-212-30/+32
| | | | | | | | | | | | | | | | | | | | | | | According to Type-C ENGINEERING CHANGE NOTICE (ECN) "USB Type-C ECN Thunderbolt 3 Compatibility Updates for the document fix published by USB-IF, For Enter mode Thunderbolt payload, B25 - Active_Passive bit B24 - Thunderbolt Adapter This CL corrects setting B24 and B25 and sets lrx_comm(23), retimer_type(22), tbt_cable(21) irrespective of the cable speed. BUG=b:148534741 BRANCH=None TEST=Able to enter into Thunderbolt mode with Active and Passie cable Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I7fb29bea972f23ee0f87ee27ddcc1a50ce2d9a69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2481933 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Report TYPEC commands as a featureDiana Z2020-10-213-0/+6
| | | | | | | | | | | | | | | | | | | | To ease the AP's use of the new TYPEC_* host commands, add a feature flag to indicate their presence. Since ToT TCPMv2 always supports these commands, use that configuration as the trigger for it. Note for firmware branch pickers: this commit should only be picked if the branch is also picking the corresponding TYPEC commands (currently as of this CL: STATUS, DISCOVERY, and CONTROL). BRANCH=None BUG=b:167700356 TEST=on waddledoo, confirm Type-c command support shows up in "ectool inventory" Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4ff78c9b6ca297933611d4abf239fb67b1221751 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473100 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Add fields for sink capabilities to TYPEC_STATUSDiana Z2020-10-213-7/+35
| | | | | | | | | | | | | | | | | Round out the final fields of the new TYPEC_STATUS v0 command return with sink capabilities fields. Note that they are not yet being populated, but are being added now to avoid unnecessary return versioning in the coming months when the command is being used. BRANCH=None BUG=b:167700356 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I38a6e96a9ec4974e11b85839abcd4deafcf96b6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473099 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Report source capabilities in TYPEC_STATUSDiana Z2020-10-214-15/+145
| | | | | | | | | | | | | | | | Report the source capabilities for a port to the TYPEC_STATUS host command, and add decoding for the interesting fields here to ectool. BRANCH=None BUG=b:167700356 TEST=on waddledoo, confirm source capability decoding from ectool matches that from TotalPhase for servo_v4 and a charger Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib79c36c613c47fc60cfd8736202216ee40fbb42f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473098 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Report partner PD revisions in TYPEC_STATUSDiana Z2020-10-213-16/+57
| | | | | | | | | | | | | | | | | | Gather and report both SOP and SOP' revisions for port partners. BRANCH=None BUG=b:167700356 TEST=on waddledoo, confirmed SOP and SOP' revisions were reported correctly with: - active cable and non-PD partner - PD 3.0 dock and active cable - PD 2.0 dock and active cable - PD 3.0 and PD 2.0 partners with no e-mark cable Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I6448e5b80212b171a44864f90ae5cdfecbcb7244 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473097 Reviewed-by: Jett Rink <jettrink@chromium.org>
* TCPMv2: Avoid VCONN-Source discovery failureAbe Levkoy2020-10-214-10/+27
| | | | | | | | | | | | | | | | | Remove redundant checks for VCONN Source in pe_attempt_port_discovery (which prevent discovery from running). Allow pe_vdm_send_request to attempt to become VCONN Source if necessary. Make the checks in the VDM request child states more complete (not just checking for VCONN Source). BUG=b:170662791 TEST=Attach Tapex Creek board; observed successful discovery BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Id7d3a1b82d1029f69b3e05b845632e7237524bc6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486303 Tested-by: Li1 Feng <li1.feng@intel.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: Update dedicated capability if charger is allow-listedDiana Z2020-10-201-0/+7
| | | | | | | | | | | | | | | | | Once we know the identity of our port partner, update whether they are considered a dedicated charger. BRANCH=None BUG=b:169107245 TEST=on drawlat, plug in apple dongle multiple times and confirm that we start charging from them even if discovery completes post-power role swap Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5b541cc9dca2c0e0481b79986573b2c503fe77c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488140 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* SM5803: Disable ramps on current set in dischargeDiana Z2020-10-202-4/+18
| | | | | | | | | | | | | | | Disabling the ramps on the current set in discharge reduces issues seen with dongles drawing current during initial connection. BRANCH=None BUG=b:169966133,b:170517117 TEST=on drawlat, confirm CableCreations dongle can now consistently plug in without having Vbus shut off Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I31e9d95cc6ca75b8b59b00aab2b24caad1c8cc72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486297 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* SM5803: Clear out bad state in OTG disableDiana Z2020-10-202-3/+25
| | | | | | | | | | | | | | | | | When sourcing fails to a port partner, the discharge status should be cleared before clearing out the FLOW1 register. Since the source bit may be unreliable after sourcing fails, use this status as an indication for whether it's safe to clear out the mode from FLOW1. BRANCH=None BUG=b:169966133,b:170517117 TEST=on drawlat, attach bad dongle and observe the port works with a good dongle after the bad one is unplugged Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I128e292b3f2bfe5362e51b6967f62e4191809149 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2476670 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* common: online_calibration: Fix compilation issueGwendal Grignou2020-10-204-10/+11
| | | | | | | | | | | | | | | | | - Fix compilation error: sizeof() of an input array was not calculated properly. - Fix calling convention: use sensor pointer instead of sensor number - Use common formula to calculate sensor number. BUG=none BRANCH=none TEST=compile, unittest, load on eve with online calibration added. Change-Id: I06ff30eb5710cbe8f91c939b2ccc084c20a37847 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486304 Reviewed-by: Yuval Peress <peress@chromium.org>
* driver: bmi: remove unnecessary msleep()Gwendal Grignou2020-10-202-45/+0
| | | | | | | | | | | | | | | | 1ms sleep after every write is not necessary. The only place it is is at init time and it is taken care of. Remove unused function. Remove sleep when ODR changes, it causes EC to stall. BUG=b:170155773 BRANCH=hatch, zork TEST=On volteer check hardware.SensorRing passes continuously. Change-Id: I5fd06c9cd6a79ee6cc7f92c448e18fb71a906184 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2483357 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
* eve: Enable TCPMv2 supportPatryk Duda2020-10-201-1/+5
| | | | | | | | | | | | | | | This patch enables TCPMv2 support on eve BUG=b:162254118 BRANCH=none TEST=Flash firmware on eve. Run FAFT_PD test suite. All tests should pass except PDTrySrc (b:170136583 b:170289846) Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I17363ab981db774fdc8bf8f831d5ed5fad983d21 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2453257 Reviewed-by: Jett Rink <jettrink@chromium.org>
* eve: save some RAM for TCPMv2/PD2.0 supportPatryk Duda2020-10-201-2/+6
| | | | | | | | | | | | | | | This patch changes buffer sizes and number of entries in command line history to save RAM. BUG=b:162254118 BRANCH=none TEST=Flash firmware on eve. Run CtsSensorTestCases test module. All tests should pass. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Ib27a005bac7e2284962fecaae97ac62a2e71ff9b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2453256 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* core/nds32: add Zephyr compatible atomic functionsDawid Niedzwiecki2020-10-201-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | Add atomic functions with prototypes equal to the ones in Zephyr. It is done as a part of porting to Zephyr, the next step is to use in the code atomic_* instead of deprecated_atomic_*. Some atomic functions in Zephyr return a value e.g. atomic_add - it returns the value of the variable before the add operation. Adjust the atomic functions' code to support that. GCC builtin functions are not used, because those functions are not available for nds32. BUG=b:169151160 BRANCH=none TEST=buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I9e181d3c64117b30a08179f84c16162ab70b25fc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2444992 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Dino Li <Dino.Li@ite.com.tw>
* dooly: update gpio by board versionZick Wei2020-10-203-0/+4
| | | | | | | | | | | | | This patch update volume down button gpio by board version. BUG=b:169638870 BRANCH=puff TEST=make BOARD=dooly Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I6674451dc03c5a8ab3df9f57f9e4992736dd8e14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2478262 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* dooly: update LED PWM channelZick Wei2020-10-201-1/+1
| | | | | | | | | | | | | This CL update white LED PWM channel to match schematic. BUG=b:163574191 BRANCH=puff TEST=verify white led breath when DUT in suspend. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ie1e7cffa126c07fa25183458dadf9322ddcc73c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486761 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* Trogdor: Remove GPIO 1.8V flagsWai-Hong Tam2020-10-204-24/+24
| | | | | | | | | | | | | | | | | | | | | | | The supply of the following GPIOs are VSPI/VHIF which is 1.8V. Their voltage levels are not configurable. The 1.8V flag is unnecessary. * PS_HOLD * PMIC_FAULT_L * AP_SUSPEND * ACCEL_GYRO_INT_L The following GPIOs are on 3.3V supply and not configurable. The 1.8V flag doesn't work. As they are used as open-drain, should be fine. * PM845_RESIN_L * PMIC_KPD_PWR_ODL BRANCH=None BUG=b:169595541 TEST=Tested the power-on and power-off sequence. Change-Id: I309c1a925b78e1140967cf3702e4ec3bba2a4583 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2485910 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Enable pull-down on SHI signalsWai-Hong Tam2020-10-204-0/+36
| | | | | | | | | | | | | | | Enable pull-down to avoid these signals floating. It is believed that it can get better power number in S5/G3. BRANCH=None BUG=b:169595541 TEST=Host commands between EC and AP work as expected. Check the GPIOs are low when AP is off. Change-Id: I1bcf882bf8f29b06a129700faebee8552085f0ef Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2469505 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* volteer: Configure temperature sensor pinsAbe Levkoy2020-10-201-0/+4
| | | | | | | | | | | | | | | | Configure these pins as ADC0-3 (alternate function) instead of as GPIO inputs (default). This saves ~5 mW during S0ix. BUG=b:155882590 TEST=dut-power -p 9997 --vbat-rate 0 -t 30 TEST=Run temps on EC console; see temperatures change over time BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I32871375fe703553d702ba05ab72abb8aca92074 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2485898 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* RAA489000: Add debug detachDiana Z2020-10-191-1/+22
| | | | | | | | | | | | | | The RAA489000 requires a specific sequence of calls to be made on debug accessory detach, or else it may get wedged in a bad state. BRANCH=None BUG=b:159495742,b:170259606 TEST=on waddledoo, reboot with suzy-q and confirm port is able to auto toggle; confirm FAFT setup passes Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I05ce29ae54c458dc45b5ee178d8e336b4d820c57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2482162
* TCPMv2: Add debug detach interfaceDiana Z2020-10-193-0/+23
| | | | | | | | | | | | | | Some TCPCs may require special commands to be run after a debug accessory leaves the Attached.SNK/SRC states. Add an interface to support this, and call it from the TC when needed. BRANCH=None BUG=b:159495742,b:170259606 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I79c7ebc308958c598cfa228598362c97b9b00e86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2481941