summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* zephyr: Avoid duplicate definition of GENMASK, etc.Simon Glass2020-12-243-1/+14
| | | | | | | | | | | | | | These two macros are defined by Zephyr after this header is included. Avoid this with an #ifdef. BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iaa802de3e49bbdbb68bf9044be28a93bd095c7de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600227 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Add a stub for system_is_locked()Simon Glass2020-12-231-0/+11
| | | | | | | | | | | | | | Add stubs for this and system_get_image_copy(). These should be implemented when we have the underlying functionality available. BUG=b:176171847 BRANCH=none TEST=build on zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iddee3b94cdb9e93a52718e49aea2750f77f5ea2e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2601141 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Add support for battery presenceSimon Glass2020-12-232-5/+43
| | | | | | | | | | | | | | | Add the battery-presence settings so that a battery can be detected. BUG=b:175248556 BRANCH=none TEST=build and run zephyr on volteer No visible change, except more code is compiled in Cq-Depend: chromium:2599491 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I9a7086e6df67f7e9fe3aedb6a15f891e71b58d49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600337 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: usb: Init mutexes in pd_set_vbus_discharge()Simon Glass2020-12-231-1/+8
| | | | | | | | | | | | | | Zephyr needs these to be inited before use. Add the code for this. It is harmless for ECOS but increases code size, so put it behind an #ifdef BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I874c02e143b9d6987ab52036652897f384540def Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600226 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Avoid build error with pd_usb_billboard_deferredSimon Glass2020-12-232-0/+4
| | | | | | | | | | | | | For now, omit this from the build, until the error can be resolved. BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I36e3b41365a9ea982fd9077f68622c15e6483a98 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600225 Reviewed-by: Keith Short <keithshort@chromium.org>
* chip/stm32/usb_hid_keyboard: Implement HID GET_REPORTNicolas Boichat2020-12-231-3/+9
| | | | | | | | | | | | | | | Implement HID GET_REPORT with INPUT type. BRANCH=nocturne,kukui BUG=b:174539061 TEST=With associated kernel CL: cd /sys/bus/usb/drivers/usbhid echo 1-1.1:1.0 > unbind; echo 1-1.1:1.0 > bind Change-Id: If62c92e55fa5454116816681c2ab46d5e796c4b5 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578620 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* galtic: Implement LED functionJacky Wang2020-12-234-86/+83
| | | | | | | | | | | | | | | | | | | | Update LED behavior by Marketing spec. BUG=b:175743432 BRANCH=firmware-dedede-13606.B TEST=BOARD=galtic Verify LED behavior with below items 1. DC mode : S0/S3/S5 2. AC mode : S0/S3/S5 3. battery low : S0/S3/S5 4. Battery Error : S0/S3/S5 Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: I95fdd4726003896918b41dc047d3a92bdf05b0a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2596564 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com> Tested-by: Henry Sun <henrysun@google.com>
* damu: Fix LED behavior under suspend.Michael5 Chen2020-12-231-1/+2
| | | | | | | | | | | | | | | Depend on marketing spec. modify LED behavior under suspend. BUG=b:175920421 BRANCH=kukui TEST=check LED behavir Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Ife6c8823dd99d96e568d32abee4d630dc901f6f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600425 Reviewed-by: Paul2 Huang <paul2_huang@pegatron.corp-partner.google.com> Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* USB: Remove DTS identification from USB PD polarityBrian J. Nemec2020-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We've added differentiation for DTS polarity and normal device polarity. These values were being passed to the pd[port].polarity fields. This creates problems for the usb_pd_config.h files which operate on the assumption that polarity is a boolean value of 0 or 1. In the case of ternary blocks that follow the format of: 'polarity ? A | B', if polarity is 'POLARITY_CC1_DTS = 2' we are incorrectly identifying it as flipped. Other usages like Servo_v4 which have lookup arrays like: tx_gpio[port][polarity]. In these cases, the DTS polarities point to garbage memory and generate hard-faults. BRANCH=none BUG=b:176154334 TEST=Connect to servo console and run 'cc snkdts' Validate that the servo did not hard-fault, instead loads a valid configuration. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: If5ed079fee9e91dbf291e1f210762c298948ad1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600657 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* ectool: Add inventory feature string for mux ackPrashant Malani2020-12-231-0/+2
| | | | | | | | | | | | | | | | | Update the `ectool inventory` ec_feature_names array with an entry for the "Type C Mux requires AP ack" feature. BUG=b:161327513 BRANCH=None TEST=Build and deploy ec-utils to volteer. Run 'ectool inventory' and verify that the mux ack feature shows the provided feature description string. Signed-off-by: Prashant Malani <pmalani@chromium.org> Change-Id: I0642947991dece36eb8a5c3332b305ff24ab113e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2601169 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* tcpm: Move tcpm.h into an include directorySimon Glass2020-12-2267-66/+67
| | | | | | | | | | | | | | | | | | This header file is used from quite a few files, relying on the EC build system to find includes in the driver/tcpm directory. For Zephyr we don't want to add that as an include. It makes more sense for header files to be in an include directory, so move it and fix up the users. BUG=b:175434113 BRANCH=none TEST=build Zephyr and ECOS on volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I5851914b1a7d3fdc1ba911c0fbe9046afbaf6f5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597985 Reviewed-by: Keith Short <keithshort@chromium.org>
* Revert "driver: Richtek update rt1715 driver code"YH Lin2020-12-222-182/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7238cb2f23505aff739d60fa7fcd06bb934f4d4e. Reason for revert: Initial merge was for unblocking the factory. Now build(s) have been done we can revert the CL. Original change's description: > driver: Richtek update rt1715 driver code > > Add rt1715 USB C PHY initial setting for better IOP compatibility. > Add Rt1715_init_cc_params function to setup rt1715 PHY noise filter > according to port partner’s CC status.rt1715_get_cc, rt1715_set_cc, > rt1715_set_polarity functions and replace tcpci_tcpm_get_cc, > tcpci_tcpm_set_cc, tcpci_tcpm_set_polarity. > > BUG=b:173023411, b:171461736 > BRANCH=master > TEST=Pass TDA.2.1.2.1 BMC PHY RX BUSIDL with Volteer+RT1715 > > Change-Id: I1bac27a155e152d42d4d35d72e2791909964da14 > Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2583884 > Tested-by: Abe Levkoy <alevkoy@chromium.org> > Reviewed-by: Abe Levkoy <alevkoy@chromium.org> > Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Bug: b:173023411 Bug: b:171461736 Change-Id: I01e9765a0b369f6da93391bd0bb27581a5feee37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2599759 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org>
* TCPMv2: Compliance Unit Test - don't build unused librariesDenis Brockus2020-12-221-2/+1
| | | | | | | | | | | | | | | | | vpd_api.o and usb_sm_checks.o are not used in the current usb_tcpmv2_compliance test BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I0cdff048b0cfed4001537f3749c04b4d6924773b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2601142 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* stm32g4: ucpd: Add missing tcpci methodsScott Collyer2020-12-223-3/+103
| | | | | | | | | | | | | | | | | This CL adds a VCONN enabe/disable support function to remove the pull resistor and 2 addiltional functions which are required to complete the stm32gx tcpci driver. BUG=b:167601672 BRANCH=None TEST=verfied type-c attaches properly on quiche Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I5a3732f15a5a0af9d372ae37475e9e8bdd3914b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2588850 Tested-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* stm32g4: ucpd: Add pd msg log and console debug commandsScott Collyer2020-12-223-3/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds code to the ucpd driver which can used for additional debug information about both usbc and usb-pd information. The message log contains up to 64 entries which is sufficient to establish a connection and enter alt-dp mode. BUG=b:167601672 BRANCH=None TEST=Connect quiche on host port and validate debug commands: > ucpd info cc1 = Rp cc2 = Rp Rp = Rp_3.0 cc1_v = 1 cc2_v = 2 rx_en = 1 pol = 1 Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I2f50a6284336f21e833ecdff72746ff04c191b52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531183 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* zephyr: Add support for typeof()Simon Glass2020-12-221-0/+9
| | | | | | | | | | | | | | | | This is not available with gcc when -std is used, as it is in Zephyr builds. Define typeof() so that the EC codebase case build, e.g. with the GEN_NOT_SUPPORTED() macro. BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer emerge-volteer -q chromeos-ec Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ic923abeec6409857895c6b20f3c47d2d662ca1ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597984 Reviewed-by: Keith Short <keithshort@chromium.org>
* Revert "npcx9: remove unnecessary default CONFIGs for internal flash"Hung-Te Lin2020-12-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a3dd3c3a941794bd6efcdfac0b70bfae7441ed29. Reason for revert: chromium:1161113 board/npcx9_evb/board.c:103:4:error: CONFIG_SPI_FLASH_PORTundeclared here Original change's description: > npcx9: remove unnecessary default CONFIGs for internal flash > > In npcx9, the internal flash is accessed via FIU/UMA (implementing in > chip/npcx/flash.c). It won’t use the common/spi_flash.c to access the > internal flash. Let’s remove these two default CONFIGs to prevent > people from confusing. > > BRANCH=none > BUG=b:165777478 > TEST=buildall pass > > Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> > Signed-off-by: CHLin <CHLin56@nuvoton.com> > Change-Id: Id04dc9ff5402262b5cdf0815ae953ced777b5d96 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597124 > Reviewed-by: caveh jalali <caveh@chromium.org> Bug: chromium:1161113 Change-Id: I57fb92418e71f8ce0ffd77bad34d4e5055552af1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600713 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Auto-Submit: Hung-Te Lin <hungte@chromium.org>
* Revert "npcx9_evb: remove CONFIG_SPI_FLASH"Hung-Te Lin2020-12-222-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3f9e0a2ebb45d4b610ec770d0d2d3c6d455625c9. Reason for revert: chromium:1161113 board/npcx9_evb/board.c:103:4:error: CONFIG_SPI_FLASH_PORTundeclared here Original change's description: > npcx9_evb: remove CONFIG_SPI_FLASH > > In npcx9, the internal flash is accessed via FIU/UMA (implementing in > chip/npcx/flash.c). It won’t use the common/spi_flash.c to access the > internal flash. Let’s remove configs related to common/spi_flash.c. > > BRANCH=none > BUG=b:165777478 > TEST=buildall pass > > Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> > Signed-off-by: CHLin <CHLin56@nuvoton.com> > Change-Id: I2f1a82edf703752f1385358b977834ec21fdf879 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597125 > Reviewed-by: caveh jalali <caveh@chromium.org> Bug: chromium:1161113 Change-Id: I8d061b249596c95674e3d6d25c2f6f0e5310d2d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600426 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Auto-Submit: Hung-Te Lin <hungte@chromium.org>
* Fennel: Add battery quick charge mode in S3/S5/G3Mike Lee2020-12-221-2/+34
| | | | | | | | | | | | | | Set normal charge mode in S0,and set quick charge mode in S3/S5/G3. BUG=b:172798331 BRANCH=firmware-kukui-12573.B TEST=make build all pass and test the quick charge solution is normal Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I0e094e6a5eb7b49ee44388b941d970347182dad9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2560391 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* kukui: do not boot AP if low-battery and no chargerEric Yilun Lin2020-12-221-0/+19
| | | | | | | | | | | | | | | | BUG=b:134101454 TEST=#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 96; at batt 93%, no adapter, powerbtn, stay at G3 at batt 93%, with adapter, powerbtn, boot to S0 at batt 97^, without adapter, powerbtn, boot to S0 BRANCH=kukui Change-Id: Ib0ee742ccd1f04aaa173a34455c1333853e0ce50 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597122 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* npcx9_evb: remove CONFIG_SPI_FLASHWealian Liao2020-12-222-9/+0
| | | | | | | | | | | | | | | | In npcx9, the internal flash is accessed via FIU/UMA (implementing in chip/npcx/flash.c). It won’t use the common/spi_flash.c to access the internal flash. Let’s remove configs related to common/spi_flash.c. BRANCH=none BUG=b:165777478 TEST=buildall pass Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: I2f1a82edf703752f1385358b977834ec21fdf879 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597125 Reviewed-by: caveh jalali <caveh@chromium.org>
* npcx9: remove unnecessary default CONFIGs for internal flashWealian Liao2020-12-221-2/+0
| | | | | | | | | | | | | | | | | In npcx9, the internal flash is accessed via FIU/UMA (implementing in chip/npcx/flash.c). It won’t use the common/spi_flash.c to access the internal flash. Let’s remove these two default CONFIGs to prevent people from confusing. BRANCH=none BUG=b:165777478 TEST=buildall pass Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: Id04dc9ff5402262b5cdf0815ae953ced777b5d96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597124 Reviewed-by: caveh jalali <caveh@chromium.org>
* kukui: undef I2C console commands to save some flash.Eric Yilun Lin2020-12-221-0/+2
| | | | | | | | | | | | | | DO NOT CHERRY-PICK to firmware branch. BUG=none TEST=make BOARD=kodama, and get 1k extra flash size BRANCH=main Change-Id: I1f0205cd9c149bced3be496768a0d7000f0b61b7 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597135 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* asurada: enable CONFIG_USB_PD_TCPC_LOW_POWERDino Li2020-12-221-0/+1
| | | | | | | | | | | BUG=b:173490375 BRANCH=none TEST=On asurada, save ~7mw in S3 state. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I2f3961f7fddbaf87cb454c57f6ad7b6b3438d2f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2599639 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* gumboz: update led on/off levelZick Wei2020-12-221-6/+18
| | | | | | | | | | | | | | | | | | | | This patch update led on/off level by board version and USB-C port: 1.board version >= 2 && USB-C right port led on: gpio set high led off: gpio set low 2. board version < 2 led on: gpio set low led off: gpio set high BUG=b:173476148 BRANCH=zork TEST=verify on rework board, led behavior as intended. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I261f4a7f8adb737888de41e3fa7600cd220064a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2599727 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* galtic: Implement keyboard function.Michael5 Chen2020-12-224-0/+78
| | | | | | | | | | | | | | The galtic/galnat keyboard without keyboard numpad. The galith keyboard with keyboard numpad. BUG=b:175857578 BRANCH=dedede TEST=make BOARD=galtic Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I6c143105e67fab207ef50be87ea06caa22e59107 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597128 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* copano: Remove ALS function dependent on schematic.Jacky Wang2020-12-224-113/+5
| | | | | | | | | | | | | | Remove ALS function dependent on schematic. BUG=b:175932175 BRANCH=firmware-volteer-13521.B TEST=make BOARD=copano Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ide29770b6eb34b60d35daad00fed1c798b4676da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2598300 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* lazor: Add motion sensors ICM40608 and KX022Sue Chen2020-12-223-6/+154
| | | | | | | | | | | | | | | | | | | KX022 is for lid accel. ICM40608 is for base accel and gyro. For the i2c addresses of KX022 and BMA255 are different, do a single read to check which chip is on the DUT. For the i2c addresses of ICM40608 and BMI160 are the same, read reg ICM426XX_REG_WHO_AM_I to check if the chip is ICM426XX_CHIP_ICM40608. BUG=b:175663607 BRANCH=none TEST=Motion sensors are detected correctly and ectool motionsense show correct data. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I2788bdc1e5bad1b1212ffaa7670969318b77221f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592304 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* SYV682x: Stop VCONN configuration if there is OVPEric Herrmann2020-12-211-3/+8
| | | | | | | | | | | | | | | | | | | If a VBAT OVP is triggered while VCONN is being configured, a PPC re-init will reset the PPC. But, the VCONN configuration would undo this because it is a RMW. Instead, if VBAT OVP is triggered, don't update the VCONN state. BUG=b:171461736 TEST=On a Voxel which experiences VBAT OVPs, ensure that it recovers from these TEST=make buildall BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: I427c43144c8774627783908c0d921fa170686f7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2572236 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: support TBT Alt mode as UFPli feng2020-12-213-2/+250
| | | | | | | | | | | | | | | | | | | Implemented SVDM responders for TBT Alt mode BUG=b:148528713,b:157163664,b:162986785 BRANCH=none TEST=1. Build ec with CL:2382634; OS CPFE 13447, CB CPFE 13535 2. Boot up Volteer, run "pd trysrc 0" on EC console; 3. Then connect port 1 to TGL Windows RVP TBT port; 4. Thunderbolt connection is established. Volteer port 1 as UFP, Windows RVP TBT port as DFP. From host console, thunderbolt0 is listed as network interface in ifconfig. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: If4c80418677f541e9c1c7c8c84446357000aaecb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2370045 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aashay Shringarpure <aashay@google.com>
* tcpm/it83xx: Disable Rx decode in pd initRuibin Chang2020-12-211-0/+4
| | | | | | | | | | | | | | | | | | Default setting of Rx decode SOP and Hard reset are enabled, so I disable it in pd init. BUG=none BRANCH=none TEST=on drawcia, console cmd check register 01h Bit[5:7] = 000b, 1Bh Bit[0] = 0b. Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: Ibf3c7bc144dc0385d8d92a07fab7899d1f0d0bdd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592535 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Boten: Share interrupt lines more gracefullyjerry2.huang2020-12-212-2/+42
| | | | | | | | | | | | | | | | | | | | | 1.Set up checking for interrupt line wedging, which may occur when interrupts from the charger/TCPC occur with similar timing to the BC 1.2 interrupts. 2.Enable TCPC dump BUG=b:175526824 BRANCH=firmware-dedede-13606.B-master TEST=make buildall, test multiple DUT-DUT connections and ensure neither system wedges its interrupt line low Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I98ca5a347b47bf6fcbbd6ed27a203a3f0a33ca35 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2598299 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* gumboz: change LID accel motion sensorJason.Guo2020-12-212-71/+76
| | | | | | | | | | | | | | | This CL change lid accel motion sensor to KX022 from lis2dw12. BUG=b:175284218 BRANCH=zork TEST=ectool motionsense to make sure sensors work. Signed-off-by: jason.guo@quanta.corp-partner.google.com Change-Id: I995cb7b9ee1076db4ff719785e2c33ed0eace391 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597123 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* make: Make V= flag parsing more clearCraig Hesling2020-12-211-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | No functional change. The "else ifeq(x,y)" syntax is documented on the following page: www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html The original change that brought in V=0: crrev.com/c/427363 BRANCH=none BUG=none TEST=# Run before and after change to confirm output is the same make hosttests V=0 make hosttests V= make hosttests V=1 make hosttests V=kabob Change-Id: I22021a794cc2e8dede845c0276a2cee67fa32550 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597809 Tested-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Craig Hesling <hesling@chromium.org>
* kohaku: Set base light sensor information correctlyGwendal Grignou2020-12-212-4/+9
| | | | | | | | | | | | | | BH1370 light sensor only support 10Hz frequency. Set parameters properly. Sensor only used on kohaku. BUG=b:172343923 BRANCH=hatch TEST=Check on Kohaku the light parameters are correct. Change-Id: Ibb9b2699e414cf80730d290aba981dcd4898f84f Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2586069 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* poppy: Disable PU on GPIO10Nicolas Boichat2020-12-212-1/+11
| | | | | | | | | | | | | | | | | | | | For NPCX5, when CR_SIN is selected via DEVALTC.UART_SL2, the PU/PD is selected according to GPIO10 configuration (and not according to GPIO64). Also, disable the relevant WKIEN bit for GPIO10. BRANCH=poppy BUG=b:111215677 TEST=Boot soraka Change-Id: Icee01043dcd562f9b72f2097b9a988d5535e0ffc Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2214454 (cherry picked from commit e03bbafca5d83361f32233a6bfd09c65702102b6) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2342953 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* lillipup: fix Dut can't wake battery up from shutdown modeamber.chen2020-12-211-0/+13
| | | | | | | | | | | | | | | | | | | 1. Override "board_battery_is_initialized" to report correct battery initial state. That's same as eldrid board. 2. Once return BP_NOT_SURE for uninitialized battery, EC may require pre-charge current to wake battery up. 3. It shouldn't keep return BP_NO that it may cause EC not to set pre-charge current and cause battery keep in shutdown mode. BUG=b:175767091 BRANCH=firmware-volteer-13521.B TEST=make buildall, Verify battery which is under shutdown mode and wake it up. Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: I8b4736553224cf59ac098d41f615742590ef4a20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597134 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* Cleanup: rename function nameRuibin Chang2020-12-214-104/+106
| | | | | | | | | | | | | | | | | Rename function name from it83xx_* to it8xxx2_* for it8xxx2 driver. Rename function name from *_tcpm_sw_reset to *_tcpm_hook_disconnect. BUG=none BRANCH=none TEST=make BOARD=drawcia -j make BOARD=asurada -j Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I8111ec5b9972d1badae625e87248c62e99eabbf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2598298 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
* coachz:update current limithegang52020-12-191-0/+1
| | | | | | | | | | | | | coachz update current limit to 95 percent BRANCH=none BUG=none TEST=make BOARD=coachz -j Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: I9e2fcd2b9fb84114ce7ceb64ec0e91154306da5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597132 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* woomax: Apply matrix to base gyroscopeGwendal Grignou2020-12-181-1/+1
| | | | | | | | | | | | | | | | | Fixes c02e23c6 ("woomax: Config lid and base rotation matrix.") CL:2309527 BUG=b:160933251,b:172967880 BRANCH=none TEST=compile Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I162ef4d0a85e2fb7c6fc5331dcc0cc8643b526d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597891 Reviewed-by: Cheng-Hao Yang <chenghaoyang@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* gumboz: enable GMR sensor for tablet modeJason.Guo2020-12-182-0/+3
| | | | | | | | | | | | | | BUG=none BRANCH=zork TEST=Check screen rotation with tablet mode. Check keyboard disabled and on-screen keyboard enabled with tablet mode. Signed-off-by: jason.guo@quanta.corp-partner.google.com Change-Id: Ieb0935d39d385cc8d4c0bb35379ddd1370b15b8b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2581134 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* coachz:support for recovery modeganghe2020-12-181-0/+2
| | | | | | | | | | | | | coachz support enters recovery mode by pressing volume up+down keys BRANCH=none BUG=none TEST=make BOARD=coachz -j Signed-off-by: ganghe <hegang5@huaqin.corp-partner.google.com> Change-Id: I36c405de66a7f4ce8fd24da4dec6525518c148e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592301 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* RAA489000: VBUS current target settingKo_Ko2020-12-181-1/+10
| | | | | | | | | | | | | | | | | The value for VBUS_CURRENT_TARGET (0x92) is determined by current sense which might be different in each board. Use ceiling value to avoid insufficient current output. BUG=b:169788521 BRANCH=dedede TEST=build and flash on madoo, and make sure we get the desired value Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com> Change-Id: If5d976e1f1054dd22ff4b915b399434bc846bb76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567082 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Ko Ko <ko_ko@compal.corp-partner.google.com> Tested-by: Ko Ko <ko_ko@compal.corp-partner.google.com>
* Limozeen: Return a 3S battery type as defaultWai-Hong Tam2020-12-181-0/+15
| | | | | | | | | | | | | | | | | | | Lazor and Limozeen share a single EC firmware. * Lazor uses a 2S battery and a 2-to-1 switching capacitor. * Limozeen uses a 3S battery and a 3-to-1 switching capacitor. Return a correct default battery type in case the battery is not attached, such that the charger can still output a correct voltage. BRANCH=Trogdor BUG=b:175625362 TEST=Build the Lazor image and use it on the board with 3S battery but the battery is not attached. Change-Id: Ied80727d10d7684e26c01b97f68aceac6a43ae9a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597802 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* copano: Config the EC battery setting.Jacky Wang2020-12-182-41/+10
| | | | | | | | | | | | | | | | | Config the EC battery setting depend on battery spec. BUG=b:174969897 BRANCH=firmware-volteer-13521.B TEST=BOARD=copano 1. Check battery found on EC log. 2. Check battery cutoff function on EC console. 3. Check battery charging FET status when battery full. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: I188d4c560cedd0d34e9ef6a95b1946a6aa9389ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2596562 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* lindar: modify LED function to match LED SPECamber.chen2020-12-181-3/+3
| | | | | | | | | | | | | modify LED function to match LED SPEC BUG=b:174443628 BRANCH=firmware-volteer-13521.B TEST=make -j BOARD=lindar Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Ie5e598d119bc096280e717eddae6ed2ce12e61c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597126 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* TCPMv2: Remove test/usb_tcpmv2_tcpci.cEdward Hill2020-12-1810-514/+117
| | | | | | | | | | | | | | Remove test/usb_tcpmv2_tcpci.c to avoid duplication with test/usb_tcpmv2_compliance.c BUG=none BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ie62d0f7e2cc30c3086e03103a43dede5515006b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597598 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* battery_fuel_gauge: Make the default battery type customizableWai-Hong Tam2020-12-182-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the default battery type is a constant. There is a need that a board can support both 2S and 3S batteries, according to its SKU ID. For example, a SKU which uses 2S battery will use a 2-to-1 switching capacitor to regulate the output voltage. A SKU which uses 3S battery will use a 3-to-1 switching capacitor. If the battery is not attached, the default battery is selected to configure the charger. A wrong battery configuration may be selected. For example, the charger may output a 2S voltage but the switching capacitor uses the 3-to-1 ratio. This change enables the board to customize the default battery type. It helps fixing the above issue. BRANCH=Trogdor BUG=b:175625362 TEST=Build the Lazor image and use it on the board with 3S battery but the battery is not attached. Signed-off-by: Wai-Hong Tam <waihong@google.com> Change-Id: I76bf50c7226c4ec9f633d4b7f6025dc9ab464b49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597801 Reviewed-by: Diana Z <dzigterman@chromium.org>
* drobit: Implement keyboard matrix and keyboard backlight functionJacky Wang2020-12-182-1/+41
| | | | | | | | | | | | | | | | | | 1. Base on keyboard spec, modify the keyboard related setting. 2. Implement keyboard backlight function. BUG=b:175851434 BRANCH=firmware-volteer-13521.B TEST=make BOARD=drobit 1. Verify keyboard function behavior. 2. Verify keyboard backlight behavior. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: I4472f7d73126324df31b4e7c3d58bcf3d6c153dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597127 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>
* driver: ppc: Drop paths from driver/ppc filesSimon Glass2020-12-184-4/+4
| | | | | | | | | | | | | | | These paths don't seem to be necessary and don't currently work with Zephyr. Drop them. BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer emerge-volteer -q chromeos-ec Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I482a4a701265631439e3302c4a360e4cb5dba051 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2595220 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>