summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* TCPMv2: Fix Soft Reset logicstabilize-13654.B-masterAbe Levkoy2020-12-081-8/+17
| | | | | | | | | | | BUG=b:173025773,b:173025737,b:155181980 TEST=Observe Soft Reset after not receiving GoodCRC 3 times BRANCH=firmware-volteer-13521.B-master Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Iee7016549a8a83b21d0a7ca168ace7ea2594a594 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578199 Reviewed-by: Diana Z <dzigterman@chromium.org>
* storo: Initial EC imageTao Xia2020-12-088-0/+1422
| | | | | | | | | | | | | | | | | | | | | Create the initial EC image for the storo variant by copying the waddledee reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.3.0). BUG=b:174284884 BRANCH=None TEST=make BOARD=storo Signed-off-by: Tao Xia <xiatao5@huaqin.corp-partner.google.com> Change-Id: If1648599689e6da5985248ffa095b298ef221142 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567079 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Wentao Qin <qinwentao@huaqin.corp-partner.google.com> Commit-Queue: Henry Sun <henrysun@google.com>
* power/host_sleep: Fix notifying about power state transitionsPatryk Duda2020-12-081-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CL:2321874 moves sleep_set_notify() and sleep_notify_transition() under CONFIG_POWER_SLEEP_FAILURE_DETECTION ifdef and introduces their no-op counterparts if CONFIG_POWER_SLEEP_FAILURE_DETECTION is not defined. Before that CL aforementioned functions were outside ifdef. Commit message also mentions that CL is only moving code, not performing any logical changes. Therefore this CL is moving sleep_set_notify() and sleep_notify_transition() outside ifdef and removes their no-on counterparts to eliminate logical changes introduced in CL:2321874 Issue was found when running EC ToT on octopus (casta). When AP was going to S0ix EC reported that fact, but PD was not changing DRP state to 'toggle off'. BUG=b:162083524, b:161775827 BRANCH=none TEST=Compile and flash firmware on octopus (tested on casta). Go to ChromeOS Developer Console and issue 'powerd_dbus_suspend' Check EC console if PD stack is reporting state transition and make sure that DRP is set to 'toggling off' Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I6ba4187c8549ee6d9e3b19543d67c49520927cb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2575064 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Waddledoo: Reduce flash usageDiana Z2020-12-081-0/+1
| | | | | | | | | | | | | | Define CONFIG_DEBUG_ASSERT_BRIEF for waddledoo to save flash space. BRANCH=dedede BUG=None TEST=make -j buildall; observe waddledoo is back over 2k free flash Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I90223c6c46067aa23dd9722377cbaf3202a32e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576451 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* charger: replace charger_get_input_current usesEric Yilun Lin2020-12-0813-39/+91
| | | | | | | | | | | | | | | | | | | | | | | | | Replace them with charger_get_input_current_limit which is aligned to the old usage, no funcional changes. Keep OCPC charger_get_input_current uses as was, since it is its intended use. Also, implement - isl923x_get_input_current, raa48900_get_input_current - sm5803_get_input_current_limit BUG=b:171853295 TEST=1. grep "\<charger_get_input_current\>"; only ocpc uses the function. 2. make buildall 3. test with CL:2569086 on waddledee(sm5803), waddledoo(raa489000), hayato(isl923x), pompom(isl923x), and ensure the output of `curr 0|1` equalts to the report of power meter. BRANCH=none Change-Id: I71aca33cbc88dda9b0238cb71b1609665a9c9a7f Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569085 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* charger: add charger_get_input_current_limitEric Yilun Lin2020-12-082-1/+33
| | | | | | | | | | | | | | A pre-processing CL for the later CL which migrate API from charger_get_input_current. BUG=b:171853295 TEST=make buildall BRANCH=none Change-Id: Ia15ce47ac5d068b7125c58115e368f9dfa87958c Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569084 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* charger: rename charger_set_input_currentEric Yilun Lin2020-12-0815-85/+102
| | | | | | | | | | | | | | | charger_set_input_current was actually sets the input current limit, so renames it to charger_set_input_current_limit. BUG=b:171853295 TEST=make buildall TEST=not output from `grep -r "\<charger_set_input_current\>"` BRANCH=none Change-Id: Icf4e99f287a7d4fc2d9560e8502e46cc07bfc085 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569083 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* driver: tcs3400: Report ODR for RGB sensorGwendal Grignou2020-12-081-5/+5
| | | | | | | | | | | | | | | | | | To be able to send data to the host, the oversampling ratio must be non-zero. It implies: - the host send a set frequency request for the RGB sensor - the EC use the frequency from the clear sensor to calculate the RGB sensor oversampling ratio BUG=b:172343923 BRANCH=kukui,hatch,volteer TEST=On Volteer, in calibration mode, check we get samples from the RGB sensor. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I70eb62287cae983800cdadaee4cfe00b2f22b734 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570825 Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
* driver: tcs3400: In calibration mode: always send dataGwendal Grignou2020-12-081-7/+9
| | | | | | | | | | | | | | When in calibration mode, send data periodically, even when measurement is identical to the previous one. BUG=b:172343923 TEST=On Volteer, check data is coming periodically. BRANCH=kukui,hatch,volteer Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I31da6edcf5d175812697b99b7e7ef6ec85497770 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570824 Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
* Kakadu: Fix battery charging status for bq27542wen zhang2020-12-081-0/+4
| | | | | | | | | | | | | | | | Fix the battery charging status for gauge bq27542. BUG=b:174725434 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified the battery charging status and the result is OK. Change-Id: Ie3a926dd96b967679d2c51856afc3d1c157835f5 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576196 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* kukui: allow Vconn swap if battery exists.Eric Yilun Lin2020-12-081-5/+2
| | | | | | | | | | | | | | BUG=b:174324375 TEST=insert Apple dongle, and HDMI port works. BRANCH=kukui Change-Id: I6ac5c6ce172c6f395a38b0be7dffb4e92f3b9dc4 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578221 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Madoo: Fixing LED behaviorKo_Ko2020-12-081-5/+17
| | | | | | | | | | | | | | | | | | | Fix the following behavior: 1. Rescue LED from EVT and previous board(board id<3) 2. Change low battery led color according to customer's demand 3. Fixing the issue that when removing AC from right port, left battery led will blink and go off. BUG=b:173464588 BRANCH=None TEST=flash on EVT board and change cbi to verify the LED functions Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com> Change-Id: Ie4a855e4d846a05b681e386cb82f702eea8c4e6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2577152 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>
* SYV682: Disable VCONN on VCONN OCPEric Herrmann2020-12-081-4/+26
| | | | | | | | | | | | | | | | | | | The SYV682 has a 'soft' overcurrent protection on VCONN which current limits to ~600mA. If the cause is a short it will eventually hit thermal shutdown. Instead, we should disable VCONN when we get an OCP event. We must allow current spikes for at least 1ms, so disable with a deglitch. BUG=b:170441866,b:172710638 TEST=make buildall TEST=On Voxel, short VCONN to ground for at least 100ms, then observe that VCONN is disabled and 'VCONN OC!' is printed in the EC console. BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: I6712543b73072c959597c73cd493f248267a42ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2572237 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* TCPMv2 DRP: always try sink caps on PE_SNK_Ready for FRSPeter Marheine2020-12-081-35/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, device policy was inhibited from requesting partner sink capabilities when entering SNK.Ready out of a power role swap (because the flag gets cleared while invalidating the old contract in the PRS process), which prevents Fast Role Swap from being enabled in most situations- for instance Section E.2 of the USB-PD specification revision 3.0 version 2.0 states that a PRS is a normal part of connecting to a hub and the device should request sink caps via device policy in order to enable FRS. This change attempts to get sink caps from the port partner in PE_SNK_Ready, then use them to evaluate support for FRS. By moving partner capabilities evaluation to PE_SNK_Ready, we also prevent FRS from being enabled when operating as a source: we don't expect sinks to send FRS, and this helps avoid detecting (and attempting to act on) spurious FRS signaling. BUG=b:146393213 TEST=Morphius connects to a hub supporting FRS as expected and successfully completes a fast role swap when power is removed from the hub. BRANCH=zork Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Icf402b4ded99d35e23b51b168cb7f306c3ac156b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2564978 Reviewed-by: Diana Z <dzigterman@chromium.org>
* npcx: Don't delay hibernate wake by 2 secondsEdward Hill2020-12-071-1/+5
| | | | | | | | | | | | | | | Waking from PSL hibernate is power-on for EC but not for H1, so we should not add the 2 second delay for CONFIG_BOARD_RESET_AFTER_POWER_ON in this case. BUG=b:173180800 BRANCH=zork TEST=no 2 second delay on wake from hibernate Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ib0c8f2ca7f197626b20a11e21ace44a5046db18b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576439 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* stats_manager: add export to b/ friendly .mdRuben Rodriguez Buchillon2020-12-071-18/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change in addition to our copy/paste friendly textfile also outputs a buganizer markdown friendly .md summary of the results, to paste into bugs. BUG=b:174800621 BRANCH=None TEST=dut-power -t 3 Storing .md summaries at: [...]/S?_20201204-104756/onboard_summary.md cat [...]/S?_20201204-104756/onboard_summary.md **Onboard INA** |NAME|COUNT|MEAN|STDDEV|MAX|MIN| |-|-:|-:|-:|-:|-:| |LCD_BL_VOUT_mw|3|0.00|0.00|0.00|0.00| |PP1200_BRIJ_mw|3|0.00|0.00|0.00|0.00| |PP1200_TCPC_C0_mw|3|0.00|0.00|0.00|0.00| |PP1800_EC_mw|3|0.00|0.00|0.00|0.00| |PP1800_SENSORS_mw|3|0.00|0.00|0.00|0.00| |PP1800_VR_mw|3|0.00|0.00|0.00|0.00| |PP3300_A_R_mw|3|0.00|0.00|0.00|0.00| |PP3300_EC_STBY_mw|3|0.00|0.00|0.00|0.00| |PP3300_EC_mw|3|0.00|0.00|0.00|0.00| |PP3300_H1_mw|3|0.00|0.00|0.00|0.00| |PP3300_HUB_mw|3|0.00|0.00|0.00|0.00| |PP3300_PD_A_mw|3|0.00|0.00|0.00|0.00| |PP3300_PD_EC_mw|3|0.00|0.00|0.00|0.00| |PP3300_TCPC_C0_mw|3|0.00|0.00|0.00|0.00| |PP5000_A_mw|3|0.00|0.00|0.00|0.00| |PPVAR_BAT_R_mw|3|0.00|0.00|0.00|0.00| |PPVAR_BAT_mw|3|0.00|0.00|0.00|0.00| TEST=pytest stats_manager_unittest.py 21 passed TEST=python2 -m py.test stats_manager_unittest.py 21 passed Change-Id: I94e2d00721e744614838992604cd7a3124c0e39f Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573736 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
* delbin: Initial PS8811 registers.Michael5 Chen2020-12-074-4/+42
| | | | | | | | | | | | | | | | Depend on b/160937185 #32, initial PS8811 registers. BUG=b:160937185 BRANCH=firmware-volteer-13521.B TEST=manual Check register value under s0. Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I262858b61050f9ad857f44e703bbd3cfd0e989f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2561904 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* lindar: modify LED function to match LED SPECamber.chen2020-12-072-10/+11
| | | | | | | | | | | | | | | modify LED function to match LED SPEC BUG=b:174443628 BRANCH=firmware-vloteer-13521.B TEST=make -j BOARD=lindar Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Ie51eaa92aed3c22c5452a132048f95287ea94367 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2566857 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* docs: Fix typos in write protection docTom Hughes2020-12-071-11/+11
| | | | | | | | | | | BRANCH=none BUG=none TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ib512490365a0f20380813bd871f7effbf374a435 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552604 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* docs: Fix headers in write protection docTom Hughes2020-12-071-7/+7
| | | | | | | | | | | | | gitiles doesn't render backticks in headers. BRANCH=none BUG=none TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I312799ad938d35e8452a90d129baf933ff6639e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552603 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* servo_v4p1: Add support for host hub I2C interfaceJan Dabros2020-12-072-1/+14
| | | | | | | | | | | | | | | BUG:b:150323106,b:169929627 BRANCH:master TEST:make -b servo_v4p1. Verify that we are receiving descriptive message for all GL3590 events. E.g. try to access invalid port: i2cxfer raw 1 0x50 0 0xd0 For the full list of events refer to GL3590 I2C Application Note. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia34f1deb508bbbaad94d2eb1a279d200958db92e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563687 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* gl3590: Add initial support for USB HUB I2C interfaceJan Dabros2020-12-073-0/+166
| | | | | | | | | | | | | | | | | | | | | GL3590 is a USB hub with support for out-of-band transactions via I2C. Set of additional registers allow to disable/enable ports, query port status (including power-related information), handle over-current events and others. This initial driver implements method for reading and writing from/to GL3590 registers as well as event handler to parse asynchronous messages from hub. BUG:b:150323106,b:169929627 BRANCH:master TEST:buildall. Functionality can be tested on servo_v4p1 with a consecutive commit applied. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I385ff4790ddc367d07b7e588f4e10aeb83e9f1c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563686 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* config.h: Make body detection setting use separate default valueChing-Kang Yen2020-12-071-6/+16
| | | | | | | | | | | | | | | | | | | Formerly, if a board want to customize the body detection settings, it need to fill all the settings. This CL makes it just have to fill the exact settings that we want to customize. BRANCH=None BUG=b:123434029 TEST=buildall Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: I7554e8f21a446f8d93b2558402690e265e82b58e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569087 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Ching-Kang Yen <chingkang@chromium.org> Commit-Queue: Ching-Kang Yen <chingkang@chromium.org> Tested-by: Ching-Kang Yen <chingkang@chromium.org>
* voxel: disable CONFIG_KEYBOARD_VIVALDIBen Chen2020-12-071-0/+6
| | | | | | | | | | | | | | | | | | | Disable Vivaldi keyboard since Vivaldi currently does not allow for side volume buttons to be distinguished from keyboard volume F9/F10 keys. This is necessary so that Chrome can ignore F9/F10 in tablet mode, but side volume buttons still work. BUG=b:173147060 BRANCH=master TEST=make -j BOARD=voxel TEST=make buildall TEST=test on voxel, side-buttons work in clamshell/tablet mode and that F9/F10 only work in clamshell. Change-Id: I6bcc07ede9e88a82c44642493037eca81936f98f Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573658 Reviewed-by: Keith Short <keithshort@chromium.org>
* copano : Config EC chipsetJacky Wang2020-12-072-1/+7
| | | | | | | | | | | | | | Base on schematic, change EC chip to npcx7m7fc from npcx7m6fc. BUG=b:174720060 BRANCH=firmware-volteer-13521.B TEST=make BOARD=copano Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Iaf9d52636f6ffc14a9a15d776a3d65a0241a5ded Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2571135 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* casta: change CONFIG_BC12_MAX14637_DELAY_FROM_OFF_TO_ON to 100Marco Chen2020-12-071-0/+4
| | | | | | | | | | | | | | | | BUG=b:173166535 BRANCH=octopus TEST=build and flash to casta; verify whether BC12 can detect CDP/DCP/SDP correctly. TEST=`make buildall -j` Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I6e3b9d79416a0cdf8200dae16e22cf0b2564c391 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567198 Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
* max14637: add a config to define delay in ms from power off to onMarco Chen2020-12-072-1/+3
| | | | | | | | | | | | | | | BUG=b:173166535 BRANCH=octopus TEST=Change delay to 100; build and flash casta; verify whether BC12 can detect CDP/DCP/SDP correctly. TEST=`make -j buildall` Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I08cd881a2413e540eaaab3789f98e28f39514ad5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567197 Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: fix build for keyboard shimYuval Peress2020-12-057-17/+124
| | | | | | | | | | | | | | | | | | | | | See platform/ec/common/build.mk for reference. The use of keyboard_scan.c should only be allowed when HAS_TASK_KEYSCAN is defined. As such, we should always set HAS_TASK_KEYSCAN to 1 if CONFIG_PLATFORM_EC_KEYBOARD is defined. Further, CROS_EC_TASK_LIST was defined per project and it doesn't need to be, we can instead define it once for all boards depending on which tasks are set to 1 in shimmed_tasks.h Note that shimmed_tasks.h can still be used in tests. BRANCH=none BUG=none TEST=zmake testall Cq-Depend: chromium:2566421 Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id0ed49dd49e3c4eb2ac23184cf943c91dcd261eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567560
* zephyr: Sort the options a bitSimon Glass2020-12-053-112/+121
| | | | | | | | | | | | | | | | | | | We have quite a few options already and plan to add more. Sort them to make it easier to see what is there. The I2C enum isn't really connected with the basic CONFIG munging done in config_chip.h so move it to i2c.h instead. Fix the 'keybaord' typo while we are here. BRANCH=none BUG=none TEST=build and boot on volteer Change-Id: Id03fe44ff859736f1e2f86231ca1e8d9dc4c50af Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2575198 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: add CBI module to zephyr optionsJett Rink2020-12-043-0/+40
| | | | | | | | | | | | | | Shim in CBI module and necessary dependencies. BRANCH=none BUG=b:168032342,b:168032589 TEST=type `cbi` on volteer Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Ic08f472f8d52cd4521b78f819ea22e337cccc6f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2572736 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* dirinboz: remove unuse configZick Wei2020-12-041-2/+0
| | | | | | | | | | | | | | | | This patch remove unuse config on dirinboz: CONFIG_IO_EXPANDER_PCAL6408 CONFIG_USB_MUX_PS8740 BUG=none BRANCH=zork TEST=make BOARD=dirinboz Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I6cbbb20b4b43c860206828943b9376959b0e1cad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573659 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* asurada: use udelay for HPD pulseEric Yilun Lin2020-12-041-1/+6
| | | | | | | | | | | | | | usleep is unstable on asurada, we use udelay instead to prevent from the pulse width over the spec (1ms). BUG=b:171172053 TEST=ensure the pulse width is reliable. BRANCH=none Change-Id: I8b349b6d09dca3a116e6fc9a2552faa041664674 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2539262 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* power/mt8192: back to S5 when PMIC failed to shutdownTing Shen2020-12-041-0/+4
| | | | | | | | | | | | | | | | | | | | `apshutdown` sometimes fails to shutdown PMIC, when this happens, powerstate will bounce between G3 and S5G3 until watchdog kicks in. To fix this, we should detect PMIC status in S5G3, go back to S5 to retry shutdown if PMIC is still alive. BUG=b:174546890 TEST=Run the reproduce steps in b/174546890#comment13, verify EC enters G3. BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I1f0544e16d818074378f58f1208bd586031a5ebb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573895 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* syv682x: update OVP warningEric Yilun Lin2020-12-041-1/+1
| | | | | | | | | | | | | | | | The VBAT OVP function is actually protecting the CC lines (if not VCONN SRC), and VBAT (if VCONN SRC). BUG=none TEST=none BRANCH=none Change-Id: I2eda0d2777d7e0facaf7340afe8e500454fc7169 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573664 Reviewed-by: Ayo Wu <ayowu@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Kakadu: Fix battery is_present status for bq27542wen zhang2020-12-041-2/+4
| | | | | | | | | | | | | | Fix the battery is_present status for gauge bq27542. BUG=b:174802149 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified the battery present status and the result is OK. Change-Id: Ic8d9d503bc2f7d9648df56c150018f304aacfb18 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2571145 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* COIL: Rename SLEEP_MASK_I2C_CONTROLLERDiana Z2020-12-042-4/+4
| | | | | | | | | | | | | Rename SLEEP_MASK_I2C_CONTROLLER and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib49a5c6b07a203dc659ed65909292e5f1009d33f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558907 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* COIL: Rename local variables in common i2c_controllerDiana Z2020-12-041-105/+105
| | | | | | | | | | | | | | Rename local variables and related comments in common i2c_controller code. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I712217d86f7232f509f1f649b772ec73204ceb53 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558906 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* sm5803: add parenthesis to the input of macrosEric Yilun Lin2020-12-041-4/+4
| | | | | | | | | | | | | | Inputs have to be guarded with parenthesis. BUG=none TEST=make buildall BRANCH=main Change-Id: Iedf678e1a2b0f3525aa2b788b0e2c9171d3b4acc Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570885 Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* genesis: hardcode barrel jack connected stateMatt Ziegelbaum2020-12-041-17/+25
| | | | | | | | | | | | | | | The proto boards have an error in which GPIO_BJ_ADP_PRESENT_L never pulls low due to an error in the board layout. Since it's not possible to boot genesis with type-C power anyway, just hardcode the connection. BUG=b:173566595 TEST=Boot to AP BRANCH=None Change-Id: I56b4393b5ddce03ac79158c41f66e3463c064b83 Signed-off-by: Matt Ziegelbaum <ziegs@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552227 Reviewed-by: Joe Tessler <jrt@chromium.org>
* genesis: add initial genesis EC firmwareMatt Ziegelbaum2020-12-047-0/+1789
| | | | | | | | | | | | | | Genesis is similar to Ambassador, so the starting point for its firmware is a copy of Ambassador's firmware. BUG=b:173566595 TEST=None/doesn't boot due to power differences BRANCH=None Change-Id: I6de3c9ae83f58c21bf5588817cfde02c7ef1247a Signed-off-by: Matt Ziegelbaum <ziegs@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552226 Reviewed-by: Joe Tessler <jrt@chromium.org>
* zephyr: Add is-test flag to zmake.yaml files under test/Yuval Peress2020-12-045-0/+5
| | | | | | | | | | | | | | | | This change will make the firmware builder auto-detect new tests. BRANCH=none BUG=none TEST=Ran zephyr's firmware_builder.py Cq-Depend: chromium:2551964 Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I70ba1b32b67e2cb4e3676d228b299294028597a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552848 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr/test/i2c: update to i2c_controller.c nameJett Rink2020-12-031-1/+1
| | | | | | | | | | | | | | After COIL rename, we need to update the CMakeLists.txt for the i2c test BRANCH=none BUG=b:174572350 TEST=builds and passes test Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I33b712876c11dc77e7835c2505749d449e11ffa6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2572398 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* genvif: fix null string for USB_VID_SOPDenis Brockus2020-12-031-2/+2
| | | | | | | | | | | | | | | | | copy/pasted wrong name array when setting the value Bumped the version to 3.0.0.9 BUG=b:172293518 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I50b2dacfcd64bb3276ebec4e3c376056f42ce891 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2572245 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>
* eldrid: modify charger configurationTerry Chen2020-12-033-1/+111
| | | | | | | | | | | | | BUG=b:166728543 BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Terry Chen <terry_chen@wistron.corp-partner.google.com> Change-Id: I1a918326a625f294fe6cd9a2ec8e2c5b2af43569 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2534231 Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* power: move headers to include/powerJack Rosenthal2020-12-0322-16/+16
| | | | | | | | | | | | | | This makes the headers visible to the Zephyr build. BUG=b:173798264 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I3b6d27c1234b3924ee8902a86eec5fdb2ccd9998 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2571897 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* tcpmv2: change SOP' Discover Identity retry logic.Keith Short2020-12-031-10/+24
| | | | | | | | | | | | | | | | | To further improve the time to enter alternate modes, limit the number of SOP' DiscID retries that are performed before a contract is in place. This ensures interoperability with captive cable devices that cannot respond to SOP' until a contract is established. BUG=b:169741906, b:166650426 BRANCH=firmware-volteer-13521.B-master TEST=Connect TBT3 loopack device and verify TBT mode is entered. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I007780df567cd0e66236b2c3067d065eecf07fe1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550307 Reviewed-by: Diana Z <dzigterman@chromium.org>
* asurada: enable AMON/BMONEric Yilun Lin2020-12-032-1/+5
| | | | | | | | | | | | | BUG=b:169532537 TEST=amon; ensure the report current is accurate comapres to the power meter BRANCH=none Change-Id: I43f98db84f362f0331b128475c9cea955c18f163 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569082 Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* isl923x: make get_amon_bmon a functionEric Yilun Lin2020-12-031-43/+59
| | | | | | | | | | | | | A pre-processing CL for the charger_get_input_current API. BUG=b:169532537 TEST=make buildall BRANCH=none Change-Id: Iec7baeb32e0d8f7f6c7260fada8a78d920cc325e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569081 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* adlrvpp: Modify GPIO assignments as per Rev 2 schematicsSooraj Govindan2020-12-031-10/+10
| | | | | | | | | | | | | | | | | Add support for "Revision 2 add-in card" to enable Chrome EC, on AlderLake reference platform. BRANCH=None BUG=b:174290307 TEST=Build, flash and boot the Alderlake RVP platform to OS make BOARD=adlrvpp_ite -j; sudo util/flash_ec --board=adlrvpp_ite --image=<path> Signed-off-by: Sooraj Govindan <sooraj.govindan@intel.com> Change-Id: I314ed281b12f41c1539afb9716301af6fd7ede26 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2544294 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* servo_v4/usb_pd_policy: Disable VBUS instead of power supply resetPatryk Duda2020-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running 'fakedisconnect' command on ServoV4, CC_DETACH bit is going to be set. Detach is done by calling pd_power_supply_reset() which disables VBUS (set DUT_CHG_EN to 0) and requests 5 volts from charger. Next step is disable PD communication by calling pd_comm_enable() and set RP to RP_RESERVED value (pd_set_rp_rd() function). Setting RP to RP_RESERVED (just disconnect all resistors on CC1 and CC2) actually is a trick to make PD_C1 task think that DUT is disconnected. TCPM stack checks voltage on CC lines and when voltage on active CC line indicates that we are open it changes state to SRC_DISCONNECTED. Changing state to SRC_DISCONNECTED triggers pd_power_supply_reset() which was already run in do_cc() function as a result of 'fakedisconnect' command. Calling this once again causes weird behaviour - communication issues and finally Hard Reset, eg: > fakedisconnect 100 1000 Fake disconnect for 1000 ms starting in 100 ms. C0 Req [1] 5000mV 3000mA [210.470350 CL: p0 s0 i500 v15000] [210.472703 PD TMOUT RX 1/1] RXERR1 Preamble C1 srcCAP>-1 C1 srcCAP>-1 C1 st14 SRC_DISCONNECTED [210.473835 PD TMOUT RX 467/1] RXERR0 Preamble C0 REQ>1 C0 st6 SNK_REQUESTED C0 st34 HARD_RESET_SEND C0 st35 HARD_RESET_EXECUTE C0 HARD RST TX Hard Reset in PD_C0 task can cause additional delay when C1 gets connected and DUT requests higher voltage. As a result DUT sends Hard Reset due to timeout. Hard Reset on port 1 causes PDTrySrc to fail because of timeout waiting for 'fakedisconnect' command. This was fixed by removing one voltage change request. In other words in do_cc() function we are not calling pd_power_supply_reset(), but disabling VBUS only. Eventually pd_power_supply_reset() will be called during transition to SRC_DISCONNECT state. BUG=b:162254118 BRANCH=none TEST=Run FAFT_PD test suite. All tests should pass except PDVbusRequest (depends on charger connected to ServoV4). TEST=Call 'fakedisconnect' command on ServoV4 console and check if there is no Hard Reset on port 0. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I657dd1ce2dc3a2f4914e975387eeebb037e1ada5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569652 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>