summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* battery: Set host's low battery shutdown SoC to 4%Daisuke Nojiri2021-07-011-4/+4
| | | | | | | | | | | | | | | Currently, the host's low battery shutdown SoC is 3% by default but most boards are configured to 4%. This patch changes the default value to 4% so that we require only minority boards to customize it. BUG=b:191837893, b:189737806 BRANCH=None TEST=Storo using battfake EC command. Change-Id: I69ed5d8cc8c0d1e321d79c5eae26a9c21624a4ea Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2998509 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* driver: Add argument check in BMA2x2 driverTomasz Michalec2021-06-301-0/+1
| | | | | | | | | | | | | | set_range and set_data_rate functions of BMA2x2 driver should check input values to not set values outside of range supported by device. BUG=none BRANCH=none TEST=makeall Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ie9650975e00a99e86a5229ee200dab24be536076 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953222 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Add BMA255 emulatorTomasz Michalec2021-06-301-0/+154
| | | | | | | | | | | | | | | | | Add BMA255 emulator which is emulated device on i2c bus. Emulated accelerometer properties are defined through device tree, but they can be changed in runtime through BMA255 emulator API. It allows to set custom handlers for write and read messages to emulate more complex scenarios or malfunctioning device. BUG=b:184855546 BRANCH=none TEST=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I4def7fcc54edbf9cb346fda0f21f647a5ad5f8d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2933301 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* battery: Set host's low battery shutdown SoC to 3%Daisuke Nojiri2021-06-292-5/+8
| | | | | | | | | | | | | | | | | | | | | | | Currently, the host's low battery shutdown SoC is 2%. This is the same as EC's low battery shutdown threshold. The EC waits for 30 secs before it triggers the low battery shutdown and powerd reads the SoC every 30 secs. Thus, in most cases powerd can shut down the system gracefully but these delays can be configured differently and the system may be too busy to process all shutdown tasks within 30 secs. This patch increases the host's shutdown SoC to 3%. This will further guarantee that powerd will be given enough time to do everything for a proper shutdown. It also avoids deeply discharging the battery, which is bad for the battery health. BUG=b:191837893 BRANCH=None TEST=Altas using battfake EC command. Change-Id: I3ab23205b400a1a326a60b8f9501611c027183b2 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994747 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* usb_mux: Remove disconnect latch flagAyushee Shah2021-06-291-18/+0
| | | | | | | | | | | | | | With dark resume enabled, disconnect latch flag is obsolete BUG=None BRANCH=None TEST=Swapping Type C devices in s0ix works Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Ica1b55f820f5b3fff5b7dabf88ca57ac0993f246 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846417 Reviewed-by: Madhusudanarao Amara <madhusudanarao.amara@intel.corp-partner.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* cbi: Separate CBI EEPROM driver from CBI protocolPhilip Chen2021-06-292-4/+57
| | | | | | | | | | | | | | | | | Factor out the physical storage driver (cbi_eeprom.c) from the CBI data/protocol layer (cbi.c), setting up the groundwork to support more options of CBI sources. BRANCH=None BUG=b:186264627 TEST=make buildall -j Change-Id: Ic30a6f789970dd6723cf70d4e852ddb7161f796f Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965848 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* driver: bma4xx: Add support for BMA422 sensorBhanu Prakash Maiya2021-06-282-0/+3
| | | | | | | | | | | | | | | | | | | | | | | BMA422 is one of BMA4XX series accel sensor series. Adding defines, driver from Bosch APIs based initial patches submitted by Bosch team members in crrev/c/2894333. Reference code can be found on https://github.com/BoschSensortec/BMA423-Sensor-API. BRANCH=none BUG=b:178400750 TEST=Accel implementation tested on Guybrush EC commands: > accelinfo > acceldata Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Change-Id: I8117283e54980379989fb01f68c29b7d6c501eca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981465 Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com> Reviewed-by: Rob Barnes <robbarnes@google.com>
* tcpm: Do not include gpio.hCaveh Jalali2021-06-261-3/+2
| | | | | | | | | | | | | | | This removes the inclusion of gpio.h from tcpm.h. There's really nothing GPIO related in this file. BRANCH=none BUG=b:192010784 TEST=buildall passes Change-Id: Ia244e36f6137e2c170089ab0e08db7c1902b7e15 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2987160 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* TCPM: Add new LPM bypass TCPC accessorsCaveh Jalali2021-06-251-0/+24
| | | | | | | | | | | | | | | | | | | | This adds a set of light-weight TCPC register access functions for special cases where the caller arranges for the TCPC to be accessible and the complexity of fully taking a TCPC out of LPM mode is not desirable. A typical use case is for alert service routines to be able to peek at a TCPCs alert register to determine if further processing is requested. BRANCH=none BUG=b:191531291 TEST=buildall passes Change-Id: Ib5c9add95f04be311315808168b070793b51cb24 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2986601 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* stm32: rename CONFIG_STM32_SPI1_MASTER to …CONTROLLERHarry Cutts2021-06-251-3/+3
| | | | | | | | | | | | | In line with OSHWA terminology. BUG=b:181607131 TEST=make -j BOARD=hammer BRANCH=none Change-Id: I6d212e60d5aceb8497f00520b693006cc1af2d45 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981123 Reviewed-by: caveh jalali <caveh@chromium.org>
* chgstv2: Refactor charger_discharge_on_acDaisuke Nojiri2021-06-251-0/+2
| | | | | | | | | | | | | | | This patch makes charger_discharge_on_ac call board_discharge_on_ac. It also makes set_chg_ctrl_mode call charger_discharge_on_ac. This makes sense since when the charge control mode changes, discharge-on-ac also needs to be enabled or disabled. BUG=b:188457962 BRANCH=none TEST=make runhosttests Change-Id: I65ec09f580afc987cc86f4c60c15c1f90ead6c3c Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2986848
* Update EC_CMD_CHARGE_CONTROL to version 2Daisuke Nojiri2021-06-252-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 2 of EC_CMD_CHARGE_CONTROL can control battery sustainer. It allows the host to set the upper and lower thresholds between which the EC tries to keep the battery state of charge. Version 2 of EC_CMD_CHARGE_CONTROL also supports 'GET' request. It allows the host to query the current charge control settings. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = off (-1% ~ -1%) localhost ~ # ectool chargecontrol normal 66 66 Charge state machine is in normal mode with sustainer enabled. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = on (66% ~ 66%) localhost ~ # ectool chargecontrol normal Charge state machine is in normal mode. BUG=b:188457962 BRANCH=none TEST=Atlas. See above. Change-Id: I81ec62172b4f159c46334fc0f940a2adae3f2b8a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929340 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* SenderResponseTimer: offset with TCPC transmit success timestampudaykiran2021-06-252-0/+9
| | | | | | | | | | | | | | | | | | | | | | The SenderResponseTimer shall be used by the sender's policy engine to ensure that a message requesting a response is responded to within a bounded time. Which is 24Msec to 30 Msec. However, delays associated TCPC I2C, PE, and PRL layers make hard reset response time greater 30Msec. This CL address the delay associated with TCPC. When TCPC transmit success is reported by TCPC upon receiving the GoodCRC, time stamp is recorded. Another time stamp is recorded just before starting SenderResponseTimer and offsetting PD_T_SENDER_RESPONSE. BUG=b:182439366 BRANCH=none TEST=checked with GRL compliance tester. Noted that total response time is in the middle of the expected time of 24ms to 30ms. This fix achieved response time about 27.675ms Signed-off-by: udaykiran <udaykiran@google.com> Change-Id: Id2ddcdd90eed8b3d66ade3d16877004871a21de8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2971078 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPCI: add ALERT_NONECaveh Jalali2021-06-241-0/+1
| | | | | | | | | | | | | | | This adds the TCPC_REG_ALERT_NONE constant to explicitly checking if the alert register has no alerts pending. BRANCH=none BUG=b:191531291 TEST=buildall passes Change-Id: If2d2166fbc422f071a394125fbdbe14cf20f54bc Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2986599 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* chgstv2: Unify power-on and shutdown battery thresholdsDaisuke Nojiri2021-06-231-40/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, power-on battery SoC and shutdown battery SoC are independently configured by each board. This patch will unify the setting as follows: CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 2 (don't boot if soc < 2%) CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2 (shutdown if soc <= 2%) BATTERY_LEVEL_SHUTDOWN = 3 (shutdown if soc < 3%) CONFIG_BATTERY_EXPORT_DISPLAY_SOC = Y (removed) CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC = 1 This allows us to show the low battery alert whenever we can because EC doesn't inhibit power-on even if it knows the host would immediately shut down. With CONFIG_BATTERY_EXPORT_DISPLAY_SOC, boards will start using the CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2% as the low battery threshold (and the SoC will be agreed between the EC and Powerd). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 1 will keep the same threshold. This is for avoiding degrading the UX by increasing the power-on threshold (even though a question that 1% may not be enough for soft sync to finish consistently remains to be answered). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON > 2 will have a lower threshold but we think 2% is enough to finish the software sync. A lower threshold also improves the UX by showing the low battery alert in the situation where otherwise the system would leave the user uninformed by not responding to a power button press. BUG=b:191837893 BRANCH=None TEST=buildall Change-Id: If6ff733bc181f929561a3fffb8a84e760668ce37 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* mt8192: move power_signal to includeDenis Brockus2021-06-221-0/+16
| | | | | | | | | | | | | | | | | | enum power_signal was duplicated in a few places and really belonged in an include file. This has been created as include/power/mt8192.h BUG=b:180980668 BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ibdcecc73feffcfa6d5b72fa8ef503f1802e14925 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980811 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* bb_retimer: cleanup: Change the power handler func name & paramsVijay Hiremath2021-06-181-5/+5
| | | | | | | | | | | | | | Changed the power handler function name from bb_retimer_power_handle() to bb_retimer_power_enable() and on_off param to enable. BUG=none BRANCH=none TEST=make buildall -j Change-Id: Ifad4c71a5d76b4841ea369a991160e221c051ec5 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2973375 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: update snprintf signature to be compatible with zephyr 2.6Yuval Peress2021-06-181-2/+3
| | | | | | | | | | | | | | | | Also update the tests for printf since the documentation makes no guarantee about negative size values. BRANCH=none BUG=b:190731415 TEST=build brya TEST=make run-printf Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I5e773362f1f30a1beb95284e589e49db3a1d8800 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2970989 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* KB800x: Add DriverEric Herrmann2021-06-181-0/+4
| | | | | | | | | | | | | Add KB800x driver. Add config options to Kconfig. BUG=b:168930682 TEST=On Volteer, check USB4, TBT3, DPMF, DP, and USB3 functionality BRANCH=none Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: Ic71b0d4236037522455a0561ba87fd9a874a4968 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2930581 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: add check for zephyr versionYuval Peress2021-06-171-0/+9
| | | | | | | | | | | BRANCH=none BUG=none TEST=(see next CL, added check to shim/src/gpio.c and tested the build) Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I2e53a1531e02aebc3648282c9fcbc2bacd7aa0b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2970986 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* PCHG: Fuzz PCHG and ctn730 driverDaisuke Nojiri2021-06-171-0/+3
| | | | | | | | | | | | | | | | This patch adds a fuzz test for PCHG and ctn730 driver. With the given corpus, the test currently reaches all the normal mode states. BUG=b:190841496 BRANCH=trogdor TEST=make run-pchg_fuzz TEST=pchg_fuzz.exe -seed=1 -runs=1000000 -dict=fuzz/pchg_fuzz.corpus Change-Id: I6eedbbbdbf3396dfa2b98ca302e16d142ea251d5 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2956076
* ec_commands: Add EC_HOST_EVENT_NONERob Barnes2021-06-161-5/+5
| | | | | | | | | | | | | | | ACPI requires event 0 to represent no event. Add EC_HOST_EVENT_NONE=0 to host_event_code to improve readability when there's no event. BUG=b:184074997 TEST=Build and boot guybrush BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I04690dd98b0e5b8ee9e002279b238c500e364398 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2964955 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* util: Add function to convert binary first base3 numberWai-Hong Tam2021-06-161-0/+31
| | | | | | | | | | | | | | | | | | | | | | Add an util function to convert a ternary bit array (each element is either 0, 1, or 2) to a non-standard ternary number system where the first 2^n natural numbers are represented as they would be in a binary system (without any Z digits) and the following 3^n-2^n numbers use the remaining ternary representations in the normal ternary system order (skipping the values that were already used up). This function is useful for converting BOARd ID, which is initially used a binary and later decided to switch to tri-state after some revisions have already been built. BRANCH=Trogdor BUG=b:190250108 TEST=make runhosttests Change-Id: I853a04f3b28eb54c61855251dc5232c7e6994fef Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2964389 Reviewed-by: Julius Werner <jwerner@chromium.org>
* config: Rename CONFIG_CROS_BOARD_INFOPhilip Chen2021-06-161-3/+3
| | | | | | | | | | | | | | | | | | Rename CONFIG_CROS_BOARD_INFO to CONFIG_CBI_EEPROM to make it clear that the information comes from on-board EEPROM. It sets up the groundwork for adding more options of CBI sources later. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: I9a6feee0a8b35bbf29e445544243485507767ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2945792 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* guybrush: Add PS8811 driverRob Barnes2021-06-141-0/+1
| | | | | | | | | | | | | | | Add PS8811 USB A retimer driver. Reusing USB mux structure even though the retimer does not have a mux. BUG=b:176987937 TEST=Build and run BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ie11a105f344e6acc1312cda517fdfe54ecb8c8ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946307 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* bb_retimer: Return status from bb_retimer_power_handle()Caveh Jalali2021-06-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | This allows the implementation of bb_retimer_power_handle() to return a status value indicating whether the request was successful. The default implementation simply controls a GPIO and is expected to succeed unconditionally. More complex implementations may run into failure cases that leave the BB unreachable. When this happens, device initialization returns an error so the caller can take mitigating action. USB MUX operations tend to be called from timing sensitive code paths in the TCPM, so careful error handling helps avoid cascading problems like PD negotiation failures. BRANCH=none BUG=b:181743576,b:188826559 TEST=buildall passes, PD still works on brya Change-Id: If79078be26e47d758e2cd6cc385ff2b34fecff63 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954198 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* common/usbc: Allow boards to determine DTS (CCD) portCaveh Jalali2021-06-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | This adds support for a board specific function to determine if a particular port supports DTS (Debug and Test System) - more commonly known as the CCD port. Typically, only one port supports CCD and we should not enter debug accessory mode on non-CCD ports. The default implementation simply returns true which is equivalent to the original behavior. Boards can override board_is_dts_port() to limit entering debug accessory mode to specific ports. BRANCH=none BUG=b:188851792 TEST=buildall passes Change-Id: I10ad3cbed68478b23379b5f7ec6eff6ebae11084 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954196 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* PCHG: Handle WLC_CHG_CTRL_DEVICE_STATE_DEVICE_DOCKEDDaisuke Nojiri2021-06-112-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll extend the period for a stylus to be statically charged so that EEPROM corruption can be avoided by not entering negotiated mode with a depleted battery. During this static charge period, the user currently doesn't see any charging indication. To prevent users from removing a stylus, we'll add a new state 'device docked' to ctn730. The EC firmware is updated to handle this new state as follows: - PCHG_STATE_DETECTED will be reused to indicate a device is in proximity but not ready for communication. - PCHG_STATE_CONNECTED will be added to indicate a device is ready for digital communication. This is formerly called DETECTED. - CTN730 driver produces PCHG_EVENT_DETECTED on 'docked' event and PCHG_EVENT_CONNECTED on 'detected' event. - When DEVICE_UNDOCKED is received in PCHG_STATE_DETECTED, transition to PCHG_STATE_ENABLED. BUG=b:189323070, b:173235954 BRANCH=trogdor TEST=Verify unpowered listener board can be detected. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I7fa83f6dd31cf74eab7c158e557ddc09f8976798 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2920628 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* enable CONFIG_CMD_CHARGENNamyoon Woo2021-06-101-1/+10
| | | | | | | | | | | | | | | | | | | This patch enables the uart command, chargen by default. It generates a series of alphanumeric chractecters, and is useful in testing UART related modules with a stress workload. This patch occupies 400 bytes or so in flash memory of RW image. BUG=b:158477297 BRANCH=all TEST=ran it on Atlas, Puff, and Volteer. Signed-off-by: Namyoon Woo <namyoon@chromium.org> Cq-Depend: chromium:1679710,chromium:1554198,chromium:2080933,chromium:2217112 Change-Id: I3c0407e7a4a6d3bb8d998e3e5618be5769192a8c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2951863 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* include/flash: rename the APIsTim Lin2021-06-091-37/+37
| | | | | | | | | | | | | | | | The names conflict when enabling both Zephyr's flash driver and CONFIG_FLASH_CROS option. Rename all the APIs in include/flash.h BUG=b:187192628 BRANCH=none TEST=make buildall -j4 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: If1fd0ea28fa9f5cec1c1daa8f72f63eb7a0e6500 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2931749 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Create a public header for it83xxSimon Glass2021-06-091-0/+12
| | | | | | | | | | | | | | | | | | | Add a separate public header for this chip so we can include it from Zephyr. Drop the #ifdef since the linker will give an error if the function is missing. BUG=b:189855648 BRANCH=none TEST=make BOARD=hayato -j30 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ic4c755da2b576d6cd3465cfd803dfb0e4ad0fbef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941810 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* Create a public header for ps8743.cSimon Glass2021-06-091-0/+76
| | | | | | | | | | | | | | | | Add a separate public header for this chip so we can include it from Zephyr. BUG=b:189855648 BRANCH=none TEST=make BOARD=hayato -j30 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ieefe30bbacac0fea2132355c88626525fa37c3d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941809 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* Create a public header for it5205.cSimon Glass2021-06-091-0/+15
| | | | | | | | | | | | | | | | Add a separate public header for this chip so we can include it from Zephyr. BUG=b:189855648 BRANCH=none TEST=make BOARD=hayato -j30 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Idf2cfbf31e32880ca8cb7d5e72ba0d844cda31b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941808 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* COIL: Rename motion sense address macrosDiana Z2021-06-091-8/+8
| | | | | | | | | | | | | | | | Update the motion_sense.h address macros to reflect our current i2c terms, and also to specify that these are used exclusively in the accelerometer code. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ibad287df2ba1ecd0b6f3061599476636ac7a5354 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946316 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Create a public header for mt6360.cSimon Glass2021-06-091-0/+62
| | | | | | | | | | | | | | | | Add a separate public header for this chip so we can include it from Zephyr. BUG=b:189855648 BRANCH=none TEST=make BOARD=hayato -j30 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iaf93bf7f0f7336b17d06bd5c5691624a3877a43b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941807 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* Revert "Homestar:LED:LED function realization"Aseda Aboagye2021-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8aacd88a332b9903334e0bb3bf586560fdc5883a. Reason for revert: Orange is the same as amber, so the ectool and ec_commands.h portions were not needed. Original change's description: > Homestar:LED:LED function realization > > BUG=b:187539586 > TEST=make -j BOARD=homestar > Verify build on EVT board > BRANCH=Trogdo > > Signed-off-by: tongjian <tongjian@huaqin.corp-partner.google.com> > Change-Id: I9c77b60e11135df5e289ef32adfe34fef3134760 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2915162 > Reviewed-by: Wai-Hong Tam <waihong@google.com> Bug: b:187539586 Change-Id: Ic096dec630bcdcde17a3611f8414d88808d09469 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2947488 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: driver: add ST accel_lis2dw12Denis Brockus2021-06-071-0/+34
| | | | | | | | | | | | | | | BUG=b:180980668,b:189857004 BRANCH=none TEST=make buildall TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ib743f0dbcc4a9731ccb575344413f161cd0dbba2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2944617 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* TCPCI: Add OCP moduleDiana Z2021-06-071-1/+2
| | | | | | | | | | | | | | The TCPCI interface can report OCP conditions, so enable the OCP module automatically for all TCPCI TCPCs. BRANCH=None BUG=b:174334068 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5af9c3fb18cecbea33bec65fad26387ea09a2e71 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923238 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: Clean up motion_sensor headerDawid Niedzwiecki2021-06-071-5/+0
| | | | | | | | | | | | | | Remove motion_sensors_alt[] from the motion_sense header, because the array should be used only in motionsense_sensors file. BUG=b:183990188 BRANCH=none TEST=zmake testall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0b0e87c72d48a2b27b684612c7a752fa487c4810 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2939670 Reviewed-by: Yuval Peress <peress@chromium.org>
* TCPMv2: Rename pd_can_source_from_deviceDiana Z2021-06-051-2/+2
| | | | | | | | | | | | | | Clarify the function name by changing it to "can charge from" since "source from" isn't a generally common phrase in PD terms. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Id7a40ac9d8d4c0007e8ff6cb25c2e8c2d006df0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923239 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* COIL: espi: replace VW_SLAVE_BTLD_STATUS_DONE with ↵Caveh Jalali2021-06-041-1/+1
| | | | | | | | | | | | | | | | | VW_PERIPHERAL_BTLD_STATUS_DONE This replaces VW_SLAVE_BTLD_STATUS_DONE with VW_PERIPHERAL_BTLD_STATUS_DONE. BRANCH=none BUG=b:163885307 TEST=buildall, compare_build.sh pass Change-Id: I0b8c71fa7e590dc89357e22aafce0b67717af183 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2938041 Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
* COIL: Rename MODULE_SPI_MASTER to MODULE_SPI_CONTROLLERCaveh Jalali2021-06-031-1/+1
| | | | | | | | | | | | | | | | This renames the MODULE_SPI_MASTER to MODULE_SPI_CONTROLLER. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I4d33f57fd82c5b57f111c12387113dc82cebe60b Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932466 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* COIL: Rename CONFIG_SPI_MASTER to CONFIG_SPI_CONTROLLERCaveh Jalali2021-06-031-2/+2
| | | | | | | | | | | | | | | | This replaces the CONFIG_SPI_MASTERR config option with CONFIG_SPI_CONTROLLER. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I3c921085179294765baadf7074652978fe04a4ed Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932465 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* tcpmv2: Don't enable USB mode until PD state resolvedKeith Short2021-06-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | Don't enable USB superspeed signals until the PD capability is known. This fixes an issue where platforms that enable the virtual USB mux violate the tSenderResponse timeout when the attached SRC sends the Source Capabilities message. BUG=b:187796705 BRANCH=none TEST=Volteer - connect PD charger, obsserve no hard reset TEST=Connect non-PD USB device, verify USB mode is enabled TEST=Connect USB+DP monitor, verify DP mode entry and USB mode enabled TEST=Connect USB4 dock, verify USB4 entry TEST=faft_pd test suite passes on Voxel Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I4be08874178d1e225cf41939b9626a81b0da0524 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2895424 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: caveh jalali <caveh@chromium.org>
* COIL: Remove CONFIG_SPI_MASTER_NO_CS_GPIOSCaveh Jalali2021-06-031-4/+0
| | | | | | | | | | | | | | This removes the CONFIG_SPI_MASTER_NO_CS_GPIOS config option as no code actually uses it. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: Iab1c7a79ee0ad973605c768f87ad8e19ed6ef4e7 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932470
* COIL: Remove CONFIG_SPI_MASTER_CONFIGURE_GPIOSCaveh Jalali2021-06-031-3/+0
| | | | | | | | | | | | | | This removes the CONFIG_SPI_MASTER_CONFIGURE_GPIOS config option as no code actually uses it. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I4083a0ed1b106f9dcf0534625da5286dc0c34552 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932469
* COIL: spi_nor: Rename spi_master to spi_controllerCaveh Jalali2021-06-031-5/+7
| | | | | | | | | | | | | | | This renames the spi_master struct member of spi_nor_device_t to spi_controller. BRANCH=none BUG=b:163885307 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I446de6e60fa1e4dfa1266dca04d851fbfb6c250b Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932467 Reviewed-by: Harry Cutts <hcutts@chromium.org>
* zephyr: Don't reinitialize gpios on a warm rebootSam Hurst2021-06-031-0/+5
| | | | | | | | | | | | | | Don't reinitialize gpios on a warm reboot BRANCH=none BUG=b:187337449,b:186458444 TEST=Verified that the system booted properly Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ie11bdde9fa0124c0bf21cdc9baa3a98a85bbdad2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2904549 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* TCPCI: Add definition for power status debug bitDiana Z2021-06-011-0/+1
| | | | | | | | | | | | | | | The POWER_STATUS register has an indication in bit 7 that a debug accessory is connected. This bit appears to be present in both TCPCI Rev 2.0 Ver 1.2 and Rev 1.0 Ver 1.2. BRANCH=None BUG=b:186799392 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Idc4efe30d328070605b985d5541b71713af25030 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2919941 Reviewed-by: Rob Barnes <robbarnes@google.com>
* Remove CONFIG_BATTERY_DEAD_UNTIL_VALUEDaisuke Nojiri2021-06-011-7/+0
| | | | | | | | | | BUG=none BRANCH=none TEST=buildall Change-Id: Iebf0817c1b605d74348c9b20c01df74bd69468d2 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929338