summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* kblight: Set kb backlight enable gpiostabilize-13974.B-mainRob Barnes2021-05-142-0/+11
| | | | | | | | | | | | | | Set the keyboard backlight enable gpio on enable/disable. This will improve power usage on some boards. BUG=b:187757151 TEST=Set backlight to 0, 50, 0 and observe the enable gpio is 0, 1, 0 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ie03e98d939d05aea861c7b885a45b7e0c476db59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887550 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* TCPMv2: TD.PD.VNDI3.E3 VDM Identity Unit TestDiana Z2021-05-144-0/+121
| | | | | | | | | | | | | | | | Adds a unit test for TD.PD.VNDI3.E3 VDM Identity. Note that this currently only covers our default case of having no information to discover. There are additional items to verify if we expand the unit tests to have VDM information. BRANCH=None BUG=b:181194535 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I26b517f268eb9133fdd565783d44bbef2336048c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2893486 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Mancomb: Remove CONFIG_BRINGUPDiana Z2021-05-141-1/+0
| | | | | | | | | | | | | | | Monkey Island is far enough along that CONFIG_BRINGUP can be removed from mancomb. BRANCH=None BUG=b:187911213 TEST=make -j buildall; load on mancomb and observe the bringup banner is gone Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I2a0f58106e532360852d66e8d50f662676676b6f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2895173 Reviewed-by: Rob Barnes <robbarnes@google.com>
* Mancomb: Add BJ to charge manager and correct active charge port setDiana Z2021-05-145-2/+63
| | | | | | | | | | | | | | | | | | | | Register the BJ with the charge manager, and add a per-board callback to determine the voltage and current associated with it. Additionally, correct a couple of errors in the active charge port set function. The BJ port is incapable of sourcing Vbus, and the ports to be disabled should be all except the port being enabled. BRANCH=None BUG=b:187911213,b:187899192 TEST=on mancomb, plug in BJ and verify the correct voltage and current are registered for it Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I25369e18a56832a79421e179d267c4741916720b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2892183 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* TCPMv2: Initiate VCONN Swap when requestedstabilize-13971.B-mainAbe Levkoy2021-05-141-1/+1
| | | | | | | | | | | | | | | | | | | Do not ignore a requested VCONN Swap if VDM setup is done. Use a DPM request flag (which is always handled in the ready state) instead of the VCONN Swap PE flag (which is only handled if mode entry hasn't completed). BUG=b:187861138 TEST=make buildall BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I32ebb7c50e9abc47351398f229a2b464605f634d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2895425 Tested-by: Li1 Feng <li1.feng@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* zephyr: kohaku: disable CONFIG_PLATFORM_EC_ADCDenis Brockus2021-05-141-0/+1
| | | | | | | | | | | | | | | | ADC has not been enabled in the device tree yet. BUG=none BRANCH=none TEST=submit build will verify Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I204f3d36f8778e95b230a1668f074898a822ae57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2895789 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* TCPMv2: Correct PD 3.0 reply when SVDM isn't supportedDiana Z2021-05-141-1/+11
| | | | | | | | | | | | | | | In PD 3.0, a DUT must reply with Not_Supported when a SVDM isn't supported. Note that PD 2.0 is still perfectly welcome to send a NAK reply for this case. BRANCH=None BUG=b:181194535 TEST=with follow-on CL, verify TD.PD.VNDI3.E3 VDM Identity passes Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie3b554cca017494b86342df1e9149b4452c83852 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881028 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: lazor: fix touchpadDawid Niedzwiecki2021-05-142-0/+2
| | | | | | | | | | | | | | | Add GPIO_TRACKPAD_INT_GATE pin to let the OS manage the trackpad. BUG=b:188127604 BRANCH=none TEST=Build and flash firmware for Lazar, boot to OS, verify that touchpad works. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I526b9bc440456fdcb700c04d91c5976189840484 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897237 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: i2c: remove scl and sda referencesYuval Peress2021-05-148-106/+9
| | | | | | | | | | | | | | | The SDA and SCL components of the struct i2c_port_t are only used in and for the i2c_wedge.c logic. This isn't needed in Zephyr. Remove the values and functions that use them from the Zephyr build. BRANCH=none BUG=b:188179405 TEST=build volteer and trogdor Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I71a26fbd9bc51def744ef1f16a540728482c5a2b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2896235 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: i2c: remove frequency from devicetreeYuval Peress2021-05-146-27/+11
| | | | | | | | | | | | | | | | The frequency wasn't actually being used as it was set by the i2c controller in the proper Zephyr driver. Also, remove the kbps field in struct i2c_port_t for Zephyr builds to make sure we don't accidentally use it later on. BRANCH=none BUG=none TEST=build trogdor and volteer Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I2eea231ff629d3e6f0ebbe71923a7b0ae96af87c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2896234 Reviewed-by: Keith Short <keithshort@chromium.org>
* honeybuns: Board specific power button and LEDsScott Collyer2021-05-145-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL modifies both power button press/release polairty and power button LED control signals to be board specific instead of platform specific. Previously there were platform specific macros for BUTTON_PRESSED_LEVEL and BUTTON_RELEASED_LEVEL. But, these levels will depend on how the power button circuit is designed. This CL moves these macros to board.h. In addition, macros are added to for the GPIO signals used for green/red LED control. This allows for boards that don't support the power button LED at all. BUG=b:164157329 BRANCH=quiche TEST=Verfied power button works on both quiche and gingerbread. Previously, this was only working on quiche because gingerbread has opposite polarity for the power button signal. Also, verfied that power button/status LED turns off when dock is off. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Iee838ee158d23252e8b429f51a1dd1a71d8e94a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2868225 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* honeybuns: Add console command to limit host src capsScott Collyer2021-05-141-1/+37
| | | | | | | | | | | | | | | | | | | | | This CL adds a new console command 'hostpdo <0-4>' to allow limiting which SRC CAPs are offered on port C0. This command may be useful for debugging HW issues related to VBUS level. This CL also adds additional console log prints for the DP pin configuration selected and the VBUS transition voltage used. BUG=None BRANCH=quiche TEST=verified that all 4 SRC CAPs are offered to port partner by default and that those can be limited using the new console command. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I931d0ca1a7d5e342339bc9570ab3a971f930cca2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2865312 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* baklava: Use correct VID for USB-EPScott Collyer2021-05-142-2/+4
| | | | | | | | | | | | | | | | This CL sets CONFIG_USB_VID to correct value for the OEM. In addition, updated the vendor and product strings. BUG=b:185066262 BRANCH=quiche TEST=verfied that fwupd works correctly on baklava Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I4d61253b3a32cc117daaee5e731db9bff4b85e6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2848425 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org>
* zephyr: Rework CBI to be used as a driverDawid Niedzwiecki2021-05-1412-181/+393
| | | | | | | | | | | | | | | | | | Rework the CBI support in Zephyr to be used via driver API. Change also approach what to do with SSFC - let sensor drivers decide how to handle alternative sensors. BUG=b:183990188 BRANCH=none TEST=Add alternative motion sensors to the device tree, modify CBI SSFC with 'cbi set 8 value 4', reboot EC and verify that the new sensors are used with the 'accelinfo' command. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I701af96bfa7a17333220530a5c63b8e8aaeb0d6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2862727 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: drivers: ADC enable ADC drivertim2021-05-143-1/+46
| | | | | | | | | | | | | | enable ADC and test on it8xxx2_evb BUG=b:185202623 BRANCH=none TEST=shell: adc Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I426dd6aebbe69ba86b2e7c57fb8e9216a76246f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2874325 Tested-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* storo:The stylus has no function when the first time using the stylus.stabilize-13970.B-mainqinwentao2021-05-141-0/+3
| | | | | | | | | | | | | | | | | fix the power-on detection of the stylus BUG=b:187970959 BRANCH=dedede TEST=make -j BOARD=storo Signed-off-by: jesen <wangganxiang@huaqin.corp-partner.google.com> Change-Id: Iabde2114464865b7b1cae865bd0737cdb54c9b4a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891678 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo: remove CONFIG_SYSTEM_UNLOCKED for faft_ecMike Lee2021-05-131-3/+0
| | | | | | | | | | | | | | | Remove CONFIG_SYSTEM_UNLOCKED for firmware qual test BUG=b:187867613 BRANCH=dedede TEST=make BOARD=storo pass TEST=test firmware_ECSystemLocked pass Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I7233db423321ba1e3753afa7c012142df5c0259b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891682 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* cret: Add thermistorsjohnwc_yeh2021-05-132-0/+27
| | | | | | | | | | | | | | | | This change adds the temperature sensors for cret, which are hooked up to 2 of the ADCs. BUG=b:187894632 BRANCH=dedede TEST=build and test on cret board. Can obtain value via ectool cmd. Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Change-Id: I7d07c36e80b95b149d503fd9e37999291c21d5f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891675 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: asurada: Enable I2CDenis Brockus2021-05-135-17/+122
| | | | | | | | | | | | | | | | | | | Hold off on merging this until https://chromium-review.googlesource.com/#/q/2859183 and https://chromium-review.googlesource.com/#/q/2857993 or their equivalent have been landed by ITE BUG=b:180980668,b:186673243 BRANCH=none TEST=i2c shell "i2c scan I2C_0" Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I6c8bbe9e6aef1ab24fc25797e379b0e5cf8a070f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2855217 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: it8xxx2/pinmux: use new pinmux driverDino Li2021-05-131-15/+94
| | | | | | | | | | | | | | | | | | Enable i2c ports alt function with new pinmux driver. BUG=b:187043683 BRANCH=none TEST=On Asurada, verify I2C ports' alt function are set correctly. Cq-Depend: chromium:2857993 Signed-off-by: Denis Brockus <dbrockus@google.com> Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I816aa7e9f9aff1eecf3ebcd55bf822f0e66cdff3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2858298 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* raa489000: enable adc functionMike Lee2021-05-131-10/+31
| | | | | | | | | | | | | | | | | Enable adc function so that We can quickly get the bus voltage. and move clear ADC bit after charger_get_vbus_voltage to reduce power consumption BUG=b:178981107,b:178728138 BRANCH=dedede TEST=storo can keep asgate not drop with ac only TEST=sasukette can keep asgate not drop with AC only Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I39db6f80a5439dbd890c788981796165abb49415 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2890492 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* ectool: Make i2cread/write address print consistentRob Barnes2021-05-131-12/+11
| | | | | | | | | | | | | | | | | | ectool i2cread and i2cwrite expect an 8-bit address as input. However the output prints a 7-bit address. This is confusing for ectool users. This CL changes the output to be the 8-bit address. i2cxfer expects a 7-bit address and is unaffected by this CL. BUG=b:187811828 TEST=ectool i2cread 8 1 0x52 0 Read from I2C port 1 at 0x52 offset 0x0 = 0x10 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I71596080200d9ee08b23536d233cf34d958bf9b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887555 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Cozmo: Add new battery informationSue Chen2021-05-132-0/+88
| | | | | | | | | | | | | new battery config : AP19B5K, AP19B8K, AP20CBL BUG=none BRANCH=icarus TEST=Check found battery info in console and cutoff work. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Iffadbb28c03814f752e6b26727b2de22e943dd70 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796834 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* cret360: Modify G-sensor rotation matrixjohnwc_yeh2021-05-131-1/+1
| | | | | | | | | | | | | | | | | | The sensor on the cret is different with the waddledoo. Change base_standard_ref matrix Z-value to -1. BUG=b:187656474 BRANCH=dedede TEST=In VT2, enter ectool motionsense lid_angle and watch the value is normally. Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Change-Id: I659692d67c7dff4adcc7a271da023cefa95c3226 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891134 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* brya: Set I2C4 to 400KHzCaveh Jalali2021-05-131-1/+1
| | | | | | | | | | | | | | | This drops the I2C4 speed to 400KHz as board rev. 1 does not meet I2C timing requirements for 1MHz. BRANCH=none BUG=b:186921875,b:187764571 TEST=PD still works on C1 Change-Id: I333708682f63af3293938b07cbf5a562d7065e4d Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2885729 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* brya: Set I2C6 to 400KHzCaveh Jalali2021-05-131-1/+1
| | | | | | | | | | | | | | | This drops the I2C6 speed to 400KHz as board rev. 1 does not meet I2C timing requirements for 1MHz. BRANCH=none BUG=b:187549899,b:187764202 TEST=PD still works on C1 Change-Id: I3da75c561350d4f59bbd63f77d291eb40c1c37c3 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2885728 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* Chronicler: Change EC chip from NPCX796FC0BX to NPCX797FC0BXYu-An Chen2021-05-122-6/+4
| | | | | | | | | | | | | | | Change EC chip from NPCX796FC0BX to NPCX797FC0BX Remove BOARD_VOLTEER_APMODEENTRY BUG=b:187760200 BRANCH=volteer TEST=make BOARD=chronicler Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I3f5af07efd3edbac0b8bdb808047cf49a1a036c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887018 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* asurada: drop SVY682X smart discharge.Eric Yilun Lin2021-05-121-1/+0
| | | | | | | | | | | | | | | | | | | | | As we have ADCs for VBUS detection, we don't need to rely on the VBUS detection in SYV682X, so the VBUS SDSG function is not needed anymore (to make VBUS fast falling in to Vsafe0V). Also, SDSG might make concerns of FRS, since in transisiton, there should be no discharge circuit happen or the swap might fail. BUG=b:181203590 TEST=FRS 5V/9V/20V works on Asurada. Meets tVBUSOff. BRANCH=asurada Change-Id: I0d8f2a4b038b1ecdf23e834e37d59da9ea5d2c57 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891131 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* collis: Fine tune keyboard backlight PWM frequencyMichael5 Chen12021-05-121-1/+1
| | | | | | | | | | | | | | Fine tune keyboard backlight PWM frequency from 2.4kHz to 10kHz. BUG=b:187664424 BRANCH=firmware-volteer-13672 TEST=make BOARD=collis Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I6942a24a3764123e98895d83c483d3da4eb3eea2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887024 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* collis: Config the EC battery setting.Jacky Wang2021-05-122-19/+19
| | | | | | | | | | | | | | | | | | | Config the EC battery setting depend on battery spec. BUG=b:187366003, b:186609352 BRANCH=firmware-volteer-13672.B TEST=make BOARD=collis 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: I76f24e2ca0d0f6806e597fdcafaa9a39f8bd84d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875912 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* anx3443: fix incorrect set_mux implementationTing Shen2021-05-121-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | Current driver code sets 0xF8 bit [1:0] to 0b00 when USB_PD_MUX_NONE. However, according to the programming guide (b/181282482#comment3). 0b00 means "power-off", not "disable both paths". This is not what we want because power-off mode blocks all subsequent i2c transactions. Since this mux does not have a "none" state, this CL maps USB_PD_MUX_NONE to USB enabled instead. BUG=b:181282482 TEST=Boot Cherry, verify that error messages like "mux config:0, port:1, rv:1" disappeared BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I2c87c839242fa61e4ba0e1dfca54ebe5bb3beb37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870537 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: lazor: enable power managementYuval Peress2021-05-121-0/+6
| | | | | | | | | | | | BRANCH=none BUG=b:185284644 TEST=Run 'hibernate` command in EC console Cq-Depend: chromium:2889855 Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I044ffa440c7120b269cb58be7c4e1a04f99be980 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2878906 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Homestar:Battery:SMP:add batteryinfo for SMP-L21M4PG0tongjian2021-05-122-2/+32
| | | | | | | | | | | | BUG=b:187480606 TEST=make -j BOARD=homestar Verify build on EVT board BRANCH=Trogdor Signed-off-by: tongjian <tongjian@huaqin.corp-partner.google.com> Change-Id: Iedc4ccabb5d30e64e5a55e4594c8da21b498343e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2878763 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: driver: bbram_npcx: Add Kconfig descriptionWealian Liao2021-05-121-1/+2
| | | | | | | | | | | | | | This adds Kconfig description for CROS_BBRAM_NPCX. BUG=b:183611735 BRANCH=none TEST=zmake testall Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I7a3f00d9724d4316583d55d4516a1c79e70f6af5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2878762 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: ztest: Add system_preinitialize back to ztestWealian Liao2021-05-122-3/+15
| | | | | | | | | | | | | | | Per CL:2731180, system_preinitialize() should be added in ztest. Add the dependency functions to ztest_system & add system_preinitialize back to ztest. BUG=b:183611735 BRANCH=none TEST=zmake testall Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Iea90e1909d28556421471d7e905d0e56705b3fc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2878761 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* volteer: add volteer_npcx797fc build targetKeith Short2021-05-123-0/+15
| | | | | | | | | | | | | | | | Add the volteer_npcx797fc build target to test Volteer boards reworked with the NPCX797FC EC. BUG=b:163910671 BRANCH=none TEST=make buildall TEST=Verify memory map of volteer_npcx797fc ELF file. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I188f1d2df5d570be8c49b717a4c64f4346f45ae4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2354804 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* zephyr: lazor: Use correct Nuvoton EC VariantSam Hurst2021-05-113-10/+4
| | | | | | | | | | | | | | Change Zephyr Lazor Nuvoton EC variant from npcx7m7fc to npcx7m6fc. BRANCH=none BUG=b:187337449 TEST=Verified that sysjump from EC_RO to ZEPHER_RW worked. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ib49e5e6e5e45dd8d898ca559a897de7fedc24ced Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2885726 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* stm32: Add helper function for H7 flash ctrl regsJosie Nordrum2021-05-115-112/+201
| | | | | | | | | | | | | | | | | | | Add helper function definitions for H7 to API added in chromium:2220735. This should enable flash_physical test to run on Dartmonkey. Refactor code to pull flash registers function declarations from flash-reg.h instead of flash-f.h BRANCH=None BUG=b:157692395 TEST=On dartmonkey ./test/run_device_tests.py -t flash_physical => pass Signed-off-by: Josie Nordrum <josienordrum@google.com> Change-Id: I76846938748cbe77d534915856af0ebb7211d247 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576799 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* panic.c: force sync before reenabling bus faultsJosie Nordrum2021-05-112-3/+5
| | | | | | | | | | | | | | | | | | Force a sync between data and instruction pipelines before allowing bus faults. Remove sync from flash-stm32h7.c BRANCH=None BUG=b:157692395 TEST=tested with crrev.com/c/2576799 Signed-off-by: Josie Nordrum <JosieNordrum@google.com> Change-Id: Id67324191b4447d9be10c0b5aecc87620aa69d1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2706039 Tested-by: Josie Nordrum <josienordrum@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Josie Nordrum <josienordrum@google.com> Auto-Submit: Josie Nordrum <josienordrum@google.com>
* blipper: Remove config for firmware qualMike Lee2021-05-111-3/+0
| | | | | | | | | | | | | | Remove CONFIG_SYSTEM_UNLOCKED for firmware qual test BUG=b:183472826 BRANCH=dedede TEST=make BOARD=blipper,and test firmware_ECSystemLocked pass Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I2959ad2e1a020c22e506cb927f37fda6bee801ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2886464 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Blipper: add USB-A power enable and disableMike Lee2021-05-113-1/+10
| | | | | | | | | | | | | | | | Enable CONFIG_USB_Enable CONFIG_USB_PORT_POWER_DUMB for enabling/disabling charging from USB-A ports. BUG=b:183472826 BRANCH=dedede TEST=make -j BOARD=blipper TEST=Run "test_that -b dedede firmware_ECUsbPorts" and pass Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I8639fb6f63e60acfd504aef60338324419ff1412 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2883380 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* haboki: initial boardZick Wei2021-05-119-0/+1654
| | | | | | | | | | | | | | | | | This CL initial board for haboki which is a IT8320 variant of keeby, and include below change: 1. Copied from drawcia and update baseboard to keeby. 2. Removed board_pulse_entering_rw() and set EC_ENTERING_RW to GPC7. BUG=b:187094464, b:187126367 BRANCH=None TEST=make BOARD=haboki Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ie11776b88e38a2b7af0f844ad2ed1b810b2c0a74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875007 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* jelboz:Re-define Volume up/down positionMichael5 Chen12021-05-111-2/+2
| | | | | | | | | | | | | | Depend on dynamic change volume up/down function. Need change Volume up/down position. BUG=b:185557799 BRANCH=zork TEST=Check Volume up/down function. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Iae53d5026060dc0c9c92a8e400a9bd095278cbe8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881717 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* mkbp: Move key simulation to input devicesBoris Mittelberg2021-05-1027-82/+94
| | | | | | | | | | | | | | | | | | Today some platforms include MKBP_KEYBOARD because they use side buttons, switches or other events that share the same driver with MKBP keyboard. Those platforms don't enable KEYSCAN task. The CL is moving key emulation functionality to MKBP input devices, to make a clear separation between the real keyboard usage and emulation/buttons/switches/etc. All boards that were selecting `CONFIG_KEYBOARD_PROTOCOL_MKBP` without KEYSCAN task are now updated to select `CONFIG_MKBP_INPUT_DEVICES` BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I515140ebf6e175f4b29991329f92266ffca232a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2824044
* mkbp: EC buttons and switches via MKBPBoris Mittelberg2021-05-1014-187/+263
| | | | | | | | | | | | | | Allowing EC buttons and switches to be signaled via MKBP protocol, using CONFIG_MKBP_INPUT_DEVICES. Default behaviour is unchanged. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Cq-Depend: chromium:2824044 Change-Id: Ib96f98ecb3717a8ee8963be69fb7d7eb72e6d132 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796382
* PCHG: Enable device event on suspend completeDaisuke Nojiri2021-05-103-0/+21
| | | | | | | | | | | | | | | | | | | | | | Currently, PCHG can send a device event any time. When a signal is sent to the host while it's attempting to suspend, suspend is delayed by 10 seconds. A solution is to make Powerd disable a corresponding PCHG event (i.e. EC_DEVICE_EVENT_WLC) when it's notifying an upcoming suspend to other processes. This patch makes PCHG re-enable EC_DEVICE_EVENT_WLC after suspend is complete. BUG=b:182973695, b:173235954 BRANCH=trogdor TEST=Verify CoachZ suspends without a delay. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I10d7fcf234a7e0e05ce5d77b8e930a0cf0748331 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2863564 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Coachz: When the base state changes, update the virtual switchWai-Hong Tam2021-05-102-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the base state changes, update the virtual switch. It sends a mode change event to notify AP and then AP will query the latest virtual switch of the base state. BRANCH=None BUG=b:174295396 TEST=Checked detaching and attaching the base. Detach the base: > [269.820490 BASE_DET = 2813 (pulse 0)] [269.821044 tablet mode enabled] [269.821486 event set 0x0000000010000000] [269.821974 base state: detached] Attach the base: > [273.714608 BASE_DET = 156 (pulse 0)] [273.715151 tablet mode disabled] [273.715598 event set 0x0000000010000000] [273.716907 base state: attached] [273.717754 event set 0x0000000010000000] Change-Id: I2f0cac61ee359083df300f4fe3f3d16a14dfb926 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2884609 Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
* Coachz: Enable the basestate console commandWai-Hong Tam2021-05-101-0/+2
| | | | | | | | | | | | | | The basestate console command is used by tests to emulate the base detach or attach state. Enable it to pass the tests. BRANCH=Trogdor BUG=b:174295396 TEST=Run the basestate to emulate the attach and detach states. Change-Id: I49f7b135873dd821d533088b320bfcadafc85659 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2884608 Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
* mancomb: Enable 4 byte port80 codesRob Barnes2021-05-101-0/+1
| | | | | | | | | | | | | | | | AMD SOCs send 4 byte port80 codes. This CL will allow these codes to be properly displayed. BUG=b:181598456 TEST=4 byte codes on guybrush BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I931ecca06097765d61a83cab739b3dffab80d282 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881032 Reviewed-by: Eric Peers <epeers@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* guybrush: Enable 4 byte port80 codesRob Barnes2021-05-101-0/+1
| | | | | | | | | | | | | | | | AMD SOCs send 4 byte port80 codes. This will allow these codes to be properly displayed. BUG=b:181598456 TEST=4 bytes port 80 codes seen during boot BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Id9dab36e8fe5741fe43705e12caca35a111f269c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881031 Reviewed-by: Eric Peers <epeers@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>