Commit Graph

16504 Commits

Author SHA1 Message Date
Ko_Ko 6e61e71e87 Madoo: Improve shared interrupt line behavior
When interrupts are interleaved from the TCPC and charger, we can get
into a state where the interrupt line for the board ends up stuck low.
Improve on this situation by setting a deferred function to check on the
interrupt line after we get a signal in, and notify chips on that line
there may be more to process.

BRANCH=None
BUG=b:173345295
TEST=on madoo, plug in powered PD hub to C1, generating interrupts
from both the charger and TCPC and verify C1 interrupt line goes high
once connection is ready

Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com>
Change-Id: I3d29df28f94cb6c352adf05b9204ab4ff52a9726
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557758
Reviewed-by: Henry Sun <henrysun@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Ko Ko <ko_ko@compal.corp-partner.google.com>
Tested-by: Ko Ko <ko_ko@compal.corp-partner.google.com>
2020-12-01 04:10:29 +00:00
Yu-An Chen d8ba788789 Metaknight: Change EC chip from NPCX796FC0BX to NPCX797FC0BX
Change EC chip from NPCX796FC0BX to NPCX797FC0BX

BUG=b:173464184
BRANCH=master
TEST=make BOARD=metaknight
TEST=make BOARD=metaknight_legacy
TEST=new ec is working after rework.

Signed-off-by: yu-an.chen@quanta.corp-partner.google.com
Change-Id: Icb81a4a89c71db183994d3737fa8ed807353e06c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557775
Reviewed-by: Henry Sun <henrysun@google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
2020-12-01 02:41:20 +00:00
Gwendal Grignou 104f5257a6 motion: Control on which task sensor setting functions are running on
Analysis of motionsense shutdown revealed a race condition,
as function that change sensor state can run on parallel tasks, namely
CHIPSET and HOOK:

motion_sense_shutdown (CHIPSET) ---> (motion_sense_switch_sensor_rate)

suspend/resume (HOOK) ----> (motion_sense_switch_sensor_rate)

motion_sense_process (MOTIONSENSE) ---> motion_sense_set_data_rate (ACTIVE)
                                    \-> motion_sense_set_motion_intervals

          /----------- motion_sense_init --\
          |                                |
motion_sense_switch_sensor_rate ---> motion_sense_set_data_rate (ACTIVE)
          |                                  \----------- sensor->collection_rate = odr...; (ACTIVE)
          \------------> sensor->collection_rate = 0;   (INACTIVE)
           \-----------> motion_sense_set_motion_intervals

Running motion_sense_switch_sensor_rate() on HOOK task is necessary because
on some platform, the power line may be already off, when the device is going to S5.

- Always run motion_sense_switch_sensor_rate() on hook.
- When changing ODR is needed (sensor active), schedule MOTIONSENSE task.

The new sequencing is simplified:

suspend/resume/shutdown (HOOK) ----> (motion_sense_switch_sensor_rate)

          /----------- motion_sense_init --\
          |                                |
motion_sense_switch_sensor_rate ---> schedule MOTIONSENSE.
          \------------> sensor->collection_rate = 0;   (INACTIVE)

motion_sense_process (MOTIONSENSE) ---> motion_sense_set_data_rate (ACTIVE)
                                    \-> motion_sense_set_motion_intervals

BUG=b:170703322
BRANCH=kukui
TEST=Check on Volteer the sequence at suspend/resume/shutdown.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I0238cae9b4720e487a1e70788296a4db1b1e186b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2553347
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2020-12-01 02:37:54 +00:00
Gwendal Grignou 2d723bc996 motion_sense: Stop collection when sensor is powered down
Set collection_rate to 0 when sensor is not in initialized state anymore.
It will prevent the motion_sense task to be neededlessly scheduled.
Export wait_us to be tested.

BUG=b:170703322
BRANCH=kukui
TEST=unit test

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I1dc4c7a07ff30fa10997ef87784114c725f100d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2520297
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
Reviewed-by: Yuval Peress <peress@chromium.org>
2020-12-01 02:37:52 +00:00
Scott Chao dcdd0522d1 eldrid: add npcx7m7fc support and backward support npcx7m6fc.
BUG=b:173754312
BRANCH=firmware-volteer-13521.B-master
TEST=make buildall

Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
Change-Id: I7ce77a6813a977612b5c804cb335add419ac80b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550117
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-12-01 00:11:54 +00:00
Devin Lu 955eef5ec6 Elemi: Remove sensors
This commit remove sensors and tablet mode, since Elemi doesn't
support that.

BUG=b:163012636
BRANCH=firmware-volteer-13521.B-master
TEST=Verified boot without sensors initial.

Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: Icf23456763699024d934d78ac2cc20fcfcc5b9bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2554171
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-11-30 23:56:30 +00:00
Devin Lu 26631f3e43 drawcia: Enlarge KEYSCAN task
This commit enlarge keyboard scan task stack to prevent stack
overflow.

BUG=b:174190303
BRANCH=firmware-dedede-13606.B-master
TEST=On drawcia. Make sure KEYSCAN is not overflow with volup+H+alt
keys.

Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I99e180eca8e6665c5ab9f52d8bc7dcd5ec55e678
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557772
Reviewed-by: Diana Z <dzigterman@chromium.org>
2020-11-30 23:56:30 +00:00
Devin Lu c8a7b8afc1 Elemi: Change EC chip to npcx7m7fc
Chagne EC chip to npcx7m7fc to board version 1.

BUG=b:169118044, b:174275667
BRANCH=firmware-volteer-13521.B-master
TEST=Verified boot with npcx7m7fc re-worked board.

Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I334f56b2f47c21ff38aeccc346b6be43fb71b7ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2554172
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-11-30 23:51:32 +00:00
gaochao adf6c0a2e4 Coachz: Add ectool battery param CMD
Add ectool battery param CMD to get battery CT code

BRANCH=master
BUG=b:172410020
TEST=make BOARD=coachz -j
    flash ec and check ectool battery param cmd

Signed-off-by: gaochao <gaochao@huaqin.corp-partner.google.com>
Change-Id: Id65ef594028096a29da4b7fe44151b232d333994
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540067
Reviewed-by: Dolan Liu <liuyong5@huaqin.corp-partner.google.com>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Tested-by: Dolan Liu <liuyong5@huaqin.corp-partner.google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
2020-11-30 23:38:03 +00:00
Sean Hou 3c068a7463 ln9310: Startup sequence update.
Update Startup sequence to fully address SC_OUT over voltage issue.

BRANCH=master
BUG=170591575
TEST=Build successfully.

Change-Id: I31cbd839a7943ee19c19601bf178db6911f3dffd
Signed-off-by: Sean Hou <seanhou@lionsemi.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2520279
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
2020-11-30 20:35:48 +00:00
Patryk Duda 80bbcb5f97 tcpm/anx74xx: Provide implementation of sop_prime_enable function
CL:2542865 adds calls to tcpm_sop_prime_enable() function but there is no
implementation of sop_prime_enable() provided in anx74xx_tcpm_drv.
This causes EC crashes during firmware_PDTrySrc test.

This patch adds tcpci_tcpm_sop_prime_enable() and implementation of
sop_prime_enable() in anx74xx_tcpm_drv, similarly to other ANX drivers.

BUG=b:168560801, b:162254118
BRANCH=none
TEST=Flash eve with EC ToT, run firmware_PDTrySrc test.
     Make sure that EC doesn't crash during test.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I7cb2738f2a238901d03e3d8cb98ee39ce26bf38a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2560635
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
2020-11-30 17:50:21 +00:00
Diana Z 171046ab52 COIL: Rename common i2c_peripheral file
Rename i2c_peripheral.c and update related build file.

BRANCH=None
BUG=None
TEST=make -j buildall

Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ibd72d3b20b0cc1c07d426fbcf4d76cfb2644bc54
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558904
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2020-11-30 16:52:14 +00:00
Diana Z 529312de85 COIL: Rename host_command_controller.c
Rename host_command_controller.c and update build.mk

BRANCH=None
BUG=None
TEST=make -j buildall

Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ib5285b2686ceabca9830bbae40941754d3e13a1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558903
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2020-11-30 16:52:08 +00:00
Diana Z a0850cc42e COIL: Rename CONFIG_USB_PD_I2C_ADDR_FLAGS
Rename CONFIG_USB_PD_I2C_ADDR_FLAGS and change related comments.

BRANCH=None
BUG=None
TEST=make -j buildall

Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ia17a1ca26a5c2a16a698e55eac7e8f75b5e87aa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558902
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2020-11-30 16:52:07 +00:00
David Huang 0c2af622c9 voema: Typec port remove unused config and reconfig tcpc/ppc config.
Remove unused configuration and gpio pin and reconfig tcpc/ppc config for voema typec port.

BUG=b:169356808
BRANCH=master
TEST=Check C0/C1 port workable.

Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com>
Change-Id: I0ff2322b1cf19e24f66745c1509b811eeff69161
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550118
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-11-30 09:51:55 +00:00
Zick Wei 73b5043df4 dirinboz: update led on/off level
This patch update led on/off level by board version
and USB-C port:
1.board version >= 3 && USB-C right port
led on: gpio set high
led off: gpio set low
2. board version < 3
led on: gpio set low
led off: gpio set high

BUG=b:161210524
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: I6fec6968b2599702d61e9f2f1b7151ccd5c06a09
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2545913
Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Commit-Queue: Zick Wei <zick.wei@quanta.corp-partner.google.com>
2020-11-30 04:03:37 +00:00
Mike Lee ec767d1415 Stern: Remove power_led and EC_SKU_ID
Remove power_led and EC_SKU_ID,and use white battery_led to show power
state in DC state

BUG=b:174282565
BRANCH=firmware-kukui-12573.B
TEST=make build all pass
     test firmware branch ,battery led can work normal

Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
Change-Id: Ie046588ef608294836ce0bffccfd2d68e8c77e78
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563426
Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
2020-11-30 03:53:33 +00:00
Rob Barnes 4ae3b09ef8 guybrush: initial EC board setup
Create guybrush skeleton build. Minimal configuration required
to build.

BUG=b:173820614
BRANCH=none
TEST=make -j BOARD=guybrush

Change-Id: I1e906da42abc565941e6e7e9ca2c79462556ce09
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552855
Reviewed-by: Edward Hill <ecgh@chromium.org>
2020-11-29 01:32:59 +00:00
Tzung-Bi Shih d0775dff76 chip/mt8192_scp: support PMU counter
Supports performance monitor unit counters.

Introduces new console commands:
- enable_pmu
- disable_pmu
- show_pmu

> enable_pmu X
Parameter 1 invalid
Usage: enable_pmu [I | D | C]

> enable_pmu i
select "I"
> show_pmu
cycles: 842443131
retired instructions: 32855
I-cache:
  access: 22324
  miss: 0 (0.0%)
non-cacheable I: 0

> enable_pmu d
select "D"
> show_pmu
cycles: 1137656582
retired instructions: 36619
D-cache:
  access: 13779
  miss: 0 (0.0%)
non-cacheable D: 1072

> enable_pmu c
select "C"
> show_pmu
cycles: 2656349519
retired instructions: 74746
control transfer instruction:
  total: 20767
  miss-predict: 13346 (64.26%)
interrupts: 262

BRANCH=none
BUG=b:172988651
TEST=define DEBUG && make BOARD=asurada_scp

Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org>
Change-Id: I461ae51b84badb25e9b50ef1af7e3a81139cea47
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2562910
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2020-11-27 13:41:44 +00:00
Ting Shen d1df46fd72 usb_hid_keyboard: implement vivaldi top row feature
This CL implements a feature report defined in [1] that describes the
keyboard's top row layout.

[1] http://doc/1NTxSGv3WA2Vn4dlPLOcvKBvPytWOF0UAcIYQaFctTug

BUG=b:171156337
TEST=Verify feature report content using test code in CL:2530156.
BRANCH=none

Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I28a93f1b926d58602eb66d1b090e89384cb09f77
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2522641
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
2020-11-27 06:21:32 +00:00
Denis Brockus 710813c6c0 genvif: DR_Swap_To_DFP_Supported cleanup
Making it easier to follow the code with
regard to the VIF spec for DR_Swap_To_DFP_Supported
and add is_alt_mode_controller in the SNK path
decision.

BUG=b:172293518
BRANCH=none
TEST=verify XML output

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I06b4b86ef3e08f5768ae7396a50abff579aaaff7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2560613
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
2020-11-26 18:14:31 +00:00
Denis Brockus b8db14be52 genvif: DR_Swap_To_UFP_Supported cleanup
BUG=b:172422651
BRANCH=none
TEST=verify XML output

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I5216784a634d89ac1cbb47e4577762d907d8903a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2560612
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
2020-11-26 18:14:29 +00:00
Jason.Guo 4f4ef79f12 gumboz: Reword comments
1.reword battery comments
2.reword all Dirinboz name to gumboz

BUG=none
BRANCH=zork
TEST=make BOARD=gumboz

Signed-off-by: jason.guo@quanta.corp-partner.google.com
Change-Id: Ia7a4b8a65a6a06065da20d0bdfc38b8ad24ccadc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2556728
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
2020-11-26 07:42:42 +00:00
Mattias Nissler 7fa6cb47c9 Use host's pkg-config for gen_touchpad_hash
This is a helper running on the host, so should use host tooling.
Changing this avoids a build failure on cheza where chromeos-ec the
would fail to build before the openssl package (which is supposed to
work given that chromeos-ec doesn't list openssl in its dependencies,
and this pkg-config invocation is not a reason to start doing so).

BUG=None
BRANCH=None
TEST=emerge-cheza -v1 chromeos-ec

Signed-off-by: Mattias Nissler <mnissler@chromium.org>
Change-Id: I45161285db17a56b29a36549d3b113f42dff9362
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550660
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2020-11-26 01:09:25 +00:00
Tom Hughes 559ad51bad ec_commands: Add GENMASK macros
GENMASK is used in ec_commands.h, but is not defined if not compiling in
kernel or Chrome OS EC environments.

BRANCH=none
BUG=b:144959033
TEST=make buildall

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I439b0d77c47f3921f7bf2afd04c62cc72d668ea6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558857
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-11-25 21:59:25 +00:00
Ben Chen 20f7ec106e magolor: support npcx797fc build target
Build target to test Magolro boards reworked
with the NPCX797FC EC.

BUG=b:168608382
BRANCH=none
TEST=make buildall, workable on the re-worked Board.

Change-Id: I74f3da25f5f968bad715d773b034f025e01e90d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2554657
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Henry Sun <henrysun@google.com>
Commit-Queue: Justin TerAvest <teravest@chromium.org>
Tested-by: Justin TerAvest <teravest@chromium.org>
2020-11-25 21:00:18 +00:00
Ayushee Shah b67a2783ff Intelrvp:Separate battery configuration into board specific files
This CL adds the battery configuration from interlrvp baseboard
to board specific file for Alderlake, Tigerlake and jasperlake
platform so that same manufacturer battery but with different
config params can be used on intended platforms.

BUG=b:174129818
BRANCH=None
TEST=Able to see correct battery configuration in "battery" EC command
     and can see the battery charging and discharging.

Signed-off-by: Ayushee Shah <ayushee.shah@intel.com>
Change-Id: I639eb4466c49dbdc01d31feb4ace8844a6b1ac87
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557763
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-11-25 19:20:17 +00:00
Denis Brockus ef7bd34101 TCPMv2: pd_can_source_from_device use cleanup
Instead of having the policy logic spread over a
few locations, us pd_can_source_from_device to
localize that policy

BUG=none
BRANCH=zork
TEST=verify PR_Swaps to SNK only if partner can source

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I402abcf4c9e864203d580b37218859e68e74bf2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555866
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
2020-11-25 17:45:52 +00:00
Denis Brockus 63153bdc5e TCPMv2: AP resume should consider Src->Snk swap
TCPMv1 used PD_FLAGS_CHECK_PR_ROLE and
pd_check_pr_role() to accomplish this. This was
missing from TCPMv2.

In the TCPMv2 implementation, policy
pd_can_source_from_device was added to put the
logic in one place to detect if the PDO for a
partner device can and should be the source

Using this policy the AP resume code will check
to see if an already attached partner that we
are sinking from should be sinking from us instead.

BUG=b:169299049
BRANCH=zork
TEST=verify DRP phone will swap back to SNK on AP resume

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I8e584446445c8ee2e1c91973a58a04405cdf9e1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555865
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
2020-11-25 17:45:51 +00:00
Poornima Tom 3fdbe6eec1 FUSB302:Implement decode SOP' and SOP'' enable function
Support for decode SOP' & and SOP'' enable function in the driver
to avoid system reboot when tcpm_sop_prime_enable() is called.
Refer to https://crrev.com/c/2381030 .

BRANCH=None
BUG=b:173081501
TEST=Connect Gatex to ADLP-RVP. No reboot and USB4 connection
is established.

Signed-off-by: Poornima Tom <poornima.tom@intel.com>
Change-Id: I418f7dfdf488289f27d7b0becf012f6cf554a025
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2517261
Reviewed-by: Keith Short <keithshort@chromium.org>
2020-11-25 07:15:27 +00:00
johnwc_yeh 00cda3d68a pompom: Limit input current to fraction of negotiated limit
Limit input current to 95% of negotiated limit

BUG=b:172177779
BRANCH=none
TEST=Connect adapter then check input current.

Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com>
Change-Id: I5d2af134351611e44a331e1303e710b63912d3eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557285
Reviewed-by: AlvinCC Hsu <alvincc_hsu@compal.corp-partner.google.com>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Tested-by: AlvinCC Hsu <alvincc_hsu@compal.corp-partner.google.com>
2020-11-25 02:55:51 +00:00
Dino Li 7b6455ac96 it83xx/i2c: adjust Tlow and Thigh of 400kHz clock
This CL increased clock's Tlow to 1.51 us (1.3 us minimum) and
reduced Thigh to 1.087 us (0.6 us minimum).

BUG=b:163384683
BRANCH=none
TEST=i2c clock meet timing at 400kHz.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: Id62b2370018ba2d41e0dbc715a4c40629260d66b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557281
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Mike Goodey <mgoodey@google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2020-11-25 02:53:32 +00:00
jerry2.huang a2a960834b boten: fine tune motion sensor matrices
fine tune lid and base accel sensor matrices

BUG=b:172290264
BRANCH=none
TEST=buildall, check the sreen rotation degree is correct on tablet mode
and desktop mode

Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com>
Change-Id: I5e3ba275484dc2ecc178ef114cc27c9dc6392745
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2556731
Reviewed-by: Henry Sun <henrysun@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
2020-11-25 02:49:56 +00:00
Yu-An Chen 9c1dea75ff Metaknight: Support pen charge
Support pen charge function:
   GPIO50 low  -> pen charge enable
   GPIO50 high -> pen charge disable

BUG=b:169615752
BRANCH=master
TEST=make BOARD=metaknight
TEST=check pen charge pin voltage ,works as expected.

Signed-off-by: yu-an.chen@quanta.corp-partner.google.com
Change-Id: Ifd3d2535df6bbd071045cef8f6f6dae90f28da94
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557299
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
2020-11-25 00:03:18 +00:00
Daisuke Nojiri 9bfe97924b coachz: Enable stylus charging
This patch enables stylus charging.

BUG=b:173235954
BRANCH=Trogdor
TEST=See the description of CL:2538536.

Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Ia28214cc963168df7b229a6fbf530fc357e85740
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538540
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2020-11-24 16:23:01 +00:00
Daisuke Nojiri 786ee9e804 PCHG: Add ctn730 driver
CTN730 is a NFC/WLC transmitter (a.k.a. poller), which communicates
with a receiver (a.k.a. listener) to transfer power wirelessly.

BUG=b:173235954
BRANCH=Trogdor
TEST=See the description of CL:2538536.

Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Icf5df30d2dffe617887ff6a591ea5b4a753cb3d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538539
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2020-11-24 16:22:59 +00:00
Daisuke Nojiri faa4aa99fc PCHG: Add peripheral charge manager
Peripheral charge manager communicates with peripheral charge chips
to charge batteries of peripheral devices.

Tested using Coachz proto and a listener evaluation board from NXP demo
kit as follows:

1. Attach device then battery percentage is reported periodically.
2. Detach device then re-attach device to stop and resume charging.
3. Disable port by 'pchg 0 disable' to stop charging.
4. Enable disabled port by 'pchg 0 enable' to resume charging while
   device is in proximity.
5. When port is disabled, a device isn't detected or charged.

BUG=b:173235954
BRANCH=Trogdor
TEST=See the description above.

Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I0c2b583e5f7736b26ec7d1fb9cd9b6c59c7e8177
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538536
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2020-11-24 16:22:55 +00:00
Puthikorn Voravootivat ea6413290f amd_r19me4070: Set GPU temp to 0 when read failed
This avoids returning bogus temperature that caused
thermal shutdown.

BRANCH=none
BUG=b:171325612
TEST=no more thermal shutdown when suspend

Change-Id: Ie72d7798431636f23ae528ec9fbf8c9125ea32cc
Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2544571
Reviewed-by: Shelley Chen <shchen@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
2020-11-24 12:59:46 +00:00
Ko_Ko 57d97c6a8d Madoo: control charging LEDs independently
When plug in AC to right side (MB), only LEDs on the right should be
working according to designated behavior, and the left side should be
off. Vice versa.

Right side LEDs:
GPIO_EC_CHG_LED_R_W
GPIO_EC_CHG_LED_R_Y

Left side LEDs:
GPIO_BAT_LED_WHITE_L
GPIO_BAT_LED_AMBER_L

BUG=b:173464588
BRANCH=None
TEST=when plug in AC to left side, LEDs works correctly. When plug
in AC to right side, use gpioget to make sure LEDs are set.

Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com>
Change-Id: I837caf2d69853316941f6d4a91e86e71c6844ef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2553993
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>
2020-11-24 06:35:20 +00:00
amber.chen da74390fe8 lindar: add keyboard backlight function
add keyboard backlight function

BUG=b:173179867
BRANCH=firmware-volteer-13521.B
TEST=make -j --board=lindar

Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com>
Change-Id: I5573ef24f39a98bad3c442331255419409ec4335
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537740
Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Tested-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com>
2020-11-24 03:40:23 +00:00
Ko_Ko 34ab458a2a RAA489000: Vbus OCP threshold and target current setting
When device at USB-C port happen short, the RAA489000 charger IC have
current limit function with OTG UVP function. In order to enable OTG
UVP function, the registers of 0x92 and 0x94 has to be set. Since normal
output is 5V, set register 0x94 to 4.75V (0xBE) for detection, and set
0x92 to 3.104A (0x61) for better protection.

BUG=b:169788521
BRANCH=None
TEST=build and flash on madoo

Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com>
Change-Id: Ia20febce9be2ac26530c30c42f9a292602dec63c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2489704
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>
2020-11-24 03:09:18 +00:00
Michael5 Chen 90482ffee4 drobit: Config the EC battery setting.
Config the EC battery setting depend on battery spec.

BUG=b:173534296
BRANCH=firmware-volteer-13521.B
TEST=manual
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: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>
Change-Id: I4fbdcc18a5d8727ee2d1f2571310b3b7cc4b3c21
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2546720
Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com>
Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
2020-11-24 02:18:03 +00:00
Yicheng Li 50e0e9991e docs/fingerprint: Add instructions to run firmware tests
BRANCH=none
BUG=b:171422264
TEST=none

Change-Id: I677b1f17a997a21e906674bb4dc9e02a8e207a1f
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552353
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Tom Hughes <tomhughes@chromium.org>
2020-11-24 00:24:19 +00:00
Denis Brockus 7ba8cc6218 genvif: refactor return vif field or default value
BUG=b:174032040
BRANCH=none
TEST=verify XML output

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I8bce3f6625ddb642319bff0c473b34b342df8433
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555097
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
2020-11-24 00:02:52 +00:00
Denis Brockus c8a03c56d9 genvif: USB_Comms_Capable should be YES if USB4_Supported
BUG=b:172293518
BRANCH=none
TEST=verify XML output

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Ic83fa9e9af4e8e4e4fc1e20635fa92d5d143531c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552859
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
2020-11-24 00:02:48 +00:00
Denis Brockus cac3d04165 genvif: USB_PD_Support/PD_Port_Type selected output
Added check for USB4_Supported in is_usb_pd_supported
because USB4_Supported is a must be YES for PD_Support

Also split up PD_Port_Type from Type_C_State_Machine
because PD_Port_Type should not appear if this
component does not support USB PD and the same exclusion
can not be said about Type_C_State_Machine

BUG=b:172293518
BRANCH=none
TEST=verify XML output

Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I3d1a8f603693d90673ea3e610ca751f8d9c027a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552858
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
2020-11-24 00:02:47 +00:00
Tom Hughes 8ef91774b4 docs: Run mdformat on write protection doc
Command used:
(outside) $ mdformat -in_place --compatibility docs/write_protection.md

BRANCH=none
BUG=none
TEST=view in gitiles

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I3889b3279165b5897f5489549d4530681b6ac5b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552602
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
2020-11-23 22:56:16 +00:00
Gwendal Grignou e9ff9c08ce driver:tcs3400: Add placeholder set_range
set_range is now called all the time at init to set the current range
at resume. Set one for tcs3400 otherwise the EC crashes.

fixes: commit d28c10498c ("motion_sense: Make change in range permanenti")
CL:2215751

BUG=chromium:1083791
BRANCH=none
TEST=check on Volteer EC is not crashing in
motion_sense_switch_sensor_rate() at resume.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I172d3289bb69c14fa757d761b0099fea312292e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2553346
Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
2020-11-23 20:06:40 +00:00
Patryk Duda 264c5edd3d PD: Fix passing information about polarity when DTS is connected
Commit 7dec638eb5 introduced two polarity
modes POLARITY_CC1_DTS, POLARITY_CC2_DTS in enum tcpc_cc_polarity, but
in many places there was an assumption that value other than 0 means
that cable is inverted, the most notable example is usb_mux_set(). As a
result kernel sometimes was not reporting SuperSpeed depending on if
cable was inverted or not.

This patch adds mapping from polarity with DTS to polarity without DTS
where necessary.

BUG=b:162254118
BRANCH=none
TEST=Connect ServoV4 to eve and run servod. Make sure that USB-C muxer
     is connects USB3.0 lines (servod should set it).
     Flash EC ToT on eve. Boot ChromeOS and go to Developer Console.
     Run 'dmesg -w', check if device (eg. ethernet adapter) is attached as
     SuperSpeed device. Unplug cable, invert and plug again. Kernel
     should report that device is attached as SuperSpeed.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I354ef7047240cc8b5db01936b3780fae7387edb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555157
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
2020-11-23 18:40:49 +00:00
Aseda Aboagye 5421f90715 raa489000: Adjust charger IC settings for ripple
This commit updates some of the charger IC settings to help reduce the
current ripple.  These settings including enable hysteresis for
DCM/CCM as well as reducing the switching frequency to 600KHz.

BUG=b:163056834
BRANCH=dedede
TEST=Build and flash waddledoo, verify that input current ripple is
reduced.

Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I8c19ed040b92cf833d132ad247e761849985a919
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552860
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
2020-11-23 18:32:17 +00:00